Skip to content

adk deploy cloud_run: Option --agent_engine_id documented but not recognized #303

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
jfolaya8 opened this issue Apr 20, 2025 · 7 comments · May be fixed by #344
Open

adk deploy cloud_run: Option --agent_engine_id documented but not recognized #303

jfolaya8 opened this issue Apr 20, 2025 · 7 comments · May be fixed by #344
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@jfolaya8
Copy link

Describe the bug
The documentation for the adk deploy cloud_run command indicates that --agent_engine_id is an optional parameter. However, when attempting to use this option during command execution, an error occurs stating that the option does not exist (Error: No such option: --agent_engine_id).

According to the official documentation, --agent_engine_id should be a valid optional parameter:
https://google.github.io/adk-docs/deploy/cloud-run/#setup-environment-variables

To Reproduce

  1. Execute the adk deploy cloud_run command including the --agent_engine_id option, similar to the following example:

    adk deploy cloud_run \
    --project=$GOOGLE_CLOUD_PROJECT \
    --region=$GOOGLE_CLOUD_LOCATION \
    --service_name=my-adk-agent-service \
    --app_name=my-app-name \
    --agent_engine_id=YOUR_AGENT_ENGINE_ID \
    ./path/to/your/agent

Expected behavior
The command should execute successfully, recognizing and utilizing (or ignoring if truly optional for the internal logic at that point) the --agent_engine_id parameter as described in the documentation.

Desktop (please complete the following information):

  • OS: MacOs Sonoma
  • Python version(python -V): 3.12.4
  • ADK version: 0.2.0
@hangfei
Copy link
Collaborator

hangfei commented Apr 22, 2025

Are you blocked by this issue @jfolaya8 ?

@hangfei
Copy link
Collaborator

hangfei commented Apr 22, 2025

@DeanChensj could you confirm the right logic for agent_engine_id?

@hangfei hangfei added the good first issue Good for newcomers label Apr 22, 2025
@jfolaya8
Copy link
Author

Hi @hangfei, thanks for asking.

Currently, I'm not strictly blocked because I'm in the testing phase. I was able to deploy the agent without the
--agent_engine_id flag.

However, as expected, without connecting to my existing Vertex AI Agent Engine using this ID, session state is lost whenever the Cloud Run service restarts. My understanding is that agent_engine_id is needed precisely to enable session persistence with an existing Agent Engine, which is a functionality I will require.

So, while I can continue with some testing for now, it would be great if you can check it out. Thanks for looking into it.

@devxaitist
Copy link

@hangfei @jfolaya8

I'd like to work on this issue as a first-time contributor. I'll investigate why the --agent_engine_id option is documented but not recognized and submit a PR to fix it. Please let me know if there's any specific guidance or if someone else is already working on this.

devxaitist added a commit to devxaitist/adk-python that referenced this issue Apr 22, 2025
Add the --agent_engine_id option to the deploy cloud_run CLI command
that was documented but not implemented. This allows users to connect
their deployed agent to a Vertex AI Agent Engine for session persistence.

Part of google#303
devxaitist added a commit to devxaitist/adk-python that referenced this issue Apr 22, 2025
Update the Dockerfile template to use the agent_engine_id parameter
by converting it to the required session_db_url format. This enables
proper connection to Vertex AI Agent Engine when deploying to Cloud Run.

Fixes google#303
@devxaitist
Copy link

@hangfei @jfolaya8

I'd like to work on this issue as a first-time contributor. I'll investigate why the --agent_engine_id option is documented but not recognized and submit a PR to fix it. Please let me know if there's any specific guidance or if someone else is already working on this.

I've started working on this issue and created a draft PR (#344 ). I've implemented the missing --agent_engine_id option in the CLI and updated the Dockerfile template to use it correctly.

Currently, the PR is in draft status while I set up a testing environment to verify the changes. Once I've confirmed that everything works as expected, I'll mark it ready for review.

Looking forward to any feedback or testing guidance in the meantime.

@hangfei hangfei self-assigned this Apr 22, 2025
@DeanChensj
Copy link
Collaborator

Hi @devxaitist , thanks for pointing this out, we will remove the misleading doc instruction. Meanwhile, we are adding a session_db_url option to specify the usage of Database session or Vertex Session.

@DeanChensj DeanChensj added the documentation Improvements or additions to documentation label Apr 22, 2025
@devxaitist
Copy link

Hi @devxaitist , thanks for pointing this out, we will remove the misleading doc instruction. Meanwhile, we are adding a session_db_url option to specify the usage of Database session or Vertex Session.

Hello @DeanChensj

Thank you for the clarification. I already created a draft PR implementing the --agent_engine_id option, but I see the team is planning to go in a different direction with the session_db_url option instead. Should I close my current draft PR, or would you prefer me to update it to implement the new session_db_url option? I'd be happy to contribute to this new approach if that would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants