In the current structure of the Dockerfile, the build first creates a layer with the agent's code, and then creates another layer with the installed dependencies. This order of operations causes the build process to re-create the dependencies layer after every code change, even if the list of dependencies in the requirements.txt hasn't changed.
The correct order should be:
- copy only requirements.txt file.
- run pip install to download dependencies
- copy agent code
This should reduce the amount of time it takes to build container images when redeploying updated agent code, as long as the dependencies list doesn't change.
Reactions are currently unavailable
adk-python/src/google/adk/cli/cli_deploy.py
Line 203 in 0dbc37d
In the current structure of the Dockerfile, the build first creates a layer with the agent's code, and then creates another layer with the installed dependencies. This order of operations causes the build process to re-create the dependencies layer after every code change, even if the list of dependencies in the requirements.txt hasn't changed.
The correct order should be:
This should reduce the amount of time it takes to build container images when redeploying updated agent code, as long as the dependencies list doesn't change.