Files
gitea-act_runner/storage.conf
Zoran Peričić c741ce2aaf v0.3.0-4: rootless Podman improvements
- Add btrfs storage.conf for gitea-runner user
- Add gitea-runner-podman.service dependency to runner service
- Auto-allocate subuid/subgid ranges via usermod (min 524288)
- Add systemd-container dep for loginctl enable-linger
- Use sysusers_create_package in %pre for proper user creation
- Track /var/lib/gitea/runners dir in %files
- Use runuser instead of sudo in setup script
- Add After=systemd-logind.service to podman service
- Fix SELinux volume label (:Z -> :z) in config.yaml
2026-04-06 00:33:13 +02:00

52 lines
2.4 KiB
Plaintext

# Podman storage configuration for gitea-runner user
# ==================================================
#
# PREREQUISITE: /var/lib/gitea must be a separate Btrfs mount point.
# This ensures all runner workloads (container images, layers, build cache)
# stay on the Btrfs partition, isolated from the system root filesystem.
#
# Example /etc/fstab entry (recommended mount options for CI workloads):
# /dev/sdXN /var/lib/gitea btrfs noatime,compress=zstd:1,space_cache=v2,autodefrag,discard=async,commit=120 0 0
#
# Mount option breakdown:
# noatime - Skip access time updates on reads, reduces write I/O
# compress=zstd:1 - Transparent compression; level 1 is fast with good ratio,
# can reduce container image storage by up to 50%
# space_cache=v2 - Faster free-space tracking for frequent allocate/delete
# cycles typical of container image churn
# autodefrag - Background defrag for small random writes (build artifacts)
# discard=async - Async TRIM for SSDs (omit this for spinning disks)
# commit=120 - Flush data every 120s instead of 30s — reduces write
# overhead; acceptable for CI data that can be rebuilt
#
# WHY BTRFS DRIVER?
# - Fast snapshots: Gitea runners frequently pull and remove images. The btrfs
# driver uses subvolumes, which is faster than OverlayFS on XFS.
# - Layer deduplication: When multiple runners use similar base images (e.g.
# node, go), Btrfs deduplicates them automatically, saving disk space.
# - Resource isolation: Since /var/lib/gitea is a separate mount, heavy runner
# I/O won't slow down the system root on XFS.
#
# INSTALLATION:
# This file is installed to:
# /var/lib/gitea/runners/.config/containers/storage.conf
# Podman reads it automatically when running as the gitea-runner user.
#
# INITIALIZATION (run as gitea-runner after install):
# podman system reset
# podman info | grep -E "store|graphRoot"
# Verify: storage.driver must be "btrfs" and graphRoot must point
# inside /var/lib/gitea/runners/
#
# All values below are commented out as examples. Uncomment and adjust
# to match your environment.
# [storage]
# driver = "btrfs"
#
# # Podman will automatically create subdirectories here
# graphroot = "/var/lib/gitea/runners/.local/share/containers/storage"
# [storage.options]
# # Optional: add quotas here if you want to limit disk space for runners