Description
Describe the bug
adk deploy agent_engine
forces you to add arguments for project and region even when they are present in an agent's .env file, but then returns an error due to those env variables being reserved, forcing you to remove them from the .env file (where they serve a good purpose for dev and testing).
To Reproduce
Steps to reproduce the behavior:
- Create an agent with a .env file that includes
GOOGLE_CLOUD_PROJECT
andGOOGLE_CLOUD_LOCATION
(so alsoGOOGLE_GENAI_USE_VERTEXAI=TRUE
). - try to deploy with just
adk deploy agent_engine --staging_bucket=gs://YOUR_BUCKET path/to/agent
to see that it does not respect the values already present in the .env file - deploy with providing those values with:
adk deploy agent_engine --project=YOUR_PROJECT_ID --region=us-central1 --staging_bucket=gs://YOUR_BUCKET path/to/agent
- See errors that the
GOOGLE_CLOUD_PROJECT
and thenGOOGLE_CLOUD_LOCATION
are reserved:
Deploy failed: 400 Environment variable name 'GOOGLE_CLOUD_PROJECT' is reserved. Please rename the variable in `spec.deployment_spec.env`.
Expected behavior
Ideally you wouldn't need to provide the --project
and --region
flags if those env values are set in the .env file of the agent.
However if it has been decided that you must provide those values, then if there is no conflict between the provided values and the values in the .env file, you should be able to keep them in your .env file (as they are useful for testing, development, etc.)