From f2c5cf80fa47fad89d04472517ec4812d8d925b9 Mon Sep 17 00:00:00 2001 From: codex Date: Sat, 21 Nov 2026 20:26:25 +0000 Subject: [PATCH 1/4] Route AkylDash Actions to its isolated local Docker Desktop runner --- .gitea/workflows/ci.yaml | 2 +- .gitea/workflows/deploy-handoff.yaml | 2 +- .gitea/workflows/release-images.yaml | 2 +- .gitea/workflows/runner-smoke.yaml | 2 +- docs/development/DELIVERY_POLICY.md | 8 +- docs/operations/CI_RUNNER.md | 12 +- docs/operations/CURRENT_STATE.md | 6 +- infra/runner/desktop/compose.yaml | 34 ++++ infra/runner/desktop/register.ps1 | 16 ++ infra/runner/desktop/runner.yaml | 17 ++ infra/runner/test-ci-container-builds.sh | 2 +- infra/runner/test-runner-config.sh | 196 ++++++++++++++++++++++- 12 files changed, 285 insertions(+), 14 deletions(-) create mode 100644 infra/runner/desktop/compose.yaml create mode 100644 infra/runner/desktop/register.ps1 create mode 100644 infra/runner/desktop/runner.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 6638e57..001c194 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -7,7 +7,7 @@ on: jobs: tests-and-images: - runs-on: akyldash-ci + runs-on: akyldash-local-ci steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/.gitea/workflows/deploy-handoff.yaml b/.gitea/workflows/deploy-handoff.yaml index b187581..29c2d42 100644 --- a/.gitea/workflows/deploy-handoff.yaml +++ b/.gitea/workflows/deploy-handoff.yaml @@ -13,7 +13,7 @@ jobs: gitea.event.workflow_run.conclusion == 'success' && gitea.event.workflow_run.event == 'workflow_run' && gitea.event.workflow_run.head_branch == 'main' - runs-on: akyldash-ci + runs-on: akyldash-local-ci steps: - uses: actions/checkout@v4 with: diff --git a/.gitea/workflows/release-images.yaml b/.gitea/workflows/release-images.yaml index 866e4f9..ab85861 100644 --- a/.gitea/workflows/release-images.yaml +++ b/.gitea/workflows/release-images.yaml @@ -12,7 +12,7 @@ jobs: gitea.event.workflow_run.conclusion == 'success' && gitea.event.workflow_run.event == 'push' && gitea.event.workflow_run.head_branch == 'main' - runs-on: akyldash-ci + runs-on: akyldash-local-ci steps: - uses: actions/checkout@v4 with: diff --git a/.gitea/workflows/runner-smoke.yaml b/.gitea/workflows/runner-smoke.yaml index e7ca9c1..e6ac718 100644 --- a/.gitea/workflows/runner-smoke.yaml +++ b/.gitea/workflows/runner-smoke.yaml @@ -8,7 +8,7 @@ on: jobs: runner-smoke: - runs-on: akyldash-ci + runs-on: akyldash-local-ci steps: - name: Verify isolated runner boundary run: | diff --git a/docs/development/DELIVERY_POLICY.md b/docs/development/DELIVERY_POLICY.md index a771ede..e9f2b93 100644 --- a/docs/development/DELIVERY_POLICY.md +++ b/docs/development/DELIVERY_POLICY.md @@ -50,11 +50,7 @@ и проверяет runtime-изоляцию job-контейнера: отсутствие системного и rootless Docker socket, production env/secrets и host checkout. Smoke дополняет статические проверки runner/CI и не дублирует их. -- Инфраструктурная конфигурация репозитория закрепляет официальный - `act_runner 0.2.13`, label `akyldash-ci`, capacity 1 и ограничения job 2 CPU, - 3 GiB RAM, 512 процессов, 15 GiB store. Версия runner и лимиты приведены по - IaC; в рамках этой задачи VPS не проверялся. Job-контейнеры не должны получать - ни один Docker socket. +- Все задания используют `akyldash-local-ci` в Docker Desktop владельца. Конфигурация `infra/runner/desktop` выделяет заданию 4 CPU, 6 GiB RAM и 512 процессов, capacity 1. Данные внутреннего Docker хранятся в отдельном томе. Job-контейнеры не получают Docker socket. - Текущая политика `main` из branch API: ветка защищена и требует одного одобрения. На момент проверки API также сообщил `enable_status_check=false` и пустой список status contexts. Это PR не меняет branch protection. @@ -86,7 +82,7 @@ Gitea 1.25 документация подтверждает используе предположениях: - `runs-on` поддерживает статическую метку или список меток; текущая - `akyldash-ci` — статическая метка. + `akyldash-local-ci` — статическая метка. - Выражения доступны ограниченно; в сравнении с GitHub Actions Gitea 1.25 обещает функцию `always()`, поэтому workflow не должен зависеть от `if:`-выражений для динамического выбора набора тестов по diff или уровню diff --git a/docs/operations/CI_RUNNER.md b/docs/operations/CI_RUNNER.md index 9a26c03..57735e3 100644 --- a/docs/operations/CI_RUNNER.md +++ b/docs/operations/CI_RUNNER.md @@ -1,6 +1,16 @@ # AkylDash Gitea Actions runner -## Scope and isolation +## Local Docker Desktop runner + +All four workflows target the repository-scoped label `akyldash-local-ci` on the owner's Windows PC. Use the pinned rootless DinD image and Compose files in `infra/runner/desktop`. This requires Docker Desktop's `desktop-linux` context and the existing Gitea HTTPS proxy on `home-runner_runner`. Registration and Docker data use separate named volumes. The outer container runs privileged for rootless DinD. Jobs receive no host mounts, Docker socket or privileged mode. Capacity is one job with 4 CPUs, 6 GiB memory and 512 processes. Docker data shares the Desktop VM's free disk space. + +From PowerShell run `.\infra\runner\desktop\register.ps1` once and enter the repository runner registration token at the hidden prompt. Verify `akyldash-desktop-local` is online and both required PR jobs pass. To pause, use `docker --context desktop-linux compose --project-directory infra/runner/desktop stop runner`; use `up -d runner` to resume with the existing registration and data. Old workflow revisions still request the VPS label. Update outstanding branches before retrying. + +## Historical VPS configuration + +The remainder records the former VPS installation and its test history. Its label must not be assigned to the local runner. Do not install it for current workflows. + +### Scope and isolation The deployment follows the official [Gitea 1.25 act_runner guide](https://docs.gitea.com/1.25/usage/actions/act-runner/) for repository-scoped registration. Gitea warns that access to a Docker daemon diff --git a/docs/operations/CURRENT_STATE.md b/docs/operations/CURRENT_STATE.md index bb91d55..1e8b86a 100644 --- a/docs/operations/CURRENT_STATE.md +++ b/docs/operations/CURRENT_STATE.md @@ -1,5 +1,9 @@ # Infrastructure current state +## Local runner storage — 2026-11-21 + +The AkylDash Docker Desktop data volume reported 931.6 GiB available. A container using the runner configuration reached Gitea over HTTPS. The dedicated local label is `akyldash-local-ci`. Registration and successful Actions jobs require separate verification in Gitea. + ## Windows ACL SID resolution — 2026-11-03 - Read-only PowerShell 5.1 inspection found that display-name conversion of @@ -459,7 +463,7 @@ Docker state, UFW rule details, and protected file metadata were not verified. reviewing the checkout; it grants only fixed verification, Compose `config`/`status`, and guarded rollback commands. 4. After merging the reviewed PR, confirm a subsequent CI and smoke run on - `akyldash-ci`. Image publishing and production deployment remain manual and + `akyldash-local-ci`. Image publishing and production deployment remain manual and are not part of CI. 5. Test backup/restore and rollback only with synthetic data in an isolated environment before any production deployment. diff --git a/infra/runner/desktop/compose.yaml b/infra/runner/desktop/compose.yaml new file mode 100644 index 0000000..d1dc0ba --- /dev/null +++ b/infra/runner/desktop/compose.yaml @@ -0,0 +1,34 @@ +name: akyldash-ci + +services: + runner: + image: docker.io/gitea/runner@sha256:f7f06cb66fa54b556e295f51fba4996c41b4ca65a1fbe0b03d650f78e32b9d0f + privileged: true + restart: unless-stopped + cpus: 6 + mem_limit: 8g + environment: + CONFIG_FILE: /etc/akyldash-runner.yaml + GITEA_INSTANCE_URL: https://git.vakanaut.ru + DOCKERD_ROOTLESS_ROOTLESSKIT_NET: slirp4netns + DOCKERD_ROOTLESS_ROOTLESSKIT_MTU: "65520" + configs: + - source: runner-config + target: /etc/akyldash-runner.yaml + extra_hosts: + - "git.vakanaut.ru:172.30.243.2" + networks: [gitea] + volumes: + - registration:/data + - docker-data:/home/rootless/.local/share/docker + +configs: + runner-config: + file: ./runner.yaml +networks: + gitea: + external: true + name: home-runner_runner +volumes: + registration: + docker-data: diff --git a/infra/runner/desktop/register.ps1 b/infra/runner/desktop/register.ps1 new file mode 100644 index 0000000..4b0bf46 --- /dev/null +++ b/infra/runner/desktop/register.ps1 @@ -0,0 +1,16 @@ +$ErrorActionPreference = 'Stop' +$compose = @('--context', 'desktop-linux', 'compose', '--project-directory', $PSScriptRoot) +$token = Read-Host 'admin/akyldash repository runner registration token' -AsSecureString +if (!$token.Length) { throw 'Registration token is empty.' } +$buffer = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($token) +try { + [Runtime.InteropServices.Marshal]::PtrToStringBSTR($buffer) | + docker @compose run --rm -T --no-deps --workdir /data --entrypoint /bin/sh runner -ec 'test ! -e /data/.runner && exec gitea-runner --config /etc/akyldash-runner.yaml register --no-interactive --instance https://git.vakanaut.ru --name akyldash-desktop-local --token-file /dev/stdin' + if ($LASTEXITCODE) { throw 'Registration failed or already exists.' } +} +finally { + [Runtime.InteropServices.Marshal]::ZeroFreeBSTR($buffer) + $token.Dispose() +} +docker @compose up -d runner +if ($LASTEXITCODE) { throw 'Could not start the registered runner.' } diff --git a/infra/runner/desktop/runner.yaml b/infra/runner/desktop/runner.yaml new file mode 100644 index 0000000..ffeb828 --- /dev/null +++ b/infra/runner/desktop/runner.yaml @@ -0,0 +1,17 @@ +log: + level: info + +runner: + file: /data/.runner + capacity: 1 + labels: + - "akyldash-local-ci:docker://docker.gitea.com/runner-images:ubuntu-24.04" + +cache: + enabled: false + +container: + docker_host: "-" + privileged: false + valid_volumes: [] + options: "--cpus=4 --memory=6g --pids-limit=512 --add-host=git.vakanaut.ru:172.30.243.2" diff --git a/infra/runner/test-ci-container-builds.sh b/infra/runner/test-ci-container-builds.sh index 4556c90..79c7bf8 100644 --- a/infra/runner/test-ci-container-builds.sh +++ b/infra/runner/test-ci-container-builds.sh @@ -5,7 +5,7 @@ workflow=.gitea/workflows/ci.yaml kaniko_action=.gitea/actions/kaniko-build/action.yml caddy_action=.gitea/actions/caddy-validate/action.yml -grep -Fq 'runs-on: akyldash-ci' "$workflow" +grep -Fq 'runs-on: akyldash-local-ci' "$workflow" grep -Fq 'uses: ./.gitea/actions/caddy-validate' "$workflow" [[ $(grep -Fc 'uses: ./.gitea/actions/kaniko-build' "$workflow") -eq 2 ]] check_workspace_wiring() { diff --git a/infra/runner/test-runner-config.sh b/infra/runner/test-runner-config.sh index dc89fc9..19cad44 100644 --- a/infra/runner/test-runner-config.sh +++ b/infra/runner/test-runner-config.sh @@ -63,7 +63,201 @@ grep -Fq 'find-free-subid-range.awk' "$installer" grep -Fq 'usermod "${subid_args[@]}" "$runner_user"' "$installer" grep -Fq 'subid_args+=(--add-subuids "$subid_range")' "$installer" assert_absent 'usermod.*(sudo|docker)|/var/run/docker.sock|/etc/sudoers' "$installer" -grep -Fq 'runs-on: akyldash-ci' .gitea/workflows/runner-smoke.yaml +for workflow in .gitea/workflows/*.yaml; do + grep -Eq '^ +runs-on: akyldash-local-ci +grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml +assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml + +fixture=$(mktemp) +fixture_g=$(mktemp) +trap 'rm -f "$fixture" "$fixture_g"' EXIT +printf 'production.env\n' >"$fixture" +if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then + echo 'Negative guard regression: prohibited fixture was accepted' >&2 + exit 1 +fi +printf 'codex:100000:65536\n' >"$fixture" +printf 'codex:165000:1000\n' >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 231072-296607 ]] +: >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 165536-231071 ]] +: >"$fixture" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 100000-165535 ]] +printf 'broken\n' >"$fixture_g" +if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then + echo 'Malformed subordinate ID allocation was accepted' >&2 + exit 1 +fi +echo 'runner configuration guards passed' + "$workflow" + if grep -E '^ +runs-on:' "$workflow" | grep -Evq '^ +runs-on: akyldash-local-ci +done +desktop=infra/runner/desktop/runner.yaml +grep -Fq 'akyldash-local-ci:docker://docker.gitea.com/runner-images:ubuntu-24.04' "$desktop" +grep -Fq 'docker_host: "-"' "$desktop" +grep -Eq '^ privileged: false +grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml +assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml + +fixture=$(mktemp) +fixture_g=$(mktemp) +trap 'rm -f "$fixture" "$fixture_g"' EXIT +printf 'production.env\n' >"$fixture" +if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then + echo 'Negative guard regression: prohibited fixture was accepted' >&2 + exit 1 +fi +printf 'codex:100000:65536\n' >"$fixture" +printf 'codex:165000:1000\n' >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 231072-296607 ]] +: >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 165536-231071 ]] +: >"$fixture" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 100000-165535 ]] +printf 'broken\n' >"$fixture_g" +if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then + echo 'Malformed subordinate ID allocation was accepted' >&2 + exit 1 +fi +echo 'runner configuration guards passed' + "$desktop" +grep -Eq '^ valid_volumes: \[\] +grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml +assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml + +fixture=$(mktemp) +fixture_g=$(mktemp) +trap 'rm -f "$fixture" "$fixture_g"' EXIT +printf 'production.env\n' >"$fixture" +if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then + echo 'Negative guard regression: prohibited fixture was accepted' >&2 + exit 1 +fi +printf 'codex:100000:65536\n' >"$fixture" +printf 'codex:165000:1000\n' >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 231072-296607 ]] +: >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 165536-231071 ]] +: >"$fixture" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 100000-165535 ]] +printf 'broken\n' >"$fixture_g" +if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then + echo 'Malformed subordinate ID allocation was accepted' >&2 + exit 1 +fi +echo 'runner configuration guards passed' + "$desktop" +grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml +assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml + +fixture=$(mktemp) +fixture_g=$(mktemp) +trap 'rm -f "$fixture" "$fixture_g"' EXIT +printf 'production.env\n' >"$fixture" +if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then + echo 'Negative guard regression: prohibited fixture was accepted' >&2 + exit 1 +fi +printf 'codex:100000:65536\n' >"$fixture" +printf 'codex:165000:1000\n' >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 231072-296607 ]] +: >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 165536-231071 ]] +: >"$fixture" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 100000-165535 ]] +printf 'broken\n' >"$fixture_g" +if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then + echo 'Malformed subordinate ID allocation was accepted' >&2 + exit 1 +fi +echo 'runner configuration guards passed' +; then exit 1; fi +done +desktop=infra/runner/desktop/runner.yaml +grep -Fq 'akyldash-local-ci:docker://docker.gitea.com/runner-images:ubuntu-24.04' "$desktop" +grep -Fq 'docker_host: "-"' "$desktop" +grep -Eq '^ privileged: false +grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml +assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml + +fixture=$(mktemp) +fixture_g=$(mktemp) +trap 'rm -f "$fixture" "$fixture_g"' EXIT +printf 'production.env\n' >"$fixture" +if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then + echo 'Negative guard regression: prohibited fixture was accepted' >&2 + exit 1 +fi +printf 'codex:100000:65536\n' >"$fixture" +printf 'codex:165000:1000\n' >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 231072-296607 ]] +: >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 165536-231071 ]] +: >"$fixture" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 100000-165535 ]] +printf 'broken\n' >"$fixture_g" +if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then + echo 'Malformed subordinate ID allocation was accepted' >&2 + exit 1 +fi +echo 'runner configuration guards passed' + "$desktop" +grep -Eq '^ valid_volumes: \[\] +grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml +grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml +assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml + +fixture=$(mktemp) +fixture_g=$(mktemp) +trap 'rm -f "$fixture" "$fixture_g"' EXIT +printf 'production.env\n' >"$fixture" +if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then + echo 'Negative guard regression: prohibited fixture was accepted' >&2 + exit 1 +fi +printf 'codex:100000:65536\n' >"$fixture" +printf 'codex:165000:1000\n' >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 231072-296607 ]] +: >"$fixture_g" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 165536-231071 ]] +: >"$fixture" +range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") +[[ $range == 100000-165535 ]] +printf 'broken\n' >"$fixture_g" +if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then + echo 'Malformed subordinate ID allocation was accepted' >&2 + exit 1 +fi +echo 'runner configuration guards passed' + "$desktop" grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml From ff87584980dfb6a8015e1bccaa2c757ee3e544e6 Mon Sep 17 00:00:00 2001 From: codex Date: Sat, 21 Nov 2026 20:27:46 +0000 Subject: [PATCH 2/4] Correct shell guard for every workflow runner label --- infra/runner/test-runner-config.sh | 194 +---------------------------- 1 file changed, 4 insertions(+), 190 deletions(-) diff --git a/infra/runner/test-runner-config.sh b/infra/runner/test-runner-config.sh index 19cad44..e47cf9d 100644 --- a/infra/runner/test-runner-config.sh +++ b/infra/runner/test-runner-config.sh @@ -64,200 +64,14 @@ grep -Fq 'usermod "${subid_args[@]}" "$runner_user"' "$installer" grep -Fq 'subid_args+=(--add-subuids "$subid_range")' "$installer" assert_absent 'usermod.*(sudo|docker)|/var/run/docker.sock|/etc/sudoers' "$installer" for workflow in .gitea/workflows/*.yaml; do - grep -Eq '^ +runs-on: akyldash-local-ci -grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml -assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml - -fixture=$(mktemp) -fixture_g=$(mktemp) -trap 'rm -f "$fixture" "$fixture_g"' EXIT -printf 'production.env\n' >"$fixture" -if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then - echo 'Negative guard regression: prohibited fixture was accepted' >&2 - exit 1 -fi -printf 'codex:100000:65536\n' >"$fixture" -printf 'codex:165000:1000\n' >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 231072-296607 ]] -: >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 165536-231071 ]] -: >"$fixture" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 100000-165535 ]] -printf 'broken\n' >"$fixture_g" -if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then - echo 'Malformed subordinate ID allocation was accepted' >&2 - exit 1 -fi -echo 'runner configuration guards passed' - "$workflow" - if grep -E '^ +runs-on:' "$workflow" | grep -Evq '^ +runs-on: akyldash-local-ci + labels=$(sed -n 's/^ *runs-on: *//p' "$workflow" | sort -u) + [[ $labels == akyldash-local-ci ]] || { echo "Unexpected runner in $workflow" >&2; exit 1; } done desktop=infra/runner/desktop/runner.yaml grep -Fq 'akyldash-local-ci:docker://docker.gitea.com/runner-images:ubuntu-24.04' "$desktop" grep -Fq 'docker_host: "-"' "$desktop" -grep -Eq '^ privileged: false -grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml -assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml - -fixture=$(mktemp) -fixture_g=$(mktemp) -trap 'rm -f "$fixture" "$fixture_g"' EXIT -printf 'production.env\n' >"$fixture" -if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then - echo 'Negative guard regression: prohibited fixture was accepted' >&2 - exit 1 -fi -printf 'codex:100000:65536\n' >"$fixture" -printf 'codex:165000:1000\n' >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 231072-296607 ]] -: >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 165536-231071 ]] -: >"$fixture" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 100000-165535 ]] -printf 'broken\n' >"$fixture_g" -if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then - echo 'Malformed subordinate ID allocation was accepted' >&2 - exit 1 -fi -echo 'runner configuration guards passed' - "$desktop" -grep -Eq '^ valid_volumes: \[\] -grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml -assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml - -fixture=$(mktemp) -fixture_g=$(mktemp) -trap 'rm -f "$fixture" "$fixture_g"' EXIT -printf 'production.env\n' >"$fixture" -if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then - echo 'Negative guard regression: prohibited fixture was accepted' >&2 - exit 1 -fi -printf 'codex:100000:65536\n' >"$fixture" -printf 'codex:165000:1000\n' >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 231072-296607 ]] -: >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 165536-231071 ]] -: >"$fixture" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 100000-165535 ]] -printf 'broken\n' >"$fixture_g" -if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then - echo 'Malformed subordinate ID allocation was accepted' >&2 - exit 1 -fi -echo 'runner configuration guards passed' - "$desktop" -grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml -assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml - -fixture=$(mktemp) -fixture_g=$(mktemp) -trap 'rm -f "$fixture" "$fixture_g"' EXIT -printf 'production.env\n' >"$fixture" -if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then - echo 'Negative guard regression: prohibited fixture was accepted' >&2 - exit 1 -fi -printf 'codex:100000:65536\n' >"$fixture" -printf 'codex:165000:1000\n' >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 231072-296607 ]] -: >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 165536-231071 ]] -: >"$fixture" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 100000-165535 ]] -printf 'broken\n' >"$fixture_g" -if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then - echo 'Malformed subordinate ID allocation was accepted' >&2 - exit 1 -fi -echo 'runner configuration guards passed' -; then exit 1; fi -done -desktop=infra/runner/desktop/runner.yaml -grep -Fq 'akyldash-local-ci:docker://docker.gitea.com/runner-images:ubuntu-24.04' "$desktop" -grep -Fq 'docker_host: "-"' "$desktop" -grep -Eq '^ privileged: false -grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml -assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml - -fixture=$(mktemp) -fixture_g=$(mktemp) -trap 'rm -f "$fixture" "$fixture_g"' EXIT -printf 'production.env\n' >"$fixture" -if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then - echo 'Negative guard regression: prohibited fixture was accepted' >&2 - exit 1 -fi -printf 'codex:100000:65536\n' >"$fixture" -printf 'codex:165000:1000\n' >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 231072-296607 ]] -: >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 165536-231071 ]] -: >"$fixture" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 100000-165535 ]] -printf 'broken\n' >"$fixture_g" -if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then - echo 'Malformed subordinate ID allocation was accepted' >&2 - exit 1 -fi -echo 'runner configuration guards passed' - "$desktop" -grep -Eq '^ valid_volumes: \[\] -grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml -grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml -assert_absent '(^|[[:space:]])(docker|docker-compose|deploy)([[:space:]]|$)|production.env=|review_secret=' .gitea/workflows/runner-smoke.yaml - -fixture=$(mktemp) -fixture_g=$(mktemp) -trap 'rm -f "$fixture" "$fixture_g"' EXIT -printf 'production.env\n' >"$fixture" -if assert_absent 'deploy|production.env|review_secret|docker.sock' "$fixture" 2>/dev/null; then - echo 'Negative guard regression: prohibited fixture was accepted' >&2 - exit 1 -fi -printf 'codex:100000:65536\n' >"$fixture" -printf 'codex:165000:1000\n' >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 231072-296607 ]] -: >"$fixture_g" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 165536-231071 ]] -: >"$fixture" -range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g") -[[ $range == 100000-165535 ]] -printf 'broken\n' >"$fixture_g" -if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then - echo 'Malformed subordinate ID allocation was accepted' >&2 - exit 1 -fi -echo 'runner configuration guards passed' - "$desktop" +grep -Fxq ' privileged: false' "$desktop" +grep -Fxq ' valid_volumes: []' "$desktop" grep -Fq 'test ! -S /var/run/docker.sock' .gitea/workflows/runner-smoke.yaml grep -Fq 'test ! -e /etc/akyldash/production.env' .gitea/workflows/runner-smoke.yaml grep -Fq 'test ! -e /etc/akyldash/review_secret' .gitea/workflows/runner-smoke.yaml From c341b40bca9625d377e1625493e44503274c0821 Mon Sep 17 00:00:00 2001 From: codex Date: Sun, 22 Nov 2026 04:56:58 +0000 Subject: [PATCH 3/4] Allow container actions to share the job network namespace --- infra/runner/desktop/runner.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/runner/desktop/runner.yaml b/infra/runner/desktop/runner.yaml index ffeb828..a3999a6 100644 --- a/infra/runner/desktop/runner.yaml +++ b/infra/runner/desktop/runner.yaml @@ -14,4 +14,4 @@ container: docker_host: "-" privileged: false valid_volumes: [] - options: "--cpus=4 --memory=6g --pids-limit=512 --add-host=git.vakanaut.ru:172.30.243.2" + options: "--cpus=4 --memory=6g --pids-limit=512" From bcb1b68306c9aa8c68dec2eb95830394d66ff220 Mon Sep 17 00:00:00 2001 From: codex Date: Sun, 22 Nov 2026 05:00:46 +0000 Subject: [PATCH 4/4] Record verified local runner migration --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad5b65e..21ec86c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Документация: инструкции Акылдаша переведены на нативный Windows Codex, `commerce-infra` и Gitea MCP. Сохранены независимое ревью, обязательные CI-проверки, одобрение текущего head и ограничения production-доступа. +- CI Акылдаша перенесён на локальный Docker Desktop с отдельной меткой `akyldash-local-ci` и томом для образов. Сборка backend и OpenSearch, проверки изоляции и загрузка CI-артефакта прошли на локальном раннере. - Deployment: подготовлен внешний handoff для Windows-клиента от точного Gitea commit. Bundle фиксирует commit/tree/blob identity и SHA-256; installer проверяет bundle и ACL до записи и не запускает Git. Bootstrap на release A