hermes f071c7fb43 fix(hermes_infra/gitea): add dedicated act_runner cache-server (#34)
## Problem

The built-in `act_runner` cache server binds to an interface unreachable from per-job container networks (`container.network: ""` is the default). `ACTIONS_CACHE_URL` ends up pointing at an unreachable IP, and every CI job burns ~9 minutes on:

```
::warning::Failed to restore: getCacheEntry failed: connect ETIMEDOUT 192.168.112.21:37051
::warning::Failed to save:    reserveCache  failed: connect ETIMEDOUT 192.168.112.21:37051
```

Measured on `admin/brencher#15` (https://gitea.rudolf.keenetic.link/admin/brencher/actions/runs/16):

| Job     | wall-clock | of which dead air on cache |
|---------|------------|----------------------------|
| 3.12.3  | 12m 40s    | ~9m (271s × 2 timeouts)    |
| 3.13    | 11m 13s    | ~9m                        |
| 3.14    | 11m 17s    | ~9m                        |

So even though `python-package.yml` enables `cache: 'pip'`, the cache backend is unreachable, jobs hit `pip install` cold every time, and CI ends up ~4x slower than necessary.

## Fix

Run a dedicated `act_runner cache-server` container on the same overlay network as the runner, and point the runner at it via `external_server`. Shared secret comes from a Docker secret mounted into both containers and read via `ACT_RUNNER_EXTERNAL_SECRET_FILE`.

## Changes

- `poc/gitea/stack-compose.yml`:
  - New `cache_server` service (`command: ["cache-server"]`) on the `gitea` overlay with a `cache_data` named volume.
  - `runner` and `cache_server` both mount the external Docker secret `gitea_cache_secret` at `/run/secrets/gitea_cache_secret` and set `ACT_RUNNER_EXTERNAL_SECRET_FILE` accordingly.
  - Top-level `secrets:` block declares `gitea_cache_secret` as `external: true`, with the create command commented inline next to it.
- `poc/gitea/config.yaml`: point `cache.{host,port,external_server}` at `gitea_cache_server:37051`; `external_secret` left empty because the secret is loaded from the file.

## Verification

- Both YAMLs parse (PyYAML).
- Service name `gitea_cache_server` resolves on the `gitea` overlay via Swarm service-name DNS.
- `docker secret inspect gitea_cache_secret` works after the one-time create step.

## Deploy notes

1. On the swarm manager, create the secret once:
   ```
   echo -n "$(openssl rand -hex 32)" | docker secret create gitea_cache_secret -
   ```
2. `docker stack deploy -c stack-compose.yml gitea`.
3. Re-run a CI job and confirm cache `restore`/`save` log lines no longer ETIMEDOUT.

## Related

- Related: admin/brencher#15 — `python-package.yml` enables `cache: 'pip'` and was timing out for the reason this PR fixes.
- Refs: gitea/actions/runs/16 jobs #248/249/250.

## Supersedes

- Supersedes: admin/ansible#33 — first attempt was based on a stale `origin/master` and accidentally included `hermes_squid/` changes from the actual upstream merge. The current branch is rebased on `admin/master` (`c3b7128`) and only touches `poc/gitea/`.Reviewed-on: http://192.168.1.96/admin/ansible/pulls/34
Reviewed-by: admin <rudolfss13@gmail.com>
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
2026-09-04 08:11:41 +02:00
x
2026-08-05 11:10:16 +02:00
2020-12-02 23:35:47 +03:00
2025-05-16 23:19:05 +02:00
2023-03-11 20:55:38 +01:00
2020-12-02 23:35:47 +03:00
2017-06-08 23:08:24 +03:00
2018-05-02 23:12:40 +03:00
2020-12-02 23:35:47 +03:00
2021-08-19 00:16:56 +03:00
2023-03-11 20:55:38 +01:00
2025-06-02 23:56:25 +02:00
2020-12-03 00:22:50 +03:00
2020-12-02 23:35:47 +03:00
2017-11-28 22:58:00 +03:00
2025-06-02 23:56:25 +02:00
2020-12-02 23:35:47 +03:00
2020-12-02 23:35:47 +03:00
2020-12-02 23:35:47 +03:00
S
Description
No description provided
11 MiB
Languages
Python 46.4%
Jinja 32.6%
Shell 14.4%
Dockerfile 6.6%