Put every gcloud call behind a provider seam

Part of #32 (phase 1, the provider seam). This changes where the engine calls the cloud, not what it does on GCE.

What changed

Every gcloud call now sits in providers/gce.sh, behind a verb. Callers call prov_* and check_* verbs. select.sh loads the file SIM_PROVIDER names (default gce).

Before After
gcloud calls outside providers/gce.sh 181 0
Provider verbs in gce.sh none 77 (prov_* and check_*)
status --json schema 15 16, adds provider and region (zone was already there)

Two files stay outside the seam, each listed with its reason in provider-gate.sh: gce/aws/setup-federation.sh (Google is the identity source whatever provider runs the rig) and multiplexer/multiplexer.py (a separate Python process that discovers GCE labs).

flowchart LR
  subgraph callers
    sim[simulation.sh]
    pre[preflight.sh]
    eng[geo, praefect, iap, plugin, openshift-local, lab-identity]
  end
  sel{{select.sh<br/>SIM_PROVIDER}}
  subgraph verbs[verbs: prov_* and check_*]
    v1[node, tag, ttl]
    v2[snapshot, disk, address]
    v3[rule, access, diagnostics]
    v4[identity, nested, preflight checks]
  end
  gce[gce.sh<br/>the only gcloud caller]
  fake[fake.sh<br/>records calls]
  aws[aws.sh<br/>refuses: not yet implemented]
  gate[provider-gate.sh<br/>fails CI on any other gcloud call]
  sim --> sel
  pre --> sel
  eng --> sel
  sel --> verbs
  verbs --> gce
  verbs -.-> fake
  verbs -.-> aws
  gate -.checks.-> callers

Verbs by group

  • Node: prov_node_create, _delete, _start, _stop, _get, _exists, _find, _addresses, _bind, _hold, _attr, _attrs_json, _tag_add, _tag_remove, prov_ttl_arm, prov_unit_names, prov_unit_json
  • Access: prov_ssh, prov_ssh_exec, prov_scp, prov_proxy_option, prov_console
  • Firewall rules: prov_rule_create, _exists, _delete, _update, _json, _names_matching
  • Snapshot and disk: prov_snapshot_create, _get, _exists, _delete, _list, prov_disk_create, _delete, prov_disk_table, prov_boot_disk_swap
  • Address: prov_address_reserve, _get, _exists, _delete, _list
  • Capacity and placement: prov_capacity_error, prov_zone_cannot_host, prov_zones_offering, prov_zones_offering_accelerator, prov_machine_type_offered, prov_image_has_feature, prov_default_project, prov_default_zone, prov_region_of, prov_subnet_ranges
  • Identity and model access: prov_role_exists, _create, _update, _permissions, prov_account_exists, _create, prov_project_bound, _bind, prov_model_access_grant
  • Nested virtualization: prov_nested_create, prov_nested_policy_enforced
  • Diagnostics: prov_diagnostics_hint, prov_resource_names, prov_require
  • Preflight checks: check_gcloud, check_login, check_project, check_zone, check_project_access, check_compute_api, check_iap_api, check_iap_access, check_machine_type, check_ssh_key, check_quota

aws.sh refuses with "not yet implemented" before any verb runs. fake.sh records each call, so the engine's call sequence can be tested offline.

ADR 0006 amendment

The thirteen verbs in the ADR leave out snapshot, suspend, address and diagnostics, which the engine also needs. The amendment makes those four groups required on every provider and records the phase 2 decisions: commercial AWS regions first, almalinux-9 for the image, and an EventBridge Scheduler at() schedule plus terminate-on-shutdown for the TTL. Identity and nested-virtualization verbs are extensions that serve the GCE-only OpenShift and Vertex lanes.

Checks

  • provider-gate.sh fails CI on any gcloud call outside the seam: any group, a flag first, a continued line, a quoted or aliased gcloud, Python and Ruby files. provider-selftest.sh has one red case per form. It also proves SIM_PROVIDER=aws in the env file is refused by up, restore, geo and praefect, and that restore fills provider and region on a record that lacks them (root-password merged, so schema goes 15 to 16).
  • The touched selftests and tests/run.sh (686 checks) pass, and the word budget holds at 40485 of 40489.
  • Live GCE regression on 177ae562: omnibus lifecycle with hot-patch, snapshot and restore, and a caproni rig, all passed and torn down. Later commits fix the env-file load order, widen the gate, and stamp old records on restore.
Edited by Andrew Dunn

Merge request reports

Loading
Loading