Skip to content

Commit 0c6086c

Browse files
wuliang229copybara-github
authored andcommitted
chore: remove redundant definition for adk deploy gke command
PiperOrigin-RevId: 788758843
1 parent 9db5d9a commit 0c6086c

File tree

1 file changed

+0
-158
lines changed

1 file changed

+0
-158
lines changed

src/google/adk/cli/cli_tools_click.py

Lines changed: 0 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,161 +1247,3 @@ def cli_deploy_gke(
12471247
)
12481248
except Exception as e:
12491249
click.secho(f"Deploy failed: {e}", fg="red", err=True)
1250-
1251-
1252-
@deploy.command("gke")
1253-
@click.option(
1254-
"--project",
1255-
type=str,
1256-
help=(
1257-
"Required. Google Cloud project to deploy the agent. When absent,"
1258-
" default project from gcloud config is used."
1259-
),
1260-
)
1261-
@click.option(
1262-
"--region",
1263-
type=str,
1264-
help=(
1265-
"Required. Google Cloud region to deploy the agent. When absent,"
1266-
" gcloud run deploy will prompt later."
1267-
),
1268-
)
1269-
@click.option(
1270-
"--cluster_name",
1271-
type=str,
1272-
help="Required. The name of the GKE cluster.",
1273-
)
1274-
@click.option(
1275-
"--service_name",
1276-
type=str,
1277-
default="adk-default-service-name",
1278-
help=(
1279-
"Optional. The service name to use in GKE (default:"
1280-
" 'adk-default-service-name')."
1281-
),
1282-
)
1283-
@click.option(
1284-
"--app_name",
1285-
type=str,
1286-
default="",
1287-
help=(
1288-
"Optional. App name of the ADK API server (default: the folder name"
1289-
" of the AGENT source code)."
1290-
),
1291-
)
1292-
@click.option(
1293-
"--port",
1294-
type=int,
1295-
default=8000,
1296-
help="Optional. The port of the ADK API server (default: 8000).",
1297-
)
1298-
@click.option(
1299-
"--trace_to_cloud",
1300-
is_flag=True,
1301-
show_default=True,
1302-
default=False,
1303-
help="Optional. Whether to enable Cloud Trace for GKE.",
1304-
)
1305-
@click.option(
1306-
"--with_ui",
1307-
is_flag=True,
1308-
show_default=True,
1309-
default=False,
1310-
help=(
1311-
"Optional. Deploy ADK Web UI if set. (default: deploy ADK API server"
1312-
" only)"
1313-
),
1314-
)
1315-
@click.option( # This is the crucial missing piece
1316-
"--verbosity",
1317-
type=LOG_LEVELS,
1318-
help="Deprecated. Use --log_level instead.",
1319-
)
1320-
@click.option(
1321-
"--log_level",
1322-
type=LOG_LEVELS,
1323-
default="INFO",
1324-
help="Optional. Set the logging level",
1325-
)
1326-
@click.option(
1327-
"--temp_folder",
1328-
type=str,
1329-
default=os.path.join(
1330-
tempfile.gettempdir(),
1331-
"gke_deploy_src",
1332-
datetime.now().strftime("%Y%m%d_%H%M%S"),
1333-
),
1334-
help=(
1335-
"Optional. Temp folder for the generated GKE source files"
1336-
" (default: a timestamped folder in the system temp directory)."
1337-
),
1338-
)
1339-
@click.argument(
1340-
"agent",
1341-
type=click.Path(
1342-
exists=True, dir_okay=True, file_okay=False, resolve_path=True
1343-
),
1344-
)
1345-
@click.option(
1346-
"--adk_version",
1347-
type=str,
1348-
default=version.__version__,
1349-
show_default=True,
1350-
help=(
1351-
"Optional. The ADK version used in GKE deployment. (default: the"
1352-
" version in the dev environment)"
1353-
),
1354-
)
1355-
@adk_services_options()
1356-
@deprecated_adk_services_options()
1357-
def cli_deploy_gke(
1358-
agent: str,
1359-
project: Optional[str],
1360-
region: Optional[str],
1361-
cluster_name: str,
1362-
service_name: str,
1363-
app_name: str,
1364-
temp_folder: str,
1365-
port: int,
1366-
trace_to_cloud: bool,
1367-
with_ui: bool,
1368-
verbosity: str,
1369-
adk_version: str,
1370-
log_level: Optional[str] = None,
1371-
session_service_uri: Optional[str] = None,
1372-
artifact_service_uri: Optional[str] = None,
1373-
memory_service_uri: Optional[str] = None,
1374-
session_db_url: Optional[str] = None, # Deprecated
1375-
artifact_storage_uri: Optional[str] = None, # Deprecated
1376-
):
1377-
"""Deploys an agent to GKE.
1378-
1379-
AGENT: The path to the agent source code folder.
1380-
1381-
Example:
1382-
1383-
adk deploy gke --project=[project] --region=[region] --cluster_name=[cluster_name] path/to/my_agent
1384-
"""
1385-
session_service_uri = session_service_uri or session_db_url
1386-
artifact_service_uri = artifact_service_uri or artifact_storage_uri
1387-
try:
1388-
cli_deploy.to_gke(
1389-
agent_folder=agent,
1390-
project=project,
1391-
region=region,
1392-
cluster_name=cluster_name,
1393-
service_name=service_name,
1394-
app_name=app_name,
1395-
temp_folder=temp_folder,
1396-
port=port,
1397-
trace_to_cloud=trace_to_cloud,
1398-
with_ui=with_ui,
1399-
verbosity=verbosity,
1400-
log_level=log_level,
1401-
adk_version=adk_version,
1402-
session_service_uri=session_service_uri,
1403-
artifact_service_uri=artifact_service_uri,
1404-
memory_service_uri=memory_service_uri,
1405-
)
1406-
except Exception as e:
1407-
click.secho(f"Deploy failed: {e}", fg="red", err=True)

0 commit comments

Comments
 (0)