feat(ops): M8.9 upgrade rehearsal on clones, barrier and node plan (ADR-0076)
Drill-only --synthetic-until/--accelerate and evo-world-clone compare (compare_region_histories) prove a candidate build runs the same world on clones of one cut before any barrier. upgrade-check.sh rehearses a failed migration under load and the version barrier with real hosts; upgrade-barrier.sh retires an old build in dev/stage only once the new digest is Ready. Nodes: aevolution.io/stores pins every objects-volume pod, aevolution.io/compute is preference-only (Alertmanager first), checked by policy and scheduling-check.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,10 @@ environment-isolation or World0-protection invariant is broken:
|
||||
- the cleanup tool refuses World0 before invoking kubectl;
|
||||
- World0 launch stays blocked (ADR-0075): no workload targets World0 and its
|
||||
Application keeps an unresolved path; any image a World0 overlay pins must be
|
||||
the digest already pinned in stage (promotion, never a fresh build).
|
||||
the digest already pinned in stage (promotion, never a fresh build);
|
||||
- scheduling (ADR-0076): every pod that mounts the node-local objects volume
|
||||
selects the store node; aevolution.io/compute is only ever preferred, never
|
||||
required; upgrade-rehearsal flags never appear in a deployed workload.
|
||||
"""
|
||||
import os
|
||||
import shutil
|
||||
@@ -281,6 +284,28 @@ for directory, _, files in os.walk(os.path.join(ROOT, 'deploy', 'kubernetes')):
|
||||
check((image.get('name'), image.get('digest')) in staged,
|
||||
f'{rel}: {image.get("name")} must be promoted from {stage}, not pinned independently')
|
||||
|
||||
# M8.9 scheduling (ADR-0076). Node-local volumes pin their pods: added CPU does not
|
||||
# make the objects volume portable. Compute is a preference so one node still works.
|
||||
for path, doc in objects:
|
||||
if doc['kind'] not in workload_kinds or path.endswith('region-values.yaml'):
|
||||
continue
|
||||
spec = doc.get('spec', {})
|
||||
pod = spec.get('jobTemplate', {}).get('spec', {}).get('template', {}).get('spec') \
|
||||
or spec.get('template', {}).get('spec') or spec
|
||||
claims = [v.get('persistentVolumeClaim', {}).get('claimName') for v in pod.get('volumes', [])]
|
||||
if 'aevolution-objects' in claims:
|
||||
check(pod.get('nodeSelector', {}).get('aevolution.io/stores') == 'true',
|
||||
f'{path}: a pod mounting aevolution-objects must select aevolution.io/stores')
|
||||
required = (pod.get('affinity', {}).get('nodeAffinity', {})
|
||||
.get('requiredDuringSchedulingIgnoredDuringExecution', {}))
|
||||
check('aevolution.io/compute' not in yaml.safe_dump(required)
|
||||
and 'aevolution.io/compute' not in pod.get('nodeSelector', {}),
|
||||
f'{path}: aevolution.io/compute may only be preferred, never required')
|
||||
for container in pod.get('containers', []):
|
||||
text = ' '.join(container.get('args', []) + container.get('command', []))
|
||||
check('--accelerate' not in text and '--synthetic-until' not in text,
|
||||
f'{path}: upgrade-rehearsal flags never run in a deployed workload')
|
||||
|
||||
# The platform bundle: every rendered object is protected from prune and deletion.
|
||||
bundle = manifests.get(platform + '/cluster/kustomization.yaml', [{}])[0]
|
||||
check(bundle.get('commonAnnotations', {}).get('argocd.argoproj.io/sync-options') == 'Prune=false,Delete=false',
|
||||
@@ -334,7 +359,8 @@ for path, doc in objects:
|
||||
with tempfile.TemporaryDirectory() as empty:
|
||||
env = dict(os.environ, PATH=empty + os.pathsep + os.path.dirname(sys.executable))
|
||||
for tool in ('tools/ops/cleanup-environment.sh', 'tools/ops/region-drill.sh', 'tools/ops/fault-drill.sh',
|
||||
'tools/backup/cluster-backup.sh'):
|
||||
'tools/backup/cluster-backup.sh', 'tools/ops/scheduling-check.sh',
|
||||
'tools/ops/upgrade-barrier.sh'):
|
||||
for bad in ('world0', 'evolution-world0', 'World0', 'prod', ''):
|
||||
result = subprocess.run([shutil.which('bash') or '/bin/bash', os.path.join(ROOT, tool), bad],
|
||||
capture_output=True, text=True, env=env)
|
||||
|
||||
Reference in New Issue
Block a user