diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f413e8..e4e3168 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,16 +6,16 @@ variables: DOCKER_IMAGE_REPOSITORY: $DOCKER_REGISTRY/cwshed-clone/belki GATEWAY_IMAGE_REPOSITORY: $DOCKER_REGISTRY/cwshed KUBE_NAMESPACE: belki - DOCKER_HOST: tcp://docker:2375 + # 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_BUILDKIT: "1" + build: stage: build image: docker:29.6.1-cli - services: - - docker:29.6.1-dind - variables: - DOCKER_TLS_CERTDIR: "" before_script: - - for i in $(seq 1 60); do docker info >/dev/null 2>&1 && break; echo "waiting for docker daemon ($i/60)"; sleep 1; done + - test -S /var/run/docker.sock - docker info >/dev/null 2>&1 script: # Docker Registry diff --git a/AGENTS.md b/AGENTS.md index 6ca3575..47abc42 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). -- Prefer `docker:dind` for CI unless the target runner is explicitly pinned and known to expose `/var/run/docker.sock`. +- The production build runner is `codex-k3s-shared` and exposes `/var/run/docker.sock`; use the host Docker socket for image builds. ## Validation - For CI-only changes, prefer a targeted YAML parse and a diff review. @@ -17,6 +17,5 @@ - Do not add unnecessary local build artifacts or temporary files to the repository. ## Notes -- `docker:dind` requires a privileged Docker executor and `DOCKER_HOST=tcp://docker:2375` with `DOCKER_TLS_CERTDIR=""`. -- The `dind` daemon can take time to initialize; this repo waits for `docker info` before building. +- The build job checks that `/var/run/docker.sock` is mounted 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 ff8b1d7..b96d74a 100644 --- a/structure_and_data.md +++ b/structure_and_data.md @@ -15,9 +15,8 @@ ## Runtime / Deployment - GitLab CI runs the build job. -- The job builds through `docker:dind` with `DOCKER_HOST=tcp://docker:2375` and `DOCKER_TLS_CERTDIR=""`. -- The job waits for `docker info` to succeed before starting the build, because the daemon may need a few seconds to come up. -- The runner does not need the host Docker socket mounted for this repo. +- 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 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. @@ -30,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. -- Remote runner host: `root@10.3.1.236` (`docker-03.homelab.local`), GitLab Runner `stage-zone-runner`, Docker executor, privileged, with `docker:29.6.1-dind` as the service image. +- 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`. - 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 @@ -41,3 +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.