This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:3.13-slim | |
| # Prevents Python from buffering stdout and stderr | |
| ENV PYTHONUNBUFFERED=1 | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from google.adk.cli.fast_api import get_fast_api_app | |
| from fastapi import FastAPI | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| # Discover the `weather_agent` directory in current working dir | |
| AGENT_DIR = os.path.dirname(os.path.abspath(__file__)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2025 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| # --- EDI Configuration --- | |
| ELEMENT_SEPARATOR = "*" | |
| SEGMENT_TERMINATOR = "~" | |
| COMPONENT_SEPARATOR = ":" # Used for composite elements | |
| # --- Data Structures (Example Data) --- | |
| # Submitter of the EDI file (e.g., Billing Service or Provider) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fetch cloud_function | |
| | metric 'cloudfunctions.googleapis.com/function/execution_count' | |
| | { | |
| filter status != 'ok' | |
| ; | |
| ident | |
| } | |
| | group_by drop[status], sliding(5m), .sum | |
| | ratio | |
| | scale '%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BatchPayloads(CombineFn): | |
| '''Collect all items in the windowed collection into single batch''' | |
| def create_accumulator(self): | |
| return [] | |
| def add_input(self, accumulator, input): | |
| accumulator.append(input) | |
| return accumulator | |
| def merge_accumulators(self, accumulators): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2022-10-03T18:53:36.321-0700 [INFO] Terraform version: 1.3.1 | |
| 2022-10-03T18:53:36.321-0700 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0 | |
| 2022-10-03T18:53:36.321-0700 [DEBUG] using github.com/hashicorp/hcl/v2 v2.14.1 | |
| 2022-10-03T18:53:36.321-0700 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2 | |
| 2022-10-03T18:53:36.321-0700 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 | |
| 2022-10-03T18:53:36.321-0700 [DEBUG] using github.com/zclconf/go-cty v1.11.0 | |
| 2022-10-03T18:53:36.321-0700 [INFO] Go runtime version: go1.19.1 | |
| 2022-10-03T18:53:36.321-0700 [INFO] CLI args: []string{"terraform", "apply", "-auto-approve"} | |
| 2022-10-03T18:53:36.321-0700 [TRACE] Stdout is a terminal of width 111 | |
| 2022-10-03T18:53:36.321-0700 [TRACE] Stderr is a terminal of width 111 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version='1.0' encoding='UTF-8'?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>com.google.cloud</groupId> | |
| <artifactId>examples-testbed-local</artifactId> | |
| <packaging>jar</packaging> | |
| <version>1.0.0</version> | |
| <name>Test Local Environment Examples</name> | |
| <!-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wait_startup_script_to_finish() { | |
| vm_name=$1 | |
| vm_zone=$2 | |
| threshold=$(date --date="-5 min" "+%b %_d %H:%M:%S") | |
| echo -n "Wait for \"$vm_name\" startup script to exit." | |
| status="" | |
| while [[ -z "$status" ]] | |
| do | |
| sleep 3; | |
| echo -n "." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wait_startup_script_to_finish() { | |
| vm_name=$1 | |
| vm_zone=$2 | |
| echo -n "Wait for \"$vm_name\" startup script to exit." | |
| status="" | |
| while [[ -z "$status" ]] | |
| do | |
| sleep 3; | |
| echo -n "." | |
| status=$(gcloud compute ssh $vm_name --zone=$vm_zone --ssh-flag="-q" --command 'grep -m 1 "startup-script exit status" /var/log/syslog' 2>&-) |
NewerOlder