Skip to content

Commit 585fd31

Browse files
committed
feat(deploy): implement agent_engine_id in Dockerfile template
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
1 parent e0ee629 commit 585fd31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/google/adk/cli/cli_deploy.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
5555
EXPOSE {port}
5656
57-
CMD adk {command} --port={port} {trace_to_cloud_option} "/app/agents"
57+
CMD adk {command} {agent_engine_id_option} --port={port} {trace_to_cloud_option} "/app/agents"
5858
"""
5959

6060

@@ -80,6 +80,7 @@ def to_cloud_run(
8080
region: Optional[str],
8181
service_name: str,
8282
app_name: str,
83+
agent_engine_id: str,
8384
temp_folder: str,
8485
port: int,
8586
trace_to_cloud: bool,
@@ -145,6 +146,7 @@ def to_cloud_run(
145146
command='web' if with_ui else 'api_server',
146147
install_agent_deps=install_agent_deps,
147148
trace_to_cloud_option='--trace_to_cloud' if trace_to_cloud else '',
149+
agent_engine_id_option=f'--session_db_url=agentengine://{agent_engine_id}' if agent_engine_id else '',
148150
)
149151
dockerfile_path = os.path.join(temp_folder, 'Dockerfile')
150152
os.makedirs(temp_folder, exist_ok=True)

0 commit comments

Comments
 (0)