Allow constrained pricing health checks to complete
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
{
|
||||
"started": "2026-11-16T02:06:37.133690+00:00",
|
||||
"image": "git.yebilly.me/ssw590-group1/pricing@sha256:63e2e3d49a5119b1064868b0b15b39a1719a60a632ff0ecdc3f676fcdc55de3b",
|
||||
"existing_staging_health": {
|
||||
"Status": "healthy",
|
||||
"FailingStreak": 0,
|
||||
"Log": [
|
||||
{
|
||||
"Start": "2026-11-16T02:05:39.379167981Z",
|
||||
"End": "2026-11-16T02:05:42.481797619Z",
|
||||
"ExitCode": -1,
|
||||
"Output": "Health check exceeded timeout (3s)"
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:05:52.483085766Z",
|
||||
"End": "2026-11-16T02:05:55.560331159Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:06:05.56119162Z",
|
||||
"End": "2026-11-16T02:06:08.689713122Z",
|
||||
"ExitCode": -1,
|
||||
"Output": "Health check exceeded timeout (3s)"
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:06:18.690913613Z",
|
||||
"End": "2026-11-16T02:06:21.782465826Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:06:31.784224739Z",
|
||||
"End": "2026-11-16T02:06:34.780482181Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"existing_staging_memory_events": "low 0\nhigh 0\nmax 29\noom 0\noom_kill 0\noom_group_kill 0",
|
||||
"candidate_timeout_seconds": 10,
|
||||
"samples": [
|
||||
{
|
||||
"Start": "2026-11-16T02:06:42.778495877Z",
|
||||
"End": "2026-11-16T02:06:48.438554619Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:06:58.439880386Z",
|
||||
"End": "2026-11-16T02:07:01.623272338Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:07:11.624979767Z",
|
||||
"End": "2026-11-16T02:07:14.734453351Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:07:24.735921433Z",
|
||||
"End": "2026-11-16T02:07:27.640717567Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:07:37.641388311Z",
|
||||
"End": "2026-11-16T02:07:40.639898244Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:07:50.64115933Z",
|
||||
"End": "2026-11-16T02:07:53.824315905Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:08:03.825342377Z",
|
||||
"End": "2026-11-16T02:08:07.523556252Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:08:17.525594582Z",
|
||||
"End": "2026-11-16T02:08:20.342264608Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
}
|
||||
],
|
||||
"final_health": {
|
||||
"Status": "healthy",
|
||||
"FailingStreak": 0,
|
||||
"Log": [
|
||||
{
|
||||
"Start": "2026-11-16T02:07:24.735921433Z",
|
||||
"End": "2026-11-16T02:07:27.640717567Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:07:37.641388311Z",
|
||||
"End": "2026-11-16T02:07:40.639898244Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:07:50.64115933Z",
|
||||
"End": "2026-11-16T02:07:53.824315905Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:08:03.825342377Z",
|
||||
"End": "2026-11-16T02:08:07.523556252Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
},
|
||||
{
|
||||
"Start": "2026-11-16T02:08:17.525594582Z",
|
||||
"End": "2026-11-16T02:08:20.342264608Z",
|
||||
"ExitCode": 0,
|
||||
"Output": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"memory_events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0",
|
||||
"cpu_stat": "usage_usec 8426586\nuser_usec 6475439\nsystem_usec 1951147\ncore_sched.force_idle_usec 0\nnr_periods 372\nnr_throttled 327\nthrottled_usec 23409965\nnr_bursts 0\nburst_usec 0",
|
||||
"passed": true,
|
||||
"completed": "2026-11-16T02:08:24.345181+00:00",
|
||||
"temporary_container_removed": true
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
"""Administrator-only diagnostic; never deploys a pricing environment."""
|
||||
import json
|
||||
import subprocess
|
||||
import time
|
||||
from datetime import datetime, timezone
|
||||
|
||||
IMAGE = 'git.yebilly.me/ssw590-group1/pricing@sha256:63e2e3d49a5119b1064868b0b15b39a1719a60a632ff0ecdc3f676fcdc55de3b'
|
||||
NAME = 'ssw590-pricing-health-trial'
|
||||
|
||||
def command(*args):
|
||||
return subprocess.check_output(args, text=True).strip()
|
||||
|
||||
def health(container):
|
||||
return json.loads(command('docker', 'inspect', '--format', '{{json .State.Health}}', container))
|
||||
|
||||
def now():
|
||||
return datetime.now(timezone.utc).isoformat()
|
||||
|
||||
existing = subprocess.run(['docker','container','inspect',NAME],capture_output=True)
|
||||
assert existing.returncode != 0, 'Existing diagnostic container must be reviewed'
|
||||
report = {'started':now(), 'image':IMAGE, 'existing_staging_health':health('pricing-staging-app-1'),
|
||||
'existing_staging_memory_events':command('docker','exec','pricing-staging-app-1','cat','/sys/fs/cgroup/memory.events'),
|
||||
'candidate_timeout_seconds':10, 'samples':[]}
|
||||
container = command('docker','run','-d','--pull','never','--name',NAME,
|
||||
'--network','none','--read-only','--tmpfs','/tmp:size=16m,mode=1777',
|
||||
'--cap-drop','ALL','--security-opt','no-new-privileges:true','--user','10001:10001',
|
||||
'--memory','64m','--memory-swap','96m','--cpus','0.25','--pids-limit','64',
|
||||
'--health-timeout','10s',IMAGE)
|
||||
assert len(container) == 64 and all(c in '0123456789abcdef' for c in container)
|
||||
seen = set()
|
||||
try:
|
||||
deadline = time.monotonic() + 170
|
||||
while time.monotonic() < deadline:
|
||||
state = health(container)
|
||||
for sample in state.get('Log',[]):
|
||||
if sample['Start'] not in seen:
|
||||
seen.add(sample['Start'])
|
||||
report['samples'].append(sample)
|
||||
if len(report['samples']) >= 8:
|
||||
break
|
||||
time.sleep(5)
|
||||
report['final_health'] = health(container)
|
||||
report['memory_events'] = command('docker','exec',container,'cat','/sys/fs/cgroup/memory.events')
|
||||
report['cpu_stat'] = command('docker','exec',container,'cat','/sys/fs/cgroup/cpu.stat')
|
||||
report['passed'] = len(report['samples']) >= 8 and all(s['ExitCode'] == 0 for s in report['samples']) and report['final_health']['Status'] == 'healthy'
|
||||
finally:
|
||||
subprocess.run(['docker','rm','-f',container],check=True,capture_output=True)
|
||||
report['completed'] = now()
|
||||
report['temporary_container_removed'] = True
|
||||
print(json.dumps(report,indent=2))
|
||||
assert report['passed'], 'Health trial did not pass'
|
||||
@@ -0,0 +1,74 @@
|
||||
# Staging deployment, blocked rerun and health-timeout trial
|
||||
|
||||
Client date: 15 November 2026 (Eastern). Execution timestamps below are
|
||||
16 November UTC. Billy approved PR 25 at 01:46:19 UTC; Vincent merged it at
|
||||
01:51:04 as `a19fab34e39420811e73f91fcfbb82ee598bd74a`.
|
||||
|
||||
[Pricing build 4](https://ci.yebilly.me/job/secure-delivery/job/pricing/4/)
|
||||
selected that full source/configuration commit. It began 02:00:09.554 UTC,
|
||||
took 198.101 seconds and finished FAILURE. Twelve control tests, three app
|
||||
tests, source/dependency gates and both image gates passed. The published image was:
|
||||
|
||||
```text
|
||||
git.yebilly.me/ssw590-group1/pricing@sha256:63e2e3d49a5119b1064868b0b15b39a1719a60a632ff0ecdc3f676fcdc55de3b
|
||||
```
|
||||
|
||||
The noninteractive SSH correction worked. Initial staging deployment ran
|
||||
02:01:48.628–02:02:58.341 UTC (69.713 seconds) and passed all HTTPS health,
|
||||
version, source-SHA and quantity=3 total=30 assertions. Its recap was
|
||||
`ok=10 changed=4 unreachable=0 failed=0`.
|
||||
|
||||
The unchanged rerun ran 02:03:01.314–02:03:25.201 UTC (23.887 seconds).
|
||||
Directory/template checks were unchanged, but Compose stopped because the
|
||||
existing container was unhealthy: `ok=4 changed=0 unreachable=0 failed=1`.
|
||||
This is **not** a passed idempotence gate. Jenkins skipped production approval
|
||||
and deployment. All reports are archived in build 4 and copied to ignored
|
||||
`build/evidence/assignment8-execution/jenkins-4/`. These records are not
|
||||
known-good rollback selections in `delivery/releases/`.
|
||||
|
||||
## Diagnosis
|
||||
|
||||
Docker reported `Health check exceeded timeout (3s)`. Its recorded probe
|
||||
durations were near three seconds, including successful probes. The staging
|
||||
container later recovered without a restart; an HTTPS health request returned
|
||||
`{"status":"ok","version":"v1"}`. Gunicorn remained running. The observed
|
||||
container had no OOM kill, about 48.56 MiB usage against 64 MiB, and memory-limit
|
||||
events without OOM events. CPU quota is 0.25. This supports a probe deadline
|
||||
problem under these constraints; it does not establish that every later health
|
||||
failure has that cause.
|
||||
|
||||
## Bounded diagnostic of the correction
|
||||
|
||||
At 02:06:37–02:08:24 UTC a temporary container ran the **same reviewed image**
|
||||
with the same UID, read-only filesystem, capability restrictions, 64/96 MiB
|
||||
RAM/RAM+swap, 0.25 CPU and 64 PID cap. It had no Docker network, published port,
|
||||
proxy alias, deployment directory or app data volume. Only Docker's overall
|
||||
health timeout was overridden to ten seconds. The HTTP request timeout remained
|
||||
two seconds. Existing staging and shared services were unchanged.
|
||||
|
||||
Eight consecutive probes passed, taking 5.660, 3.183, 3.109, 2.905, 2.999,
|
||||
3.183, 3.698 and 2.817 seconds. The final state was healthy; memory events
|
||||
showed no limit hit or OOM. CPU throttling was observed. The temporary container
|
||||
was removed by its exact newly created ID in a finally block. The
|
||||
[exact diagnostic script](health-timeout-trial-20261115.py) and
|
||||
[raw JSON](health-timeout-trial-20261115.json) preserve the experiment.
|
||||
|
||||
The Dockerfile correction changes only the overall health-check timeout from
|
||||
three to ten seconds. It keeps the endpoint, request timeout, retry count,
|
||||
cadence, startup period and all resource/security limits. It still needs review
|
||||
and a successful assessed release; this diagnostic did not deploy production.
|
||||
|
||||
## v1 and v2 review sequence
|
||||
|
||||
The branch also prepares the required v2 source/test change: VERSION=v2,
|
||||
UNIT_PRICE=12, quantity 3 total=36. Three local functional tests and twelve
|
||||
control tests passed. The Windows functional environment used Flask 3.1.3 and
|
||||
Werkzeug 3.1.8; deployment remains locked to Werkzeug 3.1.9 and must pass the
|
||||
real Jenkins gates. Docker Desktop was not running; the remote runners remain
|
||||
independent of it.
|
||||
|
||||
Keep two commits: first the health fix with v1 source, then the v2 app/test
|
||||
change. Review both in one PR and merge with a merge commit, preserving their
|
||||
SHAs. Run v1 with the first reviewed commit and v2 with the second; each still
|
||||
requires staging/idempotence and real human production approval. Save and
|
||||
review the actual successful release records before either recovery exercise.
|
||||
Reference in New Issue
Block a user