165 lines
8.4 KiB
TeX
165 lines
8.4 KiB
TeX
\chapter{Automated Manual Build}
|
|
\ChapterLabel{AutomatedManualBuild}
|
|
\index{Gitea!Actions}
|
|
\index{LaTeX!automated compilation}
|
|
\index{runner!local Docker runner}
|
|
|
|
This chapter records Assignment 5, \emph{LaTeX Auto-Compilation with
|
|
Gitea -- Group}. Evidence was collected on October 7, 2026. The first
|
|
Gitea workflow succeeded; the second source-change run and the controlled
|
|
workflow failure/repair exercise are still pending.
|
|
|
|
\section{Source and Trigger}
|
|
The existing \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway}{Group 1
|
|
Gitea repository} contains the manual under \texttt{manual/latex/}, the
|
|
compiler configuration under \texttt{ci/manual/}, and the workflow at
|
|
\texttt{.gitea/workflows/manual.yml}. Required figures, the document class,
|
|
glossary, bibliography resources, and build helper are included. The existing
|
|
application deployment remains under \texttt{deploy/}.
|
|
|
|
Actions is enabled. A push to \texttt{main} or a branch matching
|
|
\texttt{codex/assignment5-*} starts the \texttt{manual} job. Vincent pushed
|
|
commit \texttt{828f6c5} on \texttt{codex/assignment5-manual-build}, referencing
|
|
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/issues/12}{issue
|
|
\#12}. Checkout uses the triggering revision, and the build verifies that the
|
|
checked-out SHA equals that revision. Results are available on the
|
|
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/actions}{repository
|
|
Actions page}.
|
|
|
|
\section{Runner Setup}
|
|
The repository-scoped runner \texttt{ssw590-vince-local}, version 2.3.0,
|
|
runs as Docker container \texttt{ssw590-local-runner} on Vincent's Windows
|
|
laptop using Docker Desktop's Linux engine. Its \texttt{latex-local} label
|
|
selects the local compiler image \texttt{ssw590-manual-ci:20261007}.
|
|
Capacity is one job at a time. The runner uses outbound connections to Gitea
|
|
over HTTPS and to GitHub for the pinned Actions; it publishes no ports.
|
|
Compilation therefore runs on the laptop while Gitea remains on the droplet.
|
|
|
|
Registration has already been completed privately. With Docker Desktop
|
|
running, these commands from the repository root start, inspect, and stop the
|
|
registered runner without registering it again:
|
|
\begin{minted}{powershell}
|
|
.\gitea\local-runner\runner.ps1 -Action Start
|
|
.\gitea\local-runner\runner.ps1 -Action Logs
|
|
.\gitea\local-runner\runner.ps1 -Action Stop
|
|
\end{minted}
|
|
Closing the log terminal does not stop the container. After a laptop or Docker
|
|
restart, start Docker Desktop and run \texttt{-Action Start}. Stopping the
|
|
runner preserves its registration volume.
|
|
|
|
\section{Reproducible Compilation}
|
|
The versioned Dockerfile supplies TeX Live 2022/Debian, latexmk 4.79,
|
|
Pygments, Node.js 22.23.3, and Git 2.39.5. The base image is pinned by digest;
|
|
resolved Debian packages are recorded in the diagnostics. A later image
|
|
rebuild can resolve newer packages, so the tested local image is retained.
|
|
Its image ID is:
|
|
\begin{minted}{text}
|
|
sha256:5d24657a4578977fc7709165b82fc869f09a654a58ab4a0c8defd9d2cd662d5d
|
|
\end{minted}
|
|
The workflow invokes the versioned build entry point:
|
|
\begin{minted}{sh}
|
|
sh ci/manual/build.sh
|
|
\end{minted}
|
|
The script compiles a disposable source copy under
|
|
\texttt{build/manual/intermediate}. It generates build metadata there and
|
|
uses latexmk with shell escape for minted, glossary and acronym generation, index
|
|
processing, and the required final cross-reference passes. Earlier PDF and
|
|
checksum deliverables are removed before compilation. A compiler error or
|
|
missing/empty PDF causes failure; the PDF upload also fails if its expected
|
|
file is absent. Diagnostics are uploaded even after a compilation failure.
|
|
|
|
\section{PDF Version Traceability}
|
|
The human document version is maintained in source. Actions appends the run
|
|
number and triggering short commit, producing versions such as
|
|
\texttt{3.1+build.1.828f6c5}. Generated metadata is not committed, so it does
|
|
not create a push loop.
|
|
|
|
\begin{tabularx}{\linewidth}{L{3.2cm}Y}
|
|
\caption{Verified first successful build, October 7, 2026\label{Table:ManualRunOne}}\\
|
|
\toprule \textbf{Record} & \textbf{Observed value}\\ \midrule
|
|
Source commit & \texttt{828f6c555b0d3a9bcf611a5097207e3942dfda11}\\
|
|
Workflow run & 1, successful\\
|
|
Visible PDF version & \texttt{3.1+build.1.828f6c5}\\
|
|
PDF artifact & \texttt{manual-pdf-build-1}\\
|
|
Diagnostics artifact & \texttt{manual-diagnostics-build-1}\\
|
|
Downloaded PDF & \texttt{2026F-SSW-590-DevOps-Group-1.pdf}, 100 pages\\
|
|
\bottomrule
|
|
\end{tabularx}
|
|
|
|
The first PDF still displays the Assignment 4 title because that title was in
|
|
the triggering source. Figure~\ref{Figure:ManualFirstPDF} preserves that
|
|
original result. The current source corrects the title to Assignment 5 and
|
|
sets human version 3.2; its next workflow run must supply its own new run
|
|
number and commit suffix.
|
|
|
|
\section{Downloadable Artifact}
|
|
Figure~\ref{Figure:ManualWorkflowRunOne} shows successful checkout,
|
|
compilation, and both artifact uploads. The workflow requests 14-day artifact
|
|
retention, subject to server policy. Vincent downloaded the PDF and
|
|
diagnostics ZIPs and saved them under \texttt{build/evidence/run-1/}.
|
|
The extracted PDF matches the PDF inside its artifact ZIP and the SHA-256
|
|
recorded in the diagnostics:
|
|
\begin{minted}{text}
|
|
9468fa2803611a09f8f832a5631489413e9ab29254d0ae77e53d43fecd9463f0
|
|
\end{minted}
|
|
These original downloads are retained locally and ignored by Git. A final
|
|
submission PDF must be downloaded from a successful workflow after the
|
|
remaining assignment work is recorded.
|
|
|
|
\begin{figure}[H]
|
|
\centering
|
|
\includegraphics[width=\linewidth]{images/gitea-actions-workflow-verification.png}
|
|
\caption{October 7, 2026: Gitea run 1 completed successfully and lists the
|
|
PDF and diagnostics artifacts. Screenshot supplied by Vincent.}
|
|
\label{Figure:ManualWorkflowRunOne}
|
|
\end{figure}
|
|
|
|
\begin{figure}[p]
|
|
\centering
|
|
\includegraphics[width=0.72\linewidth,height=0.72\textheight,keepaspectratio]{images/gitea-runner-pdf-first-run.png}
|
|
\caption{October 7, 2026: opened PDF from the first successful workflow,
|
|
showing version \texttt{3.1+build.1.828f6c5}. Its Assignment 4 title is
|
|
preserved as historical run-1 evidence. Screenshot supplied by Vincent.}
|
|
\label{Figure:ManualFirstPDF}
|
|
\end{figure}
|
|
\clearpage
|
|
|
|
\section{Change, Failure, and Repair Evidence}
|
|
\textbf{Verified:} the initial source push produced run 1 and the downloadable,
|
|
traceable PDF above. Local container checks also demonstrated that an
|
|
intentional LaTeX error fails, removes a stale deliverable, and compiles after
|
|
repair; a mismatched triggering SHA was rejected. These local checks do not
|
|
establish the required Gitea workflow failure/repair evidence.
|
|
|
|
\textbf{Pending:} push the updated title and this chapter as a second source
|
|
change, then record its commit, successful run, artifact, and opened PDF.
|
|
On the covered assignment branch, introduce a temporary LaTeX error, capture
|
|
the failed workflow and compiler message, repair it, and capture the successful
|
|
workflow and PDF. Keep the application deployment unchanged during this test.
|
|
|
|
For a queued job, check that Docker Desktop and the runner are running and
|
|
that the workflow's label matches \texttt{latex-local}. For compilation
|
|
failure, inspect the failed step and \texttt{compile-console.txt} in the
|
|
diagnostics artifact, correct the reported source error, and push the repair.
|
|
|
|
\section{Runner and Secret Boundary}
|
|
\index{runner!secret boundary}
|
|
Only trusted group members should edit branches that trigger this runner.
|
|
Workflow code and minted shell escape execute code on the build environment.
|
|
The runner can control Docker Desktop through its Docker socket, which gives
|
|
it substantial authority over the laptop. Job containers are not privileged;
|
|
the configuration disables automatic mounting of that socket into jobs.
|
|
Registration state stays in the named Docker volume
|
|
\texttt{ssw590-local-runner-data}, outside Git. No registration token or runner
|
|
identity contents appear in this chapter or its screenshots. The workflow
|
|
requests read access to repository contents and needs no cloud account secret.
|
|
|
|
\section{Manual Quality and Controls}
|
|
This draft records the corrected title, human version 3.2, first-run evidence,
|
|
and assistance in Document History and \ChapterRef{AIPromptLog}. Earlier
|
|
assignment chapters retain their historical results. The existing Hosts and
|
|
Passwords tables in \ChapterRef{HostsPasswords} are unchanged in this update;
|
|
the local runner host and a hints-only registration-state record still need
|
|
to be added before final submission. Remaining workflow evidence and final
|
|
artifact review are pending, so this chapter does not claim full completion.
|