Skip to content
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

Support configuring executor on the flow #3338

Merged
merged 3 commits into from
Sep 18, 2020

Conversation

jcrist
Copy link

@jcrist jcrist commented Sep 17, 2020

(Split off of #3333)

This moves the executor configuration to the Flow itself, rather than on the "environment". This is nice, as it improves parity between flow.register() and flow.run(), where the same configured executor is used. Several users have been confused in the past about why flow.run() doesn't use the configuration in the environment.

Another benefit here is that Flows always have to be loaded (usually unpickled), but environments are sometimes unpickled and sometimes loaded from json from cloud (on the agent). This distinction between a fully loaded environment and a half-loaded environment (that might be missing some pickled components) is confusing, removing the need for a half-loaded environment is a goal of #3333. Moving one more piece of pickled state off of environments simplifies this.

  • adds new tests (if appropriate)
  • adds a change file in the changes/ directory (if appropriate)
  • updates docstrings for any new functions or function arguments, including docs/outline.toml for API reference docs (if appropriate)

This allows for parity between local and cloud/server runs in how you
configure an executor for a flow.
Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

I think there was a typo in your test - let me know, but otherwise LGTM! The first step is now taken...

if executor is None:
executor = prefect.engine.get_default_executor_class()()

self.logger.debug("Using executor type %s", type(executor).__name__)
Copy link
Member

Choose a reason for hiding this comment

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

👏

tests/engine/test_flow_runner.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

Merging #3338 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

LGTM

@cicdw cicdw merged commit 4ec55c6 into PrefectHQ:master Sep 18, 2020
@jcrist jcrist mentioned this pull request Sep 21, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants