Moises Vera
08/13/2022, 6:10 PMOscar Björhn
08/13/2022, 6:35 PMAnna Geller
08/13/2022, 6:36 PMOscar Björhn
08/13/2022, 6:36 PMAnna Geller
08/13/2022, 6:37 PMMoises Vera
08/13/2022, 6:38 PMOscar Björhn
08/13/2022, 6:44 PMMoises Vera
08/13/2022, 7:27 PMOscar Björhn
08/13/2022, 7:38 PM# 3 steps:
# 1. Use docker's python package to build and upload a base image for my flow, if an up-to-date one doesn't already exist. This step has been omitted since it's kind of long and specific to our setup.
# 2. Prepare and run the deployment build command using shell.
# 3. Prepare and run the deployment apply command using shell.
prefect_build_command = f"prefect deployment build orchestration/flows/{flow_name_clean}.py:default -n \"{flow_name} ({env.value})\" -t {env.value} -t {extra_tag} --storage-block azure/azure-{env.value} --infra docker-container --override image={full_image_path} -o {flow_name_clean}-deployment.yaml"
print(prefect_build_command)
with Popen([prefect_build_command], stdout=PIPE, shell=True) as proc:
print(proc.stdout.read())
prefect_apply_command = f"prefect deployment apply {flow_name_clean}-deployment.yaml"
with Popen([prefect_apply_command], stdout=PIPE, shell=True) as proc:
print(proc.stdout.read())
James Brady
08/14/2022, 1:26 PM-ib
option) rather than infrastructure (and the -i
) option and then I didn't ned to edit the YAML after having built a deployment.
This is basically the opposite of the solution Anna mentions above, where you specify everything as command line switches. The end result is the same though, of not needing to edit the YAML.Anna Geller
08/14/2022, 2:40 PM