fix(cli): preserve Docker dependency cache - #6928
Open
mikemikimike wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Closes #6923.
Problem
The Dockerfile generated by
adk deploycopied the complete agent source before installing the agent'srequirements.txt. As a result, a source-only change invalidated the dependency layer and caused dependencies to be downloaded again.Changes
requirements.txtinto its own Docker layer when the file is present.Testing
.venv/Scripts/python.exe -m pytest tests/unittests/cli/utils/test_cli_deploy.py::test_to_agent_engine_happy_path tests/unittests/cli/utils/test_cli_deploy.py::test_to_gke_happy_path tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py::test_to_cloud_run_happy_path -q— 8 passed.uvx --from pyink==25.12.0 pyink --check src/google/adk/cli/cli_deploy.py tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py— passed.python -m ruff check src/google/adk/cli/cli_deploy.py tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py— passed.python -m compileall -q src/google/adk/cli/cli_deploy.py— passed.git diff --check— passed..venv/Scripts/python.exe -m pytest tests/unittests/cli/utils/test_cli_deploy.py tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py -q— 76 passed, with the 10 known failures described below.mypy --config-file pyproject.toml src/google/adk/cli/cli_deploy.py --follow-imports=skip --ignore-missing-imports— 4 existing errors outside the changed lines.Compatibility and known limitations
When no
requirements.txtexists, no requirements copy or install step is emitted. The two affected deployment test files report 76 passed and 10 unrelated Windows failures because their tests mockshutil.rmtreewith a one-argument lambda while Python 3.12 calls it with theonexckeyword; those tests were not modified. Mypy also reports four existing errors at lines 523, 1455, 1467, and 1702. The targeted deployment tests pass; no cloud credentials or external services are required.