Skip to content

Conversation

@vinodseshadri
Copy link

@vinodseshadri vinodseshadri commented Aug 6, 2025

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
@adk-bot adk-bot requested a review from seanzhou1023 August 6, 2025 03:12
@adk-bot
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!

@vinodseshadri
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

@yeesian
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
@vinodseshadri vinodseshadri marked this pull request as draft November 20, 2025 11:49
@vinodseshadri vinodseshadri force-pushed the main_conflict branch 2 times, most recently from ae22085 to c1beb4a Compare November 20, 2025 12:30
@vinodseshadri vinodseshadri marked this pull request as ready for review November 20, 2025 12:34
@vinodseshadri
Copy link
Author

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 I have resolved the conflicts and updated it with the latest code. Kindly review and merge

@ryanaiagent ryanaiagent self-assigned this Dec 5, 2025
@ryanaiagent ryanaiagent added request clarification [Status] The maintainer need clarification or more information from the author tools [Component] This issue is related to tools and removed tools [Component] This issue is related to tools labels Dec 5, 2025
@ryanaiagent
Copy link
Collaborator

Hi @vinodseshadri, Thank you for your contribution! We appreciate you taking the time to submit this pull request. Can you also fix the lint errors using autoformat.sh. Let us know once you are done so that we can proceed with the review.

@vinodseshadri
Copy link
Author

Hi @vinodseshadri, Thank you for your contribution! We appreciate you taking the time to submit this pull request. Can you also fix the lint errors using autoformat.sh. Let us know once you are done so that we can proceed with the review.

@ryanaiagent This is complete now.

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

Labels

request clarification [Status] The maintainer need clarification or more information from the author tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

5 participants