Skip to content

feat(iac): add regional orchestrator cache#2905

Draft
dobrac wants to merge 7 commits into
mainfrom
jd/regional-orchestrator-cache
Draft

feat(iac): add regional orchestrator cache#2905
dobrac wants to merge 7 commits into
mainfrom
jd/regional-orchestrator-cache

Conversation

@dobrac

@dobrac dobrac commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add optional region/zone/filestore_zone fields to GCP client cluster config
  • create per-region shared chunk cache Filestore instances for secondary client regions
  • keep secondary-region clients joined to the primary Consul/Nomad control plane

Validation

  • terraform fmt -check -recursive
  • terraform validate passed after terraform init -backend=false
  • bash -n iac/provider-gcp/nomad-cluster/scripts/run-consul.sh
  • bash -n iac/provider-gcp/nomad-cluster/scripts/run-nomad.sh

Note: a later terraform validate rerun hit local provider cache checksum mismatch after removing init-only lockfile hash noise; lockfile is unchanged in the PR.

@cla-bot cla-bot Bot added the cla-signed label Jun 2, 2026
@cursor

cursor Bot commented Jun 2, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Touches cluster topology, Nomad/Consul join behavior, Filestore provisioning, and pins older HashiCorp versions on new images—misconfiguration can break remote clients or cache mounts.

Overview
Adds multi-region GCP client orchestrator nodes with region-local shared chunk caches while keeping Consul/Nomad control plane membership in the primary region.

Regional placement & NFS: client_clusters_config gains optional region, zone, zones, filestore_zone, and distribution_policy_target_shape. Client worker MIGs deploy in the chosen region/zone; when filestore_cache_enabled, clusters in the primary region still use the existing primary Filestore, and clusters elsewhere mount a matching entry from new additional_filestores (per-region Filestore instances with location, tier, and capacity). Clusters in a non-primary region without a matching entry get no NFS cache.

Cross-region join: Startup scripts pass primary-region Nomad region, Consul datacenter, and a broader GCE retry-join zone pattern so remote clients discover the control plane; Docker auth can include the primary Artifact Registry region when it differs from the VM region.

Agent/runtime tweaks: Nomad raw_exec enables no_cgroups (GCP and AWS run-nomad.sh). Packer defaults downgrade Consul (1.17.31.16.2) and Nomad (1.8.41.6.2). Orchestrator and template-manager jobs drop inflated memory_max limits. GCP make plan is scoped to module.cluster and related ClickHouse password targets; ADDITIONAL_FILESTORES is wired through the Makefile.

Reviewed by Cursor Bugbot for commit d9d99b3. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
2706 3 2703 7
View the full list of 3 ❄️ flaky test(s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestCommandKillNextApp

Flake rate in main: 40.60% (Passed 837 times, Failed 572 times)

Stack Traces | 301s run time
=== RUN   TestCommandKillNextApp
=== PAUSE TestCommandKillNextApp
=== CONT  TestCommandKillNextApp
    process_test.go:28: Command [npx] output: event:{start:{pid:1271}}
Executing command /bin/bash in sandbox it9g2mo0mry63pp50ugd5
    process_test.go:28: Command [npx] output: event:{data:{stderr:"npm"}}
    process_test.go:28: Command [npx] output: event:{data:{stderr:" WARN exec The following package was not found and will be installed: create-next-app@16.2.7\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"Creating a new Next.js app in .../home/user/nextapp.\n\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"Using npm.\n\nInitializing project with template: app-tw \n\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"\nInstalling dependencies:\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- next\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- react\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- react-dom\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"\nInstalling devDependencies:\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- @tailwindcss/postcss\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- @types/node\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- @types/react\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- @types/react-dom\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- eslint\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- eslint-config-next\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- tailwindcss\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"- typescript\n"}}
    process_test.go:28: Command [npx] output: event:{data:{stdout:"\n"}}
    process_test.go:28: Command [npx] output: event:{keepalive:{}}
    process_test.go:28: Command [npx] output: event:{keepalive:{}}
    process_test.go:28: Command [npx] output: event:{keepalive:{}}
    process_test.go:29: 
        	Error Trace:	.../tests/envd/process_test.go:29
        	Error:      	Received unexpected error:
        	            	failed to execute command npx in sandbox iub58917nvdu1zjflynk0: invalid_argument: protocol error: incomplete envelope: unexpected EOF
        	Test:       	TestCommandKillNextApp
--- FAIL: TestCommandKillNextApp (300.52s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity

Flake rate in main: 55.64% (Passed 842 times, Failed 1056 times)

Stack Traces | 65s run time
=== RUN   TestSandboxMemoryIntegrity
=== PAUSE TestSandboxMemoryIntegrity
=== CONT  TestSandboxMemoryIntegrity
    sandbox_memory_integrity_test.go:27: Build completed successfully
--- FAIL: TestSandboxMemoryIntegrity (64.99s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity/tmpfs_hash

Flake rate in main: 55.72% (Passed 832 times, Failed 1047 times)

Stack Traces | 197s run time
=== RUN   TestSandboxMemoryIntegrity/tmpfs_hash
=== PAUSE TestSandboxMemoryIntegrity/tmpfs_hash
=== CONT  TestSandboxMemoryIntegrity/tmpfs_hash
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{start:{pid:1258}}
Executing command bash in sandbox itdjmwrfgi0a4e22m8t54 (user: root)
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Total memory: 985 MB\nUsed memory before tmpfs mount: 190 MB\nFree memory before tmpfs mount: 794 MB\nMemory to use in integrity test (60% of free, min 64MB): 476 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"476+0 records in\n476+0 records out\n499122176 bytes (499 MB, 476 MiB) copied, 2.00161 s, 249 MB/s\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\t"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"C"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"o"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"m"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"m"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"a"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"d"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"b"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"e"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"i"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"g"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"t"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"i"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"m"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"e"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"d"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:":"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\""}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"dd"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"if=/dev/urandom"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"of=/mnt/testfile"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"bs=1M"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"count=476"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\""}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\t"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"U"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"s"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"e"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"r"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"t"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"i"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"m"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"e"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"("}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"s"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"e"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"c"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"o"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"d"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"s"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:")"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:":"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" 0.00\n\tSystem time (seconds): 1.99\n\tPercent of CPU this job got: 99%\n\tElapsed (wall clock) time (h:mm"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:":ss or m:ss)"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:": 0:02.00\n\tAverage "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"shared t"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"ext "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"size (kbyte"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"s): "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"0\n\tAverage unshared data size (kbytes): 0\n\tAverage stack size (kbytes): 0\n\tAverage total size (kbytes): 0\n\tMaximum resident set size (kbytes): 2656\n\tAverage"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" residen"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"t se"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"t size ("}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"kbytes): 0\n\tM"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"ajor (requiring I/O) page faults: 3\n\tMinor (reclaiming a frame) page faults: 343\n\tVoluntary context switches: 4\n\tInvoluntary context switches: 10\n\tSwaps: 0\n\tFile system inputs: 176\n\tFile system outputs: 0\n\tSocket messages sent: 0\n\tSocket messa"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"ges received: 0\n\tSignals delivered: 0\n\tPage size (bytes): 4096\n\tExit status: 0\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Used memory after tmpfs mount and file fill: 671 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{end:{exited:true  status:"exit status 0"}}
    sandbox_memory_integrity_test.go:70: Command [bash] completed successfully in sandbox ibxhaiyagbr1oflsypgtt
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{start:{pid:1275}}
Executing command bash in sandbox i1tqpkxawwtyb9ccs6ejc (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{data:{stdout:"94c21fadfbe285c4cb73579ea0852750e2e35e83871a6d37cc7201cf281343f4\n"}}
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{end:{exited:true  status:"exit status 0"}}
    sandbox_memory_integrity_test.go:80: Command [bash] completed successfully in sandbox ibxhaiyagbr1oflsypgtt
Executing command bash in sandbox i1tqpkxawwtyb9ccs6ejc (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{start:{pid:1278}}
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
Executing command bash in sandbox ibxhaiyagbr1oflsypgtt (user: root)
    sandbox_memory_integrity_test.go:110: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:81
        	            				.../hostedtoolcache/go/1.26.3.../src/runtime/asm_amd64.s:1771
        	Error:      	Received unexpected error:
        	            	failed to execute command bash in sandbox ibxhaiyagbr1oflsypgtt: unavailable: HTTP status 502 Bad Gateway
    sandbox_memory_integrity_test.go:110: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:78
        	            				.../tests/orchestrator/sandbox_memory_integrity_test.go:110
        	Error:      	Condition never satisfied
        	Test:       	TestSandboxMemoryIntegrity/tmpfs_hash
--- FAIL: TestSandboxMemoryIntegrity/tmpfs_hash (197.36s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

When using REGIONAL or ENTERPRISE tiers for GCP Filestore, the location must be a region rather than a zone. Passing a zone like filestore_zone in regional_filestore will cause a deployment failure for these tiers, so the location should be conditionally set to the region if a regional tier is selected.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread iac/provider-gcp/nomad-cluster/main.tf Outdated

name = "${var.prefix}shared-disk-store-${each.key}"
network_name = var.network_name
location = each.value.filestore_zone

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

When using REGIONAL or ENTERPRISE tiers for GCP Filestore, the location must be a region rather than a zone. Passing a zone like filestore_zone will cause a deployment failure for these tiers. Conditionally set the location to the region (each.key) if a regional tier is selected, and default to the zone (each.value.filestore_zone) otherwise.

  location     = contains(["REGIONAL", "ENTERPRISE"], var.filestore_cache_tier) ? each.key : each.value.filestore_zone

Comment thread iac/provider-gcp/nomad-cluster/main.tf
dobrac and others added 4 commits June 2, 2026 16:01
Allow secondary client clusters to pin regional MIG placement to explicit zones without changing build or primary client pools.

Co-authored-by: Cursor <cursoragent@cursor.com>
variable "nomad_version" {
type = string
default = "1.8.4"
default = "1.6.2"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packer defaults downgrade Consul Nomad

Medium Severity

Default consul_version and nomad_version in both GCP and AWS disk-image Packer configs were lowered (1.17.3→1.16.2, 1.8.4→1.6.2). make build only overrides those when PACKER_* env vars are set, so new images can ship older agents than the rest of the cluster.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c9a0b3a. Configure here.

google_service_account_key = var.google_service_account_key
gcp_region = local.client_cluster_locations[each.key].region
gcp_zone = local.client_cluster_locations[each.key].zone
zones = local.client_cluster_locations[each.key].region != var.gcp_region ? each.value.zones : null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secondary zone ignores MIG placement

Medium Severity

For client clusters in a secondary region, zone still drives filestore_zone (via client_cluster_locations), but distribution_policy_zones is only set from zones when the cluster region differs from the primary. If zones is omitted, the regional MIG can place VMs in any zone in that region while Filestore stays in the configured zone, hurting NFS locality.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 44280bb. Configure here.

attempts = 0
}

resources {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orchestrator job drops memory limits

Medium Severity

The orchestrator start task no longer declares a resources block (previously memory and memory_max). With client raw_exec using no_cgroups in the same change, Nomad will not reserve or cap memory for this system job, increasing risk of host OOM under load.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 44280bb. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 5 total unresolved issues (including 3 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d9d99b3. Configure here.

DOCKER_REGISTRY_REGION = var.docker_registry_region
NOMAD_REGION = var.nomad_region
CONSUL_DATACENTER = var.consul_datacenter
CONSUL_RETRY_JOIN_ZONE_PATTERN = var.consul_retry_join_zone_pattern

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty NFS still mounts

High Severity

When filestore_cache_enabled is true, secondary-region client clusters without a matching additional_filestores entry get empty nfs_ip_addresses, but USE_FILESTORE_CACHE still follows the global flag. Startup runs an NFS mount with a blank host under set -e, so those nodes can fail boot instead of skipping cache as documented.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d9d99b3. Configure here.

region = coalesce(config.region, var.gcp_region)
zone = coalesce(config.zone, var.gcp_zone)
filestore_zone = coalesce(config.filestore_zone, config.zone, var.gcp_zone)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filestore_zone config unused

Medium Severity

client_clusters_config now accepts filestore_zone, and client_cluster_locations computes it, but nothing reads that local or passes it to Filestore or worker modules. Per-cluster filestore zone overrides have no effect; only additional_filestores[].location controls regional cache placement.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d9d99b3. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants