Compare commits
31 Commits
chapter3-v
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| da3339aca0 | |||
|
|
d36828343d | ||
| e649c258bb | |||
|
|
1b2f416b60 | ||
| a3c4d0d8fb | |||
| a092f18cf9 | |||
|
|
7670134c2a | ||
|
|
b08ccbf169 | ||
|
|
7076fd447b | ||
|
|
c8b690f85b | ||
|
|
c4b39bef9c | ||
|
|
f910be9afc | ||
|
|
2f3040e3dc | ||
|
|
65eff9cc93 | ||
|
|
bff2e152bb | ||
|
|
70c77b6368 | ||
|
|
546ccea891 | ||
|
|
b2ddec4565 | ||
| 6091ad285e | |||
|
|
4e990edca7 | ||
| 8ac29da984 | |||
| 6af4144720 | |||
| 9c95b9e57a | |||
| 1c35c762e0 | |||
| 3b0dae50da | |||
| 253e911e44 | |||
| d6f1d7b504 | |||
| c7452b5d2d | |||
| ede864e6c3 | |||
|
|
a89ebf582f | ||
|
|
7114fecbc2 |
@ -13,7 +13,8 @@ jobs:
|
||||
BUILD_RUN: ${{ gitea.run_number }}
|
||||
steps:
|
||||
- name: Prepare recorded Actions runtime
|
||||
run: apk add --no-cache nodejs=24.18.1-r0
|
||||
# Alpine removes superseded patch releases, so pin the major version and log the exact one.
|
||||
run: apk add --no-cache 'nodejs~24' && node --version
|
||||
- name: Check out triggering revision
|
||||
uses: https://github.com/actions/checkout@v3.6.0
|
||||
with:
|
||||
|
||||
@ -74,6 +74,22 @@ configuration; the student must confirm the required roles and actual names.
|
||||
Human review and corrections: pending. No credentials were requested or
|
||||
recorded.
|
||||
|
||||
\section{Chapter 5 Monitoring Restructure}
|
||||
Date: November 1, 2026; contributors: CC, CLD; tool: Anthropic Claude Code
|
||||
(Claude Opus 5.5). Task: compare MB's October 30 Chapter 5 draft with
|
||||
Chapter 5 of \texttt{dosManual-V1.42} and restructure it into the eight
|
||||
required evidence sections. Inputs: the assignment PDF; MB's draft; the
|
||||
pricing-app \texttt{feature/issue-3-monitoring} configuration, README, and
|
||||
runbook at commit \texttt{d1504e2591}; and CC's November 1 terminal screenshot
|
||||
of \path{/home/ubuntu/monitoring}. Output used: the restructured
|
||||
\ChapterRef{Monitoring}, Hosts and Passwords monitoring rows, glossary terms,
|
||||
citations, and history entry. Configuration tables were transcribed from the
|
||||
versioned files; operational results come only from MB's recorded October 30
|
||||
observations and CC's screenshot. The review noted that the provisioned alert
|
||||
rules do not select the contact point. No probe, alert, incident, restart, or
|
||||
exposure result was invented; those items are marked pending. Human review:
|
||||
pending.
|
||||
|
||||
\section{Example Record}
|
||||
Date: \textit{[timestamp]}; Tool and model: \textit{[name]}; Task:
|
||||
\textit{[requested outcome]}; Inputs: \textit{[sanitized constraints and
|
||||
@ -104,3 +120,20 @@ Date: October 8, 2026; Contributors: MB, CDX; Task: improve Chapter 2 formatting
|
||||
|
||||
\section{Automated Manual Build Implementation}
|
||||
Date: October 10, 2026; contributors: MB, CDX; tool: OpenAI Codex using Computer Use in Safari. The user authorized completing Chapter 3 in the existing Lightsail Gitea project. Read the earlier report and dosManual version 1.18. Observed Gitea 1.22.3, Caddy 2.8.4, act runner 0.6.1, and an already registered texlive runner. The draft workflow existed only outside the repository. Prepared a versioned push workflow, pinned TeX image, Node runtime, and visible build metadata. An isolated preflight compilation succeeded. Actions run and artifact verification remain pending at this source revision; subsequent evidence will record actual results. No secrets are included.
|
||||
|
||||
Verified runs 1 and 2 passed for successive changes; run 3 failed for the intentional undefined command with upload skipped; run 4 passed after repair. Added Chapter 3, host and hint-only credential records, glossary terms, and evidence links. No credential value was written to source.
|
||||
|
||||
\section{Jenkins CI Implementation and Review Draft}
|
||||
Date: October 20--23, 2026; contributors: MB, CDX; tool: OpenAI Codex.
|
||||
Task: continue the existing Lightsail/Gitea project through Chapter 4 of
|
||||
\texttt{dosManual-V1.38}. MB confirmed instructor approval of Lightsail,
|
||||
selected the Python pricing example and private SSH tunnel, authorized the
|
||||
dedicated pricing-app integration identity, created the Jenkins administrator
|
||||
password personally, and added the local hosts entry. Codex inspected and
|
||||
configured the service, tested private/public paths, and used an isolated
|
||||
application branch for failure and repair. Observed PR-2 run 1 failed for
|
||||
13 != 30; run 2 passed both tests on the new SHA. Codex prepared this chapter,
|
||||
supporting tables, diagram, and review package from actual evidence. MB will
|
||||
arrange teammate review later. No teammate approval, merge, issue closure,
|
||||
SSH remediation, instructor access, or complete Chapter 4 submission is
|
||||
claimed. No secret value is included in this document.
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
\usepackage{xspace}
|
||||
\usepackage{xcolor}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{positioning}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{amsmath,amssymb}
|
||||
\usepackage{array}
|
||||
@ -38,15 +40,15 @@
|
||||
\definecolor{devopsLightBlue}{RGB}{232,240,247}
|
||||
|
||||
% Replace these values for each assignment.
|
||||
\newcommand{\AssignmentTitle}{Automated LaTeX Manual Build -- Group}
|
||||
\newcommand{\AssignmentNumber}{5}
|
||||
\newcommand{\DocumentVersion}{1.9}
|
||||
\newcommand{\DocumentStatus}{Group Report}
|
||||
\newcommand{\AssignmentTitle}{Introduction to SRE: Monitoring and Reliability -- Group}
|
||||
\newcommand{\AssignmentNumber}{7}
|
||||
\newcommand{\DocumentVersion}{1.12}
|
||||
\newcommand{\DocumentStatus}{Review Draft}
|
||||
\newcommand{\CourseNumber}{SSW 590}
|
||||
\newcommand{\CourseName}{DevOps}
|
||||
\newcommand{\Instructor}{Darian Muresan}
|
||||
\newcommand{\Organization}{Stevens Institute of Technology}
|
||||
\newcommand{\DocumentDate}{October 10, 2026}
|
||||
\newcommand{\DocumentDate}{November 1, 2026}
|
||||
\newcommand{\DueDate}{[Due Date and Time]}
|
||||
\newcommand{\VERSION}{Version \DocumentVersion+build.\buildRun.\buildCommit}
|
||||
|
||||
@ -89,6 +91,8 @@
|
||||
}
|
||||
|
||||
\changenormalspacing{\singlespacing}
|
||||
\newglossaryentry{ciartifact}{name={build artifact},description={A retained output associated with a specific workflow run}}
|
||||
\newglossaryentry{cirunner}{name={Actions runner},description={An agent that receives and executes Gitea workflow jobs}}
|
||||
\begin{document}
|
||||
\pagenumbering{roman}
|
||||
\singlespacing
|
||||
@ -111,6 +115,8 @@
|
||||
\include{devopsIntroduction}
|
||||
\include{devopsGitea}
|
||||
\include{devopsAutomatedManualBuild}
|
||||
\include{devopsJenkinsCI}
|
||||
\include{devopsMonitoring}
|
||||
\include{devopsExampleAssignment}
|
||||
\include{devopsKanbanSetup}
|
||||
\include{devopsPasswords}
|
||||
|
||||
@ -1,17 +1,20 @@
|
||||
\chapter{Automated Manual Build}
|
||||
\sloppy
|
||||
\ChapterLabel{AutomatedManualBuild}
|
||||
\index{Gitea Actions}\index{runner}\index{build artifact}\index{traceability}
|
||||
\section{Source and Trigger}
|
||||
The source of record is \url{https://git.590hcm.dev/SSW590Team/devOpsManual}. The main document is \texttt{devopsAssignment.tex}; tracked chapter files, bibliography, figures in \texttt{prism-uploads}, and \texttt{.latexmkrc} form the build input. The workflow is \texttt{.gitea/workflows/build-manual.yaml}. Pushes to \texttt{main} and the isolated \texttt{chapter3-validation} branch trigger a build. Generated metadata and PDFs are ignored, so the build never commits its own output.
|
||||
\noindent Verified source links: \href{https://git.590hcm.dev/SSW590Team/devOpsManual/src/branch/main/devopsAssignment.tex}{main TeX document}; \href{https://git.590hcm.dev/SSW590Team/devOpsManual/src/branch/main/.gitea/workflows/build-manual.yaml}{workflow and non-secret job configuration}.
|
||||
The source of record is \url{https://git.590hcm.dev/SSW590Team/devOpsManual}. The main document is \path{devopsAssignment.tex}; tracked chapter files, bibliography, figures in \path{prism-uploads}, and \path{.latexmkrc} form the build input. The workflow is \path{.gitea/workflows/build-manual.yaml}. Pushes to \path{main} and the isolated \path{chapter3-validation} branch trigger a build. Generated metadata and PDFs are ignored, so the build never commits its own output.
|
||||
\begin{center}\fbox{HTTPS push :443 $\rightarrow$ Caddy $\rightarrow$ Gitea :3000}\par\smallskip
|
||||
\fbox{Runner polls Gitea $\rightarrow$ TeX container $\rightarrow$ PDF artifact}\end{center}
|
||||
The public HTTPS route retains certificate verification. Gitea port 3000 stays on the Docker network. The runner polls outward; no new public runner port is needed.
|
||||
\section{Runner Installation and Execution}
|
||||
Observed October 10, 2026: the existing \texttt{lightsail-actions-runner} runs act runner 0.6.1 in Docker on Gitea-Project, Ubuntu 24.04.4 LTS, at 184.193.0.32. Its deployment is in \texttt{/home/ubuntu/gitea-deploy}; registration persists in its runner-data volume. The server has 2 GB RAM, two vCPUs, and 60 GB disk. The runner uses the \texttt{texlive} label. Its generated default configuration has capacity one. Each workflow job uses a temporary container with one CPU and 1 GB memory, leaving capacity for Gitea and Caddy. The runner was already registered; the missing repository workflow, rather than absent registration, prevented builds.
|
||||
Registration scope is recorded in the final verification notes. The runner requires outbound HTTPS to Gitea, GitHub action repositories, the container registry, and Alpine package repositories. No deployment service was moved or replaced.
|
||||
Dated runner evidence (October 10, 2026): \href{https://git.590hcm.dev/SSW590Team/devOpsManual/settings/actions/runners}{repository runner settings} showed runner ID 1, lightsail-actions-runner, global scope, online/idle, label texlive. \href{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/5/jobs/0}{Run 5 job log} records the assigned runner and completed checkout, compilation, and upload. The expected result was a successful job on this runner; actual result: success in 21 seconds.
|
||||
Observed October 10, 2026: the existing \path{lightsail-actions-runner} runs act runner 0.6.1 in Docker on Gitea-Project, Ubuntu 24.04.4 LTS, at 184.193.0.32. Its deployment is in \path{/home/ubuntu/gitea-deploy}; registration persists in its runner-data volume. The server has 2 GB RAM, two vCPUs, and 60 GB disk. The runner uses the \path{texlive} label. Its generated default configuration has capacity one. Each workflow job uses a temporary container with one CPU and 1 GB memory, leaving capacity for Gitea and Caddy. The runner was already registered; the missing repository workflow, rather than absent registration, prevented builds.
|
||||
The repository runner settings show global scope, runner ID 1, idle and online. This pre-existing global scope was not changed. The runner requires outbound HTTPS to Gitea, GitHub action repositories, the container registry, and Alpine package repositories. No deployment service was moved or replaced.
|
||||
\section{Reproducible Compilation}
|
||||
The workflow pins the TeX image to the digest below, records Node.js 24.18.1-r0, and uses checkout v3.6.0 and upload-artifact v3.1.3 from their GitHub action repositories. The existing runner image uses a latest tag; its observed executable version is recorded above. Action tags and Alpine package availability remain external dependencies; the TeX filesystem is digest-pinned.
|
||||
\begin{quote}\small\url{ghcr.io/xu-cheng/texlive-full@sha256:c06416ebbc69c8e90e07d1f1a6f7a3f9b334e773daa3543ce879ea533317c3a7}\end{quote}
|
||||
\begin{quote}\small\url{ghcr.io/xu-cheng/texlive-full@sha256:c06416ebbc69c8e90e07d1f1a6f7a3f9}\par\noindent\texttt{b334e773daa3543ce879ea533317c3a7}\end{quote}
|
||||
The container has the TeX packages required by this manual. Node is installed before JavaScript actions execute. Checkout selects the triggering revision and does not persist Git credentials. From the repository root, compilation uses:
|
||||
\begin{verbatim}
|
||||
latexmk -pdf -interaction=nonstopmode \
|
||||
@ -20,14 +23,18 @@ test -s devopsAssignment.pdf
|
||||
\end{verbatim}
|
||||
Latexmk repeats the necessary LaTeX and bibliography passes. The repository's custom dependencies invoke makeglossaries; the index is generated during the build. Missing inputs, invalid TeX, and an absent or empty PDF fail the job. An isolated preflight with networking disabled succeeded, and Actions run 1 compiled in 21 seconds. No host TeX installation is required.
|
||||
\section{PDF Version and Traceability}
|
||||
The human document version is combined with \texttt{+build.RUN.SHORTSHA}. Gitea supplies the run number and triggering SHA to a generated \texttt{build\_meta.tex}; only its seven-character commit abbreviation and numeric run are written. The main document imports this file and displays the version in the page footer. Local compilation falls back to build 0/local. Metadata is untracked and no write-back step exists. The artifact name retains the full SHA so a downloaded PDF can be correlated with the exact source revision.
|
||||
The human document version is combined with \path{+build.RUN.SHORTSHA}. Gitea supplies the run number and triggering SHA to a generated \path{build\_meta.tex}; only its seven-character commit abbreviation and numeric run are written. The main document imports this file and displays the version in the page footer. Local compilation falls back to build 0/local. Metadata is untracked and no write-back step exists. The artifact name retains the full SHA so a downloaded PDF can be correlated with the exact source revision.
|
||||
\section{Artifact Publication and Retrieval}
|
||||
Only a successful compilation reaches upload. The named artifact is \texttt{devops-manual-build-RUN-FULLSHA}; it contains \texttt{devopsAssignment.pdf}, uses a 30-day retention request, and treats a missing file as an error. Open the repository Actions tab, choose a successful run, and select its artifact link. Extract the downloaded archive and inspect the PDF version before submission. Keep a local copy before retention expires. A failed run must not be used as a source of a new PDF.
|
||||
Download verification, October 10, 2026: \href{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/5/artifacts/devops-manual-build-5-7114fecbc20b9fa65ca0e2f000d14f1ea5aaa222}{named PDF artifact from successful run 5} was downloaded and opened in Preview as a 68-page PDF. Its visible version was 1.9+build.5.7114fec, matching commit 7114fecbc20b9fa65ca0e2f000d14f1ea5aaa222. Expected and actual results agreed. \href{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/\buildRun}{This PDF's own workflow run} identifies the current run; its footer records the corresponding version.
|
||||
Only a successful compilation reaches upload. The named artifact is \path{devops-manual-build-RUN-FULLSHA}; it contains \path{devopsAssignment.pdf}, uses a 30-day retention request, and treats a missing file as an error. Open the repository Actions tab, choose a successful run, and select its artifact link. Extract the downloaded archive and inspect the PDF version before submission. Keep a local copy before retention expires. A failed run must not be used as a source of a new PDF.
|
||||
\section{Successive Changes and Failure Recovery}
|
||||
\input{devopsBuildEvidence}
|
||||
\section{Runner and Secret Boundaries}
|
||||
Repository writers who can edit workflows can execute commands on this runner. The runner mounts the host Docker socket, which grants powerful host-level control; a temporary job container is not a security boundary against a malicious workflow author. Only trusted project contributors should have write access. No new membership or permission was granted. This workflow uses no custom repository secret, disables checkout credential persistence, and does not print registration credentials. The runner registration file and deployment credentials remain outside the repository. Hosts and Passwords chapters add runner-specific, hint-only records. Never place passwords, tokens, or private keys in source, screenshots, logs, or artifacts.
|
||||
\section{Operations, Evidence, and Troubleshooting}
|
||||
Evidence was collected on October 10, 2026 from Safari, the Lightsail SSH session, and Gitea Actions. Run 1 (\texttt{fb97d71}) succeeded in 56 seconds including checkout, metadata, compilation, and artifact upload: \url{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/1}.
|
||||
For a queued job, check the runner is online, its registration scope includes this repository, and its label matches \texttt{texlive}. For checkout failures, check HTTPS reachability and source permissions. For a TeX error, open the compilation step and fix the reported file and line, then push a new commit. For missing artifacts, inspect the upload step and PDF existence check. For memory pressure, keep capacity one and the job limits; do not run parallel full TeX builds on this host. The original draft workflow was under the deployment directory, so Gitea could not discover it until it was committed under the repository's workflow path.
|
||||
\section{Manual Quality and Controls}
|
||||
Evidence was collected on October 10, 2026 from Safari, the Lightsail SSH session, and Gitea Actions. Run 1 (\path{fb97d71}) succeeded in 56 seconds including checkout, metadata, compilation, and artifact upload: \url{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/1}.
|
||||
For a queued job, check the runner is online, its registration scope includes this repository, and its label matches \path{texlive}. For checkout failures, check HTTPS reachability and source permissions. For a TeX error, open the compilation step and fix the reported file and line, then push a new commit. For missing artifacts, inspect the upload step and PDF existence check. For memory pressure, keep capacity one and the job limits; do not run parallel full TeX builds on this host. The original draft workflow was under the deployment directory, so Gitea could not discover it until it was committed under the repository's workflow path.
|
||||
References (accessed October 10, 2026): \url{https://docs.gitea.com/1.22/usage/actions/comparison/}. Gitea 1.22 does not enforce all GitHub workflow keys, including concurrency and permissions; this workflow does not rely on those keys for isolation or scheduling.
|
||||
|
||||
The dated version history links this chapter. Both \ChapterRef{Hosts} and \ChapterRef{Passwords} were updated with verified runner details and credential hints only. Glossary terms: \gls{cirunner} and \gls{ciartifact}.
|
||||
\fussy
|
||||
|
||||
@ -1 +1,16 @@
|
||||
Run 1 establishes the first successful source revision. Further validation is pending at this intermediate revision.
|
||||
Verified October 10, 2026. Two successive pushes to main produced distinct successful PDFs. A covered test branch demonstrated failure and recovery.
|
||||
\begin{longtable}{p{0.10\textwidth}p{0.18\textwidth}p{0.57\textwidth}}
|
||||
\textbf{Run} & \textbf{Commit} & \textbf{Change and result}\\\hline
|
||||
1 & fb97d71 & Added workflow and metadata. Success, 56 s; artifact published; version 1.9+build.1.fb97d71.\\
|
||||
2 & d316cbb & Added this chapter and updated title/date. Success, 24 s; distinct artifact; version 1.9+build.2.d316cbb.\\
|
||||
3 & eb4e42c & Undefined LaTeX command on chapter3-validation. Failed, 8 s; upload skipped, no artifact.\\
|
||||
4 & 398093b & Removed the deliberate error on the same branch. Success; artifact restored; version 1.9+build.4.398093b.\\
|
||||
\end{longtable}
|
||||
Run 3 reports Undefined control sequence in \path{devopsBuildEvidence.tex}, line 2, for \path{\ChapterThreeIntentionalError}. Latexmk exits 12; compilation fails and upload is skipped. The repair removes precisely that line. Successful run pages expose artifacts named with the run number and full commit SHA.
|
||||
\begin{itemize}
|
||||
\item \url{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/1}
|
||||
\item \url{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/2}
|
||||
\item \url{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/3}
|
||||
\item \url{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/4}
|
||||
\end{itemize}
|
||||
The final main revision adds these results, verified host/credential tables, and layout improvements. Its footer and artifact name identify the exact delivery build.
|
||||
|
||||
@ -12,7 +12,15 @@ 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 / contributor} & \textbf{Change} & \textbf{Sections / related tables}\\ \midrule
|
||||
\endhead \bottomrule \endlastfoot
|
||||
October 10, 2026 / 1.9 (draft) & MB, CDX & Prepared Gitea Actions PDF compilation and visible commit/run metadata. Runner already registered; end-to-end run verification pending. Hosts and Passwords tables will be updated with verified runner details in the completed chapter. & \ChapterRef{AIPromptLog}\\
|
||||
November 1, 2026 / 1.12 (review draft) & CC, CLD & Restructured the Chapter 5 monitoring draft into the eight required evidence sections under the assignment's chapter title, with an evidence-status table, actual deployment diagram, metric inventory, dashboard and alert tables, worked SLO example, and incident template. Completed and pending work are marked separately; no new operational results were added. Included the chapter in the manual and updated Hosts and Passwords with monitoring records. & \ChapterRef{Monitoring}, \ChapterRef{Hosts}, \ChapterRef{Passwords}, \ChapterRef{AIPromptLog}\\
|
||||
|
||||
October 30, 2026 / 1.12 (draft) & MB & Drafted Chapter 5 monitoring evidence and open checks from the October 30 Prometheus, Grafana, Node Exporter, and Blackbox Exporter deployment. & \ChapterRef{Monitoring}\\
|
||||
|
||||
October 23, 2026 / 1.11 (review update) & HS & Reviewed pricing application PR~2 and its Chapter 4 evidence; confirmed the failed run and successful repair, approved the pull request after the required check passed, and recorded that peer review is complete while merge and issue closure remain pending. Reviewed the corresponding Hosts and Passwords CI entries. & \ChapterRef{JenkinsCI}, \ChapterRef{Hosts}, \ChapterRef{Passwords}\\
|
||||
|
||||
October 23, 2026 / 1.10 (review draft) & MB, CDX & Added Jenkins CI deployment, private HTTPS access, Python agent, traceable failed/repaired PR checks, protected-main policy, external network tests, and operator procedures. Updated Hosts and Passwords with CI records; peer review and merge remain pending. & \ChapterRef{JenkinsCI}, \ChapterRef{Hosts}, \ChapterRef{Passwords}, \ChapterRef{AIPromptLog}\\
|
||||
|
||||
October 10, 2026 / 1.9 & MB, CDX & Added Automated Manual Build chapter, push workflow, visible build metadata, validation evidence, and glossary terms. Updated Hosts with verified runner resources and global scope; updated Passwords with hint-only credential boundaries. & \ChapterRef{AutomatedManualBuild}, \ChapterRef{AIPromptLog}\\
|
||||
|
||||
October 8, 2026 / 1.8 (draft) & MB, CDX & Improved Chapter 2 wording and layout, removed screenshot transcriptions that duplicated the supplied figures, and standardized contributor initials. & \ChapterRef{Gitea}, \ChapterRef{AIPromptLog}\\
|
||||
October 8, 2026 / 1.7 (draft) & MB, CDX & Clarified provider responsibilities: Name.com is the domain registrar and AWS Lightsail is the production hosting provider. & \hyperref[sec:gitea-domain]{Section~\ref*{sec:gitea-domain}}, \hyperref[sec:gitea-deployment]{Section~\ref*{sec:gitea-deployment}}, \ChapterRef{Gitea}, \ChapterRef{Hosts}\\
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
\newacronym{cd}{CD}{continuous delivery or continuous deployment}
|
||||
\newacronym{iac}{IaC}{infrastructure as code}
|
||||
\newacronym{slo}{SLO}{service-level objective}
|
||||
\newacronym{sli}{SLI}{service-level indicator}
|
||||
\newacronym{sla}{SLA}{service-level agreement}
|
||||
\newglossaryentry{automation}{name={automation},description={A repeatable, version-controlled procedure executed by software rather than undocumented manual steps}}
|
||||
\newglossaryentry{deployment}{name={deployment},description={The controlled delivery of a versioned change to an environment}}
|
||||
\newglossaryentry{evidence}{name={evidence},description={A retained record of an actual execution, observation, or review}}
|
||||
@ -11,3 +13,13 @@
|
||||
\newglossaryentry{rollback}{name={rollback},description={A controlled return to a known acceptable version or state after a failed or harmful change}}
|
||||
\newglossaryentry{runbook}{name={runbook},description={A documented operational procedure for a repeatable task or incident response}}
|
||||
\newglossaryentry{synonyms}{name={synonyms},description={Equivalent terms used in this assignment; record preferred terms to avoid ambiguity in instructions and evidence}}
|
||||
|
||||
\newglossaryentry{cimergegate}{name={merge gate},description={A protected-branch rule requiring specified verification results before normal pull-request merge}}
|
||||
\newglossaryentry{ciwebhook}{name={webhook},description={An event-triggered HTTP delivery used here to notify Jenkins of Gitea repository changes}}
|
||||
\newglossaryentry{ciprhead}{name={pull-request head},description={The latest proposed source commit, which must receive a fresh CI result after each corrective push}}
|
||||
|
||||
\newglossaryentry{sreexporter}{name={exporter},description={A process that exposes measurements from a host or service as Prometheus metrics; it is a metric endpoint, not a database}}
|
||||
\newglossaryentry{sreprobe}{name={probe},description={A scheduled synthetic request, such as an HTTPS login-page check, whose success and duration are recorded as metrics}}
|
||||
\newglossaryentry{sreerrorbudget}{name={error budget},description={The amount of failure an SLO permits over its window, such as 1\% of scheduled probes for a 99\% target}}
|
||||
\newglossaryentry{srecontactpoint}{name={contact point},description={A Grafana notification destination, such as email or a webhook, that receives alert and resolved messages}}
|
||||
\newglossaryentry{srefailuredomain}{name={failure domain},description={A set of components that fail together; monitoring on the same host as the monitored services shares their failure domain}}
|
||||
|
||||
@ -48,3 +48,34 @@ role, provider, IPv4 address, and intended exposed ports above were supplied
|
||||
for this revision; obtain console and external-test evidence before marking
|
||||
them independently verified. Account rules and non-secret vault references
|
||||
are listed in \ChapterRef{Passwords}.
|
||||
\section{Verified Chapter 3 Build Host}
|
||||
\begin{longtable}{p{0.28\textwidth}p{0.62\textwidth}}
|
||||
\textbf{Component} & \textbf{Observed October 10, 2026}\\\hline
|
||||
Gitea-Project & AWS Lightsail, 184.193.0.32; Ubuntu 24.04.4; 2 GB RAM, 2 vCPU, 60 GB disk.\\
|
||||
Runner & lightsail-actions-runner, act runner 0.6.1; global scope; texlive label; Docker mode, default capacity one.\\
|
||||
Job container & Digest-pinned TeX image; limit 1 GB RAM and one CPU; no published runner port.\\
|
||||
Services & Existing Gitea 1.22.3 and Caddy 2.8.4 remain on this host.\\
|
||||
\end{longtable}
|
||||
|
||||
\section{Verified Chapter 4 CI Components}
|
||||
\begin{longtable}{p{0.27\textwidth}p{0.63\textwidth}}
|
||||
\textbf{Component} & \textbf{Observed October 23, 2026}\\\hline
|
||||
\texttt{ci.590hcm.dev} & Jenkins on existing Lightsail Gitea-Project, 184.193.0.32; DNS A TTL 300. Browser URL \url{https://ci.590hcm.dev:8443/login} through an approved SSH tunnel and local hostname mapping. Direct public CI HTTPS returns 403.\\
|
||||
Controller & Official Jenkins 2.580.1 LTS; 768 MiB/1 CPU limit; zero executors; host-loopback 8080 only; named persistent home; inbound agent port disabled.\\
|
||||
\texttt{jenkins-python-agent} & Private SSH 22, no host-published port; one exclusive python executor; 384 MiB/0.75 CPU limit; persistent workspace and host keys; Python 3.13.5.\\
|
||||
External exposure & IPv4: 22/80/443 reachable; 3000/8080/50000 timed out. IPv6: 22/80 reachable; 443/3000/8080/50000 timed out. Unrestricted SSH remains open remediation.\\
|
||||
Ownership / recovery & Existing Lightsail administrator owns CI. Restart persistence verified; no backup/restore claim. No new cloud instance or plan purchased; billing not audited.\\
|
||||
\end{longtable}
|
||||
See \ChapterRef{JenkinsCI} for the actual deployment diagram and test evidence.
|
||||
|
||||
\section{Chapter 5 Monitoring Components}
|
||||
\begin{longtable}{p{0.27\textwidth}p{0.63\textwidth}}
|
||||
\textbf{Component} & \textbf{Observed October 30, 2026 unless marked pending}\\\hline
|
||||
\texttt{metrics.590hcm.dev} & Planned Grafana HTTPS hostname through Caddy to private \texttt{grafana:3000}. Pending: Name.com DNS record and Caddy route.\\
|
||||
Prometheus & \texttt{prom/prometheus:v3.15.1}; private 9090; 30-second scrapes; 7-day retention; named volume \texttt{prometheus\_data}.\\
|
||||
Grafana OSS & \texttt{grafana/grafana:13.2.4}; private 3000 on the monitoring and existing \texttt{gitea-deploy\_internal} networks; no host port; named volume \texttt{grafana\_data}.\\
|
||||
Node Exporter & \texttt{quay.io/prometheus/node-exporter:v1.12.1}; private 9100; host root, proc, and sys mounted read-only; host PID namespace; not privileged.\\
|
||||
Blackbox Exporter & \texttt{quay.io/prometheus/blackbox-exporter:v0.29.1}; private 9115; probes the Gitea and Jenkins HTTPS login URLs.\\
|
||||
Deployment / capacity & \path{/home/ubuntu/monitoring}, a copy of the repository's \path{monitoring/} directory. Persistent 2 GiB swap file added; 592 MiB RAM available with monitoring running in one sample. Monitoring shares the instance's failure domain.\\
|
||||
\end{longtable}
|
||||
See \ChapterRef{Monitoring} for the deployment diagram and evidence status.
|
||||
|
||||
331
devopsJenkinsCI.tex
Normal file
@ -0,0 +1,331 @@
|
||||
\chapter{Continuous Integration with Jenkins}
|
||||
\ChapterLabel{JenkinsCI}
|
||||
\index{Jenkins}\index{continuous integration}\index{merge gate}
|
||||
|
||||
This chapter records the Jenkins CI implementation and the controlled failure
|
||||
and repair observed on October 23, 2026. The team continues on AWS Lightsail;
|
||||
MB reported instructor approval for that substitution for DigitalOcean.
|
||||
The application is the assignment's Python pricing example in
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app}{\texttt{SSW590Team/pricing-app}}.
|
||||
\textbf{Review status: the required Jenkins check passed, and PR~2 received teammate
|
||||
approval on October 23, 2026. The merge into main remains pending. This chapter remains
|
||||
a review draft until the merge is completed and documented.}
|
||||
|
||||
\section{Jenkins Deployment and Persistence}
|
||||
Jenkins runs as a controlled Docker service alongside the existing Gitea,
|
||||
Caddy, and Actions runner. Its official image is
|
||||
\texttt{jenkins/jenkins:2.580.1-lts-jdk21}, pinned to digest
|
||||
{\footnotesize\path{sha256:a660310e39ade10631f774bacd5219de767dfd08947ea5c32a739b5e5bb382c1}}.
|
||||
The reviewed
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/src/branch/main/deploy}{deployment directory}
|
||||
contains the non-secret Compose configuration, agent Dockerfile, initialization
|
||||
procedure, proxy configuration, and plugin record. The live stack is under
|
||||
\path{/home/ubuntu/jenkins-deploy}. The complete plugin inventory is retained
|
||||
with this review package; installed integration components include Gitea
|
||||
\texttt{286.v0740a\_413c1eb\_} and Workflow Multibranch
|
||||
\texttt{842.v3a\_b\_59b\_57b\_e6e}.
|
||||
|
||||
The Lightsail host has 2 vCPUs, 2 GB RAM, and a 60 GB disk. On October 23,
|
||||
external verification and host inspection found about 44 GB disk free.
|
||||
Observed container memory was about 498 MiB for Jenkins and 125 MiB for its
|
||||
Python agent. The controller has a 768 MiB limit, one CPU limit, and Java heap
|
||||
\texttt{-Xms128m -Xmx384m}; the agent has a 384 MiB limit and 0.75 CPU limit.
|
||||
The existing 1 GB TeX jobs should not overlap with CI unnecessarily on this
|
||||
small host. These observations are capacity checks, not a sustained load test.
|
||||
|
||||
\begin{verbatim}
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
volumes:
|
||||
- jenkins_home:/var/jenkins_home
|
||||
\end{verbatim}
|
||||
|
||||
The actual named volume is \texttt{jenkins-deploy\_jenkins\_home}.
|
||||
The named administrator account is \texttt{max}; the user personally created
|
||||
its password. Registration is disabled. Jenkins currently grants full control
|
||||
to authenticated users; only the named administrator has been provisioned.
|
||||
Do not add other accounts without reviewing that authorization strategy.
|
||||
|
||||
A controller restart test on October 23 retained the configuration, named
|
||||
administrator, Python node, multibranch job, and successful build history.
|
||||
The verification package includes before/after records, with a new test
|
||||
repeated after the PR failure and repair. Expected result: service restarts
|
||||
without loss of these objects. Actual result is recorded in the matching
|
||||
runtime JSON files. \textbf{Restart persistence is not a backup or restore test.}
|
||||
|
||||
\section{HTTPS, Access, and Firewall}
|
||||
The complete Jenkins login URL is
|
||||
\url{https://ci.590hcm.dev:8443/login}. It requires the approved SSH tunnel.
|
||||
Name.com DNS has an A record for \texttt{ci.590hcm.dev} pointing to
|
||||
\texttt{184.193.0.32}, TTL 300. On the accessing computer, map the CI name to
|
||||
loopback in the hosts file, then run the following with that operator's own
|
||||
approved Lightsail SSH key. The instructor needs approved SSH access to this
|
||||
path, but no Jenkins account merely to view the login page. Access for a new
|
||||
person must be arranged by the host owner; the owner's private key must not
|
||||
be shared.
|
||||
|
||||
\begin{verbatim}
|
||||
# Local hosts entry:
|
||||
127.0.0.1 ci.590hcm.dev
|
||||
# Use the operator's approved key file:
|
||||
ssh -i /path/to/approved-key.pem -N \
|
||||
-L 127.0.0.1:8443:127.0.0.1:443 ubuntu@184.193.0.32
|
||||
\end{verbatim}
|
||||
|
||||
Caddy terminates TLS and forwards to \texttt{jenkins:8080}. It accepts the
|
||||
CI application route only when the connection arrives from the Docker bridge
|
||||
gateway \texttt{172.18.0.1}, as it does for host-loopback SSH forwarding.
|
||||
Other CI requests receive HTTP 403. This boundary trusts the host and its
|
||||
container network. The Jenkins URL is set to
|
||||
\url{https://ci.590hcm.dev:8443/}; Caddy supplies its standard forwarded
|
||||
request headers. The certificate was validated with the normal system trust
|
||||
store: issuer Let's Encrypt YE2, valid from October 23, 2026 at 15:18:29 UTC
|
||||
through January 21, 2027 at 15:18:28 UTC.
|
||||
|
||||
The live public HTTP endpoint returned 308 with
|
||||
\url{https://ci.590hcm.dev/login} as its Location; a direct public HTTPS
|
||||
request returned 403. The tunnel URL returned 200 and rendered the login
|
||||
page. Caddy automatic HTTPS handles renewal with its existing persistent data
|
||||
volume; this was inspected as configuration, not demonstrated by waiting for
|
||||
a certificate renewal cycle \cite{caddy-ci-autohttps}. \begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.85\linewidth]{prism-uploads/ch4-https-login.jpg}
|
||||
\caption{October 23, 2026: Jenkins login form opened through the approved
|
||||
SSH tunnel at the complete HTTPS hostname. This proves web availability,
|
||||
not application test success.}\label{Figure:CILogin}
|
||||
\end{figure}
|
||||
The temporary
|
||||
\texttt{127.0.0.1:18080} tunnel used for initial setup is not the published
|
||||
operational URL.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{lcc}
|
||||
\toprule External TCP test, October 23, 2026 & IPv4 & IPv6\\\midrule
|
||||
SSH 22 & reachable & reachable\\
|
||||
HTTP 80 & reachable & reachable\\
|
||||
HTTPS 443 & reachable & timed out\\
|
||||
Gitea backend 3000 & timed out & timed out\\
|
||||
Jenkins backend 8080 & timed out & timed out\\
|
||||
Inbound agent 50000 & timed out & timed out\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Tests from the user's Mac, outside Lightsail, at 21:14:56 UTC.
|
||||
Timeouts show lack of reachability from this vantage, not a universal firewall proof.}
|
||||
\label{Table:CIExposure}
|
||||
\end{table}
|
||||
|
||||
The host is dual-stack. Cloud rules previously observed allow 80 and 22 from
|
||||
any IPv4/IPv6 address and 443 from any IPv4 address. UFW is inactive. Docker
|
||||
publishes Caddy 80/443 and binds Jenkins 8080 only to host loopback; the
|
||||
Python agent publishes no port. Jenkins' inbound agent listener is disabled.
|
||||
\textbf{Unrestricted SSH remains a corrective action inherited from Chapter 2.}
|
||||
Verify another approved administrator can still connect before narrowing it.
|
||||
No claim is made that HTTPS or the CI proxy replaces cloud and host controls.
|
||||
|
||||
\section{Gitea Trigger and Traceability}
|
||||
The repository-scoped Gitea webhook posts JSON to
|
||||
{\footnotesize\path{http://jenkins:8080/gitea-webhook/post}} on the shared container bridge.
|
||||
Its selected events are create, delete, push, pull request, and pull-request
|
||||
synchronization; the branch filter is \texttt{*}. Gitea's webhook destination
|
||||
allowlist is narrowed to \texttt{jenkins}. The network is named
|
||||
\texttt{gitea-deploy\_internal}, but its Docker \texttt{Internal} setting is
|
||||
false; it is not an egress-isolated network.
|
||||
|
||||
The dedicated restricted non-admin Gitea identity is \texttt{jenkins-ci}.
|
||||
It has write collaboration on pricing-app only. Its token scopes are
|
||||
\texttt{read:user} and \texttt{write:repository}; the latter is needed because
|
||||
this Gitea version groups commit-status writing with repository write.
|
||||
Automatic webhook administration is disabled for this identity. The human
|
||||
repository administrator configures the hook.
|
||||
|
||||
Jenkins uses the Gitea plugin with a Multibranch Pipeline. The API endpoint is
|
||||
\path{http://gitea:3000}; checkout uses the same private route. PR discovery
|
||||
uses strategy \texttt{HEAD}, not a synthetic merge revision. Fork PR
|
||||
discovery is not enabled. For the repair, webhook delivery
|
||||
\path{86a0253b-7fd1-430b-a019-1c5fb4329727} recorded
|
||||
\texttt{pull\_request\_sync}, HTTP 200, body \texttt{Processed}, at
|
||||
21:14:24 UTC. It triggered
|
||||
\href{https://ci.590hcm.dev:8443/job/pricing-app/job/PR-2/2/}{PR-2 build 2}
|
||||
for commit \texttt{747ed9a82f}. A delivered webhook only proves transport;
|
||||
the matching run and status below prove verification.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\begin{tikzpicture}[node distance=9mm,box/.style={draw,rounded corners,align=center,font=\scriptsize,inner sep=5pt},>=stealth]
|
||||
\node[box] (browser) {\textless\textless device\textgreater\textgreater\\Team browser + SSH tunnel};
|
||||
\node[box,below=of browser] (proxy) {\textless\textless container\textgreater\textgreater\\Caddy TLS proxy};
|
||||
\node[box,below left=13mm and 5mm of proxy] (gitea) {\textless\textless container\textgreater\textgreater\\Gitea 1.22.3};
|
||||
\node[box,below right=13mm and 5mm of proxy] (controller) {\textless\textless container\textgreater\textgreater\\Jenkins controller\\0 executors};
|
||||
\node[box,below=19mm of controller] (agent) {\textless\textless container\textgreater\textgreater\\Python SSH agent\\checkout + tests; 1 executor};
|
||||
\node[box,below=19mm of gitea] (data) {\textless\textless volume\textgreater\textgreater\\Gitea repositories + SQLite};
|
||||
\node[box,right=10mm of controller] (home) {\textless\textless volume\textgreater\textgreater\\Jenkins home};
|
||||
\draw[->] (browser)--node[right,font=\tiny]{SSH to host; local 8443 to host 443}(proxy);
|
||||
\draw[->] (proxy)--node[above right,font=\tiny]{private 8080}(controller);
|
||||
\draw[->] (proxy)--node[above left,font=\tiny]{private 3000}(gitea);
|
||||
\draw[->] (gitea)--node[above,font=\tiny]{webhook 8080}(controller);
|
||||
\draw[->] (controller) to[bend left=18] node[below,font=\tiny]{API status 3000}(gitea);
|
||||
\draw[->] (controller)--node[right,font=\tiny]{private SSH 22}(agent);
|
||||
\draw[->] (agent) to[bend left=12] node[below,font=\tiny]{checkout 3000}(gitea);
|
||||
\draw[->] (gitea)--(data);\draw[->] (controller)--(home);
|
||||
\end{tikzpicture}
|
||||
\caption{Actual deployment on the AWS Lightsail device Gitea-Project.
|
||||
Caddy is reached through the approved access path; webhook, agent, and data
|
||||
connections stay on the container bridge. Public CI requests are denied.}
|
||||
\label{Figure:CIDeployment}
|
||||
\end{figure}
|
||||
|
||||
\section{Versioned Pipeline and Tests}
|
||||
The root
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/src/branch/main/Jenkinsfile}{Jenkinsfile}
|
||||
uses the \texttt{python} agent label. Checkout fetches the selected revision;
|
||||
the run prints its exact commit and Python version. The next stage compiles
|
||||
\texttt{pricing.py}; the final stage runs unittest discovery. These checks
|
||||
use Python 3.13.5 and its standard library, with no pip dependency. The
|
||||
agent image derives from official Jenkins SSH Agent digest
|
||||
{\footnotesize\path{sha256:5af828cead1f8f69162f6e1d827b8a6712007c13438ca9db01ae34e11ed07fd3}}
|
||||
and installs Debian's \texttt{python3=3.13.5-1}. Transitive Debian packages
|
||||
are not fully locked; record an image digest on rebuild.
|
||||
|
||||
To reproduce from a clean checkout of the linked commit on an executor with
|
||||
Python installed:
|
||||
\begin{verbatim}
|
||||
python3 --version
|
||||
python3 -m py_compile pricing.py
|
||||
python3 -m unittest discover -s tests -v
|
||||
\end{verbatim}
|
||||
Expected passing output is two tests and \texttt{OK}. The intentional
|
||||
regression passed syntax checking but failed \texttt{test\_total}:
|
||||
\texttt{AssertionError: 13 != 30}; Jenkins returned FAILURE. The repaired
|
||||
commit passed both stages and returned SUCCESS. The run uses
|
||||
\path{/home/jenkins/agent} in the agent container; the controller does not
|
||||
execute application tests \cite{jenkins-ci-isolation}.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=\linewidth]{prism-uploads/ch4-jenkins-repair-run.jpg}
|
||||
\caption{October 23, 2026: PR-2 build 2 shows SUCCESS, the private webhook
|
||||
origin, and repair commit 747ed9a82feee9018ac8fe0d9eab8c007d23caf8.
|
||||
The Jenkins UI displays its own timezone; the narrative uses UTC explicitly.}
|
||||
\label{Figure:CIRepairRun}
|
||||
\end{figure}
|
||||
|
||||
\section{Required Merge Gate}
|
||||
The \texttt{main} protection rule disables direct pushes, requires one
|
||||
approval, dismisses stale approvals, blocks rejected reviews, and requires
|
||||
the exact context \path{pricing-app/pipeline/pr-main}. The branch build's
|
||||
\path{pricing-app/pipeline/head} context is distinct and cannot satisfy
|
||||
that PR-specific rule. The Gitea plugin publishes pending and final results
|
||||
using the integration identity; after repair, the successful required status
|
||||
belongs to the new PR head commit, not the earlier failed commit.
|
||||
|
||||
\textbf{Administrator exception:} this Gitea 1.22 installation displays an
|
||||
administrator override. The screenshots were captured from the owner's
|
||||
account, so they show that exception. No override was used. The required
|
||||
check is configured for the normal merge process, but an absolute guarantee
|
||||
that administrators cannot bypass it has not been demonstrated. Peer review
|
||||
was completed on October 23, 2026. The normal merge remains necessary before final submission.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=\linewidth]{prism-uploads/ch4-failed-check.jpg}
|
||||
\caption{October 23, 2026: failed commit 5c837eaae7a49a1a24b9aa1d9ac2b886b5b9be14;
|
||||
required context pricing-app/pipeline/pr-main is red. The normal conditions
|
||||
are unmet; the owner interface separately exposes its administrator override.
|
||||
See \href{https://git.590hcm.dev/SSW590Team/pricing-app/pulls/2}{PR 2} and
|
||||
\href{https://ci.590hcm.dev:8443/job/pricing-app/job/PR-2/1/}{failed run 1}.}
|
||||
\label{Figure:CIFailedGate}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=\linewidth]{prism-uploads/ch4-passing-check.jpg}
|
||||
\caption{October 23, 2026: repair commit 747ed9a82feee9018ac8fe0d9eab8c007d23caf8;
|
||||
required context pricing-app/pipeline/pr-main is green. Teammate approval was recorded on October 23, 2026. See the same PR and
|
||||
\href{https://ci.590hcm.dev:8443/job/pricing-app/job/PR-2/2/}{passing run 2}.}
|
||||
\label{Figure:CIPassingGate}
|
||||
\end{figure}
|
||||
|
||||
\section{Failure, Repair, and Review}
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/issues/1}{Issue 1}
|
||||
defines the exercise. \href{https://git.590hcm.dev/SSW590Team/pricing-app/pulls/2}{PR 2}
|
||||
contains \texttt{Closes \#1}.
|
||||
The source branch is:
|
||||
\begin{verbatim}
|
||||
feature/issue-1-ci-validation
|
||||
\end{verbatim}
|
||||
Its base is \texttt{main}.
|
||||
The controlled change replaced multiplication with addition, then a second
|
||||
commit restored multiplication on that same branch. Thus the final net code
|
||||
diff is empty while the two commits and both build outcomes remain auditable.
|
||||
|
||||
\begin{longtable}{L{2.3cm}L{3.1cm}L{6.5cm}}
|
||||
\toprule October 23 (UTC) & Commit / run & Expected and actual result\\\midrule
|
||||
21:10--21:11 & \texttt{5c837eaae7}; PR-2/1 & Syntax passes; test\_total fails, 13 instead of 30. Jenkins FAILURE and required PR status failure observed.\\
|
||||
21:14 & \texttt{747ed9a82f}; PR-2/2 & Correction restores multiplication. New webhook, checkout of new head, two tests pass, Jenkins SUCCESS and required PR status success observed.\\
|
||||
Completed & Peer review & Hailey reviewed and approved PR 2 on October 23, 2026, after confirming the intentional Jenkins failure, successful repair, and passing required check.\\
|
||||
Pending & Merge / closure & Merge through the normal reviewed flow, confirm merge SHA and automatic issue closure, then finalize this chapter.\\\bottomrule
|
||||
\end{longtable}
|
||||
|
||||
Both PR runs are retained and their sanitized console logs are in the review
|
||||
package. Application code was changed in a feature branch; neither Gitea nor
|
||||
Jenkins was intentionally broken. A controller restart was an operational
|
||||
persistence test, not the failure exercise.
|
||||
|
||||
\section{Credentials and Build Boundary}
|
||||
The Gitea token is in Jenkins credentials under
|
||||
\texttt{gitea-jenkins-ci-token}; the agent SSH key is a SYSTEM credential
|
||||
\texttt{python-agent-ssh}. Values are excluded from this manual and source
|
||||
control. The host's protected secrets directory retains bootstrap/operator
|
||||
material outside the repository; temporary controller bootstrap files were
|
||||
removed after import. Restrict that directory to administrators and review
|
||||
retention when rotating credentials.
|
||||
|
||||
The controller has zero executors and its inbound agent TCP listener is
|
||||
disabled. The agent has one exclusive \texttt{python} executor and a pinned
|
||||
SSH host key. Neither CI container mounts the Docker socket or the host's
|
||||
administrative SSH key. The Jenkinsfile can execute arbitrary commands:
|
||||
pricing-app writers, including the explicitly approved integration identity,
|
||||
must be trusted. Do not give untrusted contributions credentials; fork PR
|
||||
discovery is disabled. Separate containers reduce exposure but do not make
|
||||
malicious trusted pipeline code safe.
|
||||
|
||||
The operator's plugin check compares the recorded installed versions with
|
||||
Jenkins' official update-center metadata, refreshed through Check now on October 23. The evidence records the
|
||||
check time and any version differences; this is a check, not an automatic
|
||||
upgrade. Review advisories, compatibility, and available capacity before
|
||||
updating. The check found Pipeline API 1413.v2ff1a\_5e720fa\_ installed and 1429.v7a\_1b\_efb\_a\_f7c5 available; installation was deferred for compatibility review. Retain the known-good image and plugin record for rollback.
|
||||
|
||||
\begin{enumerate}
|
||||
\item Failed webhook: inspect its delivery status/body and event type in Gitea;
|
||||
check the allowed destination \texttt{jenkins}, Docker DNS/network, container
|
||||
state, and Jenkins webhook logs. Correlate the delivery with its SHA and run.
|
||||
Do not publish 8080 as a shortcut.
|
||||
\item Checkout failure: verify the integration account still has pricing-app
|
||||
access, token scope and Jenkins credential ID, and agent reachability to
|
||||
\texttt{gitea:3000}. Do not print tokens while testing.
|
||||
\item Test failure: identify the failing stage and assertion, fix code on the
|
||||
same feature branch, and push. Confirm the new run/status matches the new SHA.
|
||||
\item Offline agent or memory pressure: check the private SSH host key,
|
||||
credential, node log, container limits, disk space, and concurrent TeX builds.
|
||||
Do not disable host-key verification or grant Docker privileges.
|
||||
\item Restart: from \path{/home/ubuntu/jenkins-deploy}, run
|
||||
\texttt{docker compose restart} for the \texttt{jenkins} and \texttt{python-agent} services; verify login, agent
|
||||
online state, job history, and a new check. Never remove named volumes as
|
||||
routine troubleshooting.
|
||||
\end{enumerate}
|
||||
|
||||
\section{Manual Quality and Controls}
|
||||
This revision records the implementation narrative, actual deployment
|
||||
diagram, links to configuration and matching runs, dated failed/passing check
|
||||
screenshots, and the known limits above. The Hosts and Passwords CI entries,
|
||||
history, glossary/index, and citations support the chapter. The existing AI-use
|
||||
log records the original drafting work. Version 1.11 remains a review draft
|
||||
until the normal merge and issue closure are recorded.
|
||||
The original chapters remain part of the existing manual.
|
||||
|
||||
The service owner is the existing Lightsail administrator. No new cloud
|
||||
instance or paid plan was purchased; actual billing remains in the owner's
|
||||
account and was not audited here. Cleanup after the course requires an owner
|
||||
decision: preserve/export required evidence and configuration before removing
|
||||
the CI service. Do not delete Gitea data or Jenkins volumes as part of this
|
||||
review. Password hints identify storage and purpose only.
|
||||
|
||||
Remaining finalization items are merge and issue-closure evidence,
|
||||
verification of the instructor's own approved private access path, and a
|
||||
decision on the inherited unrestricted SSH exposure and administrator merge
|
||||
override. These remain open; green CI and peer approval do not complete them.
|
||||
948
devopsMonitoring.tex
Normal file
@ -0,0 +1,948 @@
|
||||
\chapter{Introduction to SRE: Monitoring and Reliability}
|
||||
\ChapterLabel{Monitoring}
|
||||
\index{monitoring}\index{Prometheus}\index{Grafana}\index{service-level objective}
|
||||
|
||||
This chapter records the Chapter 5 monitoring deployment for the existing
|
||||
Gitea and Jenkins services, following Chapter 5 of \texttt{dosManual-V1.42}.
|
||||
The team continues on the AWS Lightsail \texttt{Gitea-Project} instance
|
||||
approved in \ChapterRef{JenkinsCI}. Prometheus, Grafana OSS, Node Exporter,
|
||||
and Blackbox Exporter were deployed on October 30, 2026. The non-secret
|
||||
configuration is in
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/src/branch/main/monitoring}{\texttt{monitoring/}}
|
||||
on pricing-app \texttt{main}, merged through
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/pulls/4}{pricing-app PR~4}
|
||||
for \href{https://git.590hcm.dev/SSW590Team/pricing-app/issues/3}{issue~3}
|
||||
at commit
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/commit/c5716f70993208cd73a4c3d92892008017f5e35a}{\texttt{c5716f7}}.
|
||||
\textbf{Review status, November 4, 2026: all eight evidence sections pass.
|
||||
Remaining limitations are stated where they apply, such as the untested
|
||||
backup restore and the shared failure domain. Items marked
|
||||
\StatusPending{} are follow-ups, not completed work.}
|
||||
|
||||
The eight sections below match the eight required evidence sections and
|
||||
rubric rows of the assignment. Each section separates what is configured from
|
||||
what has been verified.
|
||||
|
||||
\begin{tabularx}{\linewidth}{L{0.5cm}L{4.0cm}L{1.9cm}Y}
|
||||
\caption{Chapter 5 Evidence Status by Rubric Section\label{Table:MonitoringStatus}}\\
|
||||
\toprule \textbf{\#} & \textbf{Evidence section (points)} & \textbf{Status} & \textbf{Open items}\\\midrule
|
||||
\endfirsthead
|
||||
\toprule \textbf{\#} & \textbf{Evidence section (points)} & \textbf{Status} & \textbf{Open items}\\\midrule
|
||||
\endhead
|
||||
\bottomrule
|
||||
\endlastfoot
|
||||
1 & Deployment and reproducibility (15) & \StatusPass & Baseline commit, second-member verification (CC), restart persistence, and backup recorded.\\
|
||||
2 & Metrics and probes (15) & \StatusPass & Host comparison and target health recorded (Nov.~1); Jenkins probe exception approved (Nov.~4).\\
|
||||
3 & HTTPS and access control (10) & \StatusPass & Grafana HTTPS, Caddy route, and outside tests recorded; public Grafana \texttt{/metrics} closed (Nov.~4).\\
|
||||
4 & Dashboard and CI correlation (15) & \StatusPass & Dashboard recorded (Nov.~1); build comparison for PR-4 build 15 (Nov.~4).\\
|
||||
5 & SLI, SLO, and error budget (10) & \StatusPass & Definitions, worked example, and measured incident window (Nov.~2).\\
|
||||
6 & Alerts and runbooks (15) & \StatusPass & Both rules fired, emailed, and resolved; receipt confirmed; runbook links live (Nov.~2).\\
|
||||
7 & Incident and recovery (10) & \StatusPass & Exercise, timeline, review, owned issues 5 and 6, and post-incident pipeline and commit status (Nov.~2--4).\\
|
||||
8 & Manual integration and traceability (10) & \StatusPass & Both repositories merged to \texttt{main}; Actions run~9 built the PDF (Nov.~4).\\
|
||||
\end{tabularx}
|
||||
|
||||
\section{Deployment and Reproducibility}
|
||||
\label{sec:mon-deployment}
|
||||
|
||||
\subsection{Baseline and Change Plan}
|
||||
Issue~3 tracks the change; implementation is on
|
||||
\texttt{feature/issue-3-monitoring}, and MB is the implementation owner.
|
||||
\StatusPass{} The change starts from pricing-app \texttt{main} at commit
|
||||
\texttt{db64ac1} (``Add Jenkins deployment configuration and operator
|
||||
notes'', October 23, 2026), the base of \texttt{feature/issue-3-monitoring}.
|
||||
The last passing Jenkins run before the change is PR-2 build 2 on October 23
|
||||
(\autoref{Figure:CIRepairRun}). The manual's automated PDF build is recorded
|
||||
in \autoref{sec:mon-manual}.
|
||||
|
||||
CC, a second team member who did not deploy the stack, verified the
|
||||
deployment from November 1 to 4: scrape targets and host metrics
|
||||
(\autoref{sec:mon-metrics}), HTTPS and outside exposure
|
||||
(\autoref{sec:mon-access}), both alert rules end to end
|
||||
(\autoref{sec:mon-alerts}), the controlled incident and recovery
|
||||
(\autoref{sec:mon-incident}), restart persistence, and the backup procedure
|
||||
below.
|
||||
|
||||
The host runs Ubuntu 24.04.4 with two virtual CPUs, 2~GB RAM, and a 60~GB
|
||||
root disk. Before deployment, at 22:33~UTC on October 30, about 612~MB RAM and
|
||||
44~GB of the ext4 root filesystem were available. Five containers were
|
||||
already running: Gitea, Jenkins, its Python agent, the Actions runner, and
|
||||
Caddy. A normal Jenkins build reduced available RAM to 274~MiB before Grafana
|
||||
started, so the host had little memory headroom. A persistent 2~GiB swap file
|
||||
was added. At 23:00~UTC, with all four monitoring containers running,
|
||||
592~MiB RAM was available and 687~MiB swap was in use. One sample showed
|
||||
Grafana at approximately 207~MiB, Prometheus 43~MiB, Node Exporter 13~MiB,
|
||||
and Blackbox Exporter 19~MiB. These are point observations, not a sustained
|
||||
load test; swap use and build latency must be rechecked during later builds.
|
||||
|
||||
\subsection{Versions, Images, and Retention}
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{2.6cm}L{9.4cm}}
|
||||
\toprule Component & Publisher image, pinned tag, and pulled digest\\\midrule
|
||||
Prometheus & \texttt{prom/prometheus:v3.15.1}\newline
|
||||
{\scriptsize\path{sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2}}\\
|
||||
Grafana OSS & \texttt{grafana/grafana:13.2.4}\newline
|
||||
{\scriptsize\path{sha256:dbbc38ea21103cefb50396340cd88afec779c7e070b0a7bf5a75b4ce46651d3f}}\\
|
||||
Node Exporter & \texttt{quay.io/prometheus/node-exporter:v1.12.1}\newline
|
||||
{\scriptsize\path{sha256:1b4e4438faca4dd7e001dd445d161a4a2091b0fededa84093b3a8dfeae1f1be0}}\\
|
||||
Blackbox Exporter & \texttt{quay.io/prometheus/blackbox-exporter:v0.29.1}\newline
|
||||
{\scriptsize\path{sha256:ea1c7aa3ef3f307cd03e85f34abb604478ccb90b567fc690da0cd9776da76b13}}\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Monitoring images. Tags are set in the host's \texttt{.env}, which
|
||||
contains version choices only. Digests are each image's \texttt{RepoDigests}
|
||||
from \texttt{docker image inspect IMAGE:TAG} on the host, November 1, 2026.}
|
||||
\label{Table:MonitoringImages}
|
||||
\end{table}
|
||||
|
||||
All four images come from the projects' own repositories
|
||||
\cite{PrometheusInstall,GrafanaDocker,NodeExporter,BlackboxExporter}.
|
||||
Prometheus retains seven days of time-series data, the assignment's suggested
|
||||
lab starting point; about 44~GB of disk was free before deployment.
|
||||
|
||||
\subsection{Deployment Architecture}
|
||||
\begin{figure}[htbp]\centering
|
||||
\begin{tikzpicture}[box/.style={draw,rounded corners,align=center,font=\scriptsize,inner sep=4pt,minimum width=2.3cm},mon/.style={box,fill=devopsLightBlue},lbl/.style={font=\tiny,inner sep=1.5pt},>=stealth]
|
||||
\node[box] (browser) at (0,0) {\textless\textless device\textgreater\textgreater\\Team / grader browser};
|
||||
\node[box] (caddy) at (0,-1.6) {\textless\textless container\textgreater\textgreater\\Caddy 2.8.4 TLS proxy};
|
||||
\node[box] (dest) at (5.9,-1.6) {Notification destination\\(pending)};
|
||||
\node[box] (gitea) at (-4,-3.4) {Gitea 1.22.3\\private 3000};
|
||||
\node[box] (jenkins) at (0,-3.4) {Jenkins 2.580.1\\private 8080};
|
||||
\node[mon] (grafana) at (3.4,-3.4) {Grafana OSS\\private 3000};
|
||||
\node[box] (gvol) at (6.3,-3.4) {\textless\textless volume\textgreater\textgreater\\grafana\_data};
|
||||
\node[mon] (bbox) at (-2.2,-5.6) {Blackbox Exporter\\private 9115};
|
||||
\node[mon] (prom) at (3.4,-5.6) {Prometheus\\private 9090};
|
||||
\node[box] (pvol) at (6.3,-5.6) {\textless\textless volume\textgreater\textgreater\\prometheus\_data};
|
||||
\node[mon] (node) at (3.4,-7.5) {Node Exporter\\private 9100\\host /, proc, sys (ro)};
|
||||
\draw[->] (browser)--node[lbl,right]{HTTPS 443}(caddy);
|
||||
\draw[->] (caddy.west)-|(gitea.north);
|
||||
\draw[->] (caddy.south)--(jenkins.north);
|
||||
\draw[->] (caddy.east)-|node[lbl,above,pos=0.3]{metrics (pending)}(grafana.north);
|
||||
\draw[->] (grafana.south)--node[lbl,right]{query API}(prom.north);
|
||||
\draw[->] (prom.west)--node[lbl,above]{scrape}(bbox.east);
|
||||
\draw[->] (prom.south)--node[lbl,right]{scrape}(node.north);
|
||||
\draw[->,dashed] (bbox.north)|-node[lbl,left,pos=0.2]{HTTPS probes}(-0.8,-2.5)--(-0.8,-1.6|-caddy.south);
|
||||
\draw (grafana.east)--(gvol.west);
|
||||
\draw (prom.east)--(pvol.west);
|
||||
\draw[->,dotted] (grafana.north east)--(dest.south west);
|
||||
\end{tikzpicture}
|
||||
\caption{Actual deployment on the AWS Lightsail instance Gitea-Project.
|
||||
Shaded boxes are the four new monitoring containers. Grafana joins Caddy's
|
||||
existing \texttt{gitea-deploy\_internal} network; Prometheus and both
|
||||
exporters stay on the private \texttt{monitoring} network. No monitoring port
|
||||
is published on the host. Dashed: HTTPS probes through the proxy. Dotted: alert
|
||||
notifications, not yet delivered.}
|
||||
\label{Figure:MonitoringDeployment}
|
||||
\end{figure}
|
||||
|
||||
Caddy runs as a container, so Grafana has no host loopback port mapping; it is
|
||||
attached to the existing proxy network, declared external in Compose so it is
|
||||
reused rather than recreated. Node Exporter receives the host root,
|
||||
\texttt{/proc}, and \texttt{/sys} read-only and the host PID namespace, which
|
||||
are needed for whole-host CPU, memory, and disk metrics. It is not privileged
|
||||
and no monitoring container mounts the Docker socket. Because Node Exporter
|
||||
uses the bridge network, its network-interface metrics do not represent all
|
||||
host interfaces.
|
||||
|
||||
\subsection{Startup, Update, and Recovery}
|
||||
The live deployment directory is \path{/home/ubuntu/monitoring}; it is a copy
|
||||
of the repository's \path{monitoring/} directory, not a Git checkout. From that
|
||||
directory:
|
||||
\begin{verbatim}
|
||||
docker compose config --quiet
|
||||
docker compose pull
|
||||
docker compose run --rm --no-deps --entrypoint /bin/promtool \
|
||||
prometheus check config /etc/prometheus/prometheus.yml
|
||||
docker compose up -d
|
||||
docker compose ps
|
||||
docker compose logs --tail=50
|
||||
\end{verbatim}
|
||||
Use \texttt{docker compose stop} and \texttt{docker compose start} for routine
|
||||
pauses. Never run \texttt{docker compose down -v}: it deletes the named
|
||||
volumes and all monitoring history. To upgrade, back up state, change one
|
||||
pinned tag, pull and recreate only that service, then verify health and
|
||||
persistence. Dashboards, the data source, and alert rules are provisioned
|
||||
from read-only files in Git, so they can be rebuilt; Prometheus history and
|
||||
Grafana runtime state cannot.
|
||||
|
||||
\paragraph{Backup procedure.} Each named volume is archived while its
|
||||
service is briefly stopped, so the archive is consistent. Run from
|
||||
\path{/home/ubuntu/monitoring}:
|
||||
\begin{verbatim}
|
||||
mkdir -p ~/backups
|
||||
for s in prometheus grafana; do
|
||||
docker compose stop $s
|
||||
docker run --rm -v monitoring_${s}_data:/data:ro \
|
||||
-v ~/backups:/backup alpine \
|
||||
tar czf /backup/${s}_data-$(date -u +%Y%m%dT%H%MZ).tgz -C /data .
|
||||
docker compose start $s
|
||||
done
|
||||
\end{verbatim}
|
||||
To restore one service, stop it, empty its volume, extract the archive into
|
||||
the volume with the same \texttt{alpine} container (\texttt{tar xzf} into
|
||||
\texttt{/data}), and start it again. Before an image upgrade, take a backup
|
||||
first; Grafana and Prometheus can change their storage format, so rolling
|
||||
back to an older image must use the backup taken before the upgrade, not
|
||||
the upgraded volume.
|
||||
|
||||
\StatusPass{} The procedure ran on November 2 at 16:39~UTC
|
||||
(\autoref{Figure:MonitoringBackup}): \path{prometheus_data-20261102T1639Z.tgz}
|
||||
(12~MB) and \path{grafana_data-20261102T1639Z.tgz} (163~MB). Each service was
|
||||
down for a few seconds, and both returned to running; Grafana logged its
|
||||
startup at 16:40:27~UTC. Because the Grafana archive contains its database,
|
||||
both archives were restricted to mode 0600 on November 4. \StatusPending{}
|
||||
The archives are on the same host, so they do not survive loss of the
|
||||
instance; copy them off the host. A restore has not been tested.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.8\linewidth]{prism-uploads/ch5-backup.png}
|
||||
\caption{Backup archives of the two monitoring volumes, November 2, 2026.}
|
||||
\label{Figure:MonitoringBackup}
|
||||
\end{figure}
|
||||
|
||||
\subsection{Restart Persistence}
|
||||
\StatusPass{} After the incident on November 2, Prometheus was restarted at
|
||||
16:03:58~UTC and Grafana at 16:05:12~UTC with \texttt{docker compose restart},
|
||||
one at a time and without removing volumes
|
||||
(\autoref{Figure:MonitoringRestart}). Afterward the dashboard loaded through
|
||||
the provisioned Prometheus data source and still showed the earlier hour,
|
||||
including the Jenkins outage at 15:48--15:52~UTC
|
||||
(\autoref{Figure:MonitoringIncidentDashboard}). The HTTPS rule's state
|
||||
history, including October 30 entries, was still present after the Grafana
|
||||
restart (\autoref{Figure:MonitoringIncidentHistory}). No collection gap is
|
||||
visible at the dashboard's resolution; a gap shorter than one 30-second
|
||||
scrape could still exist. A restart test shows persistence, not a successful
|
||||
backup restore.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.85\linewidth]{prism-uploads/ch5-restart-persistence.png}
|
||||
\caption{Separate Prometheus and Grafana restarts with UTC timestamps,
|
||||
November 2, 2026.}
|
||||
\label{Figure:MonitoringRestart}
|
||||
\end{figure}
|
||||
|
||||
\section{Metrics and Probes}
|
||||
\label{sec:mon-metrics}
|
||||
|
||||
\subsection{Scrape Configuration and Target Health}
|
||||
Prometheus scrapes every 30 seconds. The \texttt{https} job uses the
|
||||
multi-target pattern: each login URL becomes the probe target and
|
||||
\texttt{instance} label, and the scrape is sent to Blackbox Exporter's
|
||||
\texttt{/probe} endpoint. Blackbox Exporter's own metrics are a separate job.
|
||||
\begin{verbatim}
|
||||
- job_name: https
|
||||
metrics_path: /probe
|
||||
params: {module: [http_2xx]}
|
||||
static_configs:
|
||||
- targets:
|
||||
- https://git.590hcm.dev/user/login
|
||||
- https://ci.590hcm.dev/login
|
||||
relabel_configs:
|
||||
- {source_labels: [__address__], target_label: __param_target}
|
||||
- {source_labels: [__param_target], target_label: instance}
|
||||
- {target_label: __address__, replacement: blackbox-exporter:9115}
|
||||
\end{verbatim}
|
||||
On October 30, Prometheus reported all five configured scrape targets up:
|
||||
Prometheus itself, Node Exporter, Blackbox Exporter, and the two probe
|
||||
targets. For the probe targets, \texttt{up=1} means Blackbox Exporter was
|
||||
scraped; it does not mean the HTTPS request succeeded.
|
||||
\StatusPass{} On November 1 at 21:55:25~UTC, an \texttt{up} query in
|
||||
Grafana Explore returned five series, one per target, and the graph shows
|
||||
all five at 1 for the previous hour (\autoref{Figure:MonitoringTargetHealth}).
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.85\linewidth]{prism-uploads/ch5-target-health.png}
|
||||
\caption{\texttt{up} for all five scrape targets in Grafana Explore,
|
||||
November 1, 2026. Times are Eastern Standard Time (UTC$-5$); 16:55:25 EST
|
||||
is 21:55:25 UTC.}
|
||||
\label{Figure:MonitoringTargetHealth}
|
||||
\end{figure}
|
||||
|
||||
\subsection{Probe Success Criteria}
|
||||
The \texttt{http\_2xx} module sends an IPv4 \texttt{GET} with a 10-second
|
||||
timeout and full TLS verification. A probe succeeds only when DNS resolves,
|
||||
the certificate and hostname are valid, and the final response is 2xx.
|
||||
A login-page response is used, not a content check. A successful probe does
|
||||
not show that authenticated Git operations or a Jenkins build work.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{3.4cm}L{2.0cm}L{6.4cm}}
|
||||
\toprule Target & Status & Observation\\\midrule
|
||||
Gitea login & \StatusPass & October 30: HTTP 200 with valid TLS from the host. November 1, 18:14:58 UTC: \path{probe_success} = 1.\\
|
||||
Jenkins login & \StatusPass & October 30: HTTP 403, an access-policy denial rather than an outage. November 1, 18:14:58 UTC, after the probe exception below: \path{probe_success} = 1.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{HTTPS probe results. November 1 values are from an instant
|
||||
\texttt{probe\_success} query against Prometheus on the host.}
|
||||
\label{Table:MonitoringProbes}
|
||||
\end{table}
|
||||
|
||||
\subsection{Jenkins Probe Exception}
|
||||
Chapter 4 restricts Jenkins to the approved SSH tunnel; all other CI requests
|
||||
receive 403. Blackbox Exporter probes the public hostname, so its requests
|
||||
leave the instance and return through the public address. A narrow exception
|
||||
in the live \path{/home/ubuntu/gitea-deploy/Caddyfile} (mounted at
|
||||
\path{/etc/caddy/Caddyfile}) forwards only requests that match all three
|
||||
conditions; the pre-change file is retained as \path{Caddyfile.pre-ch5}.
|
||||
The excerpt below is reformatted, with its comment removed; the rules are
|
||||
unchanged.
|
||||
\begin{verbatim}
|
||||
ci.590hcm.dev {
|
||||
@ssh_tunnel remote_ip 172.18.0.1
|
||||
handle @ssh_tunnel { reverse_proxy jenkins:8080 }
|
||||
@probe {
|
||||
remote_ip 184.193.0.32/32
|
||||
method GET
|
||||
path /login
|
||||
}
|
||||
handle @probe { reverse_proxy jenkins:8080 }
|
||||
handle { respond "Jenkins requires the approved SSH tunnel." 403 }
|
||||
}
|
||||
\end{verbatim}
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{6.6cm}L{2.4cm}L{2.6cm}}
|
||||
\toprule Request, November 1, 2026 & From the host & From outside Lightsail\\\midrule
|
||||
\texttt{GET https://ci.590hcm.dev/login} & 200 & 403\\
|
||||
\texttt{GET https://ci.590hcm.dev/} & 403 & 403\\
|
||||
\texttt{GET https://git.590hcm.dev/user/login} & --- & 200\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Jenkins exception tests with \texttt{curl}, about 18:15 UTC. The
|
||||
outside test ran from a team member's Windows computer on a residential
|
||||
connection. The exception does not open Jenkins to the Internet.}
|
||||
\label{Table:MonitoringProbeException}
|
||||
\end{table}
|
||||
|
||||
The exception trusts the instance's own public address, so any process or
|
||||
container on the host, not only Blackbox Exporter, can load the Jenkins login
|
||||
page. Only \texttt{GET /login} matches; the sign-in form submits a
|
||||
\texttt{POST} to a different path, which the exception does not match, so it
|
||||
cannot be used to authenticate. This is an intentional change to the Chapter 4 access boundary.
|
||||
\StatusPass{} Caddy was reloaded with the exception on November 1, before
|
||||
the first successful Jenkins probe at 18:14:58~UTC; the exact reload time was
|
||||
not recorded. The previous file is kept as
|
||||
\path{/home/ubuntu/gitea-deploy/Caddyfile.pre-ch5} for rollback. The
|
||||
teammate who owns the Chapter 4 access policy reviewed and approved the
|
||||
exception on November 4.
|
||||
|
||||
\subsection{Metric Inventory}
|
||||
\begin{tabularx}{\linewidth}{L{3.3cm}L{1.3cm}L{1.2cm}Y}
|
||||
\caption{Metric Inventory\label{Table:MetricInventory}}\\
|
||||
\toprule \textbf{Metric} & \textbf{Type} & \textbf{Unit} & \textbf{Meaning and limitation}\\\midrule
|
||||
\endfirsthead
|
||||
\toprule \textbf{Metric} & \textbf{Type} & \textbf{Unit} & \textbf{Meaning and limitation}\\\midrule
|
||||
\endhead
|
||||
\bottomrule
|
||||
\endlastfoot
|
||||
\path{node_cpu_seconds_total} & counter & seconds & CPU time per CPU and mode. Utilization is derived from its rate, never its lifetime total. Whole host; does not attribute use to a container.\\
|
||||
\path{node_memory_MemAvailable_bytes} & gauge & bytes & Kernel estimate of memory available to applications, not simply unused RAM.\\
|
||||
\path{node_filesystem_avail_bytes}, \path{node_filesystem_size_bytes} & gauge & bytes & Space on the host root filesystem, selected by \texttt{device="/dev/root"}, \texttt{fstype="ext4"}, mountpoint \texttt{/}. Overlay and pseudo filesystems are excluded.\\
|
||||
\texttt{up} & gauge & 0/1 & Whether Prometheus scraped the target. For the \texttt{https} job it reflects the exporter, not the probed service.\\
|
||||
\path{probe_success} & gauge & 0/1 & Whether the HTTPS probe met the success criteria above.\\
|
||||
\path{probe_duration_seconds} & gauge & seconds & Total probe time, including DNS, TLS, and HTTP. Measured from this host only.\\
|
||||
\end{tabularx}
|
||||
|
||||
\subsection{Host Verification}
|
||||
The root filesystem labels \texttt{/dev/root}, \texttt{ext4}, and \texttt{/}
|
||||
were confirmed from the exported series. \StatusPass{} On November 1 at
|
||||
21:49:23~UTC, \texttt{free -b} and \texttt{df -B1 /} ran on the host, and
|
||||
Prometheus was queried for the matching Node Exporter series within the
|
||||
next second (sample timestamps 21:49:23.890 to 21:49:24.481~UTC), in one
|
||||
command from \path{/home/ubuntu/monitoring}.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{3.0cm}L{2.6cm}L{4.2cm}L{2.8cm}}
|
||||
\toprule Quantity & Host command (bytes) & Prometheus series (bytes) & Difference\\\midrule
|
||||
Total memory & 1{,}998{,}614{,}528 & \path{node_memory_MemTotal_bytes} 1{,}998{,}614{,}528 & exact\\
|
||||
Available memory & 839{,}430{,}144 & \path{node_memory_MemAvailable_bytes} 841{,}371{,}648 & 1.85~MiB (0.23\%)\\
|
||||
Root filesystem size & 61{,}285{,}326{,}848 & \path{node_filesystem_size_bytes} 61{,}285{,}326{,}848 & exact\\
|
||||
Root available & 41{,}715{,}208{,}192 & \path{node_filesystem_avail_bytes} 41{,}715{,}216{,}384 & 8{,}192 (two 4~KiB blocks)\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Host verification on November 1, 2026. The filesystem series use
|
||||
\texttt{device="/dev/root"}.}
|
||||
\label{Table:MonitoringHostVerification}
|
||||
\end{table}
|
||||
|
||||
Fixed sizes match exactly. Available memory and free space change from
|
||||
moment to moment, so small differences are expected when the samples are
|
||||
taken about one second apart. At the same time, 838{,}422{,}528 bytes
|
||||
(about 800~MiB) of swap were in use and the root filesystem was 32\% used.
|
||||
These are whole-host values; they do not describe any single container.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.9\linewidth]{prism-uploads/ch5-host-verification.png}
|
||||
\caption{Host commands and Prometheus queries run together on November 1,
|
||||
2026, 21:49:23~UTC.}
|
||||
\label{Figure:MonitoringHostVerification}
|
||||
\end{figure}
|
||||
|
||||
\section{HTTPS and Access Control}
|
||||
\label{sec:mon-access}
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{2.0cm}L{5.4cm}L{4.4cm}}
|
||||
\toprule Service & Login URL & Access\\\midrule
|
||||
Gitea & \url{https://git.590hcm.dev/user/login} & Public HTTPS; unchanged.\\
|
||||
Jenkins & \url{https://ci.590hcm.dev:8443/login} & Approved SSH tunnel only, as in \ChapterRef{JenkinsCI}; host-only probe exception in \autoref{sec:mon-metrics}.\\
|
||||
Grafana & \url{https://metrics.590hcm.dev/login} & Public HTTPS through Caddy to private \texttt{grafana:3000}; individual Grafana accounts, no anonymous access.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{HTTPS login URLs. No grader account is required; dashboard and alert
|
||||
evidence is embedded in this chapter.}
|
||||
\label{Table:MonitoringURLs}
|
||||
\end{table}
|
||||
|
||||
Grafana requires authentication; anonymous access and self-signup are
|
||||
disabled, and its root URL is set to \texttt{https://metrics.590hcm.dev/}.
|
||||
The administrator password is a randomly generated, host-only file mounted
|
||||
read-only into the container and excluded from Git; on November 1, 2026 the
|
||||
file was observed with mode \texttt{0600}, owned by the Grafana container
|
||||
user (UID 472). The default \texttt{admin:admin} login was rejected in a live
|
||||
API check. Prometheus 9090, Node Exporter 9100, and Blackbox Exporter 9115 are
|
||||
not published on the host. No Gitea or Jenkins metrics endpoint was enabled.
|
||||
|
||||
The \texttt{metrics.590hcm.dev} A record at Name.com points to
|
||||
\texttt{184.193.0.32}; no AAAA record exists, so IPv6 does not apply. A team
|
||||
member added the Caddy route to \texttt{grafana:3000}, which reaches Grafana
|
||||
over the existing \texttt{gitea-deploy\_internal} network. Grafana's
|
||||
certificate was issued by Let's Encrypt YE1 for \texttt{metrics.590hcm.dev},
|
||||
valid from November 3, 2026 at 18:56:05~UTC through February 1, 2027 at
|
||||
18:56:04~UTC.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{5.6cm}L{2.0cm}L{4.6cm}}
|
||||
\toprule Request (\texttt{curl}) & Result & Meaning\\\midrule
|
||||
\path{http://metrics.590hcm.dev/} & 308 & Redirects to HTTPS.\\
|
||||
\path{https://metrics.590hcm.dev/api/health} & 200 & Grafana 13.2.4, database ok; valid TLS.\\
|
||||
\path{https://metrics.590hcm.dev/api/search} & 401 & Dashboards require login.\\
|
||||
\path{https://git.590hcm.dev/user/login} & 200 & Gitea login public, as intended.\\
|
||||
\path{https://ci.590hcm.dev/login} and \path{/} & 403 & Jenkins blocked outside the SSH tunnel.\\
|
||||
\path{https://git.590hcm.dev/metrics} & 404 & No Gitea metrics endpoint.\\
|
||||
\path{https://ci.590hcm.dev/prometheus} & 403 & No Jenkins metrics path reachable.\\
|
||||
\texttt{184.193.0.32} ports 3000, 9090, 9100, 9115, 8080 & timeout & Not published; blocked by the firewall.\\
|
||||
\path{https://metrics.590hcm.dev/metrics} & \StatusFail{} 200 & Grafana's internal metrics were public (November 3).\\
|
||||
Same, after the fix (November 4, 15:41~UTC) & \StatusPass{} 302 & Redirects to the login page; no metrics returned.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{External exposure tests from a team member's Windows computer on a
|
||||
residential network, outside Lightsail, November 3, 2026, about
|
||||
21:08~UTC.}
|
||||
\label{Table:MonitoringExposure}
|
||||
\end{table}
|
||||
|
||||
The last test found a gap. Grafana serves its own Prometheus-format metrics
|
||||
at \path{/metrics} without login by default, and the new public route
|
||||
exposed about 7{,}200 lines of them: version, runtime, and usage counters,
|
||||
but no credentials or dashboard data. Prometheus does not scrape Grafana, so
|
||||
nothing depends on this endpoint. The fix sets
|
||||
\texttt{GF\_METRICS\_ENABLED: "false"} in the Grafana service in
|
||||
\texttt{compose.yaml} (pricing-app commit be6829f). It was deployed on
|
||||
November 4 by recreating Grafana with \texttt{docker compose up -d grafana}.
|
||||
The same outside request then returned 302 to the login page and no metrics.
|
||||
|
||||
The Grafana route in \path{/home/ubuntu/gitea-deploy/Caddyfile} (lines
|
||||
24--26) contains no secrets and is shown unchanged. Caddy obtains and renews
|
||||
the certificate automatically and redirects HTTP to HTTPS:
|
||||
\begin{verbatim}
|
||||
metrics.590hcm.dev {
|
||||
reverse_proxy grafana:3000
|
||||
}
|
||||
\end{verbatim}
|
||||
|
||||
\section{Dashboard and CI Correlation}
|
||||
\label{sec:mon-dashboard}
|
||||
|
||||
The provisioned dashboard \emph{SSW 590 Chapter 5 -- Gitea, Jenkins and host}
|
||||
(UID \texttt{ssw590-ch5-monitoring}) is versioned as
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/src/branch/feature/issue-3-monitoring/monitoring/grafana/dashboards/chapter5.json}{\path{monitoring/grafana/dashboards/chapter5.json}}.
|
||||
It uses the \texttt{America/New\_York} time zone, a one-hour default range,
|
||||
and a 30-second refresh. Grafana reaches Prometheus at
|
||||
\texttt{http://prometheus:9090}. Each of the six panels returned live data on
|
||||
October 30.
|
||||
|
||||
\begin{tabularx}{\linewidth}{L{3.0cm}L{1.3cm}Y}
|
||||
\caption{Required Dashboard Panels\label{Table:MonitoringPanels}}\\
|
||||
\toprule \textbf{Panel} & \textbf{Unit} & \textbf{Query and explanation}\\\midrule
|
||||
\endfirsthead
|
||||
\toprule \textbf{Panel} & \textbf{Unit} & \textbf{Query and explanation}\\\midrule
|
||||
\endhead
|
||||
\bottomrule
|
||||
\endlastfoot
|
||||
Whole-host CPU & percent & {\footnotesize\path{100 * (1 - avg(rate(node_cpu_seconds_total{job="node",mode="idle"}[5m])))}}. Non-idle share averaged across both CPUs over five minutes.\\
|
||||
Available memory & bytes & {\footnotesize\path{node_memory_MemAvailable_bytes{job="node"}}}.\\
|
||||
Available root disk & percent & {\footnotesize\path{100 * node_filesystem_avail_bytes{...} / node_filesystem_size_bytes{...}}} with the same \texttt{/dev/root}, \texttt{ext4} selector on both sides.\\
|
||||
Gitea availability & 0/1 & {\footnotesize\path{probe_success{job="https",instance="https://git.590hcm.dev/user/login"}}}.\\
|
||||
Jenkins availability & 0/1 & {\footnotesize\path{probe_success{job="https",instance="https://ci.590hcm.dev/login"}}}.\\
|
||||
HTTPS probe duration & seconds & {\footnotesize\path{probe_duration_seconds{job="https",instance=~"https://(git|ci)[.]590hcm[.]dev/.*"}}}, one labeled line per service.\\
|
||||
\end{tabularx}
|
||||
|
||||
\autoref{Figure:MonitoringDashboard} shows all six panels for the hour
|
||||
ending about 21:56~UTC on November 1. CPU stayed below about 10\%, root disk
|
||||
stayed at 68.1\% available, and both HTTPS availability panels stayed at 1.
|
||||
Probe durations were mostly 10--25~ms, with short spikes up to about 115~ms.
|
||||
Available memory rose by roughly 100~MiB at about 21:26 and 21:34~UTC; both
|
||||
times match the Grafana restarts during the capacity alert test
|
||||
(\autoref{Table:MonitoringDiskAlertTest}). Memory then fell back toward
|
||||
650~MiB as Grafana warmed up, so the restarts briefly freed memory but did
|
||||
not change the host's limited headroom.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=\linewidth]{prism-uploads/ch5-dashboard.png}
|
||||
\caption{Chapter 5 dashboard, last hour, November 1, 2026 (15:56--16:56
|
||||
EST, 20:56--21:56 UTC). The tooltip on the disk panel shows 68.1\%
|
||||
available.}
|
||||
\label{Figure:MonitoringDashboard}
|
||||
\end{figure}
|
||||
|
||||
\subsection{Build Correlation}
|
||||
\StatusPass{} The normal pipeline run used for this comparison is
|
||||
\texttt{pricing-app} » \texttt{PR-4} build 15: commit
|
||||
\texttt{be6829f}, agent \texttt{python-agent}, started by the Gitea webhook,
|
||||
SUCCESS, from 10:26:56 to 10:27:13 EST on November 4, 2026 (15:26:56 to
|
||||
15:27:13~UTC; full details in \autoref{Table:MonitoringPostIncidentBuild}).
|
||||
The agent container runs on the same host (\ChapterRef{JenkinsCI}), so any
|
||||
change appears in the whole-host panels
|
||||
(\autoref{Figure:MonitoringBuildDashboard}).
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{2.6cm}L{3.0cm}L{3.2cm}L{3.6cm}}
|
||||
\toprule Panel & Before (10:20--10:26) & During and just after the build & After\\\midrule
|
||||
Host CPU & about 2--3\% & rose to about 7\% from about 10:27 to 10:31 & back to about 2--3\%\\
|
||||
Available memory & about 760~MiB & fell to about 590~MiB at about 10:27 & stayed near 590~MiB until Grafana was recreated at about 10:40\\
|
||||
Root disk & 68\% available & no visible change & no visible change\\
|
||||
Gitea and Jenkins availability & 1 & 1 & 1\\
|
||||
Probe duration & mostly under 50~ms & no visible change & mostly under 50~ms\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Host metrics around PR-4 build 15, read from the dashboard. Times
|
||||
are EST.}
|
||||
\label{Table:MonitoringBuildCorrelation}
|
||||
\end{table}
|
||||
|
||||
The build itself lasted 17~seconds, but CPU stayed slightly higher for about
|
||||
four minutes and about 170~MiB of memory stayed in use afterward. The likely
|
||||
reason is that the Jenkins controller and agent keep work and caches in
|
||||
memory after a run, but whole-host metrics cannot attribute the change to a
|
||||
particular process or container, so this is an inference, not a measurement.
|
||||
The memory recovery at about 10:40 EST matches the Grafana recreation that
|
||||
deployed the \path{/metrics} fix (\autoref{sec:mon-access}); the CPU rise
|
||||
and the 1.2-second Jenkins probe spike at about 10:40--10:45 belong to that
|
||||
restart, not to the build. The build did not affect Gitea or Jenkins
|
||||
availability. With about 590~MiB available after a short build, the result
|
||||
supports follow-up issue 6 on memory headroom.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=\linewidth]{prism-uploads/ch5-build-dashboard-top.png}\\[4pt]
|
||||
\includegraphics[width=\linewidth]{prism-uploads/ch5-build-dashboard-bottom.png}
|
||||
\caption{Dashboard for about 10:18 to 11:18 EST on November 4, 2026
|
||||
(15:18--16:18~UTC), around PR-4 build 15 at 10:26:56--10:27:13 EST.}
|
||||
\label{Figure:MonitoringBuildDashboard}
|
||||
\end{figure}
|
||||
|
||||
\section{SLI, SLO, and Error Budget}
|
||||
\label{sec:mon-slo}
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{lL{10.6cm}}
|
||||
\toprule Term & Meaning in this chapter\\\midrule
|
||||
\gls{sli} & The measured indicator: successful scheduled HTTPS probes divided by received scheduled probes, per service and window.\\
|
||||
\gls{slo} & The internal target: at least 99\% probe success over 24 hours, evaluated separately for Gitea and Jenkins.\\
|
||||
\gls{sla} & A commitment to a customer, possibly with consequences for missing it. This lab establishes no SLA.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Reliability terms, following the SRE Workbook approach \cite{SREWorkbookSLOs}.}
|
||||
\label{Table:MonitoringSLOTerms}
|
||||
\end{table}
|
||||
|
||||
\subsection{Worked Example (Hypothetical Data)}
|
||||
The following figures are the assignment's illustrative dataset, not measured
|
||||
results. At a 30-second interval, one complete day contains
|
||||
$24 \times 3600 / 30 = 2{,}880$ scheduled probes per service. If Gitea
|
||||
succeeds on all 2,880, its success is 100\%. If Jenkins succeeds on 2,850 and
|
||||
fails on 30, its success is $100 \times 2850/2880 \approx 98.96\%$, which
|
||||
misses the 99\% target. The error budget is the failure allowance the target
|
||||
permits: $0.01 \times 2880 = 28.8$ failed samples, or $28.8 \times 30\,\text{s}
|
||||
= 14.4$ minutes. Thirty failures exceed the budget by 1.2 samples, about 0.6
|
||||
minutes. Because samples are whole, at most 28 failures would meet the target.
|
||||
|
||||
\subsection{Measured Exercise Window}
|
||||
\StatusPass{} The measured window is the ten minutes from 15:45:00 to
|
||||
15:55:00~UTC on November 2, 2026, which contains the whole Jenkins incident
|
||||
(\autoref{sec:mon-incident}). The scrape interval for the \texttt{https} job
|
||||
is 30 seconds. Both queries were run as instant queries in Grafana Explore,
|
||||
fixed to the window end with the \texttt{@} modifier, so the evaluation time
|
||||
does not depend on when they were run:
|
||||
\begin{verbatim}
|
||||
100 * avg_over_time(probe_success{job="https"}[10m] @ 1793634900)
|
||||
count_over_time(probe_success{job="https"}[10m] @ 1793634900)
|
||||
\end{verbatim}
|
||||
Here \texttt{1793634900} is 15:55:00~UTC on November 2, 2026.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{2.2cm}L{2.0cm}L{2.0cm}L{2.0cm}L{4.0cm}}
|
||||
\toprule Service & Samples received & Successes & Failures & SLI (success \%)\\\midrule
|
||||
Gitea & 20 of 20 & 20 & 0 & 100\%\\
|
||||
Jenkins & 20 of 20 & 11 & 9 & 55\%\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Measured SLI for 15:45--15:55~UTC, November 2, 2026. Successes are
|
||||
the SLI multiplied by the received count.}
|
||||
\label{Table:MonitoringMeasuredSLI}
|
||||
\end{table}
|
||||
|
||||
All 20 expected samples arrived for both services, so no sample is unknown.
|
||||
Nine failed Jenkins samples at 30-second spacing equal 4.5 minutes, which
|
||||
matches the measured restoration time of 4~min 18~s to 4~min 48~s
|
||||
(\autoref{Table:MonitoringIncidentMeasures}).
|
||||
|
||||
The 55\% value describes only this ten-minute window, which was chosen
|
||||
because it contains the outage; it does not measure the 24-hour SLO. For
|
||||
comparison only: the daily error budget at 99\% is 28.8 failed samples
|
||||
(\autoref{sec:mon-slo}), so these 9 failures would use about 31\% of one
|
||||
day's budget. If every other Jenkins sample that day succeeded, the day would
|
||||
end at $2871/2880 = 99.69\%$, above the target. That is a hypothetical
|
||||
projection, not a measured full-day result.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.8\linewidth]{prism-uploads/ch5-sli-avg.png}\\[4pt]
|
||||
\includegraphics[width=0.8\linewidth]{prism-uploads/ch5-sli-count.png}
|
||||
\caption{Instant queries for the measured window: success percentage (top)
|
||||
and received sample count (bottom).}
|
||||
\label{Figure:MonitoringMeasuredSLI}
|
||||
\end{figure}
|
||||
|
||||
\section{Alerts and Runbooks}
|
||||
\label{sec:mon-alerts}
|
||||
|
||||
\subsection{Alert Rules}
|
||||
Two Grafana-managed rules are provisioned in
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/src/branch/feature/issue-3-monitoring/monitoring/grafana/provisioning/alerting/chapter5-alerts.json}{\path{chapter5-alerts.json}},
|
||||
in folder \emph{SSW 590}, group \texttt{chapter5}, evaluated every 30
|
||||
seconds \cite{GrafanaAlerting}. Both treat no data and evaluation errors as
|
||||
alerting, so a collection failure is surfaced rather than reported as healthy.
|
||||
|
||||
\begin{tabularx}{\linewidth}{L{2.6cm}L{4.2cm}Y}
|
||||
\caption{Provisioned Alert Rules\label{Table:MonitoringAlerts}}\\
|
||||
\toprule \textbf{Rule} & \textbf{Condition and labels} & \textbf{Operator response}\\\midrule
|
||||
\endfirsthead
|
||||
\toprule \textbf{Rule} & \textbf{Condition and labels} & \textbf{Operator response}\\\midrule
|
||||
\endhead
|
||||
\bottomrule
|
||||
\endlastfoot
|
||||
HTTPS service unavailable & \path{probe_success} $= 0$ for 1 minute, per service. Owner \texttt{max}; severity critical. & Check the exporter scrape, DNS, certificate, HTTP status, proxy route, then service logs. Distinguish an unreachable login page from a failed Jenkins build.\\
|
||||
Root disk below 15\% & Root disk available percentage $< 15$ for 5 minutes. Owner \texttt{max}; severity warning. & Identify filesystem growth, protect service data, remove only verified disposable files, or expand capacity. Never delete Docker volumes as cleanup.\\
|
||||
\end{tabularx}
|
||||
|
||||
\StatusPass{} Each rule has a \texttt{runbook\_url} annotation that links to
|
||||
the alert section of \path{monitoring/RUNBOOK.md} in pricing-app (commit
|
||||
91f1575). It was deployed on November 2, and the rule's runbook link in
|
||||
Grafana opened that file in Gitea. The link points to the PR~4 branch and
|
||||
will be changed to \texttt{main} when that pull request merges.
|
||||
|
||||
\subsection{Notification Route}
|
||||
Both rules send to a single email contact point named \texttt{team-alerts},
|
||||
with resolved messages enabled. Each rule selects it directly in its
|
||||
notification settings, so no separate notification policy is needed.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{lL{8.6cm}}
|
||||
\toprule Setting & Value and effect\\\midrule
|
||||
Group by & \texttt{alertname}, \texttt{instance}: Gitea and Jenkins failures notify separately.\\
|
||||
Group wait & 30 seconds before the first notification for a new group.\\
|
||||
Group interval & 5 minutes before notifying about changes to a group.\\
|
||||
Repeat interval & 4 hours before repeating an unresolved notification.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Notification grouping and delay settings, provisioned in
|
||||
\texttt{chapter5-alerts.json}.}
|
||||
\label{Table:MonitoringNotification}
|
||||
\end{table}
|
||||
|
||||
Grafana OSS needs an outgoing mail service before an email contact point can
|
||||
send. Grafana sends through Gmail SMTP on port 587 with mandatory STARTTLS.
|
||||
The host, port, and TLS policy are in \texttt{compose.yaml}. The sender
|
||||
address and a Gmail App Password are supplied in the host-only file
|
||||
\path{/home/ubuntu/monitoring/secrets/smtp.env}, which Git ignores; the
|
||||
repository contains only \path{smtp.env.example} with placeholders.
|
||||
Changing this file requires recreating the Grafana container with
|
||||
\texttt{docker compose up -d grafana}; its named volume preserves state.
|
||||
\StatusPass{} The files and sender credentials were deployed on November 1
|
||||
and Grafana was recreated. A contact-point test was sent from the
|
||||
\texttt{team-alerts} view; the rule test below confirms end-to-end delivery
|
||||
through the same route.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.8\linewidth]{prism-uploads/ch5-team-alerts-contact.png}
|
||||
\caption{The provisioned \texttt{team-alerts} email contact point: read-only
|
||||
in the UI, single email, resolved messages enabled. SMTP credentials are not
|
||||
shown in Grafana.}
|
||||
\label{Figure:MonitoringContactPoint}
|
||||
\end{figure}
|
||||
|
||||
\subsection{Firing, Delivery, and Resolution}
|
||||
\paragraph{Capacity rule (passed).} The disk rule was tested safely on
|
||||
November 1 without filling the disk. The provisioned file was copied to a
|
||||
backup, the disk rule's threshold was changed from 15 to 90 on the host only
|
||||
(not in Git), and Grafana was restarted. Root disk free space was about
|
||||
68.07\%, so the condition became true. After the event, the backup was
|
||||
restored and Grafana was restarted again; the rule view then showed the
|
||||
threshold ``Is below 15''. Times below come from the rule's state history
|
||||
and the sender's mailbox, displayed in Eastern Standard Time and converted to
|
||||
UTC.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{4.2cm}L{2.2cm}L{6.2cm}}
|
||||
\toprule Event & Time (UTC) & Evidence\\\midrule
|
||||
Threshold raised to 90 & before 21:26 & Host-only edit; Grafana restarted.\\
|
||||
Pending & 21:26:10 & State history: A $= 68.068493$, B $= 1$.\\
|
||||
Alerting (firing) & 21:31:10 & State history: A $= 68.068266$, B $= 1$; five-minute pending period satisfied.\\
|
||||
Firing email sent & 21:31 & \texttt{[FIRING:1] Root disk space below 15 percent} from ``SSW 590 Grafana'' to the \texttt{team-alerts} address.\\
|
||||
Threshold restored to 15 & 21:34:10 & Rule ``last updated by Provisioning''.\\
|
||||
Normal & 21:34:40 & State history: A $= 68.067959$, B $= 0$.\\
|
||||
Resolved email sent & 21:34 & \texttt{[RESOLVED] Root disk space below 15 percent}, A $= 68.0679$, B $= 0$.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Capacity alert test on November 1, 2026.}
|
||||
\label{Table:MonitoringDiskAlertTest}
|
||||
\end{table}
|
||||
|
||||
The firing email followed the firing state within the 30-second group wait,
|
||||
and the resolved email followed recovery within the same minute. The final
|
||||
provisioned setting is the original 15\% threshold. The send times above
|
||||
come from the sender's mailbox; the recipient later confirmed receipt of
|
||||
both emails.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.8\linewidth]{prism-uploads/ch5-disk-alert-firing.png}
|
||||
\caption{Disk rule firing during the test on November 1, 2026, with the
|
||||
temporary threshold ``Is below 90'' and about 68.07\% free. Graph times are
|
||||
Eastern Standard Time (UTC$-5$).}
|
||||
\label{Figure:MonitoringDiskFiring}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.8\linewidth]{prism-uploads/ch5-disk-alert-history.png}
|
||||
\caption{Disk rule state history: Pending 16:26:10, Alerting 16:31:10, and
|
||||
Normal 16:34:40 Eastern Standard Time (21:26:10, 21:31:10, and 21:34:40 UTC).}
|
||||
\label{Figure:MonitoringDiskHistory}
|
||||
\end{figure}
|
||||
|
||||
\paragraph{HTTPS rule (passed).} During the controlled Jenkins incident on
|
||||
November 2, the HTTPS rule went Pending at 15:48:15, fired at 15:49:15, and
|
||||
sent its firing email in the 15:49 minute. It returned to Normal at 15:52:45
|
||||
and sent the resolved email at 15:54~UTC. Only the Jenkins instance fired;
|
||||
Gitea stayed Normal. The recipient confirmed receipt of both emails for each
|
||||
rule. Full timings are in \autoref{sec:mon-incident}
|
||||
(\autoref{Table:MonitoringIncident}).
|
||||
|
||||
\section{Incident and Recovery}
|
||||
\label{sec:mon-incident}
|
||||
|
||||
\StatusPass{} The controlled Jenkins incident ran on November 2, 2026,
|
||||
from 15:46 to 15:54~UTC. Only the Jenkins controller was stopped; Gitea,
|
||||
the Jenkins agent, and monitoring stayed up. The alert recipient confirmed
|
||||
receipt of both notifications.
|
||||
|
||||
\subsection{Exercise Plan}
|
||||
Agree on a maintenance window with the team and name who restarts Jenkins.
|
||||
Confirm no build is running, keep Gitea and monitoring up, save the restart
|
||||
command, and start a timestamped incident record. Stop only the Jenkins
|
||||
controller for about three minutes, then restart it from
|
||||
\path{/home/ubuntu/jenkins-deploy}. Restore early if the exercise exceeds its
|
||||
agreed duration or affects other work. Do not remove volumes or stop the
|
||||
instance.
|
||||
|
||||
\subsection{Timeline and Measured Times}
|
||||
The stop and restart used \texttt{docker stop jenkins} and
|
||||
\texttt{docker start jenkins} on the host. Each command was preceded and
|
||||
followed by a UTC timestamp appended to the host file
|
||||
\path{~/ch5-incident.log} (\autoref{Figure:MonitoringIncidentLog}).
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{3.6cm}L{2.6cm}L{6.2cm}}
|
||||
\toprule Event & Time (UTC) & Source\\\midrule
|
||||
Pre-check & 15:46:25 & Incident log; Jenkins availability 1.\\
|
||||
Stop issued & 15:47:52 & Incident log.\\
|
||||
Jenkins stopped & 15:47:57 & Incident log, after \texttt{docker stop} returned.\\
|
||||
First failing probe & by 15:48:15 & Rule state history: Pending.\\
|
||||
Alert firing & 15:49:15 & Rule state history: Alerting, after the one-minute pending period.\\
|
||||
Notification sent & 15:49 & Sender mailbox, \texttt{[FIRING:1] HTTPS service unavailable}.\\
|
||||
Notification received & confirmed & Recipient confirmed receipt; exact time not recorded.\\
|
||||
Jenkins restart issued & 15:51:39 & Incident log.\\
|
||||
Jenkins container started & 15:51:40 & Incident log.\\
|
||||
First successful probe & 15:52:15--15:52:45 & Dashboard still 0 at 15:52:15; rule Normal at 15:52:45.\\
|
||||
Alert resolved & 15:52:45 & Rule state history: Normal.\\
|
||||
Resolved notification sent & 15:54 & Sender mailbox, \texttt{[RESOLVED]}.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Incident timeline, November 2, 2026. Screens displayed Eastern
|
||||
Standard Time; times are converted to UTC.}
|
||||
\label{Table:MonitoringIncident}
|
||||
\end{table}
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{4.4cm}L{2.4cm}L{5.6cm}}
|
||||
\toprule Measure & Value & Explanation\\\midrule
|
||||
Planned outage & 3 min 43 s & Container stopped 15:47:57, started 15:51:40.\\
|
||||
Time to first failing check & $\le$ 18 s & Stop to Pending; bounded by the 30-second rule evaluation.\\
|
||||
Time to firing & 78 s & Stop to Alerting: about one evaluation plus the one-minute pending period.\\
|
||||
Detection (stop to notification) & about 1.5 min & Email sent in the 15:49 minute, after the 15:49:15 firing.\\
|
||||
Restoration (stop to first success) & 4 min 18 s -- 4 min 48 s & Includes about one minute of Jenkins startup after the container started.\\
|
||||
Restart to recovery & $\le$ 65 s & 15:51:40 to 15:52:45.\\
|
||||
Recovery to resolved email & about 1--2 min & Within the five-minute group interval.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Measured detection and restoration times. Precision is limited by
|
||||
the 30-second evaluation interval and minute-level email timestamps.}
|
||||
\label{Table:MonitoringIncidentMeasures}
|
||||
\end{table}
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.6\linewidth]{prism-uploads/ch5-incident-log.png}
|
||||
\caption{Host incident log with UTC timestamps for the stop and restart.}
|
||||
\label{Figure:MonitoringIncidentLog}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.75\linewidth]{prism-uploads/ch5-incident-firing.png}
|
||||
\caption{During the incident: the HTTPS rule fires for the Jenkins instance
|
||||
only, while Gitea stays Normal. Times are EST (UTC$-5$).}
|
||||
\label{Figure:MonitoringIncidentFiring}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.75\linewidth]{prism-uploads/ch5-incident-history.png}
|
||||
\caption{HTTPS rule state history for the Jenkins instance, read after the
|
||||
Grafana restart: Pending 10:48:15, Alerting 10:49:15, Normal 10:52:45 EST on
|
||||
November 2. The October 30 entries come from setup, when the Jenkins login
|
||||
returned HTTP 403 before the probe exception, and are not part of this
|
||||
exercise.}
|
||||
\label{Figure:MonitoringIncidentHistory}
|
||||
\end{figure}
|
||||
|
||||
\subsection{Recovery Checks}
|
||||
After recovery, Jenkins HTTPS availability returned to 1 and stayed there,
|
||||
and Gitea availability stayed at 1 throughout
|
||||
(\autoref{Figure:MonitoringIncidentDashboard}). The dashboard also shows the
|
||||
cost of a Jenkins start on this host: available memory rose by about
|
||||
150~MiB while Jenkins was stopped, then fell to about 600~MiB, the lowest
|
||||
value in the hour, during startup. CPU rose to about 10\%, and the Jenkins
|
||||
probe took about 2.3~seconds while Jenkins was still starting.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=\linewidth]{prism-uploads/ch5-incident-dashboard.png}
|
||||
\caption{Dashboard after the incident and the monitoring restarts, 10:06 to
|
||||
11:06 EST (15:06--16:06 UTC). The Jenkins outage is visible at about
|
||||
10:48--10:52 EST.}
|
||||
\label{Figure:MonitoringIncidentDashboard}
|
||||
\end{figure}
|
||||
|
||||
\paragraph{Pipeline, webhook, and commit status.} \StatusPass{} After the
|
||||
incident, a push to the pricing-app pull request branch triggered a Jenkins
|
||||
build through the Gitea webhook, with no manual start. The build record was
|
||||
read from the Jenkins home directory on the host, because the Jenkins web
|
||||
page is reachable only through the SSH tunnel.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{3.0cm}L{9.4cm}}
|
||||
\toprule Item & Value\\\midrule
|
||||
Build & \texttt{pricing-app} » \texttt{PR-4} build 15\\
|
||||
Result & SUCCESS\\
|
||||
Commit & \path{be6829f26e50833b0e366817bbd07bc6b306727d} (\texttt{feature/issue-3-monitoring})\\
|
||||
Agent & \texttt{python-agent}, workspace \path{/home/jenkins/agent/workspace/pricing-app_PR-4}\\
|
||||
Start and end & November 4, 2026, 15:26:56.910 to 15:27:13.736~UTC (16.8~s)\\
|
||||
Trigger & Gitea webhook on push\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Post-incident pipeline run, from \texttt{build.xml} and the build
|
||||
log in \texttt{/var/jenkins\_home/jobs/pricing-app/branches/PR-4/builds/15}.}
|
||||
\label{Table:MonitoringPostIncidentBuild}
|
||||
\end{table}
|
||||
|
||||
Jenkins reported the result back to Gitea: the commit shows the required
|
||||
check \texttt{pricing-app/pipeline/pr-main} as successful
|
||||
(\autoref{Figure:MonitoringCommitStatus}). The webhook, the pipeline, and the
|
||||
commit-status integration therefore all worked after Jenkins was restarted.
|
||||
The manual PDF build is recorded in \autoref{sec:mon-manual}.
|
||||
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=0.7\linewidth]{prism-uploads/ch5-commit-status.png}
|
||||
\caption{Gitea commit status for \texttt{be6829f}: all checks successful.}
|
||||
\label{Figure:MonitoringCommitStatus}
|
||||
\end{figure}
|
||||
|
||||
\subsection{Difference from the Chapter 4 Failure}
|
||||
The Chapter 4 exercise changed application code so a test failed while
|
||||
Jenkins stayed available (\autoref{Figure:CIFailedGate}). This exercise
|
||||
removes the Jenkins service itself while the code stays correct. The first is
|
||||
caught by the merge gate; the second is caught by monitoring and alerting.
|
||||
|
||||
\subsection{Blameless Review}
|
||||
This review describes what happened and what the system showed. It does not
|
||||
assign blame.
|
||||
|
||||
\paragraph{Impact.} Jenkins could not be reached over HTTPS for about four
|
||||
and a half minutes on November 2, from 15:47:57 to about 15:52:30~UTC. No
|
||||
build was running, so no build was lost. Gitea, its repositories, and
|
||||
monitoring were not affected.
|
||||
|
||||
\paragraph{Cause.} A planned stop of the Jenkins controller container for
|
||||
this exercise. The code and configuration did not change.
|
||||
|
||||
\paragraph{Response.} The probe failure was visible within one evaluation,
|
||||
the alert fired after the configured one-minute pending period, and the email
|
||||
went out in the same minute. Jenkins was restarted after about 3 minutes 43
|
||||
seconds, as planned. The alert resolved automatically, and the resolved email
|
||||
followed within the five-minute group interval.
|
||||
|
||||
\paragraph{What went well.} The alert separated the two services: only the
|
||||
Jenkins instance fired, and Gitea stayed Normal. No manual step was needed
|
||||
to send or resolve the notification. The incident log, rule history, and
|
||||
email timestamps agree with one another.
|
||||
|
||||
\paragraph{Measurement gaps.} Rule state times are rounded to the 30-second
|
||||
evaluation interval, and the email times are rounded to the minute. The
|
||||
acknowledgement time was not written down; only receipt was confirmed. The
|
||||
exact first successful probe is known only to a 30-second window.
|
||||
|
||||
\paragraph{Shared failure domain.} Prometheus, Grafana, and the exporters run
|
||||
on the same Lightsail instance as Gitea and Jenkins. If the instance itself
|
||||
fails, collection and notification stop with it, and no alert would be sent.
|
||||
This exercise tested a single service, not the whole host.
|
||||
|
||||
\paragraph{Follow-up issues.}
|
||||
\begin{enumerate}
|
||||
\item \textbf{High: add an independent external uptime check} for the Gitea
|
||||
and Jenkins login pages from outside Lightsail, with notification to the
|
||||
team, so a whole-host outage is still detected. Tracked as
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/issues/5}{pricing-app
|
||||
issue 5}; owner \texttt{carmen}.
|
||||
\item \textbf{Medium: protect memory headroom.} Jenkins startup lowered
|
||||
available memory to about 600~MiB while about 800~MiB of swap was already in
|
||||
use. Watch available memory during builds, consider container memory limits,
|
||||
and resize the instance if builds slow down. Tracked as
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/issues/6}{pricing-app
|
||||
issue 6}; owner \texttt{max}.
|
||||
\end{enumerate}
|
||||
Both issues were opened on November 2 and assigned in Gitea.
|
||||
|
||||
\section{Manual Integration and Traceability}
|
||||
\label{sec:mon-manual}
|
||||
|
||||
This chapter is included in the team manual. The document history, the Hosts
|
||||
and Passwords tables, the glossary, citations, and the AI Prompt Log are
|
||||
updated for the monitoring services, the \texttt{metrics.590hcm.dev}
|
||||
hostname, private ports, storage, and credential hints. The operator procedure
|
||||
is in the
|
||||
\href{https://git.590hcm.dev/SSW590Team/pricing-app/src/branch/main/monitoring/RUNBOOK.md}{monitoring runbook}
|
||||
on \texttt{main}, which both alert rules link to.
|
||||
|
||||
\StatusPass{} All Chapter 5 work is merged into \texttt{main} in both
|
||||
repositories on November 4, 2026.
|
||||
|
||||
\begin{table}[htbp]\centering\small
|
||||
\begin{tabular}{L{3.2cm}L{9.2cm}}
|
||||
\toprule Item & Reference\\\midrule
|
||||
Deployment code & \href{https://git.590hcm.dev/SSW590Team/pricing-app/pulls/4}{pricing-app PR~4}, merged after its required Jenkins check \texttt{pricing-app/pipeline/pr-main} passed; merge commit \href{https://git.590hcm.dev/SSW590Team/pricing-app/commit/c5716f70993208cd73a4c3d92892008017f5e35a}{\texttt{c5716f7}} (16:30:57~UTC). Its files match the branch that Jenkins tested. It closes issue~3.\\
|
||||
Manual chapter & devOpsManual PR~2, \texttt{chapter5-monitoring} into \texttt{main}, merge commit \href{https://git.590hcm.dev/SSW590Team/devOpsManual/commit/a3c4d0d8fb6039066ee290f57e1b5b7000c75caf}{\texttt{a3c4d0d}} (16:38:38~UTC), after the Chapter~4 manual PR~1.\\
|
||||
Build fix & devOpsManual PR~3, merge commit \href{https://git.590hcm.dev/SSW590Team/devOpsManual/commit/e649c258bbb53fa5c73c071cc2c0785455f27ae6}{\texttt{e649c25}} (16:43:18~UTC).\\
|
||||
Automated PDF build & \href{https://git.590hcm.dev/SSW590Team/devOpsManual/actions/runs/9}{Gitea Actions run~9} on \texttt{main} for \texttt{e649c25}: success in 41~s, artifact \path{devops-manual-build-9-e649c258bbb53fa5c73c071cc2c0785455f27ae6}.\\\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Final commits and automated build for Chapter 5.}
|
||||
\label{Table:MonitoringTraceability}
|
||||
\end{table}
|
||||
|
||||
The first build after the chapter merge, for \texttt{a3c4d0d}, failed before
|
||||
checkout and compiled nothing. The workflow pinned Node.js
|
||||
\texttt{24.18.1-r0}, and the Alpine package index had replaced it with
|
||||
\texttt{24.22.1-r1}. PR~3 pins the major version (\texttt{nodejs\textasciitilde 24}) and prints
|
||||
the exact version in each build log, so the build stays traceable without
|
||||
breaking on patch releases. Run~9 then built this manual from \texttt{main}
|
||||
with no other change; that PDF shows version 1.12+build.9.e649c25.
|
||||
@ -52,3 +52,29 @@ Gitea administrator & \texttt{git.590hcm.dev} & Individual administrator account
|
||||
SQLite DB user & \texttt{git.590hcm.dev} & Not applicable for SQLite: the local database file has no separate database login. & N/A; no database-user password or token exists for this configuration.\\
|
||||
\end{longtable}
|
||||
\normalsize
|
||||
\section{Chapter 3 Credential Boundaries}
|
||||
\begin{longtable}{p{0.28\textwidth}p{0.62\textwidth}}
|
||||
\textbf{Credential} & \textbf{Hint and boundary only}\\\hline
|
||||
Gitea push identity & Existing project account max; authenticate only to git.590hcm.dev. No credential value is documented.\\
|
||||
Runner registration & Existing runner-data volume, .runner registration file; restrict to administrators; never commit or publish.\\
|
||||
Actions checkout & Job authentication supplied by Gitea; checkout disables credential persistence. No custom workflow secret required.\\
|
||||
\end{longtable}
|
||||
|
||||
\section{Chapter 4 CI Credential Boundaries}
|
||||
\begin{longtable}{p{0.27\textwidth}p{0.63\textwidth}}
|
||||
\textbf{Account / credential} & \textbf{Scope and non-secret storage hint}\\\hline
|
||||
Jenkins \texttt{max} & Named administrator; user created the secret privately. Signup disabled. Current authenticated-user authorization grants full control; review before adding users.\\
|
||||
Gitea \texttt{jenkins-ci} & Restricted non-admin integration identity; write collaborator on pricing-app only. Token scopes read:user and write:repository; no repository-administration scope.\\
|
||||
{\small\path{gitea-jenkins-ci-token}} & Jenkins credential ID for source checkout/API status reporting. Protected host secrets directory is outside Git; never include its values in reports or logs.\\
|
||||
\path{python-agent-ssh} & SYSTEM credential for Jenkins-to-agent SSH only; host key pinned. Not the owner's Lightsail administration key.\\
|
||||
Operator SSH key & Each operator needs their own approved Lightsail access for the private browser tunnel. Do not share the owner's private key or embed it in CI containers.\\
|
||||
\end{longtable}
|
||||
These rows record actual CI account purposes and storage references, not secret values.
|
||||
|
||||
\section{Chapter 5 Monitoring Credential Boundaries}
|
||||
\begin{longtable}{p{0.27\textwidth}p{0.63\textwidth}}
|
||||
\textbf{Account / credential} & \textbf{Scope and non-secret storage hint}\\\hline
|
||||
Grafana administrator & Random password in host-only file \path{/home/ubuntu/monitoring/grafana_admin_password}, mode 0600, owned by the Grafana container user, mounted read-only and ignored by Git. Retrieve locally with \texttt{sudo}; never paste it into reports. Default login rejected.\\
|
||||
Grafana SMTP sender & Gmail account with a Gmail App Password, not the account password. Stored only in host file \path{/home/ubuntu/monitoring/secrets/smtp.env}, mode 0600, ignored by Git. Revoke the App Password in the Google account when the course ends. Redact from screenshots.\\
|
||||
Prometheus and exporters & No credentials; reachable only on the private monitoring network.\\
|
||||
\end{longtable}
|
||||
|
||||
@ -109,3 +109,36 @@
|
||||
howpublished = {\url{https://caddyserver.com/docs/caddyfile/options}},
|
||||
note = {Use the documented Let's Encrypt staging ACME directory for testing; accessed October 8, 2026}
|
||||
}
|
||||
|
||||
@misc{caddy-ci-autohttps,
|
||||
author={{Caddy Project}}, title={Automatic HTTPS},
|
||||
howpublished={\url{https://caddyserver.com/docs/automatic-https}},
|
||||
note={Accessed October 23, 2026}}
|
||||
@misc{jenkins-ci-isolation,
|
||||
author={{Jenkins Project}}, title={Controller Isolation},
|
||||
howpublished={\url{https://www.jenkins.io/doc/book/security/controller-isolation/}},
|
||||
note={Accessed October 23, 2026}}
|
||||
@misc{SREWorkbookSLOs,
|
||||
author={{Google}}, title={Implementing SLOs: The Site Reliability Workbook},
|
||||
howpublished={\url{https://sre.google/workbook/implementing-slos/}},
|
||||
note={Cited in dosManual version 1.42, Chapter 5}}
|
||||
@misc{GrafanaAlerting,
|
||||
author={{Grafana Labs}}, title={Grafana Alerting},
|
||||
howpublished={\url{https://grafana.com/docs/grafana/latest/alerting/}},
|
||||
note={Cited in dosManual version 1.42, Chapter 5}}
|
||||
@misc{GrafanaDocker,
|
||||
author={{Grafana Labs}}, title={Run Grafana Docker Image},
|
||||
howpublished={\url{https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/}},
|
||||
note={Cited in dosManual version 1.42, Chapter 5}}
|
||||
@misc{PrometheusInstall,
|
||||
author={{Prometheus Authors}}, title={Installation and Docker Persistence},
|
||||
howpublished={\url{https://prometheus.io/docs/prometheus/latest/installation/}},
|
||||
note={Cited in dosManual version 1.42, Chapter 5}}
|
||||
@misc{NodeExporter,
|
||||
author={{Prometheus Authors}}, title={Node Exporter},
|
||||
howpublished={\url{https://github.com/prometheus/node_exporter}},
|
||||
note={Cited in dosManual version 1.42, Chapter 5}}
|
||||
@misc{BlackboxExporter,
|
||||
author={{Prometheus Authors}}, title={Blackbox Exporter},
|
||||
howpublished={\url{https://github.com/prometheus/blackbox_exporter}},
|
||||
note={Cited in dosManual version 1.42, Chapter 5}}
|
||||
|
||||
BIN
prism-uploads/ch4-failed-check.jpg
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
prism-uploads/ch4-https-login.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
prism-uploads/ch4-jenkins-repair-run.jpg
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
prism-uploads/ch4-passing-check.jpg
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
prism-uploads/ch5-backup.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
prism-uploads/ch5-build-dashboard-bottom.png
Normal file
|
After Width: | Height: | Size: 191 KiB |
BIN
prism-uploads/ch5-build-dashboard-top.png
Normal file
|
After Width: | Height: | Size: 322 KiB |
BIN
prism-uploads/ch5-commit-status.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
prism-uploads/ch5-dashboard.png
Normal file
|
After Width: | Height: | Size: 112 KiB |
BIN
prism-uploads/ch5-disk-alert-firing.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
prism-uploads/ch5-disk-alert-history.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
prism-uploads/ch5-host-verification.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
prism-uploads/ch5-incident-dashboard.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
prism-uploads/ch5-incident-firing.png
Normal file
|
After Width: | Height: | Size: 127 KiB |
BIN
prism-uploads/ch5-incident-history.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
prism-uploads/ch5-incident-log.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
prism-uploads/ch5-restart-persistence.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
prism-uploads/ch5-sli-avg.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
prism-uploads/ch5-sli-count.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
prism-uploads/ch5-target-health.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
prism-uploads/ch5-team-alerts-contact.png
Normal file
|
After Width: | Height: | Size: 99 KiB |