Add Synology CPU shares CI profile and host capability preflight

This commit is contained in:
Codex
2026-09-29 14:52:31 +03:00
parent aa84e73bd8
commit 3321046c2a
8 changed files with 306 additions and 32 deletions
+24 -7
View File
@@ -17,9 +17,13 @@ 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.
- Runner: 0.5 CPU, 512 MiB RAM, 128 PIDs, readonly root filesystem. Build jobs:
one at a time, 1 CPU, 2 GiB RAM, 256 PIDs, no privileged mode, no host bind
- 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
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.
- 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
@@ -56,9 +60,20 @@ creates the persistent `/data/.runner` identity on first start. Neither private
file is part of the artifact, source backup, journal or diagnostic output.
The bootstrap accepts no existing installed CI descriptor or CI container.
Preflight also checks at least 8 GiB free disk and 3 GiB currently available
memory. If that capacity is unavailable, review smaller fixed limits or another
worker placement; do not bypass the preflight.
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.
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
provide the needed CFS bandwidth control. Canonical rollback completed with
`ok:gitea-ci-bootstrap`; the private enrollment is retained for v3 reuse.
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.
## Build and install
@@ -66,7 +81,7 @@ 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-v2-<unique-id> --source-commit <full-sha> --output-dir <output-dir>
python3 infra/gitea-ci/build_artifact.py --patch-id gitea-ci-bootstrap-v3-<unique-id> --source-commit <full-sha> --output-dir <output-dir>
```
The first use requires promotion of the reviewed root runner through the
@@ -107,4 +122,6 @@ registration retained. Existing Platform/Device/Gitea regression suites are
also required before promotion.
References: [official runner configuration](https://docs.gitea.com/runner/configuration/),
[Docker installation](https://docs.gitea.com/runner/installation/docker/).
[Docker installation](https://docs.gitea.com/runner/installation/docker/),
[Docker resource constraints](https://docs.docker.com/engine/containers/resource_constraints/),
[Docker capabilities API](https://docs.docker.com/reference/api/engine/version/v1.40/).