Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
231d11528a | ||
|
|
6bddbfba5a | ||
|
|
34f26e6948 | ||
|
|
a19fab34e3 | ||
|
|
5b703edc79 | ||
|
|
09731acb03 |
+14
-1
@@ -1,4 +1,17 @@
|
||||
# Preparation evidence — not completed release evidence
|
||||
# Assignment 8 evidence
|
||||
|
||||
## Reviewed Jenkins execution, 15 November 2026
|
||||
|
||||
PRs 24 and 25 are merged. The actual [test/secret gate demonstrations](evidence/gates-20261115.md)
|
||||
blocked as intended. [Release attempt 3](evidence/release-attempt-3-20261115.md)
|
||||
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.
|
||||
That correction and the separate v2 source/test change await review. No passed
|
||||
idempotence gate, production approval, promotion or recovery is claimed.
|
||||
|
||||
## Preparation evidence — historical baseline
|
||||
|
||||
All timestamps below are UTC on 14 November 2026. No assessed application
|
||||
release, image publication, production approval or rollback has occurred yet.
|
||||
|
||||
+20
-24
@@ -1,27 +1,23 @@
|
||||
# Prepare secure delivery and rollback for Assignment 8
|
||||
# Fix constrained health checks and add pricing v2
|
||||
|
||||
The existing CI checks code but does not publish or promote an application.
|
||||
Add the instructor's pricing service with locked inputs and a trusted-agent
|
||||
pipeline for security gates, digest-based staging/production deployment,
|
||||
unchanged Ansible reruns, recorded human approval and recovery operations.
|
||||
Keep the earlier PR job separate from folder-scoped deployment credentials.
|
||||
Pricing build 4 passed tests/scans and deployed v1 staging with correct HTTPS,
|
||||
source identity and total 30. Its unchanged rerun stopped because Docker's
|
||||
three-second health deadline was too short for Python startup under the
|
||||
0.25 CPU cap. Keep the two-second HTTP timeout and all security/resource limits;
|
||||
extend only Docker's overall health timeout to ten seconds.
|
||||
|
||||
Include the reproducible agent/bootstrap, scan policy, runbooks, actual
|
||||
prerequisite evidence and a clearly marked preparation chapter. Billy's DNS
|
||||
records and Caddy HTTPS routes are now verified; app requests return 502 until
|
||||
the backends are deployed. Monitoring additions await healthy production.
|
||||
The release job is configured but disabled until reviewed source
|
||||
reaches main. Assessed v1/v2 promotions and both recovery exercises remain
|
||||
pending and will require separate reviewed changes and execution evidence.
|
||||
An isolated trial of the same reviewed image passed eight consecutive checks
|
||||
in 2.817–5.660 seconds under identical limits. The temporary container had no
|
||||
network, published port or proxy alias and was removed afterward. Preserve the
|
||||
actual failed gate and diagnostic evidence; no production approval is claimed.
|
||||
|
||||
Validation: two existing tests, three Flask tests, twelve control tests;
|
||||
controlled test/secret blocks; passing source/dependency and runtime-image
|
||||
gates; Ansible syntax, agent Compose and installed Jenkins parser checks;
|
||||
successful prerequisite builds 1 (laptop) and 2 (Droplet), including pinned
|
||||
deployment SSH and noninteractive sudo. The agent now runs on the existing
|
||||
2 GiB Droplet to avoid campus SSH restrictions, with separate agent/builder
|
||||
resource caps and a passing bounded build/scan/smoke trial. Shared-host Docker
|
||||
administration is documented. The original Gitea Actions runner also moved to
|
||||
the Droplet with its existing identity, separate daemon/job caps and a passing
|
||||
reviewed-main run 12 rerun (attempt 3); the initial low-memory attempt is retained.
|
||||
No production approval or completed release is claimed.
|
||||
Also prepare the required v2 source/tests: version v2, unit price 12, total 36.
|
||||
Keep two commits: first the health fix with v1 source, then the v2 app/test
|
||||
change. Review both and merge with a merge commit, preserving both SHAs.
|
||||
Jenkins will release the first commit as v1, then the second as v2, each with
|
||||
staging/idempotence checks and separate human production approval. Recovery
|
||||
records will be saved from actual successful builds and reviewed afterward.
|
||||
|
||||
Validation: eight constrained diagnostic probes passed; three local functional
|
||||
tests and twelve control tests passed. Local functional tests used Flask 3.1.3
|
||||
and Werkzeug 3.1.8; assessed Jenkins runs retain the exact 3.1.9 dependency lock.
|
||||
|
||||
+28
-15
@@ -1,20 +1,31 @@
|
||||
# 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.
|
||||
|
||||
`app/` contains the Flask/Gunicorn service, nine exact direct/transitive
|
||||
dependencies, and a pinned Python 3.13 Alpine base digest for Linux/amd64.
|
||||
The inventory selects The-Ocean's dedicated deploy account. The example
|
||||
release record remains explicitly an example; real registry digests will be
|
||||
generated by Jenkins after the source has been reviewed and merged.
|
||||
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 at a PTY request.
|
||||
PR 25's noninteractive correction is now merged. Build 4 passed initial staging
|
||||
health/identity/price checks, then the unchanged rerun blocked on the three-second
|
||||
Docker health deadline. Eight diagnostic probes passed at ten seconds under the
|
||||
same limits. This health correction and a separate v2 source/test change await
|
||||
review. See [build 4 and the trial](evidence/release-attempt-4-20261115.md).
|
||||
|
||||
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 prepared v2 source/test change returns USD 36 and must be committed
|
||||
separately after the v1 health correction. Review both in one PR and use a
|
||||
merge commit, preserving both SHAs: select the first for v1, then the second
|
||||
for v2. The source commit must be baked into each built image.
|
||||
|
||||
Deployment work uses a dedicated trusted Jenkins agent, immutable images
|
||||
in the existing Gitea registry, and separate Ansible-managed staging and
|
||||
@@ -60,7 +71,7 @@ No campus SSH connection is needed to run a delivery job from the browser.
|
||||
passed using the dedicated deploy key, pinned host key and root sudo. Its
|
||||
non-secret tool inventory is versioned in `evidence/agent-preflight-1.txt`.
|
||||
The `secure-delivery/pricing` job loads `delivery/Jenkinsfile` from protected
|
||||
main and is disabled pending reviewed source. Release credentials are scoped
|
||||
main and was enabled after PR 24 merged. Release credentials are scoped
|
||||
to that Jenkins folder; the PR job does not bind them or the Docker socket.
|
||||
|
||||
The original inventory above is historical. [Remote prerequisite build 2](https://ci.yebilly.me/job/secure-delivery/job/agent-preflight/2/)
|
||||
@@ -94,19 +105,21 @@ See `RUNBOOKS.md`.
|
||||
|
||||
Ansible syntax, agent Compose configuration, and the installed Jenkins
|
||||
controller's declarative parser checks passed. These are preparation checks;
|
||||
**v1/v2 registry releases, promotion and recovery are not yet demonstrated**.
|
||||
**successful v1/v2 deployment, promotion and recovery are not yet demonstrated**.
|
||||
|
||||
## Remaining checkpoints
|
||||
|
||||
Vincent pushed preparation commit `bf28adc` and opened PR #24. The later
|
||||
migration changes are uncommitted and need the same review path. Create the
|
||||
issue and obtain Billy's PR review. Keep main protection. Billy added the A
|
||||
Vincent merged PR #24, including runner migration and HTTPS, after Billy's
|
||||
latest review; PR 25's SSH correction is also merged. Review/merge the health
|
||||
correction and separate v2 commit before retrying v1. Preserve their history
|
||||
with a merge commit. Create the assignment issue if still absent. Keep main protection.
|
||||
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`.
|
||||
Enable the
|
||||
release job after the reviewed source reaches main, then follow `RUNBOOKS.md`.
|
||||
both names have trusted HTTPS and HTTP redirects. Staging v1 now exists and
|
||||
passed its first HTTPS checks; production still returns 502. The original TLS
|
||||
readiness snapshot is `evidence/https-20261115.md`.
|
||||
The release job is enabled; follow `RUNBOOKS.md` after the corrected source reaches main.
|
||||
Keep Jenkins and the remote delivery node available. Production approval requires an authorized
|
||||
human; an agent must not approve unattended.
|
||||
|
||||
|
||||
+18
-2
@@ -4,9 +4,18 @@ These are execution instructions, not completed release evidence.
|
||||
|
||||
Current status, 15 November 2026: 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
|
||||
502 is expected for production while its backend is absent. The one-time HTTPS helper
|
||||
has already run; use the normal validate/reload procedure for later changes.
|
||||
Monitoring additions and assessed releases remain pending.
|
||||
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. PR 25's SSH correction
|
||||
is merged; build 4 passed initial staging checks, but its unchanged rerun was
|
||||
blocked by Docker's three-second health timeout. The ten-second diagnostic
|
||||
passed eight checks under identical limits. Review the health correction and
|
||||
separate v2 source/test change as two commits in one PR; use a merge commit
|
||||
to retain both SHAs. Select the first for v1 and the second for v2. Neither
|
||||
version is approved for production yet.
|
||||
Monitoring additions and successful releases remain pending.
|
||||
|
||||
## Authority and preparation
|
||||
|
||||
@@ -56,6 +65,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
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
[delivery]
|
||||
# The SSH host key must be verified and supplied by the trusted delivery job.
|
||||
startup ansible_host=147.182.178.136 ansible_user=deploy ansible_python_interpreter=/usr/bin/python3
|
||||
|
||||
[delivery:vars]
|
||||
# The dedicated deploy key forbids PTY allocation; sudo is noninteractive.
|
||||
ansible_ssh_use_tty=false
|
||||
|
||||
@@ -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
@@ -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")
|
||||
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,14 @@ docker compose version
|
||||
trivy --version
|
||||
pip-audit --version
|
||||
ssh -i "$DEPLOY_KEY" -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o "UserKnownHostsFile=$DEPLOY_KNOWN_HOSTS" deploy@147.182.178.136 'id; sudo -n true; python3 --version; sudo -n docker --version; sudo -n docker compose version; free -m; nproc; df -h /'
|
||||
# Exercise Ansible's own SSH/become path as well as plain SSH. Its default
|
||||
# PTY request is incompatible with the intentionally restricted deploy key.
|
||||
export ANSIBLE_HOST_KEY_CHECKING=True
|
||||
export ANSIBLE_PRIVATE_KEY_FILE="$DEPLOY_KEY"
|
||||
export ANSIBLE_SSH_ARGS="-o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$DEPLOY_KNOWN_HOSTS"
|
||||
ansible all -i '147.182.178.136,' -u deploy --become \
|
||||
-e '{"ansible_ssh_use_tty":false,"ansible_python_interpreter":"/usr/bin/python3"}' \
|
||||
-m ansible.builtin.command -a 'id -u'
|
||||
} > build/preflight/tools-and-target.txt
|
||||
cat build/preflight/tools-and-target.txt
|
||||
'''
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
Sun Nov 15 22:50:10 UTC 2026
|
||||
uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins),987
|
||||
Python 3.13.5
|
||||
ansible [core 2.21.6]
|
||||
config file = None
|
||||
configured module search path = ['/home/jenkins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
|
||||
ansible python module location = /opt/delivery-tools/lib/python3.13/site-packages/ansible
|
||||
ansible collection location = /opt/ansible-collections
|
||||
executable location = /opt/delivery-tools/bin/ansible
|
||||
python version = 3.13.5 (main, Aug 10 2026, 12:06:59) [GCC 14.2.0] (/opt/delivery-tools/bin/python3)
|
||||
jinja version = 3.1.6
|
||||
pyyaml version = 6.0.3 (with libyaml v0.2.5)
|
||||
|
||||
# /opt/ansible-collections/ansible_collections
|
||||
Collection Version
|
||||
---------------------------------------- -------
|
||||
community.docker 5.4.0
|
||||
community.library_inventory_filtering_v1 1.1.5
|
||||
Docker version 29.9.3, build 5457199
|
||||
Docker Compose version v5.7.1
|
||||
Version: 0.76.2
|
||||
pip-audit 2.10.1
|
||||
uid=1000(deploy) gid=1000(deploy) groups=1000(deploy)
|
||||
Python 3.12.3
|
||||
Docker version 29.9.3, build 5457199
|
||||
Docker Compose version v5.7.1
|
||||
total used free shared buff/cache available
|
||||
Mem: 1967 1239 86 3 817 728
|
||||
Swap: 2047 413 1634
|
||||
1
|
||||
Filesystem Size Used Avail Use% Mounted on
|
||||
/dev/vda1 24G 15G 9.2G 61% /
|
||||
147.182.178.136 | CHANGED | rc=0 >>
|
||||
0
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Assessed Jenkins gate demonstrations — 15 November 2026
|
||||
|
||||
Reviewed source: `09731acb0370566471dd4e401e59bafe55e927dc`, the merge of
|
||||
[PR 24](https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/pulls/24).
|
||||
Billy (`bill`) approved the latest preparation head `ed0a862` at 21:06 UTC;
|
||||
Vincent merged it at 21:59 UTC. The merge-triggered manual workflow
|
||||
[run 13](https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/actions/runs/13)
|
||||
passed in 2m25s before the delivery demonstrations began.
|
||||
|
||||
| Jenkins pricing run | Mode | Actual result |
|
||||
|---|---|---|
|
||||
| [1](https://ci.yebilly.me/job/secure-delivery/job/pricing/1/) | `blocked-test` | FAILURE as intended, 54.202 seconds. Twelve control tests and three normal Flask tests passed; the additional expected-total=-1 assertion failed against the real v1 total 30. All later security, publication, deployment and approval stages were skipped. |
|
||||
| [2](https://ci.yebilly.me/job/secure-delivery/job/pricing/2/) | `blocked-secret` | FAILURE as intended, 31.375 seconds. Twelve control tests and three Flask tests passed. Clean-source scanning and all nine locked dependency audits passed; the generated synthetic-secret fixture was detected, blocking publication, deployment and approval. |
|
||||
|
||||
Run 1 began at 22:11:34.732 UTC. Run 2 began at 22:12:51.073 UTC;
|
||||
its source gate ran from 22:13:14.233 to 22:13:20.115 UTC. The scanner itself
|
||||
returned zero after writing a valid report; the gate wrapper returned one
|
||||
because that report contained a finding. This is expected policy enforcement,
|
||||
not a scanner execution error. The synthetic fixture is nonfunctional and
|
||||
generated only in a temporary directory; captured match/code fields are redacted.
|
||||
|
||||
Jenkins archives the test and gate reports for each run. Exact local copies,
|
||||
selected build metadata and console logs are retained in ignored
|
||||
`build/evidence/assignment8-execution/jenkins-{1,2}/`. These two negative
|
||||
demonstrations do not establish a successful release or production approval.
|
||||
|
||||
The job was enabled only after the merge. A bootstrap MODE choice parameter
|
||||
allowed the first run to select `blocked-test`; the reviewed Jenkinsfile then
|
||||
installed its normal four parameter definitions and retained its approval,
|
||||
timeout, concurrency and ancestry checks. Existing credentials and access
|
||||
permissions were unchanged.
|
||||
@@ -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,55 @@
|
||||
# v1 publication and blocked deployment — 15 November 2026
|
||||
|
||||
[Pricing build 3](https://ci.yebilly.me/job/secure-delivery/job/pricing/3/)
|
||||
ran in `release` mode from reviewed source/configuration commit
|
||||
`09731acb0370566471dd4e401e59bafe55e927dc`. It began at 22:25:23.584 UTC,
|
||||
took 77.799 seconds, and finished FAILURE. This was a published image followed
|
||||
by a connection failure, **not a successful staging or production release**.
|
||||
|
||||
Tests, clean-source scanning and all nine locked dependency audits passed.
|
||||
Both pre-push and registry-digest Trivy image reports analyzed two targets and
|
||||
contained zero HIGH/CRITICAL findings. The agent built the image once, pushed
|
||||
the source-SHA tag, pulled it back and verified this registry reference:
|
||||
|
||||
```text
|
||||
git.yebilly.me/ssw590-group1/pricing@sha256:cccd47f112f839f3443c88c4d16fd7a1ed0fec2100a26464156526d53ccc2695
|
||||
```
|
||||
|
||||
The generated staging/production records were timestamped 22:26:29.144 UTC.
|
||||
Staging deployment began 22:26:33.530 and stopped at 22:26:39.422 UTC
|
||||
(5.892 seconds), before any application configuration or container was created:
|
||||
|
||||
```text
|
||||
TASK [Gathering Facts]
|
||||
Failed to connect to the host via ssh: PTY allocation request failed on channel 0
|
||||
startup : ok=0 changed=0 unreachable=1 failed=0
|
||||
Ansible exit code: 4
|
||||
```
|
||||
|
||||
Jenkins skipped the unchanged rerun and production approval/deployment.
|
||||
The generated records and scans are archived in that build and copied to ignored
|
||||
`build/evidence/assignment8-execution/jenkins-3/`. They are deliberately absent
|
||||
from `delivery/releases/`: neither environment has been verified healthy.
|
||||
|
||||
## Correction and verification
|
||||
|
||||
Ansible's SSH connection plugin defaults to forcing a terminal. The deploy
|
||||
key intentionally forbids PTY allocation. The inventory now selects
|
||||
`ansible_ssh_use_tty=false` for the delivery group, matching that restriction.
|
||||
See the official [Ansible 2.21 SSH connection options](https://docs.ansible.com/projects/ansible-core/2.21/collections/ansible/builtin/ssh_connection.html#parameter-use_tty).
|
||||
Pinned host verification, key restrictions, credentials and sudo policy are unchanged.
|
||||
|
||||
The administrator-only preflight was extended to exercise Ansible's actual
|
||||
SSH/become path using the same bound credentials, rather than plain SSH alone.
|
||||
[Agent preflight build 3](https://ci.yebilly.me/job/secure-delivery/job/agent-preflight/3/)
|
||||
passed in 17 seconds at 22:50 UTC. Its `ansible.builtin.command` invocation
|
||||
of `id -u` returned `0`, proving the noninteractive module and sudo path.
|
||||
The module reports CHANGED by default for a command; this is not a pricing
|
||||
deployment or an unchanged-rerun result. Exact non-secret output is retained in
|
||||
[`agent-preflight-3.txt`](agent-preflight-3.txt).
|
||||
|
||||
The source correction awaits Vincent's commit/push and Billy's review/merge.
|
||||
Retry `release` from the corrected full main SHA; let the pipeline generate
|
||||
fresh records for that reviewed source/configuration. Do not manually change
|
||||
the failed attempt's record to imply a successful deployment or reuse it for
|
||||
rollback. Retain its published image and reports as evidence.
|
||||
@@ -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.
|
||||
@@ -1,9 +1,15 @@
|
||||
This group document records the SSW 590 coursework and its supporting
|
||||
commands, designs, and evidence. Assignment 8 prepares secure delivery with
|
||||
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
|
||||
job passed; reviewed v1/v2 publication, DNS/TLS, promotion, rollback and staging
|
||||
recovery remain pending. This draft is not ready for submission.
|
||||
jobs, DNS/TLS and deliberate Jenkins test/secret blocks passed. The reviewed v1
|
||||
image was published with passing scans. After the noninteractive SSH correction
|
||||
merged, staging passed health, identity and price checks, but its unchanged
|
||||
rerun was blocked by a three-second Docker health deadline. Eight constrained
|
||||
diagnostic probes passed with a ten-second deadline. That correction and the
|
||||
required v2 source/test change await review as separate commits. Complete
|
||||
v1/v2 promotions, approvals, rollback and staging recovery remain pending.
|
||||
This draft is not ready for submission.
|
||||
Assignment 7 introduced site reliability
|
||||
engineering: Prometheus, Grafana OSS, Node Exporter, and Blackbox Exporter
|
||||
run as four pinned containers beside Gitea and Jenkins on the originally 1\,GiB
|
||||
|
||||
@@ -935,3 +935,75 @@ an account, recovering a password-manager copy and resetting an existing login.
|
||||
It updated current readiness records, the preserved DNS handoff, history and
|
||||
this log, then rebuilt and visually checked the local manual. Source changes
|
||||
remain uncommitted; peer review, app releases, approvals and recoveries remain pending.
|
||||
|
||||
\section{Delivery Gates and SSH Correction}
|
||||
Date: November 15, 2026; Tool: OpenAI Codex; Human: Vincent Sun.
|
||||
Vincent reported the merge complete and asked Codex to continue and finish the
|
||||
assignment, then requested continuation after his usage limit reset. Codex read
|
||||
the repository requirements and guide, verified PR~\#24's latest Billy review
|
||||
and merged main \texttt{09731ac}, and synchronized a clean local branch
|
||||
\texttt{codex/assignment8-release-evidence}. Vincent retains commits/pushes;
|
||||
no additional commit or push was authorized or performed.
|
||||
|
||||
After the merge-triggered Actions manual build finished, Codex enabled the
|
||||
reviewed pricing job and initialized a MODE choice parameter for its first
|
||||
negative demonstration. The Jenkinsfile then installed its normal parameters.
|
||||
Pricing builds 1 and 2 actually stopped the wrong-price and synthetic-secret
|
||||
fixtures before publication/deployment. Build 3 passed normal tests and all
|
||||
security gates and published/pulled a real v1 digest, but Ansible's default
|
||||
PTY request conflicted with the deploy key's intentional no-PTY restriction.
|
||||
Gathering Facts was unreachable with zero changes; no app or production
|
||||
approval was reached. Earlier plain-SSH prerequisites had not exercised
|
||||
Ansible's default terminal behavior, so they had missed this integration gap.
|
||||
|
||||
Codex checked the official Ansible 2.21 SSH option documentation, set the
|
||||
inventory's \texttt{ansible\_ssh\_use\_tty=false}, and extended the administrator
|
||||
preflight to bind the existing credentials and run \texttt{id -u} through
|
||||
Ansible/become without a terminal. Preflight build 3 passed and returned 0.
|
||||
The job's read-only command reports CHANGED by module default; this is not an
|
||||
application deployment/idempotence result. No key restriction, host pin,
|
||||
credential scope, review gate or human approval was weakened.
|
||||
|
||||
Codex preserved exact reports and metadata over pinned SSH, wrote dated
|
||||
non-secret evidence and a focused PR description, updated this chapter/history
|
||||
and the incomplete draft status, and rebuilt/reviewed the local PDF. The
|
||||
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.
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
% Replace these values for each assignment.
|
||||
\newcommand{\AssignmentTitle}{Secure Delivery and Rollback -- Group}
|
||||
\newcommand{\AssignmentNumber}{8}
|
||||
\newcommand{\DocumentVersion}{6.0}
|
||||
\newcommand{\DocumentVersion}{6.2}
|
||||
\newcommand{\DocumentStatus}{Draft}
|
||||
\newcommand{\CourseNumber}{SSW 590}
|
||||
\newcommand{\CourseName}{DevOps}
|
||||
|
||||
@@ -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.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}\\
|
||||
November 14, 2026 / 6.0 agent migration & VS, CDX & At Vincent's direction, moved the trusted delivery agent to the existing 2\,GiB droplet to remove campus SSH dependence. Added agent and builder resource caps, private deployment routing with pinned host verification, restart/fallback procedures, preflight build 2 and a passing bounded build/scan/smoke trial. Documented shared-host Docker authority, swap use and the unchanged laptop PDF runner. Updated the architecture, Hosts and hints-only Passwords tables, handoff and AI log; assessed releases and campus browser rehearsal remain pending. & \ChapterRef{SecureDelivery}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\
|
||||
|
||||
@@ -26,7 +26,10 @@ 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
|
||||
is still absent. No credential or permission changed during these runs.
|
||||
|
||||
\section{Hosts}
|
||||
\small
|
||||
@@ -50,8 +53,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; build 4 reached staging
|
||||
but its health rerun blocked. Campus rehearsal and completed promotion 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 +76,11 @@ 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}\\
|
||||
Staging application & Compose project \texttt{pricing-staging}, v1 on private
|
||||
port 8000 with alias \texttt{pricing-staging}; 64/96 MiB RAM/RAM+swap, 0.25 CPU,
|
||||
64 PIDs, UID 10001, read-only root and no published port. Configuration and
|
||||
release metadata in \path{/opt/startup/pricing-staging}; no app data volume.
|
||||
Initial HTTPS assertions passed; unchanged-rerun health gate blocked.\\
|
||||
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 +89,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. Staging v1 passed
|
||||
initial HTTPS checks; production still returns 502 before deployment\\
|
||||
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
|
||||
|
||||
@@ -6,19 +6,22 @@
|
||||
Assignment 8 implements Chapter 6 of instructor manual version 1.43, using its
|
||||
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. This version records preparation begun November 14 and DNS/TLS
|
||||
readiness verified November 15, not a completed release exercise.
|
||||
\textbf{It is not ready for submission.} Reviewed v1/v2
|
||||
publication, promotion, production rollback, staging failure/recovery and
|
||||
monitoring correlation remain pending. No approval, release digest or successful
|
||||
deployment is inferred from a tool installation or local smoke test.
|
||||
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 reviewed v1 images are published. After the SSH correction
|
||||
merged, staging passed its initial HTTPS, identity and price checks. Its
|
||||
unchanged rerun stopped at Docker's health deadline. A bounded timeout
|
||||
diagnostic passed; the correction and v2 source/test change await review.
|
||||
\textbf{It is not ready for submission.} Complete v1/v2 promotion,
|
||||
production rollback, staging failure/recovery and monitoring correlation remain
|
||||
pending. Published image metadata is not evidence of a successful deployment.
|
||||
|
||||
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 prepared separate v2 source/test change
|
||||
returns USD 36 in local tests. It has not been released. The image embeds its actual source commit during the build. Health,
|
||||
identity and pricing are verified separately.
|
||||
|
||||
\section{Deployment and Trust Boundaries}
|
||||
@@ -40,7 +43,7 @@ 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[box] (stage) at (9.6,-2.8) {Staging v1 (gate blocked)\\\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[data,text width=12.9cm,align=left] (storage) at (4.8,-8.45) {
|
||||
\textbf{Persistent state and read-only mounts on The-Ocean}\\[3pt]
|
||||
@@ -53,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
|
||||
Staging app config & \texttt{/opt/startup/pricing-staging}; production pending; 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}] {};
|
||||
@@ -63,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] (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] (proxy)--node[note,above]{HTTP}(stage);
|
||||
\draw[flow,dashed] (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. Solid boxes are installed, including staging;
|
||||
production and its monitoring connection remain planned. 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
|
||||
@@ -113,7 +116,7 @@ Deployment credentials belong to the \texttt{secure-delivery} Jenkins folder,
|
||||
not the root multibranch PR job. That job retains its earlier ordinary tests,
|
||||
plus Python syntax and release-control tests; it does not bind delivery
|
||||
credentials or a Docker socket. The new release job loads
|
||||
\path{delivery/Jenkinsfile} from protected main and is currently disabled.
|
||||
\path{delivery/Jenkinsfile} from protected main and was enabled after PR~\#24 merged.
|
||||
Only trusted reviewed code may use the privileged node. Exclusive scheduling
|
||||
is not a defense against an administrator or an author permitted to select that
|
||||
node; the two-member repository and Jenkins administration remain trust boundaries.
|
||||
@@ -166,7 +169,7 @@ Its baked identity was explicitly \texttt{uncommitted-preflight}, not a release
|
||||
Local scans & Source/dependency gates passed; a generated synthetic secret
|
||||
blocked the gate. At 20:32 UTC the complete runtime-image gate passed with no
|
||||
HIGH/CRITICAL findings. Reports and exit codes remain in ignored local evidence.
|
||||
Assessed Jenkins gate runs and published-image scans remain pending.\\
|
||||
Later assessed Jenkins runs and published-image scans are recorded below.\\
|
||||
\bottomrule
|
||||
\end{longtable}
|
||||
\normalsize
|
||||
@@ -216,20 +219,148 @@ 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 & Pending review and merge & Separate change pending\\
|
||||
Registry digest / Jenkins release build & Not published / not run & Not published / not run\\
|
||||
Staging + unchanged rerun & Pending & Pending\\
|
||||
Source / config commits & Reviewed \texttt{a19fab3}; health fix awaits review & Separate source/test change prepared\\
|
||||
Registry digest / Jenkins release build & Published in builds 3 and 4; identifiers below & Not published / not run\\
|
||||
Staging + unchanged rerun & Build 4: initial deploy passed, rerun blocked & Pending\\
|
||||
Production approval / result & No approval or promotion yet & No approval or promotion yet\\
|
||||
Recovery evidence & Healthy rollback pending & Staging failure/recovery pending\\
|
||||
\bottomrule
|
||||
\end{tabularx}
|
||||
\normalsize
|
||||
|
||||
\section{Reviewed Gate Runs and Deployment Correction}
|
||||
Billy approved the updated PR~\#24 head \texttt{ed0a862} at 21:06 UTC on
|
||||
November 15; Vincent merged it as \texttt{09731ac} at 21:59 UTC. The resulting
|
||||
Actions manual build 13 passed in 2m25s. It finished before the delivery runs.
|
||||
All times in this section are UTC.
|
||||
|
||||
\begin{itemize}
|
||||
\item \href{https://ci.yebilly.me/job/secure-delivery/job/pricing/1/}{Pricing build 1},
|
||||
\texttt{blocked-test}, took 54.202 seconds. Twelve control tests and the three
|
||||
normal Flask tests passed. The deliberate expected-total=$-1$ assertion failed
|
||||
against the actual total 30. Publication, deployment and approval were skipped.
|
||||
\item \href{https://ci.yebilly.me/job/secure-delivery/job/pricing/2/}{Pricing build 2},
|
||||
\texttt{blocked-secret}, took 31.375 seconds. Tests, clean-source scanning and
|
||||
all nine locked dependency audits passed. The generated synthetic-secret finding
|
||||
blocked the gate and all publication/deployment stages. Match/code fields in
|
||||
the archived secret report are redacted; no real secret was introduced.
|
||||
\item \href{https://ci.yebilly.me/job/secure-delivery/job/pricing/3/}{Pricing build 3},
|
||||
\texttt{release}, took 77.799 seconds. Tests and source/dependency gates passed.
|
||||
Both pre-push and registry-digest image scans analyzed two targets and found zero
|
||||
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
|
||||
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
|
||||
configuration or container was created, and production approval was not reached.
|
||||
Its generated records are retained as attempt evidence, not known-good recovery
|
||||
selections in \path{delivery/releases/}.
|
||||
|
||||
Ansible defaults to forcing a terminal, but the dedicated deploy key intentionally
|
||||
forbids PTY allocation. The inventory correction sets
|
||||
\texttt{ansible\_ssh\_use\_tty=false}; it preserves the restricted key, pinned
|
||||
host verification and noninteractive sudo. The expanded administrator preflight
|
||||
exercises Ansible's actual connection/become path as well as plain SSH.
|
||||
\href{https://ci.yebilly.me/job/secure-delivery/job/agent-preflight/3/}{Preflight build 3}
|
||||
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 validated connection prerequisites only. Billy subsequently approved
|
||||
PR~\#25 and Vincent merged it before pricing build 4, recorded below.
|
||||
|
||||
\begin{figure}[htbp]
|
||||
\centering
|
||||
\renewcommand{\theHfigure}{delivery.preflight.\arabic{figure}}
|
||||
\includegraphics[width=\linewidth,trim=330bp 880bp 900bp 0bp,clip]{images/assignment8-ansible-preflight-3-20261115.jpg}
|
||||
\caption{Actual successful Jenkins prerequisite build 3 after adding the
|
||||
noninteractive Ansible connection check. No pricing environment was deployed.}
|
||||
\label{Figure:DeliveryAnsiblePreflight}
|
||||
\end{figure}
|
||||
|
||||
Dated records under \path{delivery/evidence/} preserve the results:
|
||||
\begin{itemize}
|
||||
\item \path{gates-20261115.md}: deliberate blocking demonstrations.
|
||||
\item \path{release-attempt-3-20261115.md}: publication and SSH failure.
|
||||
\item \path{agent-preflight-3.txt}: successful noninteractive connection.
|
||||
\end{itemize}
|
||||
Jenkins archives the complete reports. The ignored local evidence directory is:
|
||||
\begin{quote}\small
|
||||
\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. Neither the candidate image nor v2 has been released.
|
||||
|
||||
Keep the v1 health fix and v2 application/test change in separate reviewed
|
||||
commits, which may share one PR. Merge with a merge commit, preserving both
|
||||
SHAs. Select the first commit for v1 and the second for v2. Each must pass the
|
||||
full release path and its own real human approval; save and review actual
|
||||
successful release records before recovery. No commit SHA is invented here.
|
||||
|
||||
\section{Release, Recovery and Monitoring Runbooks}
|
||||
The versioned \path{delivery/RUNBOOKS.md} gives the executable sequence.
|
||||
Vincent handles commits/pushes; Billy reviews repository changes. Once reviewed
|
||||
v1 is on main and DNS/TLS are ready, enable the delivery job, demonstrate
|
||||
\texttt{blocked-test} and \texttt{blocked-secret}, then run \texttt{release}.
|
||||
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. The SSH correction is merged. Review/merge the v1
|
||||
health-timeout fix and separate v2 source/test commit, then retry
|
||||
\texttt{release} with the reviewed v1 commit first.
|
||||
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.
|
||||
@@ -271,16 +402,16 @@ 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;
|
||||
production remains undeployed. 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; reviewed application releases remain outstanding.
|
||||
the planned routing boundary; completed application promotion remains outstanding.
|
||||
|
||||
Vincent pushed preparation commit \texttt{bf28adc}; PR~\#24 exists. The later
|
||||
agent migration and documentation changes remain local and uncommitted.
|
||||
Issue creation, peer review/merge, both assessed releases, production approvals,
|
||||
PR~\#24 now includes the runner migration and HTTPS changes and is merged.
|
||||
Issue creation, review/merge of the health fix and v2, complete 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.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Reference in New Issue
Block a user