Skip to content

Fix: Add missing --agent_engine_id option to adk deploy cloud_run command #344

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/google/adk/cli/cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

EXPOSE {port}

CMD adk {command} --port={port} {trace_to_cloud_option} "/app/agents"
CMD adk {command} {agent_engine_id_option} --port={port} {trace_to_cloud_option} "/app/agents"
"""


Expand All @@ -80,6 +80,7 @@ def to_cloud_run(
region: Optional[str],
service_name: str,
app_name: str,
agent_engine_id: str,
temp_folder: str,
port: int,
trace_to_cloud: bool,
Expand Down Expand Up @@ -145,6 +146,7 @@ def to_cloud_run(
command='web' if with_ui else 'api_server',
install_agent_deps=install_agent_deps,
trace_to_cloud_option='--trace_to_cloud' if trace_to_cloud else '',
agent_engine_id_option=f'--session_db_url=agentengine://{agent_engine_id}' if agent_engine_id else '',
)
dockerfile_path = os.path.join(temp_folder, 'Dockerfile')
os.makedirs(temp_folder, exist_ok=True)
Expand Down
7 changes: 7 additions & 0 deletions src/google/adk/cli/cli_tools_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ def cli_api_server(
default="WARNING",
help="Optional. Override the default verbosity level.",
)
@click.option(
"--agent_engine_id",
type=str,
help="Optional. The Vertex AI Agent Engine ID to use. if set, the agent will be deployed to a managed session service.",
)
@click.argument(
"agent",
type=click.Path(
Expand All @@ -553,6 +558,7 @@ def cli_deploy_cloud_run(
region: Optional[str],
service_name: str,
app_name: str,
agent_engine_id: str,
temp_folder: str,
port: int,
trace_to_cloud: bool,
Expand All @@ -574,6 +580,7 @@ def cli_deploy_cloud_run(
region=region,
service_name=service_name,
app_name=app_name,
agent_engine_id=agent_engine_id,
temp_folder=temp_folder,
port=port,
trace_to_cloud=trace_to_cloud,
Expand Down