Skip to content

fix(deploy): specify --cpu=2 for backend-sync to support 6Gi/8Gi memory (#21668) - #21671

Merged
Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
hardik4love-lang:fix/cloud-run-deploy-backend-sync-cpu-21668
Oct 15, 2026
Merged

Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
hardik4love-lang:fix/cloud-run-deploy-backend-sync-cpu-21668

Conversation

@hardik4love-lang

@hardik4love-lang hardik4love-lang commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #21668: Resolves main CI deploy failure:
ERROR: (gcloud.run.deploy) spec.template.spec.containers[0].resources.limits.memory: Invalid value specified for container memory. For 1.0 CPU, memory must be between 128Mi and 4Gi inclusive.

Root Cause

Google Cloud Run enforces strict CPU-to-memory allocation constraints:

  • 1.0 vCPU: memory limit is strictly capped between 128Mi and 4Gi inclusive.
  • 2.0 vCPU: memory limit is allowed between 512Mi and 8Gi inclusive.

In .github/actions/deploy-backend-stack/action.yml (deploy-backend-sync), --memory=${{ inputs.backend_sync_memory }} configures memory to 8Gi (or 6Gi), but did not declare --cpu=2. Cloud Run defaulted container CPU to 1.0, causing Google Cloud Run to reject the revision deployment during gcloud run deploy.

Solution

Explicitly specify --cpu=2 in deploy-backend-sync within .github/actions/deploy-backend-stack/action.yml, aligning with the existing --cpu=2 flags used by sync-backfill-lifecycle (which also runs with --memory=8Gi) and deploy-backend-integration. This permits both 6Gi and 8Gi memory allocations to be deployed without error.

View guided diff

Failure-Class

Failure-Class: none

Cloud Run now rejects backend-sync deploys that request 8Gi on 1 CPU (limit for 1 CPU is 4Gi); #21668's 8Gi made every backend-stack deploy fail hard at backend-sync (dev run 38792031889). This PR adds the required --cpu=2, and the static contract test pins it on sync.

@undivisible

Copy link
Copy Markdown
Collaborator

The whole file was converted to CRLF, so the diff rewrites 1,267 lines for a one-line change (--cpu=2). Please restore LF line endings so the diff is just that line.

@hardik4love-lang

Copy link
Copy Markdown
Contributor Author

Hi @undivisible, thanks for pointing that out! LF line endings have been restored across the entire file. The diff is now strictly the single line addition (--cpu=2).

BasedHardware#21668 raised backend-sync memory to 6-8Gi; Cloud Run requires >=2 CPU for
8Gi, and the 1-CPU deploy was rejected outright (dev auto-deploy run
38792031889). The contract test still asserted --cpu=2 must stay off sync;
carve it out and pin it present instead.
@Git-on-my-level

Copy link
Copy Markdown
Member

Static-contract failure fixed on this branch (commit b0ef8f0): test_backend_integration_deploy_pins_mcp_serving_capacity asserted --cpu=2 must stay off backend-sync, but #21668 raised sync memory to 6-8Gi and Cloud Run requires ≥2 CPU for 8Gi — the 1-CPU deploy was rejected outright (dev auto-deploy run 38792031889, 'Invalid value specified for container memory'). The test now carves --cpu=2 out of the not-on-sync set and pins it present. Verified locally: full test_render_backend_runtime_env.py 49 passed. This unblocks all backend-stack deploys (dev + prod) which are currently hard-failing at backend-sync.

@Git-on-my-level
Git-on-my-level merged commit 3d3d6e0 into BasedHardware:main Oct 15, 2026
53 of 55 checks passed
@hardik4love-lang

Copy link
Copy Markdown
Contributor Author

Payout & Contribution Claim Details

@hardik4love-lang

Copy link
Copy Markdown
Contributor Author

Hi @josancamon19 @kodjima33 @Git-on-my-level, following up on the bounty claim for this merged P0 deploy fix (#21671). Could you please check on the disbursement to PayPal: \[email protected]? Thank you for your support!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[loop-c] main CI red: gha-ERROR: (gcloud.run.deploy) spec.template.spec.containers[N].resources.limits.memory: Invalid value specified for contain

3 participants