-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Rework ProvidersManager to separate runtime and infrastructure focus #60218
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
shared/providers_discovery/src/airflow_shared/providers_discovery/__init__.py
Outdated
Show resolved
Hide resolved
|
cc @potiuk Would be good to get your review on this one, you'd know the ProvidersManager best |
shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
Show resolved
Hide resolved
kaxil
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.
Close enough but I'd wait for @potiuk to do a review too
|
Agreed, I would wait for a review from @potiuk too |
jason810496
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.
Thanks for the PR. LGTM overall!
shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
Show resolved
Hide resolved
shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
Outdated
Show resolved
Hide resolved
shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
Outdated
Show resolved
Hide resolved
shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
Show resolved
Hide resolved
potiuk
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.
Very nice and clean - just one question and one suggestion. Great Job @amoghrajesh on making it closer to task-isolation and provider split "north star".
|
Thanks for the review folks. Merging this one. |
…pache#60218) Splitting providers manager: ProvidersManagerRuntime in task-sdk for runtime resources and ProvidersManager as we know today stays to serve server components
…pache#60218) Splitting providers manager: ProvidersManagerRuntime in task-sdk for runtime resources and ProvidersManager as we know today stays to serve server components
closes: #60403
Motivation
Motivation is that
ProvidersManageris imported in few places in task sdk from core airflow, blocking client server separation.Now coming to a bigger problem and solving this issue better,
ProvidersManageris a monolithic structure that forces workers to load infrastructure components they will never use (executors, auth managers). This for no reason provides workers with data they do not need increasing instance size as well.Simple example:
So, my goal here it to enable client server separation by splitting runtime resources of providers (hooks, taskflow_decorators) from others that airflow-core needs.
Approach
A detailed table of what should belong where as per me:
Decided to extract current ProvidersManager into two portions, one that handles runtime and other that handles what core needs.
What's done:
ProvidersManagerRuntimein task-sdk for runtime resources andProvidersManageras we know today stays to serve server componentsTask sdk will do this from now one:
Testing
Backward compatibility
Existing code continues to work with deprecation warnings:
CLI
Just created a simple script and ran it, output: providers-output.txt
Impact on consumers
For Providers
Nothing now, watch out for deprecation warnings and migrate using runtime properties from task sdk.
For Airflow developers / DAG authors
If you are using ProvidersManager for your DAG code, first of all you shouldn't but if you really are, migrate after watching deprecation warnings for runtime properties.
What's next
Next phase:
provider.yaml` Update API server to read from YAML (eliminate hook imports)
Benefits:
^ 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 airflow-core/newsfragments.