Repository navigation
Commit 508a30d
feat: check GCP compute and project IAM quotas (#1028)
GCP deployments now check regional/family CPU and supported GPU
capacity, project custom roles including soft-deleted roles, and service
accounts against applied limits. Demand comes from resource
configuration, separates immediate launches from maximum headroom, and
credits only proven held identities. Desired role IDs matching this
deployment’s own soft-deleted roles are undeleted and do not consume a
new role slot. Explicit custom-role/service-account capacity failures
map to the same typed project quota guidance; ordinary throttling
retains provider retry behavior.
Project limits use Cloud Quotas and Service Usage applied values;
regional Compute responses supply provider usage. IAM metadata lists
paginate completely. Service accounts include disabled/default accounts;
partial, duplicate or missing identities yield Unknown. Cloud Quotas
does not supply all-regions usage on the observed target, so readable
all-regions limits without usage remain Unknown. Unresolved dimensioned
GPU variants also remain Unknown.
Setup enables `cloudquotas.googleapis.com` through existing service
activation, including Terraform setup, and both test-infrastructure
modules declare it. Older setup imports and installed stacks without
that optional activation keep it absent; disabled or denied reads warn
with an enable/API-permission hint rather than blocking updates.
Permissions: `compute.regions.get`, `compute.projects.get` and
`cloudquotas.quotas.get` in project-scoped provisioning read
quota/capacity metadata. Service-account provision/management/heartbeat
sets grant project `iam.serviceAccounts.list` for complete identity
inventory; resource-scoped viewer grants cannot list project inventory.
`serviceusage.quotas.get` reads project applied IAM limits through a
narrow shared metadata role; that role is included in demand. Existing
IAM custom-role metadata reads are reused. No token/key/customer-content
or broad telemetry access is added.
Existing public-safe implementation/read evidence and exact limitations
are retained in
[#1010](#1010): applied
CPU/GPU all-regions limits360/360; A2 CPU12/A100 GPU1 controls;
paginated IAM identity equivalence and two-probe create/delete counting;
custom-role capacity response replay. These are existing
integrated-feature controls, not new runs on the split commit. Do not
interpret a parent accepting a min0/max2 configuration as a late GPU
quota failure; no GPU VM was launched. No new parent/race/entry-point
claim is added by this split.
[Regional CPU
negative](https://raw.githubusercontent.com/alienplatform/alien/pr-assets/alien-5/gcp-cpu-reader/negative.png),
[positive reader
control](https://raw.githubusercontent.com/alienplatform/alien/pr-assets/alien-5/gcp-cpu-reader/control.png),
and [custom-role config
controls](https://raw.githubusercontent.com/alienplatform/alien/pr-assets/alien-5/custom-roles-config-controls.png)
show the existing read/config evidence. All these controls left provider
inventories unchanged and created no resources.
Compatibility: no persisted or SDK schema fields change in this layer.
Missing management-role quota reads produce non-blocking Unknown. Old
GCP handoff import and subsequent mutation regression coverage retain
ownership validation. The supported generator and generated-output diff
both passed in [feature
CI38534727697](https://github.com/alienplatform/alien/actions/runs/38534727697);
current-head CI and review also pass.
Compute blocks only when capacity certainly launched by this operation
does not fit. Initial launch uses the configured minimum;
scale-to-maximum shortfalls warn visibly with the quota identity,
shortfall and increase link. Bounds-only changes add no replacement
surge. Instance-type replacement, and effective disk changes on AWS,
count the proven rolling overlap. Late-resolved
image/identity/interrupted-rollout inputs remain a visible Unknown
warning; they never add speculative blocking surge. Observed held
capacity is credited in its original quota pool.
Layer validation: 518 preflight library tests pass. Read-only policy
control: regional CPUS4/200 and N2_CPUS0/200. No new cloud resources or
quota overrides were needed.
Merge order: #1032 → #1026 → #1027 → #1028 → #1029 → #1030. Each layer
depends on the preceding PR; human merges only.
Service Usage metric requests use `view=FULL` to receive applied quota
buckets/effective limits. The missing-query parent regression fails; all
5 relevant wire tests pass, including denied reads.
Current head `1d7ab07ce`: **CI green, Greptile 5/5, mergeable and ready
for review**
([review](#1028 (comment))).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: islo <sandbox@islo.dev>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent d4ac8fd commit 508a30d
37 files changed
Lines changed: 3871 additions & 18 deletions
File tree
- crates
- alien-gcp-clients
- src
- gcp
- tests
- alien-infra
- src
- artifact_registry
- core
- remote_bindings
- remote_stack_management
- service_account
- alien-manager
- src/routes
- tests
- alien-permissions
- permission-sets
- compute-cluster
- service-account
- tests
- alien-preflights
- src
- mutations
- runtime
- fixtures
- infra/test/modules
- gcp-target
- gcp
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
717 | 723 | | |
718 | 724 | | |
719 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
720 | 740 | | |
721 | 741 | | |
722 | 742 | | |
| |||
6817 | 6837 | | |
6818 | 6838 | | |
6819 | 6839 | | |
| 6840 | + | |
| 6841 | + | |
| 6842 | + | |
| 6843 | + | |
| 6844 | + | |
| 6845 | + | |
| 6846 | + | |
| 6847 | + | |
| 6848 | + | |
| 6849 | + | |
| 6850 | + | |
| 6851 | + | |
| 6852 | + | |
| 6853 | + | |
| 6854 | + | |
| 6855 | + | |
| 6856 | + | |
| 6857 | + | |
| 6858 | + | |
| 6859 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
71 | 78 | | |
72 | 79 | | |
73 | 80 | | |
| |||
214 | 221 | | |
215 | 222 | | |
216 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
217 | 250 | | |
218 | 251 | | |
219 | 252 | | |
| |||
517 | 550 | | |
518 | 551 | | |
519 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
520 | 564 | | |
521 | 565 | | |
522 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
0 commit comments