Hello Everyone ! I use Prefect 1 and I have an odd...
# best-practices
j
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
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
Hey @Jordan Charlier ! Would you mind sharing how storage is configured for your flow?
j
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
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
I register the flow but there is no change. It shouldn’t push a new flow code
c
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