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

Agent Environment Hybrid Execution Model First Pass #670

Merged
merged 69 commits into from
Feb 27, 2019
Merged

Conversation

joshmeek
Copy link

@joshmeek joshmeek commented Feb 20, 2019

Thanks for contributing to Prefect!

Please describe your work and make sure your PR:

  • adds new tests (if appropriate)
  • updates CHANGELOG.md (if appropriate)
  • updates docstrings for any new functions or function arguments, including docs/outline.toml for API reference docs (if appropriate)

What does this PR change?

This PR introduces a whole overhaul of how environments are handled in Prefect. Mainly following the outline in PIN-3.

Introduced:

  • A Prefect docker image (python:3.6 base)
  • DockerOnKubernetes environment

Does not introduce the DaskOnKubernetes environment discussed in PIN-3. Will be implemented in a later PR.

Why is this PR important?

Environments now have a core Environment class which two base environments inherit from—LocalEnvironment and DockerEnvironment. This now allows us to make platform specific environments which abstract out infrastructure requirements to the environments themselves. For example, the Kubernetes environments subclass the DockerEnvironment because they use Docker in their deployments. Their setup functions may be used to create any other infrastructure requirements for the flow run. (e.g. creating a Dask scheduler and workers)

Closes #599, closes #600, closes #601
Starts working towards #602

Note: base environments do not implement setup and execute because they are not platform dependent.

Note: I welcome input on naming conventions for these environments

The Kubernetes environments are meant to be used in tandem with the Prefect k8s agent (https://github.com/PrefectHQ/k8s-agent). This means that all Kubernetes environments' execute function should send out the running of the flow in a Kubernetes job. This is important because the resource collection aspect of the agent looks for completed/failed jobs and then cleans up any resources tied to that job that were created during the setup phase.

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.

Could you also update the tutorial on Local Flow debugging? There's a section at the end that discusses building a container locally and using from_file to detect any serialization errors. Maybe just say "Let's use the example of a DockerEnvironment because it's easiest and representative of the types of errors you may encounter in other environments" or something.

src/prefect/environments/docker.py Show resolved Hide resolved
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.

Request for MORE DOCS but otherwise 👌

docs/outline.toml Show resolved Hide resolved
@joshmeek joshmeek merged commit f4193ca into master Feb 27, 2019
@joshmeek joshmeek deleted the environments branch February 27, 2019 20:37
zanieb pushed a commit that referenced this pull request Jan 12, 2022
Integration tests proof of concept and with jest projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
3 participants