Author SHA1 Message Date
vsun1 72bf10dcec Merge pull request 'Codex/assignment8 recovery evidence' (#27) from codex/assignment8-recovery-evidence into main
vpn-dns-gateway/pipeline/head This commit looks good
Automated Manual Build / manual (push) Successful in 2m17s
Reviewed-on: #27
Reviewed-by: bill <yebilly4@gmail.com>
2026-11-16 04:14:29 +00:00
vsun1 29e580c461 Revert "Exercise staging-only Gunicorn bind mismatch"
vpn-dns-gateway/pipeline/head This commit looks good
vpn-dns-gateway/pipeline/pr-main This commit looks good
This reverts commit 1e23001e73.
2026-11-15 23:00:00 -05:00
vsun1 1e23001e73 Exercise staging-only Gunicorn bind mismatch 2026-11-15 23:00:00 -05:00
vsun1 6c5342219a Record verified releases and prepare recovery exercises 2026-11-15 23:00:00 -05:00
vsun1 231d11528a Merge pull request 'Codex/assignment8 v1 v2 evidence' (#26) from codex/assignment8-v1-v2-evidence into main
vpn-dns-gateway/pipeline/head This commit looks good
Automated Manual Build / manual (push) Successful in 2m7s
Reviewed-on: #26
Reviewed-by: bill <yebilly4@gmail.com>
2026-11-16 02:57:41 +00:00
vsun1 6bddbfba5a Add pricing v2 at twelve dollars per unit
vpn-dns-gateway/pipeline/head This commit looks good
vpn-dns-gateway/pipeline/pr-main This commit looks good
2026-11-15 21:54:21 -05:00
vsun1 34f26e6948 Allow constrained pricing health checks to complete 2026-11-15 21:54:21 -05:00
vsun1 a19fab34e3 Merge pull request 'Fix noninteractive Ansible deployment and record delivery gates' (#25) from codex/assignment8-release-evidence into main
vpn-dns-gateway/pipeline/head This commit looks good
Automated Manual Build / manual (push) Successful in 2m7s
Reviewed-on: #25
Reviewed-by: bill <yebilly4@gmail.com>
2026-11-16 01:51:04 +00:00
30 changed files with 1995 additions and 102 deletions
+10 -5
View File
@@ -2,12 +2,17 @@
## Reviewed Jenkins execution, 15 November 2026
PR 24 is merged. The actual [test/secret gate demonstrations](evidence/gates-20261115.md)
PRs 24–26 are merged. The actual [test/secret gate demonstrations](evidence/gates-20261115.md)
blocked as intended. [Release attempt 3](evidence/release-attempt-3-20261115.md)
passed scans and published v1, then stopped before any app change at the
Ansible PTY request. The noninteractive SSH correction was verified in
agent-preflight build 3 but awaits source review/merge. No successful promotion,
production approval or recovery has occurred.
published v1 and stopped at the Ansible PTY request. After that correction
merged, [release attempt 4](evidence/release-attempt-4-20261115.md) passed initial
staging checks but its unchanged rerun stopped at Docker's health timeout.
Eight isolated diagnostic probes passed with ten seconds instead of three.
After review, [builds 5 and 6](evidence/releases-20261115.md) completed v1/v2
promotions, zero-change reruns and actual human approvals. Production monitoring
is live; one HTTP 502 sample during v2 replacement is preserved. The exact
successful records and staging-only fault/revert history await review before
recovery. Both recovery exercises remain unexecuted.
## Preparation evidence — historical baseline
+23 -12
View File
@@ -1,15 +1,26 @@
# Fix noninteractive Ansible deployment over the restricted SSH key
# Record verified releases and prepare the recovery exercises
The first reviewed v1 release passed its tests and security gates and published
an image, but stopped during Ansible Gathering Facts: Ansible forced a PTY
that the dedicated deploy key forbids. Set `ansible_ssh_use_tty=false` in the
delivery inventory and extend the administrator preflight to exercise Ansible's
actual SSH/sudo path. Keep the key restriction and pinned host verification.
Jenkins builds 5 and 6 completed reviewed v1/v2 delivery: tests/scans passed,
unchanged staging reruns had changed=0, Vincent approved each production input,
and each exact digest was promoted without rebuilding. Copy their four actual
release selectors into Git so recovery can use reviewed known-good records.
Preserve failed attempts, approvals, timings and scan hashes as evidence.
Record the actual Jenkins test/secret blocks, passing image scans and publication,
zero-change staging connection failure, and successful connection preflight.
No app deployment or production approval is claimed. Retry v1 after merge;
v2 promotion, both recoveries and monitoring evidence still remain.
The reviewed production probe/panel was applied after healthy v1 and verified
in Prometheus and the Grafana UI. Record the single HTTP 502 sample during v2
replacement; zero downtime and unobserved alert notifications are not claimed.
Include the guarded operator helper and current manual/inventory updates.
Validation: credential-bound Jenkins agent-preflight build 3 passed and returned
root UID 0 through Ansible without a PTY; twelve release-control tests passed.
The recovery fixture deliberately binds Gunicorn to 8001 only in staging,
while health still probes 8000. Keep three commits in this PR: records/evidence
and the patch; the staging-only template fault; its immediate revert. Review
all three, including the intermediate bad configuration. Merge with a merge
commit, preserving that SHA while the final main template remains correct.
The explicit Jenkins staging-failure mode selects that historical configuration;
merging alone does not deploy it. Both recovery executions remain pending.
Validation: successful Jenkins builds 5/6, real approval records, strict selector
verification for all four records, post-release HTTPS identity/price/400 checks,
all six scrape targets up, successful reload and the live production panel.
The failure patch passes git apply --check and local staging/production isolation
checks. No credential or access scope changed.
+23 -17
View File
@@ -1,7 +1,7 @@
# Secure Delivery and Rollback — Assignment 8
The active application starts with the instructor's Startup Pricing Service
v1 from `Examples.zip`, `Examples/dosSecureDelivery/v1/`. The deployment
The application is adapted from the instructor's Startup Pricing Service
v1 in `Examples.zip`, `Examples/dosSecureDelivery/v1/`. The deployment
starters come from that bundle's `ansible/` directory. The task follows
Chapter 6 of instructor manual version 1.43.
@@ -11,18 +11,20 @@ The inventory selects The-Ocean's dedicated deploy account. The example
release record remains explicitly an example; real registry digests are
generated by Jenkins from reviewed source.
Current execution status, 15 November: PR 24 is merged and the delivery job
is enabled. Real Jenkins test/secret demonstrations blocked as intended. The
first v1 image was scanned and published, but staging stopped before any app
change because Ansible requested a PTY forbidden by the deploy key. The
noninteractive inventory correction and expanded, passing Ansible preflight
await review/merge. See [gate evidence](evidence/gates-20261115.md) and
[release attempt 3](evidence/release-attempt-3-20261115.md).
Current execution status, 15 November Eastern / 16 November UTC: PRs 24–26
are merged, preserving the separate v1/v2 commits. Real Jenkins test/secret
demonstrations blocked as intended. Builds 5 and 6 then completed both releases,
with zero-change staging reruns, passing gates and actual human production
approvals. Both environments are healthy v2; production monitoring is live.
See [release evidence](evidence/releases-20261115.md). The four successful
records and staging-only fault history need review before the two remaining
[recovery exercises](exercises/README.md). Earlier failures/trials remain
historical evidence, not the current release result.
Run the tests from `app/` after installing its requirements into the selected
Linux test environment. The expected v1 result for three units is USD 30.
The later v2 source/test change will be a separate reviewed commit and will
return USD 36. The source commit must be baked into each built image.
The reviewed v2 source/test change returns USD 36. PR 26 preserved the separate
v1 and v2 SHAs, selected explicitly by builds 5 and 6 and baked into each image.
Deployment work uses a dedicated trusted Jenkins agent, immutable images
in the existing Gitea registry, and separate Ansible-managed staging and
@@ -102,19 +104,23 @@ See `RUNBOOKS.md`.
Ansible syntax, agent Compose configuration, and the installed Jenkins
controller's declarative parser checks passed. These are preparation checks;
**successful v1/v2 deployment, promotion and recovery are not yet demonstrated**.
The subsequent actual release evidence is linked above; **the two recovery
exercises remain unexecuted**.
## Remaining checkpoints
Vincent merged PR #24, including runner migration and HTTPS, after Billy's
latest review. Review/merge the noninteractive Ansible correction before
retrying v1. Create the assignment issue if still absent. Keep main protection.
latest review; PR 25's SSH correction and PR 26's two source commits are also
merged. Review/merge the actual successful records and the preserved staging-only
fault/revert commits before recovery. Create the assignment issue if still absent.
Keep main protection and preserve commit history with a merge commit.
Billy added the A
records; Google and Cloudflare now resolve both names to `147.182.178.136`.
On 15 November Caddy's prepared routes were validated and gracefully reloaded;
both names have trusted HTTPS and HTTP redirects. They currently return 502
because the app containers are not deployed. See `evidence/https-20261115.md`.
The release job is enabled; follow `RUNBOOKS.md` after the corrected source reaches main.
both names have trusted HTTPS and HTTP redirects. Both environments now passed
v1/v2 release checks and are healthy v2. The original TLS
readiness snapshot is `evidence/https-20261115.md`.
The release job is enabled; follow `RUNBOOKS.md` after the recovery records/configuration are reviewed on main.
Keep Jenkins and the remote delivery node available. Production approval requires an authorized
human; an agent must not approve unattended.
+22 -12
View File
@@ -2,16 +2,15 @@
These are execution instructions, not completed release evidence.
Current status, 15 November 2026: Billy's DNS records resolve correctly and the
Current status, 15 November 2026 Eastern / 16 November UTC: Billy's DNS records resolve correctly and the
two Caddy routes are active with trusted certificates and HTTP-to-HTTPS redirects.
502 is expected while the app backends are absent. The one-time HTTPS helper
has already run; use the normal validate/reload procedure for later changes.
The reviewed preparation is merged, the release job is enabled, and real
Jenkins test/secret blocks are recorded. Release build 3 published v1 but
stopped at Ansible's PTY request before any app change. Review/merge the
noninteractive inventory correction and retry from the corrected main SHA.
The expanded Ansible/sudo preflight passed; full deployment remains unverified.
Monitoring additions and successful releases remain pending.
The one-time HTTPS helper has already run; use the normal validate/reload
procedure for later changes. PRs 24–26 are merged. Actual builds 5/6 passed
v1/v2 promotions, zero-change reruns and real vsun1 approvals. Both environments
are healthy v2. The production probe/panel is applied and verified; one HTTP 502
sample during replacement is recorded. Review the four actual successful
records and staging-only fault/revert history before recovery; see
`exercises/README.md`. The earlier failed builds remain historical evidence.
## Authority and preparation
@@ -36,9 +35,13 @@ docker exec gitea-caddy-1 caddy reload --config /etc/caddy/Caddyfile --adapter c
docker exec monitoring-prometheus-1 promtool check config /etc/prometheus/prometheus.yml
```
Preserve bind-mounted file inodes when copying new contents. Apply monitoring
only after healthy production, then reload using its existing documented
procedure. The temporary candidate checks already passed without a reload.
Preserve bind-mounted file inodes when copying new contents. Monitoring was
applied only after healthy v1 production, using the guarded one-time
`bootstrap/enable-production-monitoring.py`. It compares prior probes/panels,
validates with promtool, backs up and reloads Prometheus via SIGHUP. Do not
rerun its one-time application over the already changed state. The protected
backup is `/root/ssw590-delivery-bootstrap/monitoring-20261116/`. Actual targets,
reload metric and the provisioned Grafana panel were verified separately.
## v1 and v2
@@ -61,6 +64,13 @@ procedure. The temporary candidate checks already passed without a reload.
VERSION=v2, UNIT_PRICE=12, expected total=36. Repeat the complete release and
real approval. Preserve v1 images/configuration/records; save v2 records.
The v1 health correction and v2 source/test change may be reviewed together
in one PR while remaining separate commits. Do not squash them: the delivery
job requires both selected source commits to remain ancestors of protected
main. Start with the full v1 health-fix SHA, then use the full v2 SHA only after
v1 production verification. Actual successful records still need review before
rollback. Never substitute a failed attempt's generated record for that evidence.
## Healthy production rollback
Record the detection/decision UTC and reason. Before approval, start the HTTPS
+2 -1
View File
@@ -9,5 +9,6 @@ RUN pip install --no-cache-dir -r requirements.txt \
COPY app.py .
USER 10001:10001
EXPOSE 8000
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2)"
# Allow Python startup under the 0.25 CPU cap; the HTTP timeout remains 2s.
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2)"
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "1", "--worker-tmp-dir", "/tmp", "app:app"]
+2 -2
View File
@@ -2,8 +2,8 @@ import os
from flask import Flask, jsonify, request
app = Flask(__name__)
VERSION = "v1"
UNIT_PRICE = 10
VERSION = "v2"
UNIT_PRICE = 12
COMMIT = os.environ.get("APP_COMMIT", "development")
+3 -3
View File
@@ -7,17 +7,17 @@ class PricingTests(unittest.TestCase):
self.client = app.test_client()
def test_price(self):
self.assertEqual(total_price(3), 30)
self.assertEqual(total_price(3), 36)
response = self.client.get("/price?quantity=3")
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json["total"], 30)
self.assertEqual(response.json["total"], 36)
def test_invalid_quantity(self):
for value in ["0", "-1", "1001", "abc", "1.5"]:
self.assertEqual(self.client.get("/price?quantity=" + value).status_code, 400)
def test_release_identity(self):
self.assertEqual(self.client.get("/").json["version"], "v1")
self.assertEqual(self.client.get("/").json["version"], "v2")
self.assertEqual(self.client.get("/health").json["status"], "ok")
@@ -0,0 +1,79 @@
"""Apply the reviewed production probe/panel only after production is healthy."""
import argparse
from datetime import datetime, timezone
import hashlib
import json
import os
from pathlib import Path
import shutil
import subprocess
import urllib.request
parser = argparse.ArgumentParser()
parser.add_argument('--prometheus', required=True, type=Path)
parser.add_argument('--dashboard', required=True, type=Path)
parser.add_argument('--backup', required=True, type=Path)
parser.add_argument('--apply', action='store_true')
args = parser.parse_args()
live_prom = Path('/root/monitoring/prometheus/prometheus.yml')
live_dashboard = Path('/root/monitoring/grafana/dashboards/sre.json')
before = {live_prom:live_prom.read_bytes(), live_dashboard:live_dashboard.read_bytes()}
candidate_prom = args.prometheus.read_text().replace('\r\n','\n')
candidate_dashboard = args.dashboard.read_bytes()
addition = ' # Apply this addition only after Assignment 8 production is healthy.\n - https://app.yebilly.me/health\n'
assert candidate_prom.count(addition) == 1, 'Unexpected production probe'
assert candidate_prom.replace(addition,'').strip() == before[live_prom].decode().replace('\r\n','\n').strip(), 'Existing probes differ; inspect before changing'
old = json.loads(before[live_dashboard])
new = json.loads(candidate_dashboard)
assert old['uid'] == new['uid'] == 'group1-sre'
assert old['version'] == 1 and new['version'] == 2
panel = new['panels'][-1]
assert panel['id'] == 8 and panel['type'] == 'timeseries'
assert panel['targets'][0]['expr'] == 'probe_success{job="https",instance="https://app.yebilly.me/health"}'
comparison = dict(new, version=old['version'], panels=new['panels'][:-1])
assert comparison == old, 'Existing dashboard differs; inspect before changing'
with urllib.request.urlopen('https://app.yebilly.me/health',timeout=10) as response:
health = json.load(response)
assert response.status == 200 and health['status'] == 'ok' and health['version'] in {'v1','v2'}, 'Production must be healthy first'
stamp = datetime.now(timezone.utc).strftime('%Y%m%dT%H%M%S%fZ')
temporary = '/tmp/ssw590-production-probe-' + stamp + '.yml'
subprocess.run(['docker','cp',str(args.prometheus),'monitoring-prometheus-1:'+temporary],check=True,capture_output=True)
try:
validation = subprocess.check_output(['docker','exec','monitoring-prometheus-1','promtool','check','config',temporary],text=True)
if not args.apply:
print(validation + 'Validated only; no active file changed.')
raise SystemExit(0)
args.backup.mkdir(parents=True,mode=0o700,exist_ok=False)
for path in before:
shutil.copy2(path,args.backup / (path.name + '.before'))
inodes = {p:p.stat().st_ino for p in before}
def write(path,content):
with path.open('wb') as stream:
stream.write(content)
stream.flush()
os.fsync(stream.fileno())
assert path.stat().st_ino == inodes[path], 'Bind inode changed'
try:
write(live_prom,candidate_prom.encode())
write(live_dashboard,candidate_dashboard)
subprocess.run(['docker','kill','--signal','HUP','monitoring-prometheus-1'],check=True,capture_output=True)
except Exception:
for path,content in before.items():
write(path,content)
subprocess.run(['docker','kill','--signal','HUP','monitoring-prometheus-1'],check=True,capture_output=True)
raise
report = {'applied_at':datetime.now(timezone.utc).isoformat(),'production_health':health,
'validation':validation,'prior_probes_and_panels_preserved':True,
'files':[{'path':str(p),'before_sha256':hashlib.sha256(before[p]).hexdigest(),
'after_sha256':hashlib.sha256(p.read_bytes()).hexdigest(),
'inode_preserved':p.stat().st_ino == inodes[p]} for p in before],
'backup':str(args.backup),'reload':'Prometheus SIGHUP; Grafana file provisioning',
'result':'applied; runtime probe and panel verification still required'}
(args.backup / 'applied.json').write_text(json.dumps(report,indent=2))
print(json.dumps(report,indent=2))
finally:
# docker cp creates a root-owned file; the Prometheus service runs as nobody.
subprocess.run(['docker','exec','--user','0','monitoring-prometheus-1','rm','-f',temporary],check=True,capture_output=True)
@@ -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,26 @@
{
"applied_at": "2026-11-16T03:08:11.087796+00:00",
"production_health": {
"status": "ok",
"version": "v1"
},
"validation": "Checking /tmp/ssw590-production-probe-20261116T030810544427Z.yml\n SUCCESS: /tmp/ssw590-production-probe-20261116T030810544427Z.yml is valid prometheus config file syntax\n\n",
"prior_probes_and_panels_preserved": true,
"files": [
{
"path": "/root/monitoring/prometheus/prometheus.yml",
"before_sha256": "fe1d0f479d947e20ea7ebfec164689fe69ea9539ba0289adc2b7d26b8ffe62d6",
"after_sha256": "e35bc7fb3d09f7b3442324a2af147d8f1319ae1f0631ba81ed7577bb63826edd",
"inode_preserved": true
},
{
"path": "/root/monitoring/grafana/dashboards/sre.json",
"before_sha256": "c21fadca47ee624001133a82b788e728d08168664302666ed103113f3bec5f13",
"after_sha256": "08f99b845e5d56b81f54bf1b386aa50a54a88296ce5caf9496c5bfbf62929ed1",
"inode_preserved": true
}
],
"backup": "/root/ssw590-delivery-bootstrap/monitoring-20261116",
"reload": "Prometheus SIGHUP; Grafana file provisioning",
"result": "applied; runtime probe and panel verification still required"
}
@@ -0,0 +1,218 @@
{
"observed_at": "2026-11-16T03:14:11.206493+00:00",
"queries": {
"probe_success{job=\"https\"}": [
{
"metric": {
"__name__": "probe_success",
"instance": "https://ci.yebilly.me/login",
"job": "https"
},
"value": [
1794798851.242,
"1"
]
},
{
"metric": {
"__name__": "probe_success",
"instance": "https://git.yebilly.me/user/login",
"job": "https"
},
"value": [
1794798851.242,
"1"
]
},
{
"metric": {
"__name__": "probe_success",
"instance": "https://app.yebilly.me/health",
"job": "https"
},
"value": [
1794798851.242,
"1"
]
}
],
"prometheus_config_last_reload_successful": [
{
"metric": {
"__name__": "prometheus_config_last_reload_successful",
"instance": "prometheus:9090",
"job": "prometheus"
},
"value": [
1794798851.244,
"1"
]
}
],
"up": [
{
"metric": {
"__name__": "up",
"instance": "blackbox-exporter:9115",
"job": "blackbox"
},
"value": [
1794798851.245,
"1"
]
},
{
"metric": {
"__name__": "up",
"instance": "prometheus:9090",
"job": "prometheus"
},
"value": [
1794798851.245,
"1"
]
},
{
"metric": {
"__name__": "up",
"instance": "https://ci.yebilly.me/login",
"job": "https"
},
"value": [
1794798851.245,
"1"
]
},
{
"metric": {
"__name__": "up",
"instance": "https://git.yebilly.me/user/login",
"job": "https"
},
"value": [
1794798851.245,
"1"
]
},
{
"metric": {
"__name__": "up",
"instance": "node-exporter:9100",
"job": "node"
},
"value": [
1794798851.245,
"1"
]
},
{
"metric": {
"__name__": "up",
"instance": "https://app.yebilly.me/health",
"job": "https"
},
"value": [
1794798851.245,
"1"
]
}
]
},
"targets": [
{
"labels": {
"instance": "blackbox-exporter:9115",
"job": "blackbox"
},
"health": "up",
"lastError": "",
"lastScrape": "2026-11-16T03:13:46.738098436Z"
},
{
"labels": {
"instance": "https://git.yebilly.me/user/login",
"job": "https"
},
"health": "up",
"lastError": "",
"lastScrape": "2026-11-16T03:14:02.878212313Z"
},
{
"labels": {
"instance": "https://ci.yebilly.me/login",
"job": "https"
},
"health": "up",
"lastError": "",
"lastScrape": "2026-11-16T03:13:50.769303819Z"
},
{
"labels": {
"instance": "https://app.yebilly.me/health",
"job": "https"
},
"health": "up",
"lastError": "",
"lastScrape": "2026-11-16T03:13:54.602557327Z"
},
{
"labels": {
"instance": "node-exporter:9100",
"job": "node"
},
"health": "up",
"lastError": "",
"lastScrape": "2026-11-16T03:14:06.522911829Z"
},
{
"labels": {
"instance": "prometheus:9090",
"job": "prometheus"
},
"health": "up",
"lastError": "",
"lastScrape": "2026-11-16T03:13:47.742950331Z"
}
],
"dashboard_provisioning_source": {
"uid": "group1-sre",
"title": "Group 1 SRE",
"panels": [
{
"id": 1,
"title": "Droplet CPU utilization (%)"
},
{
"id": 2,
"title": "Available memory (bytes)"
},
{
"id": 3,
"title": "Root filesystem available (%)"
},
{
"id": 4,
"title": "Gitea HTTPS availability (probe_success)"
},
{
"id": 5,
"title": "Jenkins HTTPS availability (probe_success)"
},
{
"id": 6,
"title": "HTTPS probe duration (s)"
},
{
"id": 7,
"title": "Scrape health (up)"
},
{
"id": 8,
"title": "Pricing production HTTPS availability (probe_success)"
}
]
},
"production_probe_up": true,
"pricing_panel_configured": true,
"runtime_panel_verification": "Separate Grafana UI verification required"
}
@@ -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.
+202
View File
@@ -0,0 +1,202 @@
{
"releases": [
{
"version": "v1",
"build": 5,
"url": "https://ci.yebilly.me/job/secure-delivery/job/pricing/5/",
"result": "SUCCESS",
"source": "34f26e6948b7001ede8ca19f23b67a02082e6a9a",
"started": "2026-11-16T03:00:10.966000+00:00",
"completed": "2026-11-16T03:05:08.180000+00:00",
"total_seconds": 297.214,
"approval": {
"Approver": "vsun1",
"Decision": "approved",
"UTC": "2026-11-16T03:04:01Z"
},
"deployments": {
"staging-deploy": {
"started": "2026-11-16T03:01:27.245015+00:00",
"completed": "2026-11-16T03:02:26.405414+00:00",
"elapsed_seconds": 59.16,
"operation": "deploy",
"ansible_exit_code": 0,
"recaps": [
{
"host": "startup",
"ok": 10,
"changed": 3,
"unreachable": 0,
"failed": 0
}
],
"result": "passed"
},
"staging-rerun": {
"started": "2026-11-16T03:02:29.440969+00:00",
"completed": "2026-11-16T03:03:10.939985+00:00",
"elapsed_seconds": 41.499,
"operation": "rerun",
"ansible_exit_code": 0,
"recaps": [
{
"host": "startup",
"ok": 10,
"changed": 0,
"unreachable": 0,
"failed": 0
}
],
"result": "passed"
},
"production-deploy": {
"started": "2026-11-16T03:04:05.207821+00:00",
"completed": "2026-11-16T03:05:05.610689+00:00",
"elapsed_seconds": 60.403,
"operation": "deploy",
"ansible_exit_code": 0,
"recaps": [
{
"host": "startup",
"ok": 10,
"changed": 4,
"unreachable": 0,
"failed": 0
}
],
"result": "passed"
}
},
"scans": {
"image-gate": {
"analyzed_targets": 2,
"high_critical": 0,
"report_sha256": "55ca73c4b493fa7a612671e02e6cf097c0b3fc011895712189704c8721b9028e"
},
"published-image-gate": {
"analyzed_targets": 2,
"high_critical": 0,
"report_sha256": "f375643ae8f6888e9f5ab582342c4d11bee8563936c86a9de08e7b7b5cd52ef8"
},
"dependencies": {
"packages": 9,
"advisories": 0
},
"source_secrets": {
"findings": 0
}
},
"unit_tests": {
"started": "2026-11-16T03:00:34.908112+00:00",
"completed": "2026-11-16T03:00:35.815417+00:00",
"exit_code": 0,
"result": "passed"
},
"release_image": "git.yebilly.me/ssw590-group1/pricing@sha256:59c880b2704f91668618d9a2ff0bc8fbab0af4239ceb916de261863890ef88d8",
"configuration_commit": "34f26e6948b7001ede8ca19f23b67a02082e6a9a",
"records": [
"delivery/releases/v1-staging.json",
"delivery/releases/v1-production.json"
]
},
{
"version": "v2",
"build": 6,
"url": "https://ci.yebilly.me/job/secure-delivery/job/pricing/6/",
"result": "SUCCESS",
"source": "6bddbfba5a36e0e397537678ffb197e101fb0670",
"started": "2026-11-16T03:05:33.456000+00:00",
"completed": "2026-11-16T03:12:29.163000+00:00",
"total_seconds": 415.707,
"approval": {
"Approver": "vsun1",
"Decision": "approved",
"UTC": "2026-11-16T03:11:18Z"
},
"deployments": {
"staging-deploy": {
"started": "2026-11-16T03:06:46.416545+00:00",
"completed": "2026-11-16T03:07:46.522813+00:00",
"elapsed_seconds": 60.106,
"operation": "deploy",
"ansible_exit_code": 0,
"recaps": [
{
"host": "startup",
"ok": 10,
"changed": 3,
"unreachable": 0,
"failed": 0
}
],
"result": "passed"
},
"staging-rerun": {
"started": "2026-11-16T03:07:49.044973+00:00",
"completed": "2026-11-16T03:08:34.532184+00:00",
"elapsed_seconds": 45.487,
"operation": "rerun",
"ansible_exit_code": 0,
"recaps": [
{
"host": "startup",
"ok": 10,
"changed": 0,
"unreachable": 0,
"failed": 0
}
],
"result": "passed"
},
"production-deploy": {
"started": "2026-11-16T03:11:21.802336+00:00",
"completed": "2026-11-16T03:12:28.036700+00:00",
"elapsed_seconds": 66.234,
"operation": "deploy",
"ansible_exit_code": 0,
"recaps": [
{
"host": "startup",
"ok": 10,
"changed": 3,
"unreachable": 0,
"failed": 0
}
],
"result": "passed"
}
},
"scans": {
"image-gate": {
"analyzed_targets": 2,
"high_critical": 0,
"report_sha256": "89d8912330a8fdfb0e5e8ccd1e41f971415c611ba80ee2dd6d484401ec2f6a09"
},
"published-image-gate": {
"analyzed_targets": 2,
"high_critical": 0,
"report_sha256": "32562513adffdd78782417083b51e56fd29f758a3e050faeda147dee822bc339"
},
"dependencies": {
"packages": 9,
"advisories": 0
},
"source_secrets": {
"findings": 0
}
},
"unit_tests": {
"started": "2026-11-16T03:05:54.830225+00:00",
"completed": "2026-11-16T03:05:55.609726+00:00",
"exit_code": 0,
"result": "passed"
},
"release_image": "git.yebilly.me/ssw590-group1/pricing@sha256:efe8658a0adf0854038d58199652030cbd0ef70047a1c6ebc7b09906cf1ec88b",
"configuration_commit": "6bddbfba5a36e0e397537678ffb197e101fb0670",
"records": [
"delivery/releases/v2-staging.json",
"delivery/releases/v2-production.json"
]
}
]
}
+85
View File
@@ -0,0 +1,85 @@
# Reviewed v1/v2 releases and production monitoring
Client date: 15 November 2026 Eastern; all times below are 16 November UTC.
Billy approved PR 26 at 02:56:00; Vincent merged it at 02:57:42 as
`231d11528a425114a8d3570afba56943c4d57d96`, preserving both source commits.
The merge-triggered manual workflow 15 passed in 2m7s before delivery began.
| Evidence | v1 | v2 |
|---|---|---|
| Source and configuration | `34f26e6948b7001ede8ca19f23b67a02082e6a9a` | `6bddbfba5a36e0e397537678ffb197e101fb0670` |
| Jenkins | [Build 5 SUCCESS](https://ci.yebilly.me/job/secure-delivery/job/pricing/5/) | [Build 6 SUCCESS](https://ci.yebilly.me/job/secure-delivery/job/pricing/6/) |
| Full run, including human wait | 03:00:10.966–03:05:08.180; 297.214 s | 03:05:33.456–03:12:29.163; 415.707 s |
| Initial staging | 59.160 s; ok=10, changed=3, failed=0 | 60.106 s; ok=10, changed=3, failed=0 |
| Unchanged staging rerun | 41.499 s; ok=10, changed=0, failed=0 | 45.487 s; ok=10, changed=0, failed=0 |
| Actual human approval | `vsun1`, 03:04:01 | `vsun1`, 03:11:18 |
| Production deployment | 03:04:05.208–03:05:05.611; 60.403 s | 03:11:21.802–03:12:28.037; 66.234 s |
| Verified quantity 3 total | USD 30 in both environments | USD 36 in both environments |
Both runs passed twelve control tests and three Flask tests, clean-source
scanning, all nine locked dependency audits (zero advisories), and pre-push and
registry-digest image gates (two analyzed targets, zero HIGH/CRITICAL findings).
No exception was added. Each source-SHA image was built once, pushed, pulled
and promoted by the same exact digest across staging and production.
Repository: `git.yebilly.me/ssw590-group1/pricing`
```text
v1 sha256:59c880b2704f91668618d9a2ff0bc8fbab0af4239ceb916de261863890ef88d8
v2 sha256:efe8658a0adf0854038d58199652030cbd0ef70047a1c6ebc7b09906cf1ec88b
```
The four selectors in `delivery/releases/` are copied unchanged from these
successful Jenkins builds. They include the real source/configuration SHAs,
digest, environment, expected version/total, build URL and creation time.
They pass `release.py verify` and need review/commit before recovery. Earlier
failed-attempt records were not substituted. Full reports and actual approval
records remain archived in Jenkins; exact local copies are retained in ignored
`build/evidence/assignment8-execution/jenkins-{5,6}/`.
[Machine-readable summary](releases-20261115.json) includes recaps, timestamps,
scan counts and full image-report SHA-256 hashes.
## Production monitoring, applied only after healthy v1
At 03:08:11 the previously reviewed production `/health` target and panel 8
were applied. The guarded helper required healthy production, compared earlier
probes/panels, validated the candidate with installed promtool, saved protected
backups and preserved both bind-mounted file inodes. Prometheus reloaded via
SIGHUP; Grafana provisioned the changed file. No container, volume, retention,
allowlist, credential or existing alert rule was replaced. The first dry-run
cleanup needed root inside Prometheus because docker cp created a root-owned
temporary file; that was corrected before active application.
[Applied metadata](monitoring-applied-20261115.json) records hashes and backup
`/root/ssw590-delivery-bootstrap/monitoring-20261116/`.
[Actual samples and targets](monitoring-runtime-20261115.json), observed at
03:14:11, showed production, Gitea and Jenkins probe_success=1, all six scrape
targets up and successful reload=1. The dashboard source retained its previous
seven panels; the actual Grafana UI also displayed the new pricing panel and
its data. A legacy SQL dashboard lookup returned no row, so it was not used
as proof of provisioning.
Prometheus supports [runtime SIGHUP reload](https://prometheus.io/docs/prometheus/latest/configuration/configuration/).
Grafana's [file provisioning](https://grafana.com/docs/grafana/latest/administration/provisioning/)
detects dashboard changes; visible runtime verification was performed separately.
## Observed availability during v2 promotion
The [post-release capture](runtime-20261115.json) at 03:28:08 verified both
environments as healthy v2 with the exact source SHA, HTTP 200 for identity,
health and total 36, and HTTP 400 for quantity 0. Both containers had zero OOM
events and no observed memory-limit events in that capture.
The production probe history contains one failed sample at **03:11:54.602**
during v2's 03:11:21.802–03:12:28.037 deployment window. Adjacent successful
samples were 03:11:24.602 and 03:12:24.602. The capture preserves exact HTTP
status and duration samples. A single failed 30-second-cadence sample does
not establish an exact 30-second outage or zero downtime between other samples.
The interval is shorter than the existing one-minute alert duration; no alert
firing or notification is claimed without separate evidence. The single-host
Compose replacement is not blue/green or highly available deployment.
The Grafana screenshot is retained in the manual's image folder. Production
rollback and deliberate staging failure/recovery remain **unexecuted** pending
review of the successful records and preserved staging-only configuration fault.
See [the recovery exercise instructions](../exercises/README.md).
+604
View File
@@ -0,0 +1,604 @@
{
"observed_at": "2026-11-16T03:28:08.004273+00:00",
"endpoints": {
"staging": [
{
"path": "/",
"http_status": 200,
"body": {
"commit": "6bddbfba5a36e0e397537678ffb197e101fb0670",
"service": "Startup Pricing",
"version": "v2"
}
},
{
"path": "/health",
"http_status": 200,
"body": {
"status": "ok",
"version": "v2"
}
},
{
"path": "/price?quantity=3",
"http_status": 200,
"body": {
"currency": "USD",
"quantity": 3,
"total": 36
}
},
{
"path": "/price?quantity=0",
"http_status": 400,
"body": {
"error": "quantity must be between 1 and 1000"
}
}
],
"production": [
{
"path": "/",
"http_status": 200,
"body": {
"commit": "6bddbfba5a36e0e397537678ffb197e101fb0670",
"service": "Startup Pricing",
"version": "v2"
}
},
{
"path": "/health",
"http_status": 200,
"body": {
"status": "ok",
"version": "v2"
}
},
{
"path": "/price?quantity=3",
"http_status": 200,
"body": {
"currency": "USD",
"quantity": 3,
"total": 36
}
},
{
"path": "/price?quantity=0",
"http_status": 400,
"body": {
"error": "quantity must be between 1 and 1000"
}
}
]
},
"containers": {
"staging": {
"running": true,
"oom_killed": false,
"health": "healthy",
"memory_events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\n"
},
"production": {
"running": true,
"oom_killed": false,
"health": "healthy",
"memory_events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\n"
}
},
"monitoring_samples": {
"probe_success": [
{
"metric": {
"__name__": "probe_success",
"instance": "https://app.yebilly.me/health",
"job": "https"
},
"values": [
[
1794798504.602,
"1"
],
[
1794798534.602,
"1"
],
[
1794798564.602,
"1"
],
[
1794798594.602,
"1"
],
[
1794798624.602,
"1"
],
[
1794798654.602,
"1"
],
[
1794798684.602,
"1"
],
[
1794798714.602,
"0"
],
[
1794798744.602,
"1"
],
[
1794798774.602,
"1"
],
[
1794798804.602,
"1"
],
[
1794798834.602,
"1"
],
[
1794798864.602,
"1"
],
[
1794798894.602,
"1"
],
[
1794798924.602,
"1"
],
[
1794798954.602,
"1"
],
[
1794798984.602,
"1"
],
[
1794799014.602,
"1"
],
[
1794799044.602,
"1"
],
[
1794799074.602,
"1"
],
[
1794799104.602,
"1"
],
[
1794799134.602,
"1"
],
[
1794799164.602,
"1"
],
[
1794799194.602,
"1"
],
[
1794799224.602,
"1"
],
[
1794799254.602,
"1"
],
[
1794799284.602,
"1"
],
[
1794799314.602,
"1"
],
[
1794799344.602,
"1"
],
[
1794799374.602,
"1"
],
[
1794799404.602,
"1"
],
[
1794799434.602,
"1"
],
[
1794799464.602,
"1"
],
[
1794799494.602,
"1"
],
[
1794799524.602,
"1"
],
[
1794799554.602,
"1"
],
[
1794799584.602,
"1"
],
[
1794799614.602,
"1"
],
[
1794799644.602,
"1"
],
[
1794799674.602,
"1"
]
]
}
],
"probe_http_status_code": [
{
"metric": {
"__name__": "probe_http_status_code",
"instance": "https://app.yebilly.me/health",
"job": "https"
},
"values": [
[
1794798504.602,
"200"
],
[
1794798534.602,
"200"
],
[
1794798564.602,
"200"
],
[
1794798594.602,
"200"
],
[
1794798624.602,
"200"
],
[
1794798654.602,
"200"
],
[
1794798684.602,
"200"
],
[
1794798714.602,
"502"
],
[
1794798744.602,
"200"
],
[
1794798774.602,
"200"
],
[
1794798804.602,
"200"
],
[
1794798834.602,
"200"
],
[
1794798864.602,
"200"
],
[
1794798894.602,
"200"
],
[
1794798924.602,
"200"
],
[
1794798954.602,
"200"
],
[
1794798984.602,
"200"
],
[
1794799014.602,
"200"
],
[
1794799044.602,
"200"
],
[
1794799074.602,
"200"
],
[
1794799104.602,
"200"
],
[
1794799134.602,
"200"
],
[
1794799164.602,
"200"
],
[
1794799194.602,
"200"
],
[
1794799224.602,
"200"
],
[
1794799254.602,
"200"
],
[
1794799284.602,
"200"
],
[
1794799314.602,
"200"
],
[
1794799344.602,
"200"
],
[
1794799374.602,
"200"
],
[
1794799404.602,
"200"
],
[
1794799434.602,
"200"
],
[
1794799464.602,
"200"
],
[
1794799494.602,
"200"
],
[
1794799524.602,
"200"
],
[
1794799554.602,
"200"
],
[
1794799584.602,
"200"
],
[
1794799614.602,
"200"
],
[
1794799644.602,
"200"
],
[
1794799674.602,
"200"
]
]
}
],
"probe_duration_seconds": [
{
"metric": {
"__name__": "probe_duration_seconds",
"instance": "https://app.yebilly.me/health",
"job": "https"
},
"values": [
[
1794798504.602,
"0.057399797"
],
[
1794798534.602,
"0.028300941"
],
[
1794798564.602,
"0.023132207"
],
[
1794798594.602,
"0.021246711"
],
[
1794798624.602,
"0.023551593"
],
[
1794798654.602,
"0.023607454"
],
[
1794798684.602,
"0.182590187"
],
[
1794798714.602,
"0.080492206"
],
[
1794798744.602,
"0.048286408"
],
[
1794798774.602,
"0.021541103"
],
[
1794798804.602,
"0.082225976"
],
[
1794798834.602,
"0.026266413"
],
[
1794798864.602,
"0.021229488"
],
[
1794798894.602,
"0.026039405"
],
[
1794798924.602,
"0.024995092"
],
[
1794798954.602,
"0.026780972"
],
[
1794798984.602,
"0.022616423"
],
[
1794799014.602,
"0.079699801"
],
[
1794799044.602,
"0.023901787"
],
[
1794799074.602,
"0.029992619"
],
[
1794799104.602,
"0.022638427"
],
[
1794799134.602,
"0.082084913"
],
[
1794799164.602,
"0.03257138"
],
[
1794799194.602,
"0.028129282"
],
[
1794799224.602,
"0.02010407"
],
[
1794799254.602,
"0.081311747"
],
[
1794799284.602,
"0.027378471"
],
[
1794799314.602,
"0.020048075"
],
[
1794799344.602,
"0.018652785"
],
[
1794799374.602,
"0.019703541"
],
[
1794799404.602,
"0.020952708"
],
[
1794799434.602,
"0.020200855"
],
[
1794799464.602,
"0.081365277"
],
[
1794799494.602,
"0.030027777"
],
[
1794799524.602,
"0.020230579"
],
[
1794799554.602,
"0.028499939"
],
[
1794799584.602,
"0.024388546"
],
[
1794799614.602,
"0.02259808"
],
[
1794799644.602,
"0.030377942"
],
[
1794799674.602,
"0.080982268"
]
]
}
]
}
}
+64
View File
@@ -0,0 +1,64 @@
# Reviewed recovery exercises
V1 and v2 have now completed Jenkins releases 5 and 6 with real human approvals.
The four exact successful records in `../releases/` need review/commit before
recovery. Do not use the earlier failed attempts' records.
The patch here is a deliberate **staging-only** configuration fault: Gunicorn
binds to 8001 while the unchanged image healthcheck probes 8000. It changes no
image, host port, credential, shared service, production command or stored data.
The reviewed Jenkins `staging-failure` mode requires a staging record and uses
that record's existing v2 digest; it does not publish/rebuild an image.
## Commit and review sequence
1. Commit the actual release records, evidence, monitoring helper, manual and
this patch while the active template remains correct.
2. Apply this patch and commit the one changed template as
`Exercise staging-only Gunicorn bind mismatch`.
3. Immediately revert that second commit, creating a third commit. The final
branch/main template must be good; the bad configuration survives only as
a reviewed historical commit selected explicitly by SHA for the exercise.
4. Billy reviews all three commits, including the intermediate configuration
fault and its restoration. Use a merge commit, preserving history.
After the first commit, the two configuration commits can be made with:
```powershell
git apply delivery/exercises/staging-bind-mismatch.patch
git add delivery/ansible/templates/compose.yaml.j2
git commit -m "Exercise staging-only Gunicorn bind mismatch"
git revert --no-edit HEAD
```
## Execution after review/merge
First record the planned healthy production rollback decision and start the
HTTPS observer. Use `MODE=rollback-production` and
`RELEASE_RECORD=delivery/releases/v1-production.json`. The approved operation
must restore v1's exact image/configuration, source SHA and total 30. This is
an exercise on healthy v2, not a claimed production incident. A real human
must approve the Jenkins production input.
Then start a separate staging observer and select:
```text
MODE=staging-failure
RELEASE_RECORD=delivery/releases/v2-staging.json
STAGING_FAILURE_CONFIG=<full SHA of the reviewed bind-mismatch commit>
```
The SHA must be the actual preserved intermediate commit, not the final
revert or an invented placeholder. Leave SOURCE_COMMIT blank so the job uses
reviewed current main for its control code. Compose wait must block within
its 90-second bound and stop before production. Preserve that failure.
Recover with `MODE=recover-staging` and the same good v2 staging record, leaving
STAGING_FAILURE_CONFIG blank. It must restore the recorded good configuration,
verify source/version/total 36, and pass the unchanged rerun with changed=0.
Save decision/start/completion times, recaps, observer samples and monitoring
correlation. Samples cannot establish zero interruption between requests.
Both exercises remain unexecuted. No failure configuration is deployed merely
by merging this PR: its net template is unchanged and the bad SHA is selected
only in the explicit staging exercise.
@@ -0,0 +1,13 @@
diff --git a/delivery/ansible/templates/compose.yaml.j2 b/delivery/ansible/templates/compose.yaml.j2
--- a/delivery/ansible/templates/compose.yaml.j2
+++ b/delivery/ansible/templates/compose.yaml.j2
@@ -1,6 +1,9 @@
services:
app:
image: "{{ release_image }}"
+{% if target_env == 'staging' %}
+ command: ["gunicorn", "--bind", "0.0.0.0:8001", "--workers", "1", "--worker-tmp-dir", "/tmp", "app:app"]
+{% endif %}
restart: unless-stopped
read_only: true
tmpfs:
+12
View File
@@ -0,0 +1,12 @@
{
"release_image": "git.yebilly.me/ssw590-group1/pricing@sha256:59c880b2704f91668618d9a2ff0bc8fbab0af4239ceb916de261863890ef88d8",
"expected_commit": "34f26e6948b7001ede8ca19f23b67a02082e6a9a",
"configuration_commit": "34f26e6948b7001ede8ca19f23b67a02082e6a9a",
"expected_version": "v1",
"expected_total": 30,
"proxy_network": "gitea_web",
"build_url": "https://ci.yebilly.me/job/secure-delivery/job/pricing/5/",
"created_at": "2026-11-16T03:01:23.246375+00:00",
"target_env": "production",
"public_url": "https://app.yebilly.me"
}
+12
View File
@@ -0,0 +1,12 @@
{
"release_image": "git.yebilly.me/ssw590-group1/pricing@sha256:59c880b2704f91668618d9a2ff0bc8fbab0af4239ceb916de261863890ef88d8",
"expected_commit": "34f26e6948b7001ede8ca19f23b67a02082e6a9a",
"configuration_commit": "34f26e6948b7001ede8ca19f23b67a02082e6a9a",
"expected_version": "v1",
"expected_total": 30,
"proxy_network": "gitea_web",
"build_url": "https://ci.yebilly.me/job/secure-delivery/job/pricing/5/",
"created_at": "2026-11-16T03:01:23.246375+00:00",
"target_env": "staging",
"public_url": "https://staging.yebilly.me"
}
+12
View File
@@ -0,0 +1,12 @@
{
"release_image": "git.yebilly.me/ssw590-group1/pricing@sha256:efe8658a0adf0854038d58199652030cbd0ef70047a1c6ebc7b09906cf1ec88b",
"expected_commit": "6bddbfba5a36e0e397537678ffb197e101fb0670",
"configuration_commit": "6bddbfba5a36e0e397537678ffb197e101fb0670",
"expected_version": "v2",
"expected_total": 36,
"proxy_network": "gitea_web",
"build_url": "https://ci.yebilly.me/job/secure-delivery/job/pricing/6/",
"created_at": "2026-11-16T03:06:40.913173+00:00",
"target_env": "production",
"public_url": "https://app.yebilly.me"
}
+12
View File
@@ -0,0 +1,12 @@
{
"release_image": "git.yebilly.me/ssw590-group1/pricing@sha256:efe8658a0adf0854038d58199652030cbd0ef70047a1c6ebc7b09906cf1ec88b",
"expected_commit": "6bddbfba5a36e0e397537678ffb197e101fb0670",
"configuration_commit": "6bddbfba5a36e0e397537678ffb197e101fb0670",
"expected_version": "v2",
"expected_total": 36,
"proxy_network": "gitea_web",
"build_url": "https://ci.yebilly.me/job/secure-delivery/job/pricing/6/",
"created_at": "2026-11-16T03:06:40.913173+00:00",
"target_env": "staging",
"public_url": "https://staging.yebilly.me"
}
+8 -4
View File
@@ -3,10 +3,14 @@ commands, designs, and evidence. Assignment 8 implements secure delivery with
a trusted Jenkins agent, locked Flask/Gunicorn service, security gates,
Ansible, scoped deployment credentials and recovery runbooks. The prerequisite
jobs, DNS/TLS and deliberate Jenkins test/secret blocks passed. The reviewed v1
image was published with passing scans, but staging stopped at a terminal
request incompatible with the restricted deploy key. A noninteractive Ansible
preflight passed; its inventory correction awaits review/merge. Successful
v1/v2 deployment, approvals, rollback and staging recovery remain pending.
images were published with passing scans. After the SSH and health-deadline
corrections were reviewed, Jenkins builds 5 and 6 promoted v1 and v2 by exact
digest through separate staging/production environments. Both unchanged reruns
passed with zero changes; Vincent approved each production operation. The
production probe and Grafana panel are live. One failed availability sample
was observed during v2 replacement; zero downtime is not claimed. The actual
release records and staging-only fault still require review before the healthy
production rollback and failed-staging recovery demonstrations.
This draft is not ready for submission.
Assignment 7 introduced site reliability
engineering: Prometheus, Grafana OSS, Node Exporter, and Blackbox Exporter
+79
View File
@@ -971,3 +971,82 @@ source correction must be committed, reviewed and merged before a new v1 run.
Published-but-undeployed attempt records are not presented as known-good
rollback records. Successful promotions, human approvals, both recoveries and
monitoring correlation remain unexecuted.
\section{Pricing Health Deadline and v2 Preparation}
Date: November 15, 2026 Eastern (November 16 UTC); Tool: OpenAI Codex;
Human: Vincent Sun. After Vincent reported the fix merged, Codex checked the
repository requirements/status, verified Billy's PR~\#25 approval and merge
\texttt{a19fab3}, synchronized a clean branch and ran pricing build 4. Tests,
scans, publication and initial staging verification passed. The unchanged
rerun stopped because Docker reported the container unhealthy; no production
approval or deployment occurred. The noninteractive SSH correction worked.
Codex inspected only the staging container's health/state, logs, resource
counters and public health endpoint. Probes near three seconds sometimes hit
the three-second deadline; the app later recovered without restart and no OOM
kill was recorded. Codex tested a ten-second overall deadline in an isolated
temporary container using the same reviewed image and constraints, with no
network, published port or proxy alias. Eight checks passed in 2.817--5.660
seconds; CPU throttling occurred, but no diagnostic memory-limit/OOM event.
The diagnostic container was removed by its exact created ID. Its code/raw
JSON and actual build-4 reports were preserved. Existing staging was unchanged.
Codex changed only the image's overall health deadline, retaining the two-second
HTTP request timeout and other health/security/resource settings. It prepared
the required v2 source/test change locally; three functional and twelve control
tests passed. Docker Desktop was unavailable, so the functional tests used the
existing Windows Flask installation (Werkzeug 3.1.8 rather than the deployment
lock's 3.1.9); this was not represented as a passed locked Jenkins release.
Both remote runners remain independent of the laptop Docker daemon.
To reduce review cycles, Codex prepared instructions for two commits in one PR:
v1 health correction first, then v2 app/tests. A merge commit must preserve
both reviewed source SHAs for explicit Jenkins selection. No commit, push,
review or production approval was performed by Codex. It updated current
staging inventory, architecture, evidence, runbooks, history and this log,
and rebuilt/visually reviewed the ignored local PDF. Successful releases,
unchanged reruns, human approvals, known-good records and both recovery
exercises remain pending.
\section{Reviewed Releases and Production Monitoring}
Date: November 15, 2026 Eastern (November 16 UTC); Tool: OpenAI Codex;
Human: Vincent Sun; Reviewer: Billy Ye. Vincent reported the merge complete
and asked Codex to continue. Codex reread repository requirements/status,
verified Billy's PR~\#26 review and the preserved v1/v2 commits, synchronized
main and created a local recovery-evidence branch. It waited for Actions
workflow 15 to finish before running the two delivery releases sequentially.
No source commit or push was performed by Codex.
Build 5 selected v1 source/configuration \texttt{34f26e6}; build 6 selected v2
\texttt{6bddbfb}. Both passed actual tests, scans, staging deployment and
unchanged reruns. Codex requested a real human approval at each Jenkins input;
Vincent clicked the approvals himself. Codex verified the recorded
\texttt{vsun1} identities and UTC times (03:04:01 and 03:11:18), subsequent
production assertions and SUCCESS results. It copied the four exact generated
selectors unchanged, verified them and preserved full archives, scan hashes,
recaps and timing summaries. V1 total 30 and v2 total 36 were actual pipeline
checks in both environments, not inferred from source alone.
After healthy v1, Codex applied the previously reviewed production probe/panel
using a guarded administrator helper: compare prior probes/panels, validate,
back up, preserve bind inodes, SIGHUP Prometheus and observe Grafana provisioning.
The first dry-run cleanup used Prometheus's non-root service user for a
root-owned temporary file; it was corrected before live application. A legacy
Grafana SQL lookup returned no dashboard row, so it was not treated as proof.
The earlier Grafana tab could not be attached; a fresh tab in the same Chrome
session displayed the actual provisioned panel and data. Live Prometheus
queries confirmed the new probe, prior targets and reload success. Official
Prometheus/Grafana documentation supported the reload/provisioning procedure.
No credentials, allowlists, retention or existing alerts were changed.
Post-release HTTPS captures verified both healthy v2 containers, exact source,
total 36 and invalid-input HTTP 400. The production history contained one
HTTP 502 sample at 03:11:54.602 UTC during v2 replacement, bounded by successful
samples 60 seconds apart. Codex preserved this interruption rather than claiming
zero downtime or an unobserved notification. It prepared the successful records
and staging-only bind-mismatch patch for review, with an intermediate bad commit
and immediate revert so final main remains correct. Both recovery executions
still require those reviewed commits and measured evidence. Codex updated
current inventory, architecture, runbooks, history and this record, then rebuilt
and visually checked the ignored local PDF. Existing Billy/Claude records and
historical execution evidence were preserved.
+1 -1
View File
@@ -36,7 +36,7 @@
% Replace these values for each assignment.
\newcommand{\AssignmentTitle}{Secure Delivery and Rollback -- Group}
\newcommand{\AssignmentNumber}{8}
\newcommand{\DocumentVersion}{6.1}
\newcommand{\DocumentVersion}{6.3}
\newcommand{\DocumentStatus}{Draft}
\newcommand{\CourseNumber}{SSW 590}
\newcommand{\CourseName}{DevOps}
+2
View File
@@ -12,6 +12,8 @@ link each entry to the changed chapter, table, figure, or controlled artifact.
\multicolumn{4}{l}{\small\itshape Document Update History (continued)}\\
\toprule \textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At}\\ \midrule
\endhead \bottomrule \endlastfoot
November 15, 2026 / 6.3 & BY, VS, CDX & Recorded PR~\#26's review/merge and successful Jenkins v1/v2 releases 5/6, zero-change reruns, actual vsun1 approvals and identical per-release staging/production digests. Saved the four real selectors for review. Applied the reviewed production probe/panel after healthy v1, verified live targets/Grafana and preserved one HTTP 502 sample during v2 replacement. Updated both-app inventory and architecture; prepared a staging-only fault patch and reviewed-history/revert procedure for the still-pending recovery exercises. Passwords hints and access scopes are unchanged. & \ChapterRef{SecureDelivery}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\
November 15, 2026 / 6.2 & VS, CDX & Verified PR~\#25's review/merge and ran pricing build 4: scans/publication and initial staging checks passed; the unchanged rerun blocked at the three-second Docker health deadline. Tested ten seconds under identical limits in an isolated temporary container: eight checks passed, then the container was removed. Prepared the health correction and separate v2 source/test change for one review preserving both commits. Updated staging inventory, diagram and actual evidence; Passwords hints are unchanged. No production approval or completed release is claimed. & \ChapterRef{SecureDelivery}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\
November 15, 2026 / 6.1 & VS, CDX & Verified Billy's latest review and Vincent's merge of PR~\#24; enabled delivery and recorded real blocked-test/secret runs and the first scanned, published v1 image. Preserved the staging SSH failure before any app change. Set Ansible to avoid PTY allocation and verified its credential-bound connection/sudo path in preflight build 3; the correction awaits review/merge before a release retry. Updated current evidence and retained the incomplete-submission status. Hosts and Passwords tables are unchanged: no service, account, credential or permission was added. & \ChapterRef{SecureDelivery}, \ChapterRef{AIPromptLog}\\
November 15, 2026 / 6.0 DNS and TLS readiness & BY, VS, CDX & Billy added staging/app DNS. Codex validated and gracefully applied the prepared Caddy routes, preserving prior services and storage; verified public DNS, trusted TLS and HTTP redirects. Recorded expected 502 responses while app backends remain undeployed. Updated current DNS/HTTPS inventory and the verified vsun1 Gitea administrator role. No passwords, permissions or releases changed. & \ChapterRef{SecureDelivery}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\
November 14, 2026 / 6.0 Actions runner migration & VS, CDX & Moved the existing manual runner and compiler image to The-Ocean without re-registration. Corrected an initial low-memory failure, verified reviewed-main run 12 attempt 3, artifact checksum/title and idle restart. Added daemon/job caps, admission checks and fallback guards; updated current host/credential hints and retained October evidence. Both active runners now use the droplet. & \ChapterRef{AutomatedManualBuild}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\
+22 -6
View File
@@ -26,7 +26,13 @@ The-Ocean to avoid campus SSH restrictions. Vincent then requested migrating
the original Actions runner too; both laptop daemons are now stopped, with
their protected fallback state retained. On November 15 Billy added the pricing
DNS records and Codex enabled Caddy HTTPS; certificates and redirects passed,
while the undeployed application backends return 502.
while the undeployed application backends returned 502. Later that evening
(November 16 UTC), build 4 deployed staging v1 and verified its HTTPS identity
and price; its unchanged rerun stopped on a Docker health timeout. Production
was still absent at that point. The subsequent reviewed builds 5 and 6 promoted
both versions with Vincent's approvals; staging and production are now v2.
Their unchanged reruns passed. The production probe and Grafana panel were
added after healthy production. No credential or permission changed during these runs.
\section{Hosts}
\small
@@ -50,8 +56,8 @@ Private WebSocket to Jenkins and SSH through Docker host gateway with pinned
public-IP host-key alias. Docker socket control grants host administration.
Named identity/workspace and BuildKit cache volumes stay outside Git;
configuration under \path{/opt/ssw590-delivery-agent/}; restart unless stopped.
Prerequisite build 2 and bounded build/scan/smoke trial passed; campus browser
rehearsal and assessed delivery remain pending.\\
Prerequisite builds 2/3 and preparation trials passed; pricing builds 5/6
completed both promotions. Campus rehearsal and both recovery exercises remain pending.\\
Environment & Course production (team use)\\
Provider & DigitalOcean, NYC1; Ubuntu 24.04 LTS; 1 vCPU; resized from
512\,MB to 1\,GiB in October, then to 2\,GiB on November 14, 2026
@@ -73,6 +79,13 @@ each; Blackbox runs as \texttt{nobody}) on network \texttt{monitoring\_monitorin
\texttt{gitea\_probe} (172.30.90.0/28); volumes
\texttt{monitoring\_prometheus\_data} (7\,d / 500\,MB) and
\texttt{monitoring\_grafana\_data}\\
Pricing applications & Separate Compose projects/aliases
\texttt{pricing-staging} and \texttt{pricing-production}, currently v2 on private
port 8000. Each: 64/96 MiB RAM/RAM+swap, 0.25 CPU, 64 PIDs, UID 10001,
read-only root, 16 MiB /tmp, ten-second overall health deadline and no host
port or app data volume. Separate configuration/release directories:
\texttt{/opt/startup/pricing-\{staging,production\}}.
Both versions passed promotion and unchanged staging reruns.\\
Exposed ports & 443/TCP and 80/TCP to all; 22/TCP to approved team addresses only
(Cloud Firewall \texttt{gitea-fw}); \texttt{ci.yebilly.me} and
\texttt{metrics.yebilly.me} answer only Stevens 155.246.0.0/16 and team
@@ -81,8 +94,8 @@ otherwise; monitoring ports 9090, 9100, 9115 not reachable\\
Owner & BY (server administration); VS (review)\\
HTTPS URLs & \url{https://git.yebilly.me}, \url{https://ci.yebilly.me/login},
\url{https://metrics.yebilly.me/login}; \url{https://staging.yebilly.me} and
\url{https://app.yebilly.me} have trusted certificates but return 502 until
application deployment\\
\url{https://app.yebilly.me} have trusted certificates. Both were verified
as healthy v2, source \texttt{6bddbfb}, total 36, with invalid input HTTP 400\\
Backup status & No scheduled backup job; manual Gitea SQLite and Jenkins-home
backups saved in a protected root directory before the November 14 delivery
bootstrap. Container-replacement persistence verified for
@@ -91,7 +104,10 @@ Gitea (\ChapterRef{GiteaFoundation}), restart persistence for Jenkins
(\ChapterRef{SREMonitoring}); manual volume backup procedure in
\texttt{monitoring/README.md}\\
Monitoring status & Prometheus and Grafana: host CPU, memory, root disk, and
HTTPS probes of Gitea and Jenkins every 30\,s; alerts \emph{HTTPS service
HTTPS probes of Gitea, Jenkins and pricing production every 30\,s; Grafana
retains seven earlier panels plus pricing availability. One production HTTP 502
sample was recorded during v2 replacement (\ChapterRef{SecureDelivery}); no
zero-downtime or app alert-notification claim is made. Existing alerts \emph{HTTPS service
down}, \emph{Root disk space low}, and \emph{Monitoring target down} to Discord \texttt{\#devops-alerts}.
Shares the droplet's failure domain; no external check yet (issue~\#20)\\
\end{tabularx}
+201 -39
View File
@@ -8,18 +8,20 @@ Startup Pricing Service and the existing Gitea, Jenkins, Caddy and monitoring
foundation. The Canvas page lists November 13, 2026 at 11:59pm; Vincent reports
an extension. Preparation began November 14; DNS/TLS and the first reviewed
Jenkins gate runs were verified November 15. PR~\#24 is merged, the delivery
job is enabled, and the first reviewed v1 image is published. Its staging
deployment stopped at SSH before creating an application container.
\textbf{It is not ready for submission.} Successful v1/v2 staging and production,
production rollback, staging failure/recovery and monitoring correlation remain
pending. Published image metadata is not evidence of a successful deployment.
job is enabled, and reviewed Jenkins builds 5 and 6 successfully promoted v1
and v2 through staging and production using exact digests. Both unchanged
staging reruns passed with zero changes, and Vincent approved each production
operation in Jenkins. Production monitoring is live. The actual successful
records are prepared for review before the two recovery exercises.
\textbf{It is not ready for submission.} Healthy production rollback, deliberate
staging failure/recovery and their measured timelines remain pending.
The instructor's v1 source and tests were copied from
\path{Examples/dosSecureDelivery/v1/} to \path{delivery/app/}. Flask validates
requests and calculates the price; Gunicorn serves it with one worker on private
port 8000. There is no payment processing, customer data or application volume.
For three units v1 returns USD 30; the separate v2 source/test change must return
USD 36. The image embeds its actual source commit during the build. Health,
For three units v1 returns USD 30; the separate reviewed v2 release returns
USD 36. Both were verified in staging and production. The image embeds its actual source commit during the build. Health,
identity and pricing are verified separately.
\section{Deployment and Trust Boundaries}
@@ -41,8 +43,8 @@ identity and pricing are verified separately.
\node[box] (host) at (9.6,0) {The-Ocean host\\\texttt{deploy} SSH account\\Python, Docker/Compose};
\node[box] (monitor) at (0,-2.8) {Prometheus, Grafana,\\Blackbox and Node Exporter\\Private metrics ports};
\node[box] (proxy) at (4.8,-2.8) {Caddy TLS proxy\\Public 80/443\\Private \texttt{gitea\_web} network};
\node[planned] (stage) at (9.6,-2.8) {Planned staging app\\\texttt{staging.yebilly.me}\\{\scriptsize\texttt{pricing-staging:8000}}};
\node[planned] (prod) at (9.6,-5.2) {Production app (planned)\\\texttt{app.yebilly.me}\\{\scriptsize\texttt{pricing-production:8000}}};
\node[box] (stage) at (9.6,-2.8) {Staging v2\\\texttt{staging.yebilly.me}\\{\scriptsize\texttt{pricing-staging:8000}}};
\node[box] (prod) at (9.6,-5.2) {Production v2\\\texttt{app.yebilly.me}\\{\scriptsize\texttt{pricing-production:8000}}};
\node[data,text width=12.9cm,align=left] (storage) at (4.8,-8.45) {
\textbf{Persistent state and read-only mounts on The-Ocean}\\[3pt]
\begin{tabular}{@{}ll@{}}
@@ -54,7 +56,7 @@ Prometheus & \texttt{monitoring\_prometheus\_data} $\rightarrow$ \texttt{/promet
Grafana & \texttt{monitoring\_grafana\_data} $\rightarrow$ \texttt{/var/lib/grafana}\\
Proxy bind mount & \texttt{/root/gitea/Caddyfile} $\rightarrow$ \texttt{/etc/caddy/Caddyfile} (ro)\\
Monitoring mounts & \texttt{/root/monitoring/}: configuration (ro); host \texttt{/} $\rightarrow$ \texttt{/host} (ro)\\
Planned app config & \texttt{/opt/startup/pricing-\{staging,production\}}; no app data volume
App configuration & \texttt{/opt/startup/pricing-\{staging,production\}}; no app data volume
\end{tabular}};
\node[draw,dashed,rounded corners,fit=(agent)(local)(builder)(git)(host)(monitor)(prod)(storage),
inner sep=0.55cm,label={[font=\small]below:Existing droplet: 1 vCPU, 2 GiB RAM, 25 GB plan disk}] {};
@@ -64,14 +66,14 @@ Planned app config & \texttt{/opt/startup/pricing-\{staging,production\}}; no ap
\draw[flow] (agent.south west)--node[note,above,sloped]{Git / OCI}(git.north east);
\draw[flow] (agent.south east)--node[note,above,sloped]{SSH}(host.north west);
\draw[flow] (git)--node[note,above]{hook}(jenkins);
\draw[flow,dashed] (host)--node[note,right]{apply}(stage);
\draw[flow,dashed] (host.east)--++(0.35,0)|-(prod.east);
\draw[flow,dashed] (monitor)--node[note,above]{probe}(proxy);
\draw[flow,dashed] (proxy)--node[note,above]{HTTP}(stage);
\draw[flow,dashed] (proxy.south east)--node[note,above,sloped]{HTTP}(prod.north west);
\draw[flow] (host)--node[note,right]{apply}(stage);
\draw[flow] (host.east)--++(0.35,0)|-(prod.east);
\draw[flow] (monitor)--node[note,above]{probe}(proxy);
\draw[flow] (proxy)--node[note,above]{HTTP}(stage);
\draw[flow] (proxy.south east)--node[note,above,sloped]{HTTP}(prod.north west);
\end{tikzpicture}}
\caption{Preparation architecture. Solid boxes are installed; dashed blue boxes
and connections are planned application work. Gray boxes identify durable state
\caption{Current architecture after both releases: staging and production v2
are installed, and the production health probe is live. Gray boxes identify durable state
or read-only mounts. Pricing is stateless; each environment retains only its
Compose and release files on the host. The agent and builder now share the
droplet; deployment SSH uses Docker's host gateway with the original pinned
@@ -217,10 +219,10 @@ timing and makes a nonzero changed count on the unchanged rerun a blocking error
\small
\begin{tabularx}{\linewidth}{L{2.1cm}Y Y}
\toprule Traceability field & v1 & v2\\\midrule
Source / config commits & Reviewed merge \texttt{09731ac}; SSH fix awaits review & Separate change pending\\
Registry digest / Jenkins release build & Published in build 3; full digest below & Not published / not run\\
Staging + unchanged rerun & SSH blocked before deployment; rerun not reached & Pending\\
Production approval / result & No approval or promotion yet & No approval or promotion yet\\
Source / config commits & Reviewed \texttt{34f26e6} & Reviewed \texttt{6bddbfb}\\
Registry digest / Jenkins release build & Exact digest; build 5 SUCCESS & Exact digest; build 6 SUCCESS\\
Staging + unchanged rerun & Passed; changed=0 on rerun & Passed; changed=0 on rerun\\
Production approval / result & \texttt{vsun1}; total 30 verified & \texttt{vsun1}; total 36 verified\\
Recovery evidence & Healthy rollback pending & Staging failure/recovery pending\\
\bottomrule
\end{tabularx}
@@ -249,6 +251,7 @@ HIGH/CRITICAL findings. The image was published and pulled back by exact digest.
\end{itemize}
Build 3 recorded these exact source/configuration and image identifiers:
\par\noindent\begin{minipage}{\linewidth}
\begin{Verbatim}[fontsize=\footnotesize,frame=single]
Source/configuration:
09731acb0370566471dd4e401e59bafe55e927dc
@@ -256,6 +259,7 @@ Image repository: git.yebilly.me/ssw590-group1/pricing
Registry digest:
sha256:cccd47f112f839f3443c88c4d16fd7a1ed0fec2100a26464156526d53ccc2695
\end{Verbatim}
\end{minipage}\par\smallskip
Staging failed at 22:26:39 UTC during Gathering Facts:
\texttt{PTY allocation request failed on channel 0}. The recap was
\texttt{ok=0 changed=0 unreachable=1 failed=0}, Ansible exit code 4. No app
@@ -272,8 +276,8 @@ exercises Ansible's actual connection/become path as well as plain SSH.
passed in 17 seconds at 22:50 UTC: Ansible ran \texttt{id -u} as root and
returned 0 without a terminal. Its \texttt{CHANGED} label describes the command
module's default reporting, not a pricing deployment or idempotence test.
This validates connection prerequisites only; the corrected configuration must
be reviewed and merged before the assessed release is retried.
This validated connection prerequisites only. Billy subsequently approved
PR~\#25 and Vincent merged it before pricing build 4, recorded below.
\begin{figure}[htbp]
\centering
@@ -295,15 +299,170 @@ Jenkins archives the complete reports. The ignored local evidence directory is:
\path{build/evidence/assignment8-execution/}
\end{quote}
\section{Staging Rerun and Health Deadline}
On November 16 at 01:46:19 UTC (November 15 Eastern), Billy approved PR~\#25;
Vincent merged it at 01:51:04 as \texttt{a19fab3}.
\href{https://ci.yebilly.me/job/secure-delivery/job/pricing/4/}{Pricing build 4}
ran from that reviewed source/configuration and took 198.101 seconds. Tests,
source/dependency gates and both image gates passed. Its exact identifiers are:
\par\noindent\begin{minipage}{\linewidth}
\begin{Verbatim}[fontsize=\footnotesize,frame=single]
Source/configuration:
a19fab34e39420811e73f91fcfbb82ee598bd74a
Image repository: git.yebilly.me/ssw590-group1/pricing
Registry digest:
sha256:63e2e3d49a5119b1064868b0b15b39a1719a60a632ff0ecdc3f676fcdc55de3b
\end{Verbatim}
\end{minipage}\par\smallskip
Initial staging deployment ran 02:01:48.628--02:02:58.341 UTC (69.713 seconds).
All health, version, source-SHA and quantity=3 total=30 checks passed:
\texttt{ok=10 changed=4 unreachable=0 failed=0}. The unchanged rerun ran
02:03:01.314--02:03:25.201 UTC (23.887 seconds) and stopped at Compose health:
\texttt{ok=4 changed=0 unreachable=0 failed=1}. Zero changes with a failed task
is not a passed idempotence gate. Production approval/deployment were skipped.
Docker reported \texttt{Health check exceeded timeout (3s)}. Completed probes
were near the same deadline. Gunicorn remained running, no OOM kill was
recorded, and staging later became healthy without a restart. A sampled
48.56 MiB usage was below the 64 MiB cap; memory-limit events occurred without
OOM events. This supports a deadline problem under the 0.25 CPU constraint,
not a general explanation for every possible health failure.
At 02:06:37--02:08:24 UTC, an isolated diagnostic ran the same reviewed v1 image
with identical UID, resource and filesystem restrictions, no Docker network,
no published port or proxy alias, and a ten-second overall health timeout.
The HTTP request retained its two-second timeout. Eight consecutive checks
passed in 2.817--5.660 seconds; CPU throttling was observed, with no memory-limit
or OOM events in the diagnostic container. Its exact newly created container ID
was removed in a finally block. Existing staging and shared services were
unchanged. The script and raw JSON are versioned beside the dated build-4
evidence under \path{delivery/evidence/}. This is a prerequisite experiment,
not a production release or a substitute for the unchanged-rerun gate.
The Dockerfile correction changes only the overall health timeout from three
to ten seconds. Endpoint, HTTP timeout, cadence, retries, startup period and
all resource/security limits remain unchanged. The branch also prepares v2
(version v2, unit price 12, total 36); three local functional tests and twelve
control tests passed. The local Windows functional environment used Flask 3.1.3
and Werkzeug 3.1.8; assessed Jenkins deployment remains locked to Werkzeug
3.1.9. At that preparation point neither candidate had been released; the
following section records their subsequent assessed Jenkins runs.
Vincent kept the v1 health fix and v2 app/tests in separate commits within
PR~\#26. Billy reviewed both; the merge preserved their SHAs for explicit
Jenkins selection. Each then passed the full release path and its own real
human approval. The actual successful selectors now await review before recovery.
\section{Successful v1 and v2 Releases}
Billy approved PR~\#26 at 02:56:00 UTC on November 16 (November 15 Eastern).
Vincent merged it at 02:57:42 as \texttt{231d115}, preserving both source commits.
Actions manual workflow 15 passed in 2m7s before delivery began. The dedicated
job first loads the reviewed main pipeline, then checks out the selected
reviewed source ancestor; its selected source can therefore differ from the
initial SCM-head metadata shown by Jenkins.
\small
\begin{tabularx}{\linewidth}{L{3.3cm}Y Y}
\toprule Actual result (UTC) & v1 & v2\\\midrule
Jenkins release & \href{https://ci.yebilly.me/job/secure-delivery/job/pricing/5/}{Build 5 SUCCESS} & \href{https://ci.yebilly.me/job/secure-delivery/job/pricing/6/}{Build 6 SUCCESS}\\
Full run including approval wait & 03:00:10--03:05:08; 297.214 s & 03:05:33--03:12:29; 415.707 s\\
Initial staging & 59.160 s; ok=10, changed=3, failed=0 & 60.106 s; ok=10, changed=3, failed=0\\
Unchanged staging rerun & 41.499 s; changed=0, failed=0 & 45.487 s; changed=0, failed=0\\
Actual approver / UTC & \texttt{vsun1}, 03:04:01 & \texttt{vsun1}, 03:11:18\\
Production deployment & 03:04:05--03:05:05; 60.403 s & 03:11:21--03:12:28; 66.234 s\\
Quantity 3 in each environment & USD 30 & USD 36\\
\bottomrule
\end{tabularx}
\normalsize
Each run passed twelve control tests and three Flask tests. Source-secret
reports had zero findings, all nine locked dependency audits had zero
advisories, and both pre-push and registry-digest image gates analyzed two
targets with zero HIGH/CRITICAL findings. No exception was added. Each
source-SHA image was built once, pushed/pulled and promoted by the same digest
through both environments. HTTPS health, version, exact baked source and price
assertions passed in production as well as staging.
The common image repository is \path{git.yebilly.me/ssw590-group1/pricing}.
These are the exact selected source/configuration commits and registry digests:
\par\noindent\begin{minipage}{\linewidth}
\begin{Verbatim}[fontsize=\footnotesize,frame=single]
v1 source/configuration:
34f26e6948b7001ede8ca19f23b67a02082e6a9a
v1 registry digest:
sha256:59c880b2704f91668618d9a2ff0bc8fbab0af4239ceb916de261863890ef88d8
\end{Verbatim}
\end{minipage}\par\smallskip
\noindent\begin{minipage}{\linewidth}
\begin{Verbatim}[fontsize=\footnotesize,frame=single]
v2 source/configuration:
6bddbfba5a36e0e397537678ffb197e101fb0670
v2 registry digest:
sha256:efe8658a0adf0854038d58199652030cbd0ef70047a1c6ebc7b09906cf1ec88b
\end{Verbatim}
\end{minipage}\par\smallskip
The four JSON files under \path{delivery/releases/} are copied unchanged from
these successful builds and pass the strict selector validation. They still
need review/commit before recovery; earlier failed-attempt records were not
substituted. Jenkins archives the full tests, scans, recaps and actual approval
records. Dated human-readable and machine-readable evidence under
\path{delivery/evidence/} preserves their timestamps, results and scan-report
hashes. Full local archives remain in the ignored execution evidence directory.
\section{Live Production Monitoring and Observed Interruption}
Only after healthy v1 production, at 03:08:11 UTC, the previously reviewed
production health target and panel 8 were applied. The guarded helper checked
public production health and the earlier configurations, validated with the
installed promtool, saved protected backups, preserved bind-mounted inodes and
reloaded Prometheus with SIGHUP. Grafana provisioned the dashboard change.
Earlier probes/panels, volumes, retention, credentials and alert rules were
preserved. The backup and applied hashes are recorded in the versioned evidence.
\href{https://prometheus.io/docs/prometheus/latest/configuration/configuration/}{Prometheus documents runtime SIGHUP reload};
\href{https://grafana.com/docs/grafana/latest/administration/provisioning/}{Grafana documents file provisioning}.
Runtime verification was performed separately from syntax validation.
At 03:14:11 UTC all six scrape targets were up, all three HTTPS probes
(Gitea, Jenkins and production) had value 1, and the reload-success metric was
1. The actual Grafana UI displayed the new panel and production series while
retaining its previous seven panels. At 03:28:08 both app containers were
healthy v2 with the exact selected source; identity, health and total 36
returned HTTP 200, and quantity 0 returned HTTP 400. Neither app had an OOM
or memory-limit event in that captured container state.
The production history contained 40 samples and one HTTP 502 / \texttt{probe\_success=0}
at \textbf{03:11:54.602 UTC}, inside v2's 03:11:21.802--03:12:28.037
production deployment window. Its adjacent successful samples were
03:11:24.602 and 03:12:24.602. This is evidence of an interruption during
single-host Compose replacement, not a zero-downtime release. One failed
30-second-cadence sample does not establish an exact 30-second outage; the
two bounding successes were 60 seconds apart. The observed interval is shorter
than the existing one-minute alert duration. No alert firing or notification
is claimed without separate evidence. A blue/green cutover after replacement
health would reduce this risk but is not implemented here.
\begin{figure}[htbp]
\centering
\renewcommand{\theHfigure}{delivery.monitor.\arabic{figure}}
\includegraphics[width=\linewidth,trim=320bp 0bp 0bp 0bp,clip]{images/assignment8-production-monitoring-20261115.jpg}
\caption{Actual Grafana production panel after activation. The visible dip
correlates with v2 replacement; exact UTC samples and HTTP 502 are retained
in the dated runtime JSON. The display uses Eastern time.}
\label{Figure:DeliveryProductionMonitoring}
\end{figure}
\section{Release, Recovery and Monitoring Runbooks}
The versioned \path{delivery/RUNBOOKS.md} gives the executable sequence.
Vincent handles commits/pushes; Billy reviews repository changes. The v1
preparation is now on main, DNS/TLS are ready, and the two deliberate gate
demonstrations have run. Review/merge the noninteractive SSH correction, then
retry \texttt{release} using the corrected full main commit.
Verify staging and changed=0 before a real human approval promotes v1. Save and
review its generated staging/production records. Apply the supplied v2 source
and test changes in another reviewed commit and repeat, expecting 36.
demonstrations and both reviewed releases have run. The four successful release
records must now be reviewed/committed before recovery. The patch in
\path{delivery/exercises/} defines a staging-only port mismatch. Preserve a
reviewed intermediate bad-configuration commit followed by its immediate revert;
the final main template remains correct. Billy must review all three commits
(records, fault, restoration), and a merge commit must preserve the bad SHA.
Only the explicit staging-failure job selects that historical configuration.
For healthy production rollback, record detection/decision time, start the
HTTPS observer, select the committed v1 production record and approve the
@@ -321,10 +480,10 @@ before production. Restore/review the correct template and rerun
total 36 and changed=0. Do not alter shared infrastructure or data to create
the failure.
The production \texttt{/health} probe and Grafana availability panel are prepared
in Git but not deployed while production is absent. Apply them after health is
verified, keeping existing Gitea/Jenkins probes and host metrics. Correlate real
Prometheus/Grafana samples with release/rollback times; 30-second scrapes and
The production \texttt{/health} probe and Grafana availability panel are now
live, as verified above. Future changes must preserve the existing Gitea/Jenkins
probes and host metrics. Correlate actual Prometheus/Grafana samples with the
remaining rollback and recovery times; 30-second scrapes and
alert durations can miss a brief interruption. Uptime probes do not verify
pricing. The observer in \path{delivery/ci/observe.py} records finer HTTPS
samples without treating an intended failure as an observer-script failure.
@@ -342,18 +501,21 @@ with no AAAA answer. Codex validated the prepared Caddy additions, saved the
previous configuration and gracefully reloaded it while preserving the earlier
routes, allowlists, volumes and bind-mounted inode. Normal curl and Python TLS
checks confirmed trusted hostname-matching certificates, TLS 1.3 and HTTP 308
redirects. HTTPS currently returns 502 because the pricing backends have not
been deployed; this is not evidence of application health. Certificate and DNS
redirects. Initially both backends returned 502. Build 4 subsequently deployed
staging v1, whose first HTTPS checks passed before the health rerun blocked.
The later reviewed builds 5 and 6 completed promotion, and both environments
were verified as healthy v2. Certificate and DNS
details are recorded in \path{delivery/evidence/https-20261115.md}. Existing
Gitea/Jenkins/Grafana checks still passed. The public application port is HTTPS
443, with internal port 8000 remaining private. Distinct DNS hostnames satisfy
the planned routing boundary; successful application deployment remains outstanding.
the routing boundary; rollback and staging recovery remain outstanding.
PR~\#24 now includes the runner migration and HTTPS changes and is merged.
Issue creation, review/merge of the SSH correction, successful v1/v2 releases, production approvals,
both recovery demonstrations, final traceability and monitoring evidence, and
the final submission review remain outstanding. Local checks are not a
replacement for those executions.
The health correction, v2, both promotions and their human approvals are
complete. Issue creation if still absent, review/merge of the successful records
and preserved staging-only fault, both recovery demonstrations and their
measured monitoring correlation, and final submission review remain outstanding.
The diagnostic trials are not substitutes for the two remaining executions.
After grading, only when instructed, retain required evidence and remove only
the two pricing projects, their routes, monitoring additions and test DNS.
Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB