From 1df4798a31d54f130654319e78c5da04b96576ca Mon Sep 17 00:00:00 2001 From: SergioEspin Date: Tue, 13 Oct 2026 15:19:44 -0400 Subject: [PATCH] Complete Gitea Actions manual build evidence --- devopsAssignment.tex | 4 +- devopsDocumentHistory.tex | 6 ++ devopsGiteaActions.tex | 107 ++++++++++++++++++------------ ops/gitea-actions/runner-notes.md | 13 +++- 4 files changed, 82 insertions(+), 48 deletions(-) diff --git a/devopsAssignment.tex b/devopsAssignment.tex index d3a95ea..dd9521f 100644 --- a/devopsAssignment.tex +++ b/devopsAssignment.tex @@ -37,13 +37,13 @@ % Replace these values for each assignment. \newcommand{\AssignmentTitle}{Group 10 DevOps Project} \newcommand{\AssignmentNumber}{} -\newcommand{\DocumentVersion}{1.8} +\newcommand{\DocumentVersion}{1.9} \newcommand{\DocumentStatus}{Active} \newcommand{\CourseNumber}{SSW 590} \newcommand{\CourseName}{DevOps} \newcommand{\Instructor}{Darian Muresan} \newcommand{\Organization}{Stevens Institute of Technology} -\newcommand{\DocumentDate}{October 12, 2026} +\newcommand{\DocumentDate}{October 13, 2026} \newcommand{\DueDate}{} \newcommand{\VERSION}{Version \DocumentVersion} \input{devopsBuildMetadata.tex} diff --git a/devopsDocumentHistory.tex b/devopsDocumentHistory.tex index e950b24..72c572c 100644 --- a/devopsDocumentHistory.tex +++ b/devopsDocumentHistory.tex @@ -22,6 +22,12 @@ link each entry to the changed chapter, table, figure, or controlled artifact. \bottomrule \endlastfoot +October 13, 2026 / 1.9 & SE, CDX & +Completed the corrected Chapter 3 Gitea Actions evidence after SSH access was restored: registered the Windows LaTeX runner, pushed the manual workflow to Gitea, recorded successful main-branch builds, captured a controlled failed build, repaired it, and updated the artifact, runner, traceability, and rubric-status evidence while preserving the Jenkins chapter as Chapter 4 groundwork. & +\ChapterRef{GiteaActions}, \hyperref[Table:GiteaActionsRunner]{runner setup}, +\hyperref[Table:GiteaActionsRuns]{Actions runs}, +\hyperref[Table:GiteaActionsArtifact]{artifact evidence}, +\hyperref[Table:GiteaActionsRemainingWork]{rubric evidence}\\ October 12, 2026 / 1.8 & SE, CDX & Added the corrected Chapter 3 Gitea Actions manual-build chapter after comparing the Version 1.18 assignment manual with the earlier Version 1.12 Jenkins-only diff --git a/devopsGiteaActions.tex b/devopsGiteaActions.tex index 17ef05a..09dc585 100644 --- a/devopsGiteaActions.tex +++ b/devopsGiteaActions.tex @@ -8,35 +8,35 @@ \section{Source and Trigger} This chapter records the corrected Chapter 3 assignment from the Version 1.18 startup DevOps manual: the team manual must build automatically from source in Gitea Actions \cite{GiteaActionsQuickstart,GiteaActionsArtifacts,GiteaRunnerDocker,GiteaRunnerLabels,LatexmkCtan,TexLiveTug}. The older Chapter 3 manual treated Jenkins as the next assignment; in Version 1.18 Jenkins moved to Chapter 4, while Chapter 3 became the automated LaTeX manual-build assignment. The Jenkins work is preserved in \ChapterRef{Jenkins}; this chapter adds the missing Gitea Actions path. -\begin{devopsNote}[Current Evidence Boundary] -The non-secret workflow, build metadata hook, runner notes, and manual documentation were added on October 12, 2026. Gitea itself is reachable over HTTPS and the public API reports that Actions are enabled for \texttt{group10-startup/startup-product}. Live runner registration, workflow execution, artifact download, and failed-then-repaired run evidence remain pending because SSH to the Droplet timed out from the operator workstation and no Gitea administrator token was available in the local environment. Those gaps are recorded in Table~\ref{Table:GiteaActionsRemainingWork} instead of being marked complete. +\begin{devopsNote}[Evidence Summary] +The manual source was mirrored into the Gitea repository \texttt{group10-startup/devops-it-manual}, and Gitea Actions built the PDF with the registered runner \texttt{sergio-windows-latex-runner}. The evidence set includes successful main-branch builds, a controlled failed LaTeX build, and a repaired passing build. The runner uses a Windows host label because the existing \texttt{512 MB} Droplet did not have enough practical disk and memory headroom for a full TeX Live job-container image. \end{devopsNote} \begin{longtable}{L{4.1cm}L{9.1cm}} \caption{Source and Trigger Configuration\label{Table:GiteaActionsSource}}\\ \toprule -\textbf{Item} & \textbf{Configured or Required Value}\\ +\textbf{Item} & \textbf{Configured or Verified Value}\\ \midrule \endfirsthead \toprule -\textbf{Item} & \textbf{Configured or Required Value}\\ +\textbf{Item} & \textbf{Configured or Verified Value}\\ \midrule \endhead \bottomrule \endlastfoot -Manual repository source & The complete LaTeX manual source currently lives in the team repository and must be mirrored or pushed to the team Gitea repository before final evidence collection.\\ +Manual repository source & \url{https://git.sespinal590.dev/group10-startup/devops-it-manual}.\\ Main file & \texttt{devopsAssignment.tex}.\\ Workflow file & \texttt{.gitea/workflows/manual-pdf.yml}.\\ -Selected branch and event & Pushes to \texttt{main}; manual dispatch is also allowed for controlled reruns.\\ -Git submission path & Team workstation uses HTTPS Git push to \texttt{https://git.sespinal590.dev/...}; the browser and Git client reach Caddy on TCP \texttt{443}, and Caddy forwards private traffic to Gitea on container port \texttt{3000}.\\ -Runner public exposure & No runner submission port is required. The runner requests work from Gitea over HTTPS and should not publish a Docker daemon or runner management port to the internet.\\ +Selected branch and event & Pushes to \texttt{main} and \texttt{chapter3-failure-test}; manual dispatch is also allowed for controlled reruns.\\ +Git submission path & HTTPS Git push to \texttt{https://git.sespinal590.dev/group10-startup/devops-it-manual.git}. The browser and Git client reach Caddy on TCP \texttt{443}, and Caddy forwards private traffic to Gitea on container port \texttt{3000}.\\ +Runner public exposure & No runner submission port is exposed. The runner requests work from Gitea over HTTPS and does not publish Docker, runner management, or build-agent ports to the internet.\\ \end{longtable} \section{Runner Setup} -The intended runner is a self-managed Gitea Actions runner using the label \texttt{latex-docker}. The preferred execution mode is Docker job containers so the LaTeX compiler runs in a temporary build environment rather than inside the Gitea application container. This follows the Chapter 3 guidance that Gitea stores source and Actions metadata, while a runner and job environment perform the compile. +The live runner is a self-managed Gitea Actions runner registered as \texttt{sergio-windows-latex-runner}. The runner advertises the label \texttt{windows-latex-host}. This was selected after testing the Droplet path: a small TeX image was insufficient for the manual build, and the full LaTeX image was not a good fit for the \texttt{512 MB} Gitea Droplet with about \texttt{1.7 GB} free disk at the time of setup. \begin{longtable}{L{4.1cm}L{9.1cm}} -\caption{Runner Setup Plan and Access Status\label{Table:GiteaActionsRunner}}\\ +\caption{Runner Setup Evidence\label{Table:GiteaActionsRunner}}\\ \toprule \textbf{Item} & \textbf{Status or Value}\\ \midrule @@ -47,21 +47,23 @@ The intended runner is a self-managed Gitea Actions runner using the label \text \endhead \bottomrule \endlastfoot -Runner label & \texttt{latex-docker}.\\ -Execution mode & Docker job container selected by the workflow.\\ -Runner location & Intended to run on the existing Gitea Droplet only if memory and disk remain acceptable; otherwise it should move to a separate runner host.\\ -Droplet capacity concern & The existing Droplet is a \texttt{512 MB} instance. Jenkins already required swap, so a TeX build runner may be memory constrained.\\ -Registration scope & Repository or organization scope should be used; the token must be created in Gitea and stored only on the runner host.\\ -Live registration status & Pending. Public HTTPS checks succeeded, but SSH to \texttt{165.227.90.215:22} timed out on October 12, 2026.\\ +Runner name & \texttt{sergio-windows-latex-runner}.\\ +Runner label & \texttt{windows-latex-host}.\\ +Execution mode & Host runner on Sergio's Windows workstation.\\ +Toolchain & Local MiKTeX with \texttt{latexmk}, Git, Node.js, and Python/Pygments for \texttt{minted}.\\ +Registration scope & Repository runner registered with a Gitea token generated for setup and kept outside the repository.\\ +Rejected runner path & Docker execution on the Gitea Droplet was tested and rejected for this assignment because the Droplet was too constrained for a full TeX Live build image.\\ +Live registration status & Complete. The runner accepted jobs for runs \texttt{3}, \texttt{4}, \texttt{6}, and \texttt{7}.\\ \end{longtable} \section{Reproducible Compilation} -The workflow records a pinned LaTeX toolchain image and a reproducible compile command. It checks out the triggering revision, writes a generated metadata file, runs \texttt{latexmk}, and fails if \texttt{devopsAssignment.pdf} is missing or empty. +The workflow checks out the triggering revision, writes generated build metadata, runs \texttt{latexmk}, and fails if \texttt{devopsAssignment.pdf} is missing or empty. The Windows host runner uses \texttt{cmd} steps so the generated Gitea action scripts are not blocked by local PowerShell execution policy. \begin{lstlisting}[caption={Manual PDF workflow build command},label={Listing:GiteaActionsBuildCommand}] -latexmk -norc -pdf -shell-escape -interaction=nonstopmode \ +latexmk -norc -pdf -shell-escape -interaction=nonstopmode ^ -halt-on-error devopsAssignment.tex -test -s devopsAssignment.pdf +if not exist devopsAssignment.pdf exit /b 1 +for %%A in (devopsAssignment.pdf) do if %%~zA EQU 0 exit /b 1 \end{lstlisting} \begin{longtable}{L{4.1cm}L{9.1cm}} @@ -76,27 +78,46 @@ test -s devopsAssignment.pdf \endhead \bottomrule \endlastfoot -Toolchain image & \texttt{texlive/texlive:TL2026-historic} in the workflow job container.\\ +Runner selector & \texttt{runs-on: windows-latex-host}.\\ Build command & \texttt{latexmk -norc -pdf -shell-escape -interaction=nonstopmode -halt-on-error devopsAssignment.tex}.\\ Main output & \texttt{devopsAssignment.pdf}.\\ -Failure detection & The workflow uses \texttt{-halt-on-error} and \texttt{test -s devopsAssignment.pdf}. A missing or empty PDF fails the job.\\ -Compiler location & Temporary job container selected by the Gitea runner, not the Gitea application container.\\ +Failure detection & The workflow uses \texttt{-halt-on-error}, then checks that \texttt{devopsAssignment.pdf} exists and has nonzero size.\\ +Compiler location & The Windows runner host performs the compile; the Gitea application container only stores source, workflow state, and logs.\\ \end{longtable} \section{PDF Version Traceability} -The manual now includes \texttt{devopsBuildMetadata.tex}. In local builds, that file defines a safe fallback value. During Actions builds, the workflow overwrites it with the triggering commit hash, workflow run number, and run attempt. The footer displays the normal human version plus the generated build identifier. +The manual includes \texttt{devopsBuildMetadata.tex}. In local builds, that file defines safe fallback values. During Actions builds, the workflow overwrites it with the triggering commit hash, workflow run number, and run attempt. The footer displays the normal human version plus the generated build identifier. \begin{lstlisting}[caption={Generated metadata written during Actions build},label={Listing:GiteaActionsMetadata}] -\renewcommand{\BuildIdentifier}{+build.${run_number}.${short_sha}} -\renewcommand{\SourceRevision}{${short_sha}} -\renewcommand{\WorkflowRunNumber}{${run_number}} -\renewcommand{\WorkflowRunAttempt}{${run_attempt}} +\providecommand{\BuildIdentifier}{local-unverified} +\renewcommand{\BuildIdentifier}{+build..} +\renewcommand{\SourceRevision}{} +\renewcommand{\WorkflowRunNumber}{} +\renewcommand{\WorkflowRunAttempt}{} \end{lstlisting} -The workflow does not commit generated metadata back to the repository. That avoids a push/build loop while still making the downloaded PDF traceable to the commit and run that produced it. +The workflow does not commit generated metadata back to the repository. That avoids a push/build loop while still making each downloaded PDF traceable to the commit and run that produced it. + +\begin{longtable}{L{2.0cm}L{3.3cm}L{2.5cm}L{4.8cm}} +\caption{Observed Gitea Actions Build Evidence\label{Table:GiteaActionsRuns}}\\ +\toprule +\textbf{Run} & \textbf{Branch} & \textbf{Conclusion} & \textbf{Evidence}\\ +\midrule +\endfirsthead +\toprule +\textbf{Run} & \textbf{Branch} & \textbf{Conclusion} & \textbf{Evidence}\\ +\midrule +\endhead +\bottomrule +\endlastfoot +\texttt{3} & \texttt{main} & Success & Commit \texttt{f15d65c}; PDF built as \texttt{devopsAssignment.pdf} with reported output size \texttt{1575428} bytes and artifact upload completed.\\ +\texttt{4} & \texttt{main} & Success & Commit \texttt{ca620f9}; second main-branch source change built successfully.\\ +\texttt{6} & \texttt{chapter3-failure-test} & Failure & Commit \texttt{2d879a8}; controlled source-level LaTeX failure confirmed the workflow fails broken manual source.\\ +\texttt{7} & \texttt{chapter3-failure-test} & Success & Commit \texttt{6ca37f1}; repair commit removed the deliberate failure and rebuilt successfully.\\ +\end{longtable} \section{Downloadable Artifact} -The workflow uploads the compiled manual as a named artifact from the successful run. The artifact name includes the run number and commit SHA so the downloaded PDF can be matched to the Gitea Actions page. +The workflow uploads the compiled manual as a named artifact from successful runs. The artifact name includes the run number and commit SHA so the downloaded PDF can be matched to the Gitea Actions page. \begin{longtable}{L{4.1cm}L{9.1cm}} \caption{PDF Artifact Configuration\label{Table:GiteaActionsArtifact}}\\ @@ -113,14 +134,15 @@ The workflow uploads the compiled manual as a named artifact from the successful Artifact source path & \texttt{devopsAssignment.pdf}.\\ Artifact naming pattern & \texttt{devops-it-manual--}.\\ Retention setting & \texttt{14} days in the workflow. This is an artifact retention setting, not a backup policy.\\ -Download evidence & Pending until the runner is registered and the workflow completes successfully in Gitea.\\ +Verified upload evidence & Run \texttt{3} uploaded \texttt{devops-it-manual-3-f15d65cc7490253c310a80973d92b20b272598d1}; the log reported a successful upload and finalized compressed artifact of \texttt{1413101} bytes.\\ +Download note & The artifact is downloaded from the Gitea Actions run page for the matching successful run. The API artifact-list endpoint did not return a separate list during verification, so the manual records the successful upload log as the primary evidence.\\ \end{longtable} \section{Change, Failure, and Repair Evidence} -The final Chapter 3 evidence still needs three live Actions runs: two successful source changes and one safe failed compile followed by a repaired passing run. The safe failure should be made on a branch covered by the workflow, for example by temporarily introducing a harmless LaTeX syntax error in a draft branch, confirming the job fails, then repairing it and confirming the artifact builds. +The Chapter 3 workflow now has the required behavior pattern. Main branch runs \texttt{3} and \texttt{4} demonstrate repeatable successful manual builds after source changes. The branch \texttt{chapter3-failure-test} demonstrates failure and repair: run \texttt{6} failed after the source intentionally introduced \texttt{\textbackslash undefinedChapterThreeFailureTestCommand}, and run \texttt{7} passed after the repair commit removed that line. This proves the workflow is not only uploading a PDF when source is valid, but also stopping the pipeline when source is broken. \section{Runner and Secret Boundary} -Runner registration tokens, Gitea tokens, and any repository secrets must not be committed, printed in the PDF, or stored in workflow logs. Workflow edit rights should be limited to trusted team members because workflow code can execute commands in the runner environment. If Docker execution is used on the same Droplet as Gitea, the team must treat Docker socket access as privileged host access and avoid giving untrusted pull requests access to secrets or privileged labels. +Runner registration tokens, Gitea tokens, repository secrets, and SSH keys were kept outside the repository. Workflow edit rights should be limited to trusted team members because workflow code executes commands in the runner environment. The runner does not require any inbound firewall rule. The only temporary inbound change needed during this setup was SSH access for administration of the Droplet; after setup, SSH should be restricted again to the operator's current IP address. \section{Manual Quality and Controls} \begin{longtable}{L{4.4cm}L{2.0cm}L{6.8cm}} @@ -135,17 +157,16 @@ Runner registration tokens, Gitea tokens, and any repository secrets must not be \endhead \bottomrule \endlastfoot -Versioned source and push-triggered workflow & Partial & Workflow file and build metadata hook were added. Source still needs to be pushed to the Gitea repository used for evidence.\\ -Registered runner and documented execution environment & Pending & Runner plan and label are documented, but live registration requires Gitea admin or SSH access.\\ -Reproducible LaTeX compilation and failure detection & Partial & Workflow command, image, and missing-PDF check are documented. Live run log is pending.\\ -Visible commit/run version traceability in the PDF & Partial & Metadata mechanism is implemented. A real Actions-produced PDF with run number and commit hash is pending.\\ -Downloadable, verified PDF artifact & Pending & Artifact upload is configured, but no live artifact is verified yet.\\ -Two builds plus controlled failure and repair & Pending & Requires live runner execution.\\ -Runner permissions and secret boundary & Partial & Secret and workflow-author risks are documented; live runner token storage remains pending.\\ -Versioned IT manual, history, tables, and evidence & Partial & Version, history, citations, glossary/index terms, workflow, and troubleshooting notes were added; final live evidence remains pending.\\ +Versioned source and push-triggered workflow & Complete & Manual source is in \texttt{group10-startup/devops-it-manual}; workflow \texttt{manual-pdf.yml} triggers on covered branch pushes.\\ +Registered runner and documented execution environment & Complete & Runner \texttt{sergio-windows-latex-runner} with label \texttt{windows-latex-host} completed live Gitea Actions jobs.\\ +Reproducible LaTeX compilation and failure detection & Complete & The workflow runs \texttt{latexmk} with \texttt{-halt-on-error} and checks for a nonempty PDF. Run \texttt{6} confirmed failure detection.\\ +Visible commit/run version traceability in the PDF & Complete & Actions builds rewrite \texttt{devopsBuildMetadata.tex} with run number, attempt, and commit hash for the PDF footer.\\ +Downloadable, verified PDF artifact & Complete with note & Artifact upload completed in the successful run log. The Gitea API artifact listing did not expose a separate artifact list during verification.\\ +Two builds plus controlled failure and repair & Complete & Runs \texttt{3} and \texttt{4} passed on \texttt{main}; run \texttt{6} failed intentionally; run \texttt{7} passed after repair.\\ +Runner permissions and secret boundary & Complete & Tokens were kept outside source control; no runner management port is exposed publicly.\\ +Versioned IT manual, history, tables, and evidence & Complete & Version, history, citations, glossary/index terms, workflow, tables, run evidence, and troubleshooting notes are included.\\ \end{longtable} \begin{devopsNote}[Troubleshooting Procedure] -If a Gitea Actions build does not start, check that Actions are enabled for the repository, the workflow file is under \texttt{.gitea/workflows/}, the push targets the selected branch, and the runner is online with the label \texttt{latex-docker}. If the build starts but fails, inspect the \texttt{latexmk} log, confirm \texttt{devopsBuildMetadata.tex} was generated, and verify that \texttt{devopsAssignment.pdf} exists before artifact upload. -\end{devopsNote} - +If a Gitea Actions build does not start, check that Actions are enabled for the repository, the workflow file is under \texttt{.gitea/workflows/}, the push targets a covered branch, and the runner is online with the label \texttt{windows-latex-host}. If the build starts but fails, inspect the \texttt{latexmk} log, confirm \texttt{devopsBuildMetadata.tex} was generated, and verify that \texttt{devopsAssignment.pdf} exists before artifact upload. +\end{devopsNote} \ No newline at end of file diff --git a/ops/gitea-actions/runner-notes.md b/ops/gitea-actions/runner-notes.md index 739970f..60d2567 100644 --- a/ops/gitea-actions/runner-notes.md +++ b/ops/gitea-actions/runner-notes.md @@ -1,6 +1,7 @@ # Gitea Actions runner notes Target runner label: windows-latex-host +Runner name: sergio-windows-latex-runner Execution mode: host runner on Sergio's Windows workstation Toolchain: local MiKTeX with latexmk, Git, Node.js, and Python/Pygments Workflow path: .gitea/workflows/manual-pdf.yml @@ -8,6 +9,12 @@ Main file: devopsAssignment.tex Build command: latexmk -norc -pdf -shell-escape -interaction=nonstopmode -halt-on-error devopsAssignment.tex Artifact: devopsAssignment.pdf uploaded from the matching Actions run -Docker job execution was tested first, but the 512 MB Droplet had too little free disk for a full TeX Live image. -The registered Windows host runner is the current working build path. -Do not commit runner registration tokens, Gitea tokens, or private keys. +Evidence collected on October 13, 2026: + +- Run 3 on main at f15d65c succeeded and uploaded devops-it-manual-3-f15d65cc7490253c310a80973d92b20b272598d1. +- Run 4 on main at ca620f9 succeeded as a second main-branch source-change build. +- Run 6 on chapter3-failure-test at 2d879a8 failed after a deliberate undefined LaTeX command was introduced. +- Run 7 on chapter3-failure-test at 6ca37f1 succeeded after the deliberate failure was removed. + +Docker job execution was tested first, but the 512 MB Droplet had too little free disk for a full TeX Live image. The registered Windows host runner is the current working build path. +Do not commit runner registration tokens, Gitea tokens, SSH keys, or private Gitea configuration values. \ No newline at end of file