Skip to content

Instantly share code, notes, and snippets.

@cicdw
Last active February 27, 2019 16:23
Show Gist options
  • Save cicdw/16246401f498999702ef9f2b92b42a15 to your computer and use it in GitHub Desktop.
Save cicdw/16246401f498999702ef9f2b92b42a15 to your computer and use it in GitHub Desktop.
Create Prefect environment and deploy Flow
from prefect.environments import DockerEnvironment
env = DockerEnvironment(
base_image="python:3.6",
registry_url="XXXXXXXX",
python_dependencies=["google-cloud-firestore"],
files={"~/google-creds.json": "/root/google-creds.json"},
env_vars={"GOOGLE_APPLICATION_CREDENTIALS": "/root/google-creds.json"},
)
flow.environment = env
# builds the Docker image and pushes Flow metadata to the Prefect Cloud database
flow.deploy(project_name="marvin")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment