From ddbaf0890c2a93aa3fe67c43691fb77037be7faf Mon Sep 17 00:00:00 2001 From: Nyan404 Date: Sun, 16 Aug 2026 17:39:18 +0300 Subject: [PATCH] fix(ci): restore aliased dind for builder runner --- .gitlab-ci.yml | 22 +++++++++++++++++----- AGENTS.md | 4 ++-- structure_and_data.md | 8 ++++---- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4e3168..3939c6a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,17 +6,29 @@ variables: DOCKER_IMAGE_REPOSITORY: $DOCKER_REGISTRY/cwshed-clone/belki GATEWAY_IMAGE_REPOSITORY: $DOCKER_REGISTRY/cwshed KUBE_NAMESPACE: belki - # codex-k3s-shared exposes the host Docker daemon to build jobs. - # Keep this aligned with msfs-logger; this project does not need DinD. - DOCKER_HOST: unix:///var/run/docker.sock + DOCKER_HOST: tcp://docker:2375 DOCKER_BUILDKIT: "1" + DOCKER_TLS_CERTDIR: "" + DOCKER_DRIVER: overlay2 build: stage: build image: docker:29.6.1-cli + services: + - name: docker:29.6.1-dind + alias: docker before_script: - - test -S /var/run/docker.sock - - docker info >/dev/null 2>&1 + - | + i=0 + until docker info >/dev/null 2>&1; do + i=$((i + 1)) + if [ "$i" -ge 60 ]; then + echo "docker:dind did not become ready within 60 seconds." + exit 1 + fi + echo "Waiting for docker:dind (${i}/60)..." + sleep 1 + done script: # Docker Registry - echo "$DOCKER_PASSWORD" | docker login $DOCKER_REGISTRY -u "$DOCKER_USERNAME" --password-stdin diff --git a/AGENTS.md b/AGENTS.md index 47abc42..86dd4c0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ - Keep the calculation domain independent from HTTP, VK, and Kubernetes. - Keep VK tokens and group IDs out of the repository; use environment variables or Kubernetes Secrets. - Production manifests are already applied in namespace `belki`; CI deploys them from `main` using the namespace-scoped RBAC in [`deploy/k8s/rbac.yaml`](./deploy/k8s/rbac.yaml). -- The production build runner is `codex-k3s-shared` and exposes `/var/run/docker.sock`; use the host Docker socket for image builds. +- The production build uses a privileged Docker executor with an explicit `docker:29.6.1-dind` service alias and TCP endpoint. ## Validation - For CI-only changes, prefer a targeted YAML parse and a diff review. @@ -17,5 +17,5 @@ - Do not add unnecessary local build artifacts or temporary files to the repository. ## Notes -- The build job checks that `/var/run/docker.sock` is mounted and runs `docker info` before building. +- The build job waits for the DinD daemon and runs `docker info` before building. - Never commit `.env` or `.gitlab.variables.env`; the latter contains the GitLab Variable handoff and a namespace-scoped kubeconfig. diff --git a/structure_and_data.md b/structure_and_data.md index b96d74a..c753871 100644 --- a/structure_and_data.md +++ b/structure_and_data.md @@ -15,8 +15,8 @@ ## Runtime / Deployment - GitLab CI runs the build job. -- The job builds through the host Docker socket (`DOCKER_HOST=unix:///var/run/docker.sock`), matching the working `msfs-logger` build setup; this repo does not start a DinD service. -- The job checks the socket and runs `docker info` before starting the build. +- The job builds through a privileged `docker:29.6.1-dind` service at `DOCKER_HOST=tcp://docker:2375`, with an explicit `alias: docker` and `DOCKER_TLS_CERTDIR=""`. +- The job waits for the DinD daemon and runs `docker info` before starting the build. - The local image is currently `belki-calculator:test`; the CI target is now `$DOCKER_REGISTRY/belki:latest`. - Local validation was performed with `python3 -m unittest discover -s tests -v` (28 tests), `compileall`, JavaScript syntax check, a local browser/API smoke test, and container health/API smoke. - The VK dialog layer is covered by tests for step-by-step entry, bulk detection, clarification, confirmation, and cancellation. @@ -29,7 +29,7 @@ - `/admin` and `/api/admin/calculations` expose the calculation history for review. The API requires `X-Admin-Password` matching `BELKI_ADMIN_PASSWORD`; the web page supports sorting by kitten ID or name and does not persist the password in browser storage. - VK `messages.send` responses include a serialized context-aware keyboard; button payloads are translated back into the same dialog commands, while text commands remain supported. - Production k3s deployment (2026-08-16): namespace `belki` runs the Belki web calculator, VK bot, PostgreSQL 16, and the migrated cwshed Nginx gateway. The gateway keeps MetalLB IP `10.12.0.204`, serves the legacy CatWar site, and routes `/belki`, `/admin`, and `/api/*` to Belki web on `10.12.0.212`. Belki images are `reg.nyan404.ru/cwshed-clone/belki` and `reg.nyan404.ru/cwshed`; PostgreSQL is mirrored as `reg.nyan404.ru/library/postgres:16-alpine-amd64` because cluster nodes cannot pull Docker Hub directly. Registry pull credentials and runtime secrets are created out-of-band in the `belki` namespace. -- The previously inspected `stage-zone-runner` at `10.3.1.236` is not the runner used by the current pipeline. The intended runner is GitLab runner `#6` (`codex-k3s-shared`); its socket-backed executor is required by `.gitlab-ci.yml`. +- The previously inspected `stage-zone-runner` at `10.3.1.236` is not the runner used by the current pipeline. Runner `#2` (`Ryzen-builder`) at `10.3.1.168` is a privileged Docker executor and supports the DinD service used by `.gitlab-ci.yml`. - 2026-08-16 `prevent-eol` check: `python:3.12-slim` is currently maintained through 2028-10-31; Docker `29.6.1-cli` was `unknown` to the EOL catalog (no finding). Docker/CI references remain tag-pinned rather than digest-pinned. ## Change Log @@ -40,4 +40,4 @@ - 2026-08-16: rewrote VK help, welcome, and web hints as a concise neutral FAQ; command behavior is unchanged. - 2026-08-16: added the calculator/VK links to the CatWar home page and deployed the calculator stack to k3s; MetalLB assigned `10.12.0.212`. - 2026-08-16: added GitLab build/deploy stages, namespace-scoped `gitlab-deploy` RBAC, and the ignored local variables handoff `.gitlab.variables.env`. -- 2026-08-16: aligned the image build with `msfs-logger` by removing DinD and using the `codex-k3s-shared` host Docker socket. +- 2026-08-16: switched the image build back to explicit aliased DinD after confirming runner `#2` has no host socket but can start `docker:29.6.1-dind` successfully.