Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Update adk_app handling to use custom module without .py extension #2374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vinodseshadri wants to merge 1 commit into google:main
base: main
Choose a base branch
Loading
from vinodseshadri:main

Conversation

@vinodseshadri
Copy link

@vinodseshadri vinodseshadri commented Aug 6, 2025
edited
Loading

Pull Request Description

This pull request addresses a critical issue in the cli_deploy.py module -where in the adk_app was ignored

Issues fixed

fixes #2298

Changes done

  • Added code to check if adk_app is set and if it is then copy the py file from agent source folder instead of creating
  • Moved the hardcoded add_app to a constant so that it can be revisited later easily
  • Added test cases to ensure custom file for add_app works
  • library built and command line tested

@adk-bot adk-bot added bot triaged tools [Component] This issue is related to tools labels Aug 6, 2025
Copy link
Collaborator

adk-bot commented Aug 6, 2025

Response from ADK Triaging Agent

Hello @vinodseshadri, thank you for creating this PR!

This PR is a bug fix, could you please provide the command line output after the fix is applied?

This information will help reviewers to review your PR more efficiently. Thanks!

Copy link
Author

Response from ADK Triaging Agent

Hello @vinodseshadri, thank you for creating this PR!

This PR is a bug fix, could you please provide the command line output after the fix is applied?

This information will help reviewers to review your PR more efficiently. Thanks!

Here is execution with no adk_app added

adk deploy agent_engine --project=xxx --region=us-east4 --staging_bucket="gs://xxxx" --display_name="test_adk" '/Users/xxx/Code/adk-python/downloads/test_agent'
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
 warnings.warn(
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/pydantic/_internal/_fields.py:198: UserWarning: Field name "config_type" in "SequentialAgent" shadows an attribute in parent "BaseAgent"
 warnings.warn(
Copying agent source code...
Copying agent source code complete.
Initializing Vertex AI...
Resolving files and dependencies...
Creating /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_122802/test_agent/requirements.txt...
Created /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_122802/test_agent/requirements.txt
Vertex AI initialized.
Using adk_app: agent_engine_app
Created /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_122802/agent_engine_app.py
Files and dependencies resolved
Running `absolufy-imports /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_122802/test_agent/__init__.py`
Running `absolufy-imports /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_122802/test_agent/agent.py`
Deploying to agent engine...
Reading requirements from requirements='/var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_122802/test_agent/requirements.txt'
Read the following lines: ['google-cloud-aiplatform[adk,agent_engines]']
Identified the following requirements: {'cloudpickle': '3.1.1', 'pydantic': '2.11.7'}
The following requirements are missing: {'cloudpickle', 'pydantic'}
The following requirements are appended: {'cloudpickle==3.1.1', 'pydantic==2.11.7'}
The final list of requirements: ['google-cloud-aiplatform[adk,agent_engines]', 'cloudpickle==3.1.1', 'pydantic==2.11.7']
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/google/auth/_default.py:76: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a "quota exceeded" or "API not enabled" error. See the following page for troubleshooting: https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds. 
 warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/google/auth/_default.py:76: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a "quota exceeded" or "API not enabled" error. See the following page for troubleshooting: https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds. 
 warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
Using bucket xxx
Wrote to gs://xxx/agent_engine/agent_engine.pkl
Writing to gs://xxx/agent_engine/requirements.txt
Creating in-memory tarfile of extra_packages
Writing to gs://xxx/agent_engine/dependencies.tar.gz
Cleaning up the temp folder: /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_122802

Below example with a test_adk.py file in the agent folder with adk_app as test_adk.py

adk deploy agent_engine --project=xxxx --region=us-east4 --staging_bucket="gs://xxx" --display_name="test_adk" '/Users/xxx/Code/adk-python/downloads/test_agent' --adk_app test_adk
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
 warnings.warn(
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/pydantic/_internal/_fields.py:198: UserWarning: Field name "config_type" in "SequentialAgent" shadows an attribute in parent "BaseAgent"
 warnings.warn(
Copying agent source code...
Copying agent source code complete.
Initializing Vertex AI...
Resolving files and dependencies...
Creating /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_123303/test_agent/requirements.txt...
Created /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_123303/test_agent/requirements.txt
Vertex AI initialized.
Using adk_app: test_adk
Using existing test_adk.py
Files and dependencies resolved
Running `absolufy-imports /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_123303/test_agent/test_adk.py`
Running `absolufy-imports /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_123303/test_agent/__init__.py`
Running `absolufy-imports /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_123303/test_agent/agent.py`
Deploying to agent engine...
Reading requirements from requirements='/var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_123303/test_agent/requirements.txt'
Read the following lines: ['google-cloud-aiplatform[adk,agent_engines]']
Identified the following requirements: {'cloudpickle': '3.1.1', 'pydantic': '2.11.7'}
The following requirements are missing: {'cloudpickle', 'pydantic'}
The following requirements are appended: {'cloudpickle==3.1.1', 'pydantic==2.11.7'}
The final list of requirements: ['google-cloud-aiplatform[adk,agent_engines]', 'cloudpickle==3.1.1', 'pydantic==2.11.7']
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/google/auth/_default.py:76: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a "quota exceeded" or "API not enabled" error. See the following page for troubleshooting: https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds. 
 warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/google/auth/_default.py:76: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a "quota exceeded" or "API not enabled" error. See the following page for troubleshooting: https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds. 
 warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
Using bucket xxx
Wrote to gs://xxx/agent_engine/agent_engine.pkl
Writing to gs://xxx/agent_engine/requirements.txt
Creating in-memory tarfile of extra_packages
Writing to gs://xxx/agent_engine/dependencies.tar.gz
/Users/vinodseshadri/venvs/adk-quickstart/lib/python3.9/site-packages/google/auth/_default.py:76: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a "quota exceeded" or "API not enabled" error. See the following page for troubleshooting: https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds. 
 warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
Cleaning up the temp folder: /var/folders/6j/966cqj6d24xbnzp9lfrp4_b00000gn/T/agent_engine_deploy_src/20250806_123303
artpick and yeesian reacted with thumbs up emoji

Copy link
Collaborator

yeesian commented Oct 29, 2025

Hi sorry for the slow response here, this is a great contribution! Can you resolve the merge conflicts? I'll be able to follow-up from there

@yeesian yeesian self-requested a review October 29, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@seanzhou1023 seanzhou1023 Awaiting requested review from seanzhou1023

@yeesian yeesian Awaiting requested review from yeesian

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

tools [Component] This issue is related to tools

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Agent Engine Deployment with GCSArtifact via custom adk_app.py not working as expected

AltStyle によって変換されたページ (->オリジナル) /