Files
billandClaude Opus 5.5 1149e9fbc3
vpn-dns-gateway/pipeline/head This commit looks good
vpn-dns-gateway/pipeline/pr-main This commit looks good
Document Assignment 6 Jenkins CI in the manual (refs #14)
Add the Continuous Integration with Jenkins chapter in the eight rubric
sections: deployment and persistence (capacity test, memory-limit fix,
restart test), HTTPS/access/firewall with IPv4 and IPv6 exposure checks,
webhook traceability with an actual deployment diagram, pipeline stages,
the required pr-main merge gate, PR #15's failure/repair/review/merge
sequence, credentials and controller build boundary, and controls.

Update the Hosts and Passwords tables (1 GiB resize, Jenkins and
ci.yebilly.me, jenkins-bot account and token hints), the title page,
abstract, Document History, glossary, and AI prompt log (including
Vincent's prepared Oct 19-21 record). Note that Assignment 5's PR #13
merged.

Also version pipeline-graph-view and its dependencies in the Jenkins
plugin lockfile, and add Vincent's source-only ci/jenkins-capacity test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:20:31 -04:00

203 lines
13 KiB
Markdown

# Jenkins plugin and pipeline capacity experiment
Prepared for Vincent Sun and Billy Ye on October 21, 2026. This disposable test
passed locally in Docker Desktop; it has NOT run on The-Ocean and is not the
Assignment 6 deployment. See `VALIDATION.md` for the evidence and limitations.
## The question we are answering
Can The-Ocean's existing 512 MB plan run the Jenkins features we need, together
with Gitea, under the limits used in the earlier core-only experiment?
Jenkins core is the base server. Plugins add features to it. Pipeline supplies
the job execution engine and steps; the Gitea connector supplies integration
with Gitea. A plugin can download successfully but fail to load because of
incompatible dependencies or insufficient memory. Loading successfully also
does not prove that a build can run. We check these separately.
The previous core-only experiment started Jenkins, but its final accounting
included about 212 MiB swap as well as 80 MiB RAM. Its raw 60-second PASS was
qualified because the successful HTTP samples spanned only 54 seconds.
## What, why and how
| Check | Why it matters | How we test / pass criterion |
|---|---|---|
| Fresh baseline | Yesterday's resources may differ today | Correct hostname/root session, available RAM >=128 MiB, swap free >=512 MiB, enough Docker disk, unused test port, Gitea HTTP 200 |
| Prepare plugins on the laptop | Catalog processing exceeded the old 128 MiB installer heap locally | Official installer resolves the selected plugins in a separate laptop container with 768 MiB RAM / 512 MiB heap; exact roots, all resolved versions and archive hashes recorded |
| Tools and plugin installation on the target | The useful system needs more than Jenkins core | In a fresh capped container, install Python/Git and copy the verified prepared archives; inspect the installed versions before Jenkins starts |
| Plugin loading | Files on disk are not evidence that Jenkins loaded them | After initialization, verify requested plugins at expected versions, every installed plugin active and no failed-plugin entries |
| Healthy idle | A momentary login response is too weak | HTTP `/login` returns 200 over >=60 seconds of sampled observations AFTER initialization and plugin verification; any failed probe resets the clock |
| Passing pipeline | Exercise actual execution and unit tests | One executor runs dependency checks, a fresh local fixture, Python syntax checking and two unit tests; Jenkins reports SUCCESS |
| Controlled failure | Prove the tests actually detect a defect | Change multiplication to addition only in the disposable workspace; Jenkins reports FAILURE and console proves the intended `13 != 30` assertion, not an unrelated infrastructure error |
| Repair | Prove recovery works without restarting the service | Recreate the original fixture in a fresh workspace on the same job; the two tests run and Jenkins reports SUCCESS |
| Shared-host protection | Jenkins must not consume all the host's resources | Repeatedly check host available RAM/free swap, Gitea HTTP 200, container RAM/swap, CPU throttling and OOM counters; abort on guard failure |
| Cleanup | Leave existing coursework services intact | Remove only this owner-labelled test container and its anonymous home volume; preserve evidence and the base image; check Gitea afterward |
This is a small selected plugin set, not the smallest theoretically possible
dependency graph. `workflow-aggregator` is a suite, so two requested IDs will
produce more than two installed plugins. The current root requests are:
```text
workflow-aggregator:608.v67378e9d3db_1
gitea:286.v0740a_413c1eb_
```
The prepared local bundle contains 59 plugin archives (45,336,313 bytes). Two
requested features therefore do not mean two loaded files. The official plugin
pages checked October 21 list minimum Jenkins versions
2.479.3 and 2.528.3 respectively, below the recorded 2.580.1 core. That baseline
comparison is only a preliminary check; dependency resolution and actual loading
are still tested. Laptop preparation uses the official bundled `jenkins-plugin-cli`.
Current dependencies are resolved (`--latest true`) rather than deliberately
installing the old aggregator's minimum dependency versions. Requested roots
are checked for an exact match; every resolved archive version and SHA-256 goes
into the prepared `manifest.json`, with a full `plugins.lock` beside it. The
target verifies the hashes before starting Docker, then inventories the copied
archives again as `plugins-resolved.json` / `plugins-resolved.lock`.
Keep installer security warnings visible in prepared `installer.txt` and review them before
any real deployment. No flag hides warnings or skips failed plugins.
New dependency preparation and Debian package versions can change between runs.
Reusing the SAME prepared bundle fixes the plugin archives and hashes for the
target comparison; Python/Git apt versions remain recorded, not fully locked.
Retain the lock file/hashes and package-version output. Do not silently
substitute a different image/plugin set and compare it as the same experiment.
## Isolation and resource limits
- Same official core image tag as before, now also pinned to its recorded digest:
`jenkins/jenkins:2.580.1-jdk21@sha256:a660310e39ade10631f774bacd5219de767dfd08947ea5c32a739b5e5bb382c1`.
- 256 MiB container RAM; 512 MiB combined RAM plus swap, allowing up to 256 MiB
container swap. Half one CPU, 256 processes, Java heap 32-128 MiB and Serial GC.
- These target limits cover Python/Git installation, copying the prepared
plugins, AND Jenkins/Python pipeline runtime. Plugin catalog resolution and
downloads are a SEPARATE laptop-only preparation: 768 MiB RAM, 1 GiB combined
RAM+swap, 512 MiB Java heap, one CPU, no service port, fifteen-minute timeout.
Those preparation limits are not proposed for the 512 MB droplet. The base-image
pull is also separate, reused if cached, and bounded to five minutes.
- Existing host swap, packages, proxy, firewall, Gitea data and containers are
not changed. The installer runs as root inside the temporary container only;
the Jenkins process and its builds then run as the container's `jenkins` user.
- Only this source directory and the prepared plugin directory are mounted,
both read-only. No Docker socket, real
credential, runner registration, production checkout or existing Jenkins home.
- Only `127.0.0.1:18080` is published. Nothing is attached to Caddy or a public
Jenkins hostname. The disposable instance has authentication enabled and
anonymous read disabled. Its random test-account password is generated inside
Jenkins, never printed/read/exported, and discarded with the temporary home.
Setup-wizard automation is specific to this disposable instance.
- One built-in executor runs only this reviewed local fixture. This is an explicit
capacity-test choice, not approval to run arbitrary PR code on a production
controller. No separate agent is tested here.
- A sampled host floor of 48 MiB available RAM or 128 MiB free swap aborts the
run; any sampled Gitea non-200, container OOM event or unexpected exit also
aborts. These are sampled best-effort guards, not a guarantee that Gitea can
never be affected between probes. A failed health request alone does not
establish that Jenkins caused the failure.
- Installation timeout: 20 minutes. Startup/idle timeout: 15 minutes. Pipeline
phase: 10 minutes; each build has a three-minute outer wait. Overall: 45 minutes.
A detached watchdog attempts targeted cleanup after 46 minutes if SSH drops.
Normal interruption also runs cleanup. Check `cleanup_ok` and inspect leftovers
after machine/Docker failure; no script can guarantee cleanup of a stopped host.
- Requires Linux cgroup v2, Docker, Python 3.8+ on the HOST and root on The-Ocean.
Ubuntu 24.04 normally provides Python, but the preflight must confirm it.
The explicit Windows `--local-smoke-test` mode applies the same CONTAINER runtime
limits but does not run the droplet host RAM/swap/disk guards or Gitea checks.
Those fields are recorded as null, not invented measurements. Docker Desktop's
VM has different resources and does not host the real Gitea service, so local
success does not answer whether Jenkins and Gitea can share the droplet.
The experiment adds no cloud instance, subscription or resize. It uses the team's
existing droplet, disk and ordinary package/plugin/image download traffic; provider
transfer billing, if applicable, remains subject to the existing account plan.
Vincent/Billy own execution and cleanup. No maintenance/reboot is performed.
## Run when SSH access is restored
For the local regression checks only, run `python ci/jenkins-capacity/test_harness.py`
from the repository on Windows, or use `python3` on Linux. These standard-library
tests need no Docker or cloud access and do not launch Jenkins. They cannot
replace the real experiment below.
First collect/review the baseline as discussed. This script intentionally refuses
the `--run-on-the-ocean` option on Vincent's laptop or a differently named host.
Do not change that guard to obtain a false droplet PASS. Docker Desktop is not
needed to upload/run the PREPARED package; Docker on the droplet is needed.
Use the prepared ZIP, which includes a `jenkins-capacity` directory with its
`prepared-plugins` subdirectory. Extract it to a new task-local folder. From
**PowerShell in the extracted ZIP's parent folder**:
```powershell
scp -i "$env:USERPROFILE\.ssh\digitalocean" -r .\jenkins-capacity root@147.182.178.136:/root/ssw590-plugin-test
ssh -i "$env:USERPROFILE\.ssh\digitalocean" root@147.182.178.136
```
The SCP command assumes `/root/ssw590-plugin-test` does not already exist. If it
does, inspect its contents before copying; SCP may nest the source directory.
Upload the whole directory, not only `run_test.py`. Billy uses his own trusted
SSH key, not Vincent's key path.
Then **inside the droplet's Linux terminal**:
```sh
cd /root/ssw590-plugin-test
python3 --version
python3 run_test.py --help
python3 run_test.py --run-on-the-ocean
```
Expect progress lines naming `tools`, `plugins`, `startup/ready`, and
`startup/pipelines`, followed by `result.json` and the evidence path. During
installation, Jenkins HTTP is reported as 0 because Jenkins has not started;
Gitea should remain 200. You can stop with Ctrl+C; let cleanup finish.
Evidence goes under `/root/ssw590-capacity-evidence/plugins-<UTC>-<PID>/`.
Download that exact printed directory with SCP for review. It contains baseline,
input hashes, base-image identity, resource samples, checkpoint duration, resolved
plugins, controlled build logs, final state and result. It deliberately excludes
raw Jenkins controller logs, the credential-bearing home and private keys.
For a NEW bundle from source on Windows (not needed to use the packaged one):
```powershell
python ci/jenkins-capacity/prepare_plugins.py --output build/jenkins-plugin-bundle
python ci/jenkins-capacity/run_test.py --local-smoke-test --plugin-bundle build/jenkins-plugin-bundle
```
The preparation command refuses to overwrite an existing bundle. Preserve or
review the old bundle first. In the repository the archives live under ignored
`build/`; they are packaged into `prepared-plugins` for upload, not committed.
Interpret the result by phase. Preparation failure can be a download, dependency,
disk or memory problem; it does not automatically mean Jenkins cannot run.
Target installation failure may come from apt/tools or copying/unpacking plugins.
Startup failure can be plugin compatibility or resource pressure. An intentional
fixture FAILURE is expected only if the correct unit-test assertion is present.
Check OOM/CPU/swap and installer output before attributing a cause. A PASS with
heavy swap or throttling demonstrates feasibility under this small test, not
comfortable capacity, long-term reliability, concurrency or production readiness.
## What a PASS does not prove
The Gitea plugin must load here, but this experiment does not configure or exercise
Gitea discovery, SCM checkout, PR head selection, webhooks, credentials, status
reporting or branch protection. Git is installed and its version checked; no
repository is cloned. The pipeline is the bundled local fixture, not yet the
assignment's root repository Jenkinsfile. The fixture's repair is not a real
issue-linked reviewed PR. No HTTPS deployment, restart persistence, real admin
accounts, concurrent runner test, final report chapter or assignment completion
is claimed. Those are subsequent implementation/evidence steps.
## Primary references
- [Official Jenkins Docker image and plugin customization](https://github.com/jenkinsci/docker)
- [Plugin installation manager options and dependency behavior](https://github.com/jenkinsci/plugin-installation-manager-tool)
- [Pipeline suite](https://plugins.jenkins.io/workflow-aggregator/)
- [Gitea connector](https://plugins.jenkins.io/gitea/)
- [Groovy initialization hooks](https://www.jenkins.io/doc/book/managing/groovy-hook-scripts/)
- [Controller isolation and built-in executor risks](https://www.jenkins.io/doc/book/security/controller-isolation/)
- [Docker RAM, swap and CPU constraints](https://docs.docker.com/engine/containers/resource_constraints/)