Skip to content

Commit 69b3261

Browse files
committed
chore: final touches for e2e testing
1 parent d95271b commit 69b3261

1 file changed

Lines changed: 29 additions & 9 deletions

File tree

src/google/adk/cli/cli_deploy.py

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ def _ensure_agent_engine_dependency(requirements_txt_path: str) -> None:
7171
FROM python:3.11-slim
7272
WORKDIR /app
7373
74+
RUN apt-get update && \
75+
apt-get upgrade -y && \
76+
apt-get install -y git && \
77+
apt -y autoremove
78+
7479
# Create a non-root user
7580
RUN adduser --disabled-password --gecos "" myuser
7681
@@ -87,7 +92,7 @@ def _ensure_agent_engine_dependency(requirements_txt_path: str) -> None:
8792
# Set up environment variables - End
8893
8994
# Install ADK - Start
90-
RUN pip install google-adk=={adk_version}
95+
# RUN pip install google-adk=={adk_version}
9196
# Install ADK - End
9297
9398
# Copy agent - Start
@@ -1103,19 +1108,34 @@ def to_agent_engine(
11031108

11041109
from ..utils._google_client_headers import get_tracking_headers
11051110

1106-
if not project or not region:
1107-
click.echo('No project/region provided. Starting onboarding flow...')
1111+
if not (api_key or project or region):
1112+
click.echo(
1113+
'No api_key/project/region provided. Starting onboarding flow...'
1114+
)
11081115
auth_info = _onboarding.handle_login_with_google()
11091116
project = auth_info.project_id
11101117
region = auth_info.region
11111118

11121119
click.echo('Initializing Agent Platform client...')
1113-
client = vertexai.Client(
1114-
project=project,
1115-
location=region,
1116-
http_options={'headers': get_tracking_headers()},
1117-
)
1118-
click.echo('Agent Platform client initialized.')
1120+
if project and region:
1121+
client = vertexai.Client(
1122+
project=project,
1123+
location=region,
1124+
http_options={'headers': get_tracking_headers()},
1125+
)
1126+
click.echo('Agent Platform client initialized with project and region.')
1127+
elif api_key:
1128+
client = vertexai.Client(
1129+
api_key=api_key,
1130+
http_options={'headers': get_tracking_headers()},
1131+
)
1132+
click.echo('Agent Platform client initialized with ExpressMode API Key.')
1133+
else:
1134+
click.echo(
1135+
'Failed to initialize Agent Platform client. Please provide an API'
1136+
'key or project and region.'
1137+
)
1138+
return
11191139

11201140
if skip_agent_import_validation:
11211141
warnings.warn(

0 commit comments

Comments
 (0)