-
Notifications
You must be signed in to change notification settings - Fork 16.4k
AIP-79 Support Airflow 2.x plugins in fast api #44464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Instead of waiting for #2 to happen, let's just copy/trim whatever minimal FAB stuff we need into the FAB provider now - just leave it completely separate from the old UI. Then we aren't blocked at all. |
That sounds good to me. That's a good idea indeed, we can save some time by doing this. Should we do it in a separate PR though? This one sets up the mechanism to embed Airflow 2 in Airflow 3 and the other PR(s) would be copying over the Flask app to Fab provider |
|
I'd kinda prefer we don't mount the "whole" AF2 app as-is in AF3, even if we do view it as temporary. |
Alright, I'll do it in this PR then |
e403d33 to
d608026
Compare
providers/src/airflow/providers/fab/www/extensions/init_jinja_globals.py
Show resolved
Hide resolved
providers/src/airflow/providers/fab/www/extensions/init_manifest_files.py
Show resolved
Hide resolved
providers/src/airflow/providers/fab/www/templates/airflow/traceback.html
Show resolved
Hide resolved
providers/src/airflow/providers/fab/www/templates/appbuilder/navbar.html
Show resolved
Hide resolved
providers/src/airflow/providers/fab/www/templates/appbuilder/navbar_menu.html
Show resolved
Hide resolved
providers/src/airflow/providers/fab/www/templates/swagger-ui/index.j2
Outdated
Show resolved
Hide resolved
providers/src/airflow/providers/fab/www/templates/appbuilder/navbar.html
Show resolved
Hide resolved
providers/src/airflow/providers/fab/www/templates/airflow/main.html
Outdated
Show resolved
Hide resolved
providers/src/airflow/providers/fab/www/static/js/toggle_theme.js
Outdated
Show resolved
Hide resolved
f3b17ee to
629f12e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work.
Can we also reuse that same application to do the flask auth server ? (When people are using FABAuthManager and we need to reach for the flask webserver) ?
629f12e to
1576e04
Compare
I was wondering the same and I think we should do that |
1576e04 to
348893e
Compare
|
Tests are passing, let me know if there are more comments/feedbacks |
jedcunningham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Couple things (like the link to the AF3 homepage) that we can sort out later.
providers/src/airflow/providers/fab/www/templates/swagger-ui/index.j2
Outdated
Show resolved
Hide resolved
2221193 to
fe5aa66
Compare
…on of the Flask application in fastapi application
fe5aa66 to
03ce01e
Compare
|
Whoo! Nice! |
…on of the Flask application in fastapi application (apache#44464)

To support Airflow 2.x plugins in Airflow 3 the goal is to embed a minimal version of Airflow 2 in fast api using WSGIMiddleware. The Airflow 2.x plugins will run in this application as they are running today in Airflow 2.
WSGIMiddlewareallows running a WSGI in the fast api application. This Flask application will be accessible under the path/pluginsv2.The plan is to:
The idea is, if you do not have any Airflow 2.x plugin defined in your environment, you should not have Flask as dependency. On the opposite, if you do have some Airflow 2.x plugins in your environment, fab provider will have to be installed and all the code needed to run the Flask application will be in this provider.
The experience for the user will not be ideal because these plugins use the Airflow 2 UI, therefore the UI experience will be inconsistent between the Airflow pages (Airflow 3 UI) and the plugins (Airflow 2 UI). A warning message will be added in the embedded Flask application to let the user knows about this weird experience but also to recommend them to migrate their plugins to Airflow 3 plugins.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.