Deploys an agent to Google Cloud Run. `agent_folder` should contain the following files: - __init__.py - agent.py - requirements.txt (optional, for additional dependencies) - ... (other required source files) The folder structure of temp_folder will be * dist/[google_adk wheel file
(
*,
agent_folder: str,
project: Optional[str],
region: Optional[str],
service_name: str,
app_name: str,
temp_folder: str,
port: int,
trace_to_cloud: bool,
otel_to_cloud: bool,
with_ui: bool,
log_level: str,
verbosity: str,
adk_version: str,
allow_origins: Optional[list[str]] = None,
session_service_uri: Optional[str] = None,
artifact_service_uri: Optional[str] = None,
memory_service_uri: Optional[str] = None,
use_local_storage: bool = False,
a2a: bool = False,
trigger_sources: Optional[str] = None,
extra_gcloud_args: Optional[tuple[str, ...]] = None,
)
| 601 | |
| 602 | |
| 603 | def to_cloud_run( |
| 604 | *, |
| 605 | agent_folder: str, |
| 606 | project: Optional[str], |
| 607 | region: Optional[str], |
| 608 | service_name: str, |
| 609 | app_name: str, |
| 610 | temp_folder: str, |
| 611 | port: int, |
| 612 | trace_to_cloud: bool, |
| 613 | otel_to_cloud: bool, |
| 614 | with_ui: bool, |
| 615 | log_level: str, |
| 616 | verbosity: str, |
| 617 | adk_version: str, |
| 618 | allow_origins: Optional[list[str]] = None, |
| 619 | session_service_uri: Optional[str] = None, |
| 620 | artifact_service_uri: Optional[str] = None, |
| 621 | memory_service_uri: Optional[str] = None, |
| 622 | use_local_storage: bool = False, |
| 623 | a2a: bool = False, |
| 624 | trigger_sources: Optional[str] = None, |
| 625 | extra_gcloud_args: Optional[tuple[str, ...]] = None, |
| 626 | ): |
| 627 | """Deploys an agent to Google Cloud Run. |
| 628 | |
| 629 | `agent_folder` should contain the following files: |
| 630 | |
| 631 | - __init__.py |
| 632 | - agent.py |
| 633 | - requirements.txt (optional, for additional dependencies) |
| 634 | - ... (other required source files) |
| 635 | |
| 636 | The folder structure of temp_folder will be |
| 637 | |
| 638 | * dist/[google_adk wheel file] |
| 639 | * agents/[app_name]/ |
| 640 | * agent source code from `agent_folder` |
| 641 | |
| 642 | Args: |
| 643 | agent_folder: The folder (absolute path) containing the agent source code. |
| 644 | project: Google Cloud project id. |
| 645 | region: Google Cloud region. |
| 646 | service_name: The service name in Cloud Run. |
| 647 | app_name: The name of the app, by default, it's basename of `agent_folder`. |
| 648 | temp_folder: The temp folder for the generated Cloud Run source files. |
| 649 | port: The port of the ADK api server. |
| 650 | trace_to_cloud: Whether to enable Cloud Trace. |
| 651 | otel_to_cloud: Whether to enable exporting OpenTelemetry signals |
| 652 | to Google Cloud. |
| 653 | with_ui: Whether to deploy with UI. |
| 654 | verbosity: The verbosity level of the CLI. |
| 655 | adk_version: The ADK version to use in Cloud Run. |
| 656 | allow_origins: Origins to allow for CORS. Can be literal origins or regex |
| 657 | patterns prefixed with 'regex:'. |
| 658 | session_service_uri: The URI of the session service. |
| 659 | artifact_service_uri: The URI of the artifact service. |
| 660 | memory_service_uri: The URI of the memory service. |
nothing calls this directly
no test coverage detected