Move CI runners to Droplet and enable application HTTPS
vpn-dns-gateway/pipeline/pr-main This commit looks good

This commit is contained in:
2026-11-15 12:49:06 -05:00
parent bf28adc7fb
commit ed0a862657
36 changed files with 1266 additions and 72 deletions
+66 -23
View File
@@ -6,8 +6,9 @@
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 on November 14, not a completed
release exercise. \textbf{It is not ready for submission.} Reviewed v1/v2
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.
@@ -31,8 +32,9 @@ identity and pricing are verified separately.
data/.style={box,draw=devopsGray,fill=gray!12,font=\scriptsize},
planned/.style={box,dashed,fill=devopsLightBlue},
flow/.style={-{Latex},thick}, note/.style={font=\scriptsize,align=center,fill=white,inner sep=1pt}]
\node[box] (agent) at (4.8,2.7) {Vincent's laptop\\Trusted delivery agent\\Docker, scans and Ansible};
\node[data,text width=3.8cm] (local) at (0,2.7) {Local Docker volumes\\\texttt{ssw590-delivery-identity}\\\texttt{ssw590-delivery-workspace}};
\node[box] (agent) at (4.8,2.7) {Droplet delivery agent\\512 MiB / 0.5 CPU\\Docker, scans and Ansible};
\node[data,text width=3.8cm] (local) at (0,2.7) {Agent volumes on droplet\\\texttt{ssw590-delivery-identity}\\\texttt{ssw590-delivery-workspace}};
\node[box] (builder) at (9.6,2.7) {Pinned BuildKit builder\\256 MiB / 0.5 CPU\\Private Docker control};
\node[box] (git) at (0,0) {Gitea + OCI registry\\\texttt{git.yebilly.me}\\SQLite retained};
\node[box] (jenkins) at (4.8,0) {Jenkins controller\\\texttt{ci.yebilly.me}\\Schedules trusted job};
\node[box] (host) at (9.6,0) {The-Ocean host\\\texttt{deploy} SSH account\\Python, Docker/Compose};
@@ -53,10 +55,11 @@ Proxy bind mount & \texttt{/root/gitea/Caddyfile} $\rightarrow$ \texttt{/etc/cad
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
\end{tabular}};
\node[draw,dashed,rounded corners,fit=(git)(host)(monitor)(prod)(storage),
\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}] {};
\draw[flow,dotted] (local)--(agent);
\draw[flow] (agent)--node[note,right,pos=0.25]{HTTPS}(jenkins);
\draw[flow] (agent)--node[note,right,pos=0.25]{private WS}(jenkins);
\draw[flow] (agent)--node[note,above]{build}(builder);
\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);
@@ -69,20 +72,42 @@ Planned app config & \texttt{/opt/startup/pricing-\{staging,production\}}; no ap
\caption{Preparation architecture. Solid boxes are installed; dashed blue boxes
and connections are planned application work. 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 its Docker socket are on
the laptop, outside the droplet.}
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
host-key alias. Browser access remains through Caddy HTTPS.}
\label{Figure:SecureDeliveryArchitecture}
\end{figure}
The exclusive node \texttt{ssw590-vince-delivery} has one executor and label
\texttt{delivery-trusted}. It connects to Jenkins over HTTPS/WebSocket, with no
published agent or Docker API port. Docker socket membership (group 0 in the
Linux VM) grants administrative Docker control. The \texttt{deploy} account's
\texttt{delivery-trusted}. Originally installed on Vincent's laptop, it now runs
on The-Ocean because campus networking blocks SSH from the laptop. Its legacy
node name is retained and its description records the new location. It connects
to \texttt{jenkins:8080} over private HTTP/WebSocket, with no published agent
or Docker API port. Docker socket membership (group 987 on this host) grants
administrative control over the same host as Jenkins, Gitea and monitoring;
containerization is not isolation from malicious Docker-authorized jobs.
The \texttt{deploy} account's
\texttt{NOPASSWD} sudo permits root commands for Ansible; a separate account
does not remove that administrative authority. Its authorized key disables SSH
forwarding and PTY allocation. The host's ED25519 key was read through the
existing strictly pinned administrator SSH connection and stored as a Jenkins
file credential; verification is not disabled.
file credential; verification is not disabled. A mounted SSH configuration
maps the existing inventory address to \texttt{host.docker.internal}, retaining
\texttt{HostKeyAlias 147.182.178.136}. Thus neither the Jenkins-agent connection
nor deployment SSH crosses campus Wi-Fi. Campus browser HTTPS access still
needs rehearsal. The Gitea Actions PDF runner subsequently moved to The-Ocean
too; \ChapterRef{AutomatedManualBuild} records its separate migration and real
workflow verification. Neither active runner now requires Docker Desktop.
Keep manual compilation and delivery releases sequential on the shared host.
The agent is capped at 512 MiB RAM / 768 MiB RAM+swap and 0.5 CPU, with a
96 MiB Java heap. Its separate pinned BuildKit container is capped at 256 MiB /
384 MiB and 0.5 CPU; builds explicitly select that builder because a Docker
socket does not make child containers inherit agent limits. Both use
\texttt{unless-stopped}. Agent restart/reconnect was verified at 03:57:57 UTC.
The laptop copy is stopped and its helper now requires an explicit fallback
switch; two copies must never connect as the same node. VS maintains the agent;
BY retains host administration. No extra instance or plan resize was made.
Deployment credentials belong to the \texttt{secure-delivery} Jenkins folder,
not the root multibranch PR job. That job retains its earlier ordinary tests,
@@ -117,11 +142,23 @@ Werkzeug 3.1.9. No claim is made that a pinned version remains vulnerability-fre
Runtime constraints & UID 10001; one Gunicorn worker; 64 MiB RAM / 96 MiB
RAM+swap; 0.25 CPU; 64 PIDs; read-only root; 16 MiB temporary filesystem;
all capabilities dropped and no host application port.\\
Jenkins prerequisite run &
Initial Jenkins prerequisite run &
\href{https://ci.yebilly.me/job/secure-delivery/job/agent-preflight/1/}{Agent preflight build 1}
passed on November 14 at 20:46 UTC, including strict-key SSH as deploy and
noninteractive sudo. \path{delivery/evidence/agent-preflight-1.txt} preserves
its non-secret inventory. This run did not deploy an application.\\
Remote agent migration &
At 03:47 UTC on November 15 (November 14 Eastern),
\href{https://ci.yebilly.me/job/secure-delivery/job/agent-preflight/2/}{preflight build 2}
passed on The-Ocean with real credentials, pinned host verification and sudo.
\path{delivery/evidence/agent-preflight-2.txt} preserves the inventory.\\
Remote capacity trial & At 03:50--03:51 UTC, a preparation snapshot passed
12 control tests, 3 app tests, source/dependency gates, a limited image build,
the full image gate and a temporary 64 MiB HTTP smoke test. Its source identity
was \texttt{uncommitted-remote-preflight}; nothing was published or promoted.
Observed available RAM exceeded 700 MiB; swap used rose from 263 to 372 MiB.
Agent memory-limit events occurred, but no OOM kill was recorded. This short
trial does not establish full release or presentation performance.\\
Local tests & Three Flask tests passed; a generated wrong-price assertion
failed as intended; twelve release/security-control tests passed. Gunicorn
health/identity/price/invalid-input smoke checks passed under the stated cap.
@@ -228,16 +265,22 @@ during migration and delays destructive changes until rollback is no longer
needed. This assignment does not add a database.
\section{Outstanding Work and Cleanup Boundary}
The domain owner must create two A records: \texttt{staging} and \texttt{app}.
Both must point to \texttt{147.182.178.136}. Neither resolved during
preparation. Distinct DNS hostnames are an explicit instructor requirement, so
an existing-host path substitute is not described as equivalent. The prepared
Caddy additions must be validated and reloaded after DNS is correct, without
removing earlier routes or certificate storage. The public application port is
HTTPS 443, with internal port 8000 remaining private.
Billy added A records for \texttt{staging} and \texttt{app}. On November 15,
Google and Cloudflare both returned \texttt{147.182.178.136} for each name,
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
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 issue draft, feature branch and code are prepared locally. Issue creation,
commit/push, peer review/merge, both assessed releases, production approvals,
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,
both recovery demonstrations, final traceability and monitoring evidence, and
the final submission review remain outstanding. Local checks are not a
replacement for those executions.
@@ -247,5 +290,5 @@ the two pricing projects, their routes, monitoring additions and test DNS.
Revoke their package tokens; retire deploy access and the delivery node/folder
after preserving job history. Do not prune Docker or use \texttt{down -v}.
Preserve earlier Gitea/Jenkins/proxy/monitoring services and all shared volumes.
The local agent, cache/identity volumes and protected remote backup are retained
The stopped laptop fallback, active remote agent, cache/identity volumes and protected remote backup are retained
while work and assessment remain in progress.