Skip to content

feat(cli) support extra packages in cloud deployments - #6860

Open
sylvesterkaczmarek wants to merge 1 commit into
google:mainfrom
sylvesterkaczmarek:feat/deploy-extra-packages
Open

feat(cli) support extra packages in cloud deployments#6860
sylvesterkaczmarek wants to merge 1 commit into
google:mainfrom
sylvesterkaczmarek:feat/deploy-extra-packages

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Link to Issue or Description of Change

Problem

Agent Engine supports --extra_packages, but Cloud Run and GKE deployments do not. Agents that share local Python packages therefore need duplicated code or custom deployment steps.

Solution

  • Add a repeatable --extra_packages option to adk deploy cloud_run and adk deploy gke.
  • Share package-staging logic across Agent Engine, Cloud Run, and GKE.
  • Stage each file or directory at the build root, copy it to /app/<basename>, and keep /app on PYTHONPATH.
  • Preserve missing-path and destination-conflict validation.
  • Leave generated deployment output unchanged when the option is not used.

Testing Plan

  • Added regression tests.
  • Relevant tests pass.

pytest tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py tests/unittests/cli/utils/test_cli_deploy.py tests/unittests/cli/utils/test_cli_tools_click.py tests/unittests/cli/test_cli_tools_click_option_mismatch.py -q

190 passed, 1 xfailed in 5.94s

The tests cover CLI forwarding, file and directory staging, generated Dockerfile instructions, existing Agent Engine behaviour, and Click option consistency.

All applicable pre-commit hooks passed.

Manual E2E

Not run against Cloud Run or GKE because that requires cloud credentials and billable resources. Unit tests build and inspect the exact deployment context and Dockerfile.

Checklist

  • I have read the CONTRIBUTING document.
  • I have self-reviewed this change.
  • I have added regression tests.
  • Relevant tests pass locally.
  • I have deployed the generated image to Cloud Run or GKE.
  • This change has no downstream dependencies.

Additional context

The option semantics match the existing Agent Engine flag so projects can use one package layout across all supported deployment targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable common folder ouside of adk-agent for code reusability

2 participants