Skip to content

Instantly share code, notes, and snippets.

@jcrist
Last active December 16, 2020 17:57
Show Gist options
  • Save jcrist/f1dd47f699554d9c1beff5ce553b5659 to your computer and use it in GitHub Desktop.
Save jcrist/f1dd47f699554d9c1beff5ce553b5659 to your computer and use it in GitHub Desktop.
Prefect Example using KubernetesJobEnviornment
from prefect import Flow
from prefect.environments.execution import KubernetesJobEnvironment
from prefect.environments.storage import Docker
with Flow("kubernetes-example") as flow:
# Add tasks to flow here...
# Run on Kubernetes using a custom job specification
# This was needed to do even simple things like increase
# the job resource limits
flow.environment = KubernetesJobEnvironment(job_spec_file="job_spec.yaml")
# Store the flow in a docker image
flow.storage = Docker()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment