From 51460a3382d37dea3011e323ea0e67aeddc84773 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Wed, 25 Feb 2026 23:12:34 +0100 Subject: [PATCH] perf(ci): switch sccache from S3 to local block storage PVC - Create 20Gi sccache-pvc (scw-bssd) for fast local cache hits - Mount at /mnt/sccache in CI build pods via runner helm values - Use SCCACHE_DIR instead of SCCACHE_BUCKET for check/test jobs - Kaniko builds keep S3 sccache (can't mount PVCs in Kaniko) Co-Authored-By: Claude Opus 4.6 --- .gitlab-ci.yml | 8 ++++---- infra/k8s/gitlab/runner-values.yaml | 5 +++++ infra/k8s/storage/sccache-pvc.yaml | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 infra/k8s/storage/sccache-pvc.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dc2b29a18..0d22beffd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,12 +19,12 @@ variables: JWT_SECRET: "CiTestSecret_Kx7mP9nR2sW5vY8bC3fG6jH1kL4pQ7tZ0uN9dM5eV8xS2wT6yA4zB_64chars_min" # Training data on block storage PVC (mounted at /mnt/training-data by runner) FOXHUNT_DATA_DIR: "/mnt/training-data/futures-baseline" - SCCACHE_BUCKET: $SCCACHE_BUCKET - SCCACHE_ENDPOINT: $SCCACHE_ENDPOINT - SCCACHE_S3_USE_SSL: "true" + # sccache on local block storage PVC (mounted at /mnt/sccache by runner) + SCCACHE_DIR: "/mnt/sccache" + RUSTC_WRAPPER: /usr/local/bin/sccache + # S3 credentials still needed for Kaniko (Dockerfile) sccache AWS_ACCESS_KEY_ID: $SCW_ACCESS_KEY AWS_SECRET_ACCESS_KEY: $SCW_SECRET_KEY - RUSTC_WRAPPER: /usr/local/bin/sccache # CI builder image on Scaleway Container Registry (reachable by Kapsule nodes) CI_BUILDER_IMAGE: rg.fr-par.scw.cloud/foxhunt-ci/ci-builder:latest # Scaleway Container Registry for service images diff --git a/infra/k8s/gitlab/runner-values.yaml b/infra/k8s/gitlab/runner-values.yaml index ff2428ad8..4c19d386d 100644 --- a/infra/k8s/gitlab/runner-values.yaml +++ b/infra/k8s/gitlab/runner-values.yaml @@ -52,6 +52,11 @@ runners: name = "training-data-pvc" mount_path = "/mnt/training-data" read_only = true + # sccache on local block storage — faster than S3 for cache hits + [[runners.kubernetes.volumes.pvc]] + name = "sccache-pvc" + mount_path = "/mnt/sccache" + read_only = false # Runner tags for job matching tags: "kapsule,rust,docker,gpu" diff --git a/infra/k8s/storage/sccache-pvc.yaml b/infra/k8s/storage/sccache-pvc.yaml new file mode 100644 index 000000000..b24f9ed7a --- /dev/null +++ b/infra/k8s/storage/sccache-pvc.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: sccache-pvc + namespace: foxhunt + labels: + app.kubernetes.io/name: sccache + app.kubernetes.io/part-of: foxhunt + app.kubernetes.io/component: ci +spec: + storageClassName: scw-bssd + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 20Gi