我一直在尝试通过添加气流插件来扩展气流的用户界面。我的目标是能够从气流中显示内部项目文档。我为此使用 MKDocs。
我遵循了气流文档流程(https://airflow.apache.org/plugins.html#example)并成功创建了一个插件。该链接出现,当我点击它时,它会将我带到 index.html。我的问题是它没有呈现任何 CSS、图像和其他 .md 或 .html 文件。它们都在同一个文件夹中。
我在 StackOverflow 上发现了一个类似的线程(Airlfow 提供静态 html 目录)。我试图按照那里发布的解决方案进行操作,但它没有帮助。
我也在气流帮助论坛上发布了查询,但我还没有收到任何解决方案。我将不胜感激任何线索。谢谢你。
#Creating a flask appbuilder BaseView
class TestAppBuilderBaseView(AppBuilderBaseView):
template_folder = '/home/airflow/airflow/plugins/test-project/site'
@expose("/")
def list(self):
return self.render_template("index.html", content="")
v_appbuilder_view = TestAppBuilderBaseView()
v_appbuilder_package = {"name": "Test View",
"category": "Test Plugin",
"view": v_appbuilder_view}
Run Code Online (Sandbox Code Playgroud)
插件类:
# Defining the plugin class
class AirflowTestPlugin(AirflowPlugin):
name = "test_plugin"
appbuilder_views = [v_appbuilder_package]
Run Code Online (Sandbox Code Playgroud) 我正在尝试将系统变量从 azure devops 传递给 python 脚本。这是我目前在 Yaml 文件中的内容:
- script: pytest test/test_pipeline.py
--$(global_variable)
--junitxml=$(Build.StagingDirectory)/test_pipeline-results.xml
displayName: 'Testing Pipeline'
condition: always()
Run Code Online (Sandbox Code Playgroud)
我的脚本中需要的变量是$(global_variable)
. 该变量包含值$(Build.SourcesDirectory)
。它是全局变量。"unrecognised arguments"
当我运行作业时,我收到一条错误消息。
任何解决此问题的帮助都会有所帮助。
谢谢!
编辑:
完整日志:
`##[section]Starting: Testing Pipeline
==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.151.2
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
pytest test/test_pipeline.py --my_param="/home/vsts/work/1/s" --junitxml=/home/vsts/work/1/a/test_pipeline-results.xml
========================== Starting Command Output …
Run Code Online (Sandbox Code Playgroud) airflow ×1
azure ×1
azure-devops ×1
css ×1
flask ×1
mkdocs ×1
plugins ×1
python-3.x ×1
yaml ×1