Files
local-ci-cd-system/runner/config.yaml
T
Simone bc894a8058 feat(sprint2): §2.1/2.2/2.3/2.5 — IP lock/lease, scheduled tasks, retention, versioned snapshot
§2.1 — IP race with capacity>1 (Invoke-CIJob.ps1)
  Phases 2-3b (clone+start+IP) now run inside a file-based exclusive mutex
  (F:\CI\State\vm-start.lock via FileShare.None). Only one job at a time is
  in the VM-start phase, preventing concurrent vmrun starts from racing for
  the same DHCP lease. After IP is confirmed unique it is written to an IP
  lease file (F:\CI\State\ip-leases\<IP>.lease). Lock is released immediately
  so build phases run fully in parallel. Lease released in finally block.
  Collision detection: if a lease file already exists for the detected IP,
  the job fails fast with a clear error rather than silently sharing a WinRM target.

§2.5 — Versioned snapshot (Invoke-CIJob.ps1 + runner/config.yaml)
  $SnapshotName now defaults to GITEA_CI_SNAPSHOT_NAME env var, falling back
  to 'BaseClean'. config.yaml documents the commented-out variable for snapshot
  refresh workflow (BaseClean_<yyyyMMdd> naming convention).

§2.3 — Artifact/log retention (scripts/Invoke-RetentionPolicy.ps1)
  Purges per-job subdirs under F:\CI\Artifacts and F:\CI\Logs older than
  RetentionDays (default 30). Switches to AggressiveRetentionDays (default 7)
  when F: free space drops below MinFreeGB (default 50 GB). Also removes stale
  IP lease files older than 12 hours (defensive cleanup for crashed jobs).
  SupportsShouldProcess (-WhatIf) for dry-run.

§2.2 — Scheduled task registration (scripts/Register-CIScheduledTasks.ps1)
  Registers two tasks under \CI\ task folder as SYSTEM/HighestPrivilege:
    CI-CleanupOrphans  — every 6h + AtStartup, -MaxAgeHours 4
    CI-RetentionPolicy — daily 03:00 (+30min random) + AtStartup (+15min random)
  Idempotent (-Force), SupportsShouldProcess (-WhatIf), validates script paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 18:36:38 +02:00

86 lines
2.9 KiB
YAML

# act_runner configuration for Local CI/CD System
# Documentation: https://gitea.com/gitea/act_runner
log:
# Log level: trace, debug, info, warn, error, fatal
level: info
# Log format: text or json
format: text
runner:
# Path to the runner state file (stores runner registration info)
file: .runner
# Maximum number of concurrent jobs this runner will accept.
# Each job spawns one ephemeral VM. Budget: 64GB RAM / ~8GB per VM = 8 max.
# Set conservatively to 4 until you benchmark actual memory usage.
capacity: 4
# Environment variables injected into every job's environment.
envs:
# Path to the template VM - update after provisioning the template
GITEA_CI_TEMPLATE_PATH: "F:\\CI\\Templates\\WinBuild\\CI-WinBuild.vmx"
# Base directory where ephemeral clone VMs are created
GITEA_CI_CLONE_BASE_DIR: "F:\\CI\\BuildVMs"
# Base directory for collected build artifacts
GITEA_CI_ARTIFACT_DIR: "F:\\CI\\Artifacts"
# Windows Credential Manager target name for guest VM credentials
GITEA_CI_GUEST_CRED_TARGET: "BuildVMGuest"
# Snapshot to clone from. Default BaseClean — set to BaseClean_<yyyyMMdd> when
# refreshing the template. Keep the previous value live for 1 week before deleting.
# GITEA_CI_SNAPSHOT_NAME: "BaseClean"
# Optional: load additional env vars from a file (one KEY=VALUE per line)
# env_file: "F:\\CI\\runner.env"
# Maximum duration for a single job before it is killed.
# Set this higher than your longest expected build.
timeout: 2h
# Labels this runner advertises to Gitea.
# Workflows using "runs-on: windows-build" will be routed to this runner.
labels:
- "windows-build:host"
- "dotnet:host"
- "msbuild:host"
# Uncomment to ignore specific errors
# insecure: false
cache:
# Enable the built-in cache server (used by actions/cache steps)
enabled: true
# Cache storage directory on the host
dir: "F:\\CI\\Cache"
# External cache server - leave empty to use built-in
host: ""
port: 0
container:
# IMPORTANT: must be false on this runner.
# All builds run in VMware VMs, not Docker containers.
enabled: false
# These settings are ignored when container.enabled is false,
# but kept for documentation purposes.
# network: ""
# privileged: false
# options: ""
# workdir_parent: ""
host:
# Working directory on the host for act_runner's own workspace files.
# Each job gets a subdirectory here for checkout and step scripts.
workdir_parent: "F:\\CI\\RunnerWork"
artifact:
# Gitea artifact proxy settings
# Artifacts uploaded by steps (actions/upload-artifact) are stored via Gitea.
# The runner itself handles local artifact paths via Invoke-CIJob.ps1.
enabled: true
dir: "F:\\CI\\Artifacts"
# Retention in days for artifacts stored by act_runner itself
# (distinct from the Gitea server's own artifact retention setting)
retention:
days: 7