Matt Alhonte
10/24/2023, 1:13 AMflow.deploy
require you to build a new Image? I'd want to just pass it an Image we've already built. Seems like the image
argument requires a DeploymentImage
object, though?alex
10/24/2023, 1:23 AMflow.deploy
builds an image on each run to ensure the flow code is available in the image. You could provide a custom Dockerfile via a DeploymentImage
object that uses your image as the base image.Matt Alhonte
10/24/2023, 1:23 AMMatt Alhonte
10/24/2023, 1:24 AMalex
10/24/2023, 1:27 AMMatt Alhonte
10/24/2023, 1:27 AMalex
10/24/2023, 1:33 AMflow.deploy
yet, but once we do, I think using the lower-level .apply
method might work better.
It would look something like this:
flow.from_source(
source="<s3://bucket/folder>",
entrypoint="flows.py:my_flow
).to_deployment(
name="my-deployment",
work_pool_name="my-work-pool",
job_variables={"image":"IMAGE_NAME"}
).apply()
This will skip building an image and allow you to use your image directly.Matt Alhonte
10/24/2023, 1:34 AMMatt Alhonte
10/24/2023, 1:36 AMjob_variables
argument, can I basically pass all the same args I currently pass to my ECSTask
object that gets passed as the infrastructure
arg when using Deployment.build_from_flow
? Thanks!Matt Alhonte
10/24/2023, 1:37 AMalex
10/24/2023, 1:37 AMjob_variables
here is equivalent to infra_overrides
in Deployment.build_from_flow
.Matt Alhonte
10/24/2023, 1:38 AMMatt Alhonte
10/24/2023, 2:01 AMif __name__ == "__main__":
s3_bucket = S3Bucket.load("my-bucket")
s3_bucket.download_folder_to_path("flow_folder", "flow_folder")
flow.from_source(
source="<s3://my-bucke/flow_folder>", entrypoint="flows.py:my_flow"
).to_deployment(
name="my-deployment",
work_pool_name="my-work-pool",
job_variables={"image":"IMAGE_NAME"},
).apply()
alex
10/24/2023, 2:21 AMflow.from_source