Hello :wave: Are there any docs explaining what ex...
# ask-community
n
Hello 👋 Are there any docs explaining what exactly happens when deploying a flow with a custom image stored in AWS ECR and specifying
build=True
? I'm aware that when this is specified as False it will pull the image from ECR at runtime before any tasks will be started. When this is set as True, will the image already be available for the worker and avoid the need to pull it from ECR? I'm asking as we noticed a delay in our flows/pods starting with the use of workers over agents when we have set
build=False
✅ 1
k
build
just decides whether the deployment process will try to build a docker image for you. If the image needed for your deployments already exists, you'll want it set to
False
. Image availability at runtime is entirely dependent on the execution platform you're running flows on and its image pull policies. For k8s work pools you can set the pull policy yourself. For ECS, if your flows are running on Fargate, there is no image caching mechanism and images must be pulled before booting the container every time.
n
Thank you. So if I'm using K8s hybrid work pools and I already have an image available in ECR I should set
build
to False. This differs to agents where the image would already be available and we didn't need to pull from ECR at runtime?
k
This is about whether you want to let Prefect's deployment process help you update your image by building it and pushing it every time you call
deploy
. If you were working with agent style deployments before, you probably already have a separate process that builds and pushes your images when your code changes, right?
n
Yes exactly, we already have process to build and push our image to ECR. We're currently just specifying the image during deployment.
I presume the image we're specifying overrides the image used by the work pool rather than the image used by the worker?
k
yep then build should be False, and the image name you provide to the deployment will override the image name on the work pool, which just serves as a default if it was missing on the deployment
n
Thank you for clarifying 🙌
One other question about the delay in starting our flow since it has to pull the image from ECR first. I remember seeing a variable we can configure so that Prefects sets up the infra in advance of the scheduled flow run. For some reason I can no longer find it. Do you know what this variable is called and where I can set it to allow Prefect more time to set up the infra?