Runner: size resources and timeouts; set Gitea Actions timeouts
Demo / hello (push) Successful in 12s

Runner (S4):
- CPU and memory requests and limits for the runner and DinD
  containers, sized for one job at a time on a 2-CPU worker.
- capacity 1, job timeout 2h, shutdown_timeout 15s and
  report_close_timeout 10s so a restarted runner can cancel and report
  its jobs inside the chart's fixed 30s grace period.
- force_pull false and job images pinned to dated runner-images tags.

Gitea (S6): ZOMBIE_TASK_TIMEOUT 5m, ENDLESS_TASK_TIMEOUT 2h30m,
ABANDONED_JOB_TIMEOUT 12h, LOG_RETENTION_DAYS 90 and
ARTIFACT_RETENTION_DAYS 30, all as role defaults with comments.

Refs DevOps/software-infrastructure#37
Refs DevOps/software-infrastructure#39

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 11:01:06 -05:00
co-authored by Claude Opus 5.5
parent e83262d862
commit 5fb2d9c7cb
3 changed files with 78 additions and 4 deletions
+57
View File
@@ -58,3 +58,60 @@ gitea_actions_docker_data_size: 50Gi
# The request also keeps the scheduler off nodes with small disks.
gitea_actions_dind_ephemeral_request: 20Gi
gitea_actions_dind_ephemeral_limit: 55Gi
# Runner and DinD CPU and memory. Sized for a 2-CPU, 16 GB worker (S3's
# recommended node) running one job at a time. The runner process itself is
# light; DinD holds the job containers, so it gets nearly all of the budget.
# A job that exceeds the DinD memory limit is OOM-killed inside the pod and
# fails with a step error, instead of the node evicting the whole runner.
gitea_actions_runner_resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 500m
memory: 256Mi
gitea_actions_dind_cpu_request: 500m
gitea_actions_dind_cpu_limit: "2"
gitea_actions_dind_memory_request: 2Gi
gitea_actions_dind_memory_limit: 8Gi
# Jobs the runner executes at once. 1 until there's a build host (L1): two
# image builds at once overrun a 2-CPU node's CPU and disk.
gitea_actions_runner_capacity: 1
# Longest a job may run on the runner. Kept below Gitea's
# ENDLESS_TASK_TIMEOUT so the runner, which can say why, fails it first.
# Workflows should still set a shorter `timeout-minutes`.
gitea_actions_runner_job_timeout: 2h
# On SIGTERM the runner waits this long for running jobs, then cancels them and
# reports the result to Gitea. Chart 0.1.2 doesn't expose the pod's
# terminationGracePeriodSeconds, so it stays at Kubernetes' 30s default. This
# plus report_close_timeout (10s) must fit inside those 30s, or the kubelet
# kills the runner before it reports and the job dies silently.
gitea_actions_runner_shutdown_timeout: 15s
gitea_actions_runner_report_close_timeout: 10s
# Per-request timeout when polling Gitea for a job (runner default 5s).
gitea_actions_runner_fetch_timeout: 10s
# Job images, pinned to dated tags from docker.gitea.com/runner-images so a
# job's environment only changes when this list is edited. v26.11.03 has the
# same digests as the floating ubuntu-24.04 and ubuntu-22.04 tags on
# 2026-11-10. With force_pull false these stay cached in DinD between jobs.
gitea_actions_runner_labels:
- "ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-24.04-v26.11.03"
- "ubuntu-24.04:docker://docker.gitea.com/runner-images:ubuntu-24.04-v26.11.03"
- "ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04-v26.11.03"
# Gitea's [actions] settings (option names checked against Gitea 1.27.0's
# modules/setting/actions.go; defaults in brackets).
# A running task whose runner stops reporting for this long is failed. [10m]
# Shorter, so a job killed with its runner fails within minutes, not quietly.
gitea_actions_zombie_task_timeout: 5m
# A task still running after this long is failed. [3h] Kept above
# gitea_actions_runner_job_timeout so the runner normally fails it first.
gitea_actions_endless_task_timeout: 2h30m
# A job no runner has picked up for this long is cancelled, for example one
# asking for a macOS or Windows runner that doesn't exist here. [24h]
gitea_actions_abandoned_job_timeout: 12h
# Days to keep job logs and uploaded artifacts. [365] and [90]
gitea_actions_log_retention_days: 90
gitea_actions_artifact_retention_days: 30
+15 -4
View File
@@ -89,10 +89,15 @@
mountPath: /var/lib/docker
resources:
requests:
cpu: "{{ gitea_actions_dind_cpu_request }}"
memory: "{{ gitea_actions_dind_memory_request }}"
ephemeral-storage: "{{ gitea_actions_dind_ephemeral_request }}"
limits:
cpu: "{{ gitea_actions_dind_cpu_limit }}"
memory: "{{ gitea_actions_dind_memory_limit }}"
ephemeral-storage: "{{ gitea_actions_dind_ephemeral_limit }}"
runner:
resources: "{{ gitea_actions_runner_resources }}"
config: |
log:
level: info
@@ -101,9 +106,15 @@
container:
require_docker: true
docker_timeout: 300s
# Use the cached job image; the labels below pin its version.
force_pull: false
runner:
capacity: 2
capacity: {{ gitea_actions_runner_capacity }}
timeout: {{ gitea_actions_runner_job_timeout }}
shutdown_timeout: {{ gitea_actions_runner_shutdown_timeout }}
report_close_timeout: {{ gitea_actions_runner_report_close_timeout }}
fetch_timeout: {{ gitea_actions_runner_fetch_timeout }}
labels:
- "ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"
- "ubuntu-24.04:docker://docker.gitea.com/runner-images:ubuntu-24.04"
- "ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04"
{% for label in gitea_actions_runner_labels %}
- "{{ label }}"
{% endfor %}
+6
View File
@@ -117,8 +117,14 @@
# logs the real client address instead of the ingress pod IP.
REVERSE_PROXY_LIMIT: 1
REVERSE_PROXY_TRUSTED_PROXIES: "{{ gitea_trusted_proxies }}"
# Timeouts and retention: see the gitea_actions_* defaults.
actions:
ENABLED: true
ZOMBIE_TASK_TIMEOUT: "{{ gitea_actions_zombie_task_timeout }}"
ENDLESS_TASK_TIMEOUT: "{{ gitea_actions_endless_task_timeout }}"
ABANDONED_JOB_TIMEOUT: "{{ gitea_actions_abandoned_job_timeout }}"
LOG_RETENTION_DAYS: "{{ gitea_actions_log_retention_days }}"
ARTIFACT_RETENTION_DAYS: "{{ gitea_actions_artifact_retention_days }}"
oauth2_client:
ENABLE_AUTO_REGISTRATION: true
UPDATE_AVATAR: true