feat(b5): add systemd unit files for CI periodic tasks (Linux host)
Implements the repo-side artifacts of Phase B5 (plans/implementation-plan-A-B.md). Creates 5 .service + .timer pairs under deploy/systemd/ that replicate the periodic tasks registered on Windows by scripts/Register-CIScheduledTasks.ps1: - ci-cleanup-orphans -> python -m ci_orchestrator vm cleanup --max-age-hours 6 (every 6h + boot) - ci-retention-policy -> pwsh Invoke-RetentionPolicy.ps1 (daily 03:00) - ci-watch-disk-space -> python -m ci_orchestrator monitor disk (every 15min) - ci-watch-runner-health -> python -m ci_orchestrator monitor runner (every 15min) - ci-backup-template -> pwsh Backup-CITemplate.ps1 (weekly Sun 02:00, NEW) Includes deploy/systemd/README.md with mapping table, install/test/rollback instructions, and PowerShell Core install note for the two PS-only scripts. Plan checklist updated; B5-closeout.md added. Hardware install steps (systemctl enable + smoke) remain user responsibility on the Linux host.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
[Unit]
|
||||
Description=Local CI/CD — auto-restart act_runner if stopped (rate-limited)
|
||||
Documentation=file:///opt/ci/local-ci-cd-system/deploy/systemd/README.md
|
||||
After=network-online.target act-runner.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ci-runner
|
||||
Group=ci-runner
|
||||
EnvironmentFile=/etc/ci/environment
|
||||
# `monitor runner` enforces internal rate-limit: max 3 restarts/h
|
||||
# (matches Windows CI-RunnerHealth scheduled task semantics).
|
||||
ExecStart=/opt/ci/venv/bin/python -m ci_orchestrator monitor runner
|
||||
TimeoutStartSec=5min
|
||||
Nice=15
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
# NoNewPrivileges intentionally NOT set: monitor may need to call
|
||||
# `systemctl restart act-runner.service` via polkit.
|
||||
ReadWritePaths=/var/lib/ci /var/log/ci
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user