google / google/adk-python

Dockerfile should first copy requirements.txt and install dependencies before copying agent code

未关闭
#6,923 4 条评论 0 个 reaction 已指派 2 人 已被 @Jacksunwei 认领 在 GitHub 查看
needs review services
主要语言
Python
星标
21.5k
派生
4k
平均合并
1 天 14 小时
30 天内合并 PR
37

描述

https://github.com/google/adk-python/blob/0dbc37d67e928d22acef937a8f441683c88af415/src/google/adk/cli/cli_deploy.py#L203

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:
1. copy only requirements.txt file.
2. run pip install to download dependencies
3. 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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。