diff --git a/.github/scripts/model-discovery.py b/.github/scripts/model-discovery.py index 4daaced7e..7fd971384 100755 --- a/.github/scripts/model-discovery.py +++ b/.github/scripts/model-discovery.py @@ -12,7 +12,7 @@ ``anthropic`` publisher. Required env vars: - GCP_REGION - GCP region (e.g. us-east5) + GCP_REGION - GCP region (e.g. global) GCP_PROJECT - GCP project ID Optional env vars: diff --git a/.github/workflows/pull-reviews.yml b/.github/workflows/pull-reviews.yml old mode 100644 new mode 100755 index b5fa97d77..cc88796a8 --- a/.github/workflows/pull-reviews.yml +++ b/.github/workflows/pull-reviews.yml @@ -15,7 +15,7 @@ jobs: with: s3_bucket: pull-reviews gcp_project_id: ambient-code-platform - gcp_region: us-east5 + gcp_region: global gcp_workload_identity_provider: projects/888214980327/locations/global/workloadIdentityPools/github/providers/ambient-code-github-actions secrets: S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} diff --git a/components/ambient-control-plane/internal/config/config.go b/components/ambient-control-plane/internal/config/config.go old mode 100644 new mode 100755 index 7a0f606d2..53db70907 --- a/components/ambient-control-plane/internal/config/config.go +++ b/components/ambient-control-plane/internal/config/config.go @@ -67,7 +67,7 @@ func Load() (*ControlPlaneConfig, error) { AnthropicAPIKey: os.Getenv("ANTHROPIC_API_KEY"), VertexEnabled: os.Getenv("USE_VERTEX") == "1" || os.Getenv("USE_VERTEX") == "true", VertexProjectID: os.Getenv("ANTHROPIC_VERTEX_PROJECT_ID"), - VertexRegion: envOrDefault("CLOUD_ML_REGION", "us-east5"), + VertexRegion: envOrDefault("CLOUD_ML_REGION", "global"), VertexCredentialsPath: envOrDefault("GOOGLE_APPLICATION_CREDENTIALS", "/app/vertex/ambient-code-key.json"), VertexSecretName: envOrDefault("VERTEX_SECRET_NAME", "ambient-vertex"), VertexSecretNamespace: envOrDefault("VERTEX_SECRET_NAMESPACE", "ambient-code"), diff --git a/components/backend/handlers/display_name.go b/components/backend/handlers/display_name.go old mode 100644 new mode 100755 index a52406237..3b3bc9524 --- a/components/backend/handlers/display_name.go +++ b/components/backend/handlers/display_name.go @@ -141,14 +141,11 @@ func getAnthropicClient(ctx context.Context, projectName string) (anthropic.Clie // Check if Vertex AI is enabled (cluster-wide setting) if isVertexEnabled() { // For Vertex AI, use the vertex package with Google Application Default Credentials - // Required env vars: GOOGLE_APPLICATION_CREDENTIALS, ANTHROPIC_VERTEX_PROJECT_ID, CLOUD_ML_REGION region := os.Getenv("CLOUD_ML_REGION") gcpProjectID := os.Getenv("ANTHROPIC_VERTEX_PROJECT_ID") - // Default to us-east5 - claude-haiku-4-5 is not available in global region - // See: https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude - if region == "" || region == "global" { - region = "us-east5" + if region == "" { + region = "global" } if gcpProjectID == "" { return anthropic.Client{}, false, fmt.Errorf("ANTHROPIC_VERTEX_PROJECT_ID is required when USE_VERTEX is enabled (check backend deployment env vars)") diff --git a/components/backend/handlers/display_name_test.go b/components/backend/handlers/display_name_test.go old mode 100644 new mode 100755 index ca0722040..538e64ab5 --- a/components/backend/handlers/display_name_test.go +++ b/components/backend/handlers/display_name_test.go @@ -347,14 +347,14 @@ var _ = Describe("Display Name Handler", Label(test_constants.LabelUnit, test_co It("Should detect Vertex AI enabled configuration", func() { os.Setenv("USE_VERTEX", "1") os.Setenv("ANTHROPIC_VERTEX_PROJECT_ID", "test-gcp-project") - os.Setenv("CLOUD_ML_REGION", "us-east5") + os.Setenv("CLOUD_ML_REGION", "global") // This tests the environment detection logic // We can't easily test the full getAnthropicClient without real credentials // but we can verify the environment variables are read correctly Expect(os.Getenv("USE_VERTEX")).To(Equal("1")) Expect(os.Getenv("ANTHROPIC_VERTEX_PROJECT_ID")).To(Equal("test-gcp-project")) - Expect(os.Getenv("CLOUD_ML_REGION")).To(Equal("us-east5")) + Expect(os.Getenv("CLOUD_ML_REGION")).To(Equal("global")) }) It("Should handle missing Vertex configuration gracefully", func() { diff --git a/components/manifests/overlays/mpp-openshift/ambient-control-plane.yaml b/components/manifests/overlays/mpp-openshift/ambient-control-plane.yaml old mode 100644 new mode 100755 index 17ebaada4..b0c63c234 --- a/components/manifests/overlays/mpp-openshift/ambient-control-plane.yaml +++ b/components/manifests/overlays/mpp-openshift/ambient-control-plane.yaml @@ -69,7 +69,7 @@ spec: - name: ANTHROPIC_VERTEX_PROJECT_ID value: "ambient-code-platform" - name: CLOUD_ML_REGION - value: "us-east5" + value: "global" - name: GOOGLE_APPLICATION_CREDENTIALS value: "/app/vertex/ambient-code-key.json" - name: VERTEX_SECRET_NAME diff --git a/docs/internal/design/control-plane.guide.md b/docs/internal/design/control-plane.guide.md old mode 100644 new mode 100755 index 9dc077d0c..61b0fe58a --- a/docs/internal/design/control-plane.guide.md +++ b/docs/internal/design/control-plane.guide.md @@ -726,14 +726,14 @@ acpctl session events CLI open | File | Change | |------|--------| | `runners/ambient_runner/platform/context.py` | Added `current_user_id`, `current_user_name`, `caller_token` fields + `set_current_user()` method to `RunnerContext` | -| `overlays/mpp-openshift/ambient-control-plane.yaml` | Added `USE_VERTEX=1`, `ANTHROPIC_VERTEX_PROJECT_ID=ambient-code-platform`, `CLOUD_ML_REGION=us-east5`, `GOOGLE_APPLICATION_CREDENTIALS=/app/vertex/ambient-code-key.json`, `VERTEX_SECRET_NAME=ambient-vertex`, `VERTEX_SECRET_NAMESPACE=ambient-code--runtime-int`; added `vertex-credentials` volumeMount + volume from `ambient-vertex` secret | +| `overlays/mpp-openshift/ambient-control-plane.yaml` | Added `USE_VERTEX=1`, `ANTHROPIC_VERTEX_PROJECT_ID=ambient-code-platform`, `CLOUD_ML_REGION=global`, `GOOGLE_APPLICATION_CREDENTIALS=/app/vertex/ambient-code-key.json`, `VERTEX_SECRET_NAME=ambient-vertex`, `VERTEX_SECRET_NAMESPACE=ambient-code--runtime-int`; added `vertex-credentials` volumeMount + volume from `ambient-vertex` secret | **Vertex invariants for MPP:** - Secret: `secret/ambient-vertex` in `ambient-code--runtime-int` — contains `ambient-code-key.json` (GCP SA key) - CP reads it via `nsKube()` (tenant SA) and copies to session namespace via `ensureVertexSecret()` - Runner pod mounts it at `/app/vertex/` — set `GOOGLE_APPLICATION_CREDENTIALS=/app/vertex/ambient-code-key.json` - `VERTEX_SECRET_NAMESPACE` must be `ambient-code--runtime-int` (not default `ambient-code`) -- GCP project: `ambient-code-platform`, region: `us-east5` +- GCP project: `ambient-code-platform`, region: `global` **acpctl session commands:** ```bash diff --git a/docs/internal/developer/local-development/kind.md b/docs/internal/developer/local-development/kind.md index 790525443..7e5462b98 100755 --- a/docs/internal/developer/local-development/kind.md +++ b/docs/internal/developer/local-development/kind.md @@ -205,7 +205,7 @@ make kind-up LOCAL_VERTEX=true GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-a ```bash make kind-up LOCAL_VERTEX=true \ ANTHROPIC_VERTEX_PROJECT_ID=my-project \ - CLOUD_ML_REGION=us-east5 \ + CLOUD_ML_REGION=global \ GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json ``` diff --git a/scripts/setup-vertex-kind.sh b/scripts/setup-vertex-kind.sh index 4523b6deb..abc28199c 100755 --- a/scripts/setup-vertex-kind.sh +++ b/scripts/setup-vertex-kind.sh @@ -24,14 +24,14 @@ # # CLOUD_ML_REGION # GCP region for Vertex AI API calls. -# Example: us-east5 (Claude is available in limited regions) +# Example: global (recommended for cost optimization) # # SETUP: # Add these to your shell profile (~/.zshrc or ~/.bashrc): # # export GOOGLE_APPLICATION_CREDENTIALS="$HOME/.config/gcloud/your-sa-key.json" # export ANTHROPIC_VERTEX_PROJECT_ID="your-gcp-project-id" -# export CLOUD_ML_REGION="us-east5" +# export CLOUD_ML_REGION="global" # # Then reload your shell: source ~/.zshrc # @@ -109,7 +109,7 @@ fi if [ -z "$CLOUD_ML_REGION" ]; then echo " [MISSING] CLOUD_ML_REGION" - echo " GCP region (e.g., us-east5)" + echo " GCP region (e.g., global)" echo "" missing_vars=1 else @@ -122,7 +122,7 @@ if [ $missing_vars -eq 1 ]; then echo "" echo ' export GOOGLE_APPLICATION_CREDENTIALS="$HOME/.config/gcloud/your-sa-key.json"' echo ' export ANTHROPIC_VERTEX_PROJECT_ID="your-gcp-project-id"' - echo ' export CLOUD_ML_REGION="us-east5"' + echo ' export CLOUD_ML_REGION="global"' echo "" echo "Then reload: source ~/.zshrc" exit 1