Open ivanstillfront opened 10 months ago
Yes, I was also wondering, why the astro dev start
command is rebuilding the Docker image all the time, even if there was no changes ... - a fix would improve the development speed.
@neel-astro To validate and determine next steps.
Describe the bug
When running a command, for example
astro dev pytest
the astro cli invokes a docker build command using the project'sDockerfile
as a base.To speed up these commands, we install dbt into its own stage. Our
Dockerfile
looks like this:dbt_requirements.txt
contents is:The cli injects docker commands after each
FROM quay.io/astronomer/astro-runtime:9.5.0
call, looking at the logs they are:The last command
COPY --chown=astro:0 . .
is really slowing down anyastro dev
command because it causes thedbt_build
stage venv creation step cache to invalidate if any file in the project folder changes.This could be resolved by omitting the final
COPY --chown=astro:0 . .
command from build stages that are not part of the final build image.What CLI Version did you experience this bug?
Astro CLI Version: 1.19.1
This CLI bug is related to which Astronomer Platform?
What Operating System is the above CLI installed on?
MacOs & Linux
🪜 Steps To Reproduce
Dockerfile
pasted aboveastro dev pytest
astro dev pytest
again, observe building the Docker container build is fully cacheddbt_requirements.txt
,requirements.txt
andpackages.txt
, observe the Docker container build cache is invalidated