feat: deploy falcondev actions-cache for local gha caching (#775)

This commit is contained in:
bo0tzz
2025-06-24 17:17:04 +02:00
committed by GitHub
parent cf2fd9a29e
commit 2258204488
9 changed files with 96 additions and 8 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
# Based on the image by onedr0p
# https://github.com/onedr0p/containers/blob/main/apps/actions-runner/Dockerfile
FROM ghcr.io/actions/actions-runner:2.325.0@sha256:deb54a88ead0a86beedec6ac949e8b28f77478835b9c6434ccc237390a6e3e4f
# This base image is patched for the local actions-cache
FROM ghcr.io/falcondev-oss/actions-runner:2.324.0@sha256:4de199ed415f0238e9d4f3844f3e037fc4f03af71a01e267aa080d5aeef6a00f
ENV HOMEBREW_NO_ANALYTICS=1 \
HOMEBREW_NO_ENV_HINTS=1 \
@@ -0,0 +1,51 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: actions-cache
namespace: actions-cache
spec:
interval: 5m
chart:
spec:
chart: app-template
version: 2.6.0
interval: 15m
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
maxHistory: 2
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
controllers:
main:
containers:
main:
image:
repository: ghcr.io/falcondev-oss/github-actions-cache-server
tag: 8.0.1@sha256:f9ceeb0770901846393d319e0c819edbf219775e2c9bd1651aaed94d0b09d9b4
env:
API_BASE_URL: "http://actions-cache.actions-cache.svc.cluster.local:3000"
STORAGE_FILESYSTEM_PATH: "/data/cache"
DB_SQLITE_PATH: "/data/sqlite.db"
service:
main:
ports:
http:
port: 3000
persistence:
data:
enabled: true
storageClass: zfs
size: 100Gi
accessMode: ReadWriteOnce
@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
+21 -3
View File
@@ -5,7 +5,7 @@ metadata:
name: &app actions-runner-registry-cache
namespace: flux-system
spec:
targetNamespace: registry-cache
targetNamespace: actions-cache
commonMetadata:
labels:
app.kubernetes.io/name: *app
@@ -21,6 +21,26 @@ spec:
retryInterval: 1m
timeout: 5m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app actions-runner-actions-cache
namespace: flux-system
spec:
targetNamespace: actions-cache
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/actions-runner/actions-cache
prune: true
sourceRef:
kind: GitRepository
name: immich-kubernetes
wait: true
interval: 30m
retryInterval: 1m
timeout: 5m
---
# yaml-language-server: $schema=https://github.com/fluxcd-community/flux2-schemas/raw/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -32,8 +52,6 @@ spec:
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: cluster-apps-onepassword
path: ./kubernetes/apps/actions-runner/controller
prune: true
sourceRef:
@@ -12,4 +12,4 @@ metadata:
apiVersion: v1
kind: Namespace
metadata:
name: registry-cache
name: actions-cache
+11 -1
View File
@@ -23,13 +23,23 @@ spec:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: registry-cache
kubernetes.io/metadata.name: actions-cache
podSelector:
matchLabels:
app.kubernetes.io/name: registry
ports:
- port: 5000
protocol: TCP
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: actions-cache
podSelector:
matchLabels:
app.kubernetes.io/name: actions-cache
ports:
- port: 3000
protocol: TCP
- to:
- ipBlock:
cidr: 0.0.0.0/0
@@ -3,7 +3,7 @@ apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: registry
namespace: registry-cache
namespace: actions-cache
spec:
interval: 5m
chart:
@@ -11,5 +11,5 @@ data:
"com.docker.network.driver.mtu": "1450"
}
},
"registry-mirrors": ["http://registry.registry-cache.svc.cluster.local:5000"]
"registry-mirrors": ["http://registry.actions-cache.svc.cluster.local:5000"]
}
@@ -50,6 +50,8 @@ spec:
value: unix:///run/docker/docker.sock
- name: RUNNER_WAIT_FOR_DOCKER_IN_SECONDS
value: '120'
- name: CUSTOM_ACTIONS_RESULTS_URL
value: "http://actions-cache.actions-cache.svc.cluster.local:3000"
volumeMounts:
- name: work
mountPath: /home/runner/_work