Skip to content

Give the backup job's upload container as much CPU as its dump step - #840

Open
nlundee wants to merge 2 commits into
mainfrom
fix-backup-cpu
Open

nlundee wants to merge 2 commits into
mainfrom
fix-backup-cpu

Conversation

@nlundee

@nlundee nlundee commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

What and why

The test deploy of main (run 44555226999) failed before any change was applied. Container Apps refused the pg-backup job from #828: an init container may not ask for more CPU than the job's app containers together, and the dump step asks for 0.5 CPU while the upload container had 0.25. The upload container now gets 0.5 CPU and 1Gi, which is a valid Consumption size and costs only while the nightly job runs.

Risk

Low. Only the backup job's container size changes. The job runs once a night for a few minutes.

Undo

Revert this commit. The deploy will then fail again in preflight, so a revert also needs the dump step lowered to 0.25.

How it was tested

  • New test in scripts/backups-alerts.test.ts: no job's init container asks for more CPU than its app containers together. It fails without the fix and passes with it.
  • The whole scripts/backups-alerts.test.ts suite passes (15 tests) against the compiled template.
  • Not run: the deploy itself. It runs after merge.

Checklist

  • A test fails without this change
  • Docs and ADRs still match the code (no doc describes container sizes)

The deploy to genki-test failed in preflight: Container Apps refuses a job whose init container asks for more CPU than its app containers together, and the pg-backup job's dump step asked for 0.5 against the upload container's 0.25. The upload container now gets 0.5 CPU and 1Gi.

A template test checks every job's init containers against its app containers.

@github-actions github-actions 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.

0 findings, 0 Important. The summary comment has the overview.

@github-actions

Copy link
Copy Markdown
Contributor

Model review

No findings.

Walkthrough

The test deploy failed in preflight because Container Apps refused the nightly pg-backup job: its dump init container asked for 0.5 CPU, more than the 0.25 CPU of its only app container, upload. This pull request raises upload to 0.5 CPU and 1Gi, a valid Consumption size. It also adds a template test that no job's init container asks for more CPU than that job's app containers together.

Area What changes
infra In infra/modules/containerapps.bicep, the pg-backup job's upload container goes from 0.25 CPU and 0.5Gi to 0.5 CPU and 1Gi, so it now matches the dump init container.
scripts scripts/backups-alerts.test.ts gets a test over the compiled template that fails when any Container Apps job has an init container asking for more CPU than its app containers together.

Reviewed at 0a07128 with claude-opus-5-5 in 0.5 min. Pushes are checked against open findings, and fixed ones are resolved. Add the label review again to review new commits.

This branch has not been deployed

No deployments
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.

1 participant