Add Synology CPUSet CI bootstrap for actual NAS capabilities

This commit is contained in:
Codex
2026-09-29 15:12:35 +03:00
parent 3321046c2a
commit 1650c4f221
9 changed files with 285 additions and 31 deletions
+23 -12
View File
@@ -17,13 +17,15 @@ been accepted. Later repositories receive explicit registrations/policies.
- Runner and Node images use official Linux amd64 manifest digests (not mutable
tags), resolved from Docker Hub on 2026-09-29. The deploy runner pulls exactly
these two digests. No repository-provided image names or commands.
- Current Synology v3 profile: daemon CPU shares 64, 512 MiB RAM, 128 PIDs,
readonly root filesystem. Build jobs: one at a time, CPU shares 128,
2 GiB RAM, 256 PIDs, no privileged mode, no host bind
- Current Synology v4 profile: daemon and the single job share logical CPU7
through CPUSet. Their combined CPU ceiling is one logical CPU. Daemon:
CPU shares64, 512 MiB RAM+swap, readonly root filesystem. Job: CPU shares128,
2 GiB RAM+swap, no privileged mode, no host bind
mounts, no host execution label and no Docker socket in job containers.
- CPU shares give low relative priority during contention, not a hard CPU
quota. Job swap uses the Docker/host default. The v1/v2 historical profiles
retain their exact 0.5/1 NanoCPU quotas and original immutable config hashes.
- CPU shares also give low relative priority during contention. The NAS kernel
lacks a PIDs controller, so v4 does not set or claim a process-count limit.
V1/v2 retain their exact 0.5/1 NanoCPU quotas; v3 retains its shares-only/PIDs
profile. Historical configuration hashes are not changed.
- No published ports or host networking. Runner cache and metrics listeners
are disabled. Communication uses outbound HTTPS to the existing Gitea.
- Only the trusted runner daemon mounts the Docker socket. That daemon is
@@ -61,11 +63,13 @@ file is part of the artifact, source backup, journal or diagnostic output.
The bootstrap accepts no existing installed CI descriptor or CI container.
Preflight reads Docker's actual resource capabilities before any runtime
mutation, and reports only allowlisted version/kernel/resource fields. V3
requires Linux amd64 plus CPU shares, memory and PIDs controls. V1/v2 additionally
require CFS period/quota and swap accounting. Missing or non-boolean capability
values do not pass. Preflight also checks at least 8 GiB free disk and 3 GiB
currently available memory.
mutation, and reports only allowlisted version/kernel/resource fields. V4
requires Linux amd64, CPUSet, CPU shares, memory/swap controls, at least eight
logical CPUs and CPU7 available in the installer's affinity. Acceptance also
verifies the actual daemon affinity is exactly CPU7. V3 requires a PIDs
controller; V1/v2 additionally require CFS period/quota. Missing or non-boolean
required capability values do not pass. Preflight also checks at least 8 GiB
free disk and 3 GiB currently available memory.
The v2 apply on 2026-09-29 imported the private token successfully and pulled
the pinned images, but Docker rejected `NanoCPUs`: this NAS kernel does not
@@ -75,13 +79,20 @@ Artifact `gitea-ci-bootstrap-v2-20260929-002` is terminal failed and must not be
restaged or retried. V3 uses separate reviewed `synology-v3/` configurations and
`bootstrap-v3.json`; historical payloads remain byte-for-byte reproducible.
The subsequent v3 plan established the actual host matrix: Docker24.0.2,
kernel4.4.302+, cgroupv1, x86_64, eight logical CPUs, MemTotal16743616512.
CPUSet/CPUShares/MemoryLimit/SwapLimit=true; CFS period/quota and PidsLimit=false.
It stopped before apply. V4 uses this verified matrix, with separate
`synology-v4/` templates and `bootstrap-v4.json`. The private token from the
rolled-back v2 attempt is reused. Neither v2 nor v3 is the next install target.
## Build and install
From a clean Platform commit:
```sh
python3 -m unittest discover -s infra/gitea-ci -p 'test_*.py'
python3 infra/gitea-ci/build_artifact.py --patch-id gitea-ci-bootstrap-v3-<unique-id> --source-commit <full-sha> --output-dir <output-dir>
python3 infra/gitea-ci/build_artifact.py --patch-id gitea-ci-bootstrap-v4-<unique-id> --source-commit <full-sha> --output-dir <output-dir>
```
The first use requires promotion of the reviewed root runner through the