https://prefect.io logo
#best-practices
Title
# best-practices
j

Jordan Charlier

10/04/2022, 2:51 PM
Hello Everyone ! I use Prefect 1 and I have an odd behavior with flows registration. The image is always push on AWS ECR. Even if there is no change. Is this normal ?
t

Thomas Fredriksen

10/04/2022, 5:13 PM
Hi there. I have been using Prefect 1 for about a year now, and I can confirm that the same happens. The Dockerfile build caching is a bit hit and miss it seems, and appears to do a complete rebuild more often that not 😕
😪 1
r

Rob Freedy

10/05/2022, 2:34 PM
Hey @Jordan Charlier ! Would you mind sharing how storage is configured for your flow?
j

Jordan Charlier

10/05/2022, 8:26 PM
Flow( name=“####“, run_config=DockerRun( image=“####.dkr.ecr.eu-west-1.amazonaws.com/######f”, labels=######], ), storage=Docker( registry_url=“#####.dkr.ecr.eu-west-1.amazonaws.com”, image_name=“####“, image_tag=“latest”, dockerfile=dockerfile_path, ignore_healthchecks=False, stored_as_script=True, path=“flow.py”, )
r

Rob Freedy

10/06/2022, 12:48 PM
Thanks for providing that @Jordan Charlier!! Just want to make sure I have the expected behavior. Is there a reason you would want to register a flow and not have the image with the new flow code be pushed to your docker storage? Also, this documentation about how prefect handles storage may be helpful: https://docs-v1.prefect.io/core/advanced_tutorials/local-debugging.html#locally-check-your-flow-s-docker-storage
j

Jordan Charlier

10/06/2022, 12:54 PM
I register the flow but there is no change. It shouldn’t push a new flow code
c

Christopher Boyd

10/06/2022, 1:34 PM
What if you pass
build_kwargs={"rm": False}
to your
DockerStorage.
You can also use
cache_from
as a build kwarg and pull the cache from a prior image
4 Views