实现 Gitea CI 编译缓存自动刷新与定向清理

基于固定 master 提交构建全新缓存镜像,并在成功验证后保留当前版和回滚版。
增加任务领取网关,在不打断运行中 CI 的前提下切换镜像。
补充宿主维护服务、部署说明、共享记忆和定向行为测试。
修复构建测试在 Windows 与 WSL 下并发写入日志的竞态。
This commit is contained in:
2026-09-22 07:37:45 +00:00
parent 292e42cf5e
commit 32caa6914b
17 changed files with 1915 additions and 43 deletions
@@ -0,0 +1,22 @@
[Unit]
Description=Refresh and retain trusted Gitea CI Rust cache images
After=network-online.target docker.service
Wants=network-online.target
Requires=docker.service
ConditionPathExists=/etc/genarrative-ci-cache/config.json
[Service]
Type=oneshot
User=root
WorkingDirectory=/opt/genarrative-ci-cache
UMask=0077
ExecStart=/usr/bin/python3 /opt/genarrative-ci-cache/scripts/maintain-gitea-rust-cache.py --config /etc/genarrative-ci-cache/config.json --apply
ExecStopPost=/usr/bin/python3 /opt/genarrative-ci-cache/scripts/maintain-gitea-rust-cache.py --config /etc/genarrative-ci-cache/config.json --resume
TimeoutStartSec=3h
TimeoutStopSec=60s
Nice=10
IOSchedulingClass=best-effort
IOSchedulingPriority=7
[Install]
WantedBy=multi-user.target
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Check for new Gitea CI compilation inputs
[Timer]
OnBootSec=5min
OnUnitInactiveSec=5min
RandomizedDelaySec=30s
Unit=genarrative-ci-cache.service
[Install]
WantedBy=timers.target