I have been trying to extend the UI of airflow by adding airflow plugins. My goal is to be able to show internal project documentation from airflow. I am using MKDocs for this.
I have followed the airflow documentation process(https://airflow.apache.org/plugins.html#example) and created a plugin successfully. The link is appearing and when I click on it, it takes me to index.html. My problem is it is not rendering any CSS, images and other .md or .html files. They are all in the same folder.
I found a similar thread on StackOverflow (Airlfow serving static html directory). I have tried to follow the solution posted there, but it is not helping.
I have also posted the query on the airflow help forum but I have not received any solution yet. I would appreciate any leads. Thank you.
#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}
Plugin Class:
# Defining the plugin class
class AirflowTestPlugin(AirflowPlugin):
name = "test_plugin"
appbuilder_views = [v_appbuilder_package]