adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

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

Open jfolaya8 opened this issue 1 year ago • 9 comments

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

jfolaya8 avatar Apr 20 '25 22:04 jfolaya8

Are you blocked by this issue @jfolaya8 ?

hangfei avatar Apr 22 '25 02:04 hangfei

@DeanChensj could you confirm the right logic for agent_engine_id?

hangfei avatar Apr 22 '25 02:04 hangfei

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.

jfolaya8 avatar Apr 22 '25 02:04 jfolaya8

@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 avatar Apr 22 '25 13:04 devxaitist

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

devxaitist avatar Apr 22 '25 15:04 devxaitist

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 avatar Apr 22 '25 22:04 DeanChensj

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.

devxaitist avatar Apr 22 '25 23:04 devxaitist

@DeanChensj pls check whether we should move this issue to adk-docs

seanzhou1023 avatar May 28 '25 00:05 seanzhou1023

Hi @devxaitist , sorry for the late response. if you run adk web --help, you would see all the supported options. You might close your PR. Thanks!

DeanChensj avatar May 28 '25 03:05 DeanChensj