Skip to content

Commit cbd3937

Browse files
committed
feat(deploy): add production remote preflight
1 parent c3d3160 commit cbd3937

8 files changed

Lines changed: 1958 additions & 32 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
python3 -m py_compile \
7575
scripts/deployment_controller.py \
7676
scripts/ci_validate_field_inputs.py \
77+
scripts/vps_field_remote_probe.py \
7778
tests/test_deployment_controller.py
7879
make test-deployment-controller
7980

deploy/deployment-policy.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"deploy/schemas/deployment-policy.schema.json",
4747
"deploy/schemas/deployment-result.schema.json",
4848
"deploy/schemas/evidence-index.schema.json",
49+
"deploy/schemas/remote-preflight.schema.json",
4950
"deploy/vps-field.env.example",
5051
"docker-compose.ci.yml",
5152
"docker-compose.yml",
@@ -64,6 +65,7 @@
6465
"scripts/field_validation_preflight.sh",
6566
"scripts/vps_field_deploy.sh",
6667
"scripts/vps_field_remote_preflight.sh",
68+
"scripts/vps_field_remote_probe.py",
6769
"scripts/vps_field_smoke_test.sh",
6870
"scripts/vps_field_verify_external.sh"
6971
],
@@ -74,5 +76,6 @@
7476
],
7577
"result_schema_version": 1,
7678
"evidence_index_schema_version": 1,
77-
"ci_proof_schema_version": 1
79+
"ci_proof_schema_version": 1,
80+
"remote_preflight_schema_version": 1
7881
}

deploy/schemas/deployment-policy.schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"supported_compose_files",
1717
"result_schema_version",
1818
"evidence_index_schema_version",
19-
"ci_proof_schema_version"
19+
"ci_proof_schema_version",
20+
"remote_preflight_schema_version"
2021
],
2122
"properties": {
2223
"schema_version": {
@@ -185,6 +186,9 @@
185186
},
186187
"ci_proof_schema_version": {
187188
"const": 1
189+
},
190+
"remote_preflight_schema_version": {
191+
"const": 1
188192
}
189193
}
190194
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://eventhorizon.invalid/schemas/remote-preflight.schema.json",
4+
"title": "EventHorizon remote preflight evidence",
5+
"type": "object",
6+
"additionalProperties": false,
7+
"required": [
8+
"schema_version",
9+
"target_alias",
10+
"deployment_commit",
11+
"checked_utc",
12+
"starting_state",
13+
"result",
14+
"checks"
15+
],
16+
"properties": {
17+
"schema_version": {
18+
"const": 1
19+
},
20+
"target_alias": {
21+
"type": "string",
22+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
23+
},
24+
"deployment_commit": {
25+
"type": "string",
26+
"pattern": "^[0-9a-f]{40}$"
27+
},
28+
"checked_utc": {
29+
"type": "string",
30+
"format": "date-time"
31+
},
32+
"starting_state": {
33+
"enum": [
34+
"INITIAL_DEPLOYMENT",
35+
"MANAGED_REDEPLOYMENT",
36+
"UNSUPPORTED"
37+
]
38+
},
39+
"result": {
40+
"enum": [
41+
"PASS",
42+
"BLOCKED"
43+
]
44+
},
45+
"checks": {
46+
"type": "array",
47+
"minItems": 1,
48+
"maxItems": 64,
49+
"items": {
50+
"type": "object",
51+
"additionalProperties": false,
52+
"required": [
53+
"id",
54+
"status",
55+
"summary"
56+
],
57+
"properties": {
58+
"id": {
59+
"type": "string",
60+
"pattern": "^[a-z][a-z0-9_]{0,63}$"
61+
},
62+
"status": {
63+
"enum": [
64+
"PASS",
65+
"WARNING",
66+
"BLOCKER"
67+
]
68+
},
69+
"summary": {
70+
"type": "string",
71+
"minLength": 1,
72+
"maxLength": 240
73+
}
74+
}
75+
}
76+
}
77+
},
78+
"allOf": [
79+
{
80+
"if": {
81+
"properties": {
82+
"result": {
83+
"const": "PASS"
84+
}
85+
},
86+
"required": [
87+
"result"
88+
]
89+
},
90+
"then": {
91+
"properties": {
92+
"starting_state": {
93+
"enum": [
94+
"INITIAL_DEPLOYMENT",
95+
"MANAGED_REDEPLOYMENT"
96+
]
97+
},
98+
"checks": {
99+
"items": {
100+
"properties": {
101+
"status": {
102+
"enum": [
103+
"PASS",
104+
"WARNING"
105+
]
106+
}
107+
}
108+
}
109+
}
110+
}
111+
},
112+
"else": {
113+
"properties": {
114+
"checks": {
115+
"contains": {
116+
"properties": {
117+
"status": {
118+
"const": "BLOCKER"
119+
}
120+
},
121+
"required": [
122+
"status"
123+
]
124+
}
125+
}
126+
}
127+
}
128+
}
129+
]
130+
}

0 commit comments

Comments
 (0)