Skip to content

AIP-51 - Misc. Compatibility Checks - #28375

Merged
o-nikolas merged 8 commits into
apache:mainfrom
rkarish:apache#27930
Jan 5, 2023
Merged

o-nikolas merged 8 commits into
apache:mainfrom
rkarish:apache#27930

Conversation

@rkarish

@rkarish rkarish commented Dec 15, 2022

Copy link
Copy Markdown
Contributor

Closes: #27930

@boring-cyborg boring-cyborg Bot added provider:cncf-kubernetes Kubernetes (k8s) provider related issues area:scheduler labels Dec 15, 2022
@rkarish rkarish changed the title AIP-51 - Misc. Compatibility Checks #27930 AIP-51 - Misc. Compatibility Checks Dec 15, 2022

@o-nikolas o-nikolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I've left some comments and requests :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also need to set a value for supports_sentry in this class as well since it does not implement the BaseExecutor interface (see the discussion starting from here for more context). You'll need to ensure both new fields are set on all the executors which don't inherit from BaseExecutor (LocalKubernetesExecutor as well) and add the appropriate unit tests for those.

Comment thread airflow/executors/executor_loader.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should actually keep this in for backwards compatibility (with a comment describing that it is deprecated) 🤔 i.e. someone in the community could be depending on this list existing. I wonder what others think about this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I searched the repository for references and it looked like it was safe to delete, but I didn't think about other users in the community being dependent on this. I think that adding a comment here and waiting to clean this up at a later time is a safer approach.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a # TODO: Remove in Airflow 3.0. We have a couple of those in the repo and will help to not miss this spot when releasing the next major.

Comment thread airflow/executors/base_executor.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want the default to be True, no? The previous code assumed all executors were picklable unless it was present in the list of UNPICKLEABLE_EXECUTORS. So any executor that goes through that code should be assumed to be picklable unless it says otherwise. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this makes more sense. For some reason I went with the opposite 🙃

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually want this to be True? The LocalExecutor is not picklable and so far we've gone with True for these only if all sub executors are True. WDYT?
There is some context in a PR comment here (from @pierrejeambrun's PR for is_local)

Comment thread airflow/sentry.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the helper method I added for this ExecutorLoader.import_default_executor_cls()

@rkarish

rkarish commented Dec 17, 2022

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback Niko! I will clean this up and let you know when I am finished.

@rkarish
rkarish requested review from o-nikolas and removed request for XD-DENG, ashb, dstandish, jedcunningham and kaxil December 17, 2022 21:58
@rkarish

rkarish commented Dec 18, 2022 •

Copy link
Copy Markdown
Contributor Author

Hey Niko, I've submitted some more changes based on the feedback and requests. I reworked the pickling support attribute, switched to using your get executor class helper method, and implemented tests for pickling and sentry support for all of the executors. CI pipeline failed so I rebased the branch off main which fixed a failure in integration tests, but it's still failing static checks. Pre-commit was passing for me locally before rebasing, seems like something changed here. When I ran it locally after rebase it was changing several files so I didn't commit those changes.

Also, I didn't mean to remove all of the other reviewers, I clicked on request re-review and it did it automatically.

@o-nikolas

Copy link
Copy Markdown
Contributor

Hey Niko, I've submitted some more changes based on the feedback and requests. I reworked the pickling support attribute, switched to using your get executor class helper method, and implemented tests for pickling and sentry support for all of the executors. CI pipeline failed so I rebased the branch off main which fixed a failure in integration tests, but it's still failing static checks. Pre-commit was passing for me locally before rebasing, seems like something changed here. When I ran it locally after rebase it was changing several files so I didn't commit those changes.

Also, I didn't mean to remove all of the other reviewers, I clicked on request re-review and it did it automatically.

Thanks @rkarish! Sorry for the delayed response but I have been on year end/holiday vacation. I'm just trying to get caught up now. I'll have a look at this PR very soon 🙏

@rkarish

rkarish commented Jan 4, 2023

Copy link
Copy Markdown
Contributor Author

You're welcome and Happy New Year! I figured you were on vacation, no rush on the review!

@o-nikolas o-nikolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look great! Perhaps @pierrejeambrun can be the second reviewer/approver, he's been very involved in the executor decoupling work.

@rkarish

rkarish commented Jan 4, 2023

Copy link
Copy Markdown
Contributor Author

That would be great to get another set of eyes on this. Congratulations on becoming a Committer by the way! Would love for you to do the honors on this one 😄 .

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one suggestion, otherwise LGTM :)

Comment thread airflow/executors/executor_loader.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a # TODO: Remove in Airflow 3.0. We have a couple of those in the repo and will help to not miss this spot when releasing the next major.

@o-nikolas
o-nikolas merged commit aa4858d into apache:main Jan 5, 2023
@o-nikolas

Copy link
Copy Markdown
Contributor

That would be great to get another set of eyes on this. Congratulations on becoming a Committer by the way! Would love for you to do the honors on this one 😄.

Thanks @rkarish! And thanks to you for helping on AIP-51 😀

@pierrejeambrun pierrejeambrun added this to the Airflow 2.6.0 milestone Jan 9, 2023
@pierrejeambrun pierrejeambrun added the type:misc/internal Changelog: Misc changes that should appear in change log label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:scheduler provider:cncf-kubernetes Kubernetes (k8s) provider related issues type:misc/internal Changelog: Misc changes that should appear in change log

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

AIP-51 - Misc. Compatibility Checks

3 participants