-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Enable Custom Specs for Dask Scheduler and Workers using the DaskKubernetesEnvironment #1534
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cicdw
requested changes
Sep 19, 2019
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.
Could you add a cloudpickle serialization test for the situation in which a user provides a custom spec?
Something like:
def test_roundtrip_cloudpickle():
env = DaskKubernetesEnvironment(...)
new = cloudpickle.loads(cloudpickle.dumps(env))
assert isinstance(new, DaskKubernetesEnvironment)
assert new._scheduler_spec is whatever
assert new._work_spec is whatever
something like that?
cicdw
approved these changes
Sep 19, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for contributing to Prefect!
Please describe your work and make sure your PR:
CHANGELOG.md
(if appropriate)docs/outline.toml
for API reference docs (if appropriate)Note that your PR will not be reviewed unless all three boxes are checked.
What does this PR change?
Closes #1533
Closes #1445
This PR allows for custom scheduler and worker YAML specs. Here's how it works:
A file path is provided to the environment:
Those files are loaded and stored on the environment as
_scheduler_spec
and_worker_spec
When the environment is serialized only the file paths are stored and the specs remain on the object itself when serialized into byte code
When a flow is executed using cloud the environment is now loaded off of the flow object in the container and the specs are retrieved there (so they are never sent to cloud)
There are some environment variables that users don't have to provide to their specs and are instead placed into the environment for cloud use
Why is this PR important?
Allowing for completely customizable scheduler and worker pods for the DaskKubernetesEnvironment is a huge plus because previously only the min/max workers were set.