-
Notifications
You must be signed in to change notification settings - Fork 482
CNTRLPLANE-3329: Add nightly CronJob to warm EFS-backed Go build cache #8496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1631c3c
9dad273
c73ce25
ca1f7ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| apiVersion: batch/v1 | ||
| kind: CronJob | ||
| metadata: | ||
| name: go-cache-warmer | ||
| namespace: arc-runners | ||
| labels: | ||
| app.kubernetes.io/component: cache-warmer | ||
| app.kubernetes.io/part-of: arc-runner-set | ||
| spec: | ||
| schedule: "0 2 * * *" | ||
| concurrencyPolicy: Forbid | ||
| successfulJobsHistoryLimit: 3 | ||
| failedJobsHistoryLimit: 1 | ||
| jobTemplate: | ||
| spec: | ||
| activeDeadlineSeconds: 3600 | ||
| backoffLimit: 1 | ||
| template: | ||
| spec: | ||
| restartPolicy: Never | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| containers: | ||
| - name: cache-warmer | ||
| image: quay.io/redhat-user-workloads/crt-redhat-acm-tenant/hypershift-gh-actions-runner:latest | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check if the file exists and examine its structure
find . -name "cache-warming-cronjob.yaml" -type fRepository: openshift/hypershift Length of output: 120 🏁 Script executed: # If found, examine the file around line 23
if [ -f "hack/github-actions-runner/cache-warming-cronjob.yaml" ]; then
echo "=== File exists. Examining contents ===" && \
cat -n "hack/github-actions-runner/cache-warming-cronjob.yaml" | head -40
else
echo "File not found at specified path"
fiRepository: openshift/hypershift Length of output: 1659 Avoid mutable Pin this image to a digest to prevent unreviewed runtime drift in nightly jobs. Resolve the actual digest value and update the image reference. 🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentionally using
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✏️ Learnings added
|
||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - | | ||
| set -euo pipefail | ||
|
|
||
| echo "=== Cloning openshift/hypershift main branch ===" | ||
| git clone --depth 1 --branch main https://github.com/openshift/hypershift.git /tmp/hypershift | ||
| cd /tmp/hypershift | ||
|
|
||
| echo "=== Compiling all packages ===" | ||
| go build ./... | ||
|
|
||
| echo "=== Compiling all test binaries ===" | ||
| go test -c -o /dev/null ./... 2>/dev/null || true | ||
|
|
||
| echo "=== Cleaning stale cache entries (older than 7 days) ===" | ||
| find /cache/go-build -type f -mtime +7 -delete | ||
| find /cache/go-build -mindepth 1 -type d -empty -delete | ||
|
|
||
| echo "=== Syncing build cache to PV ===" | ||
| cp -a "${GOCACHE}"/* /cache/go-build/ | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| echo "=== Cache warming complete ===" | ||
| du -sh /cache/go-build/ | ||
| env: | ||
| - name: GOCACHE | ||
| value: /tmp/go-build-cache | ||
| - name: GOMODCACHE | ||
| value: /tmp/go-mod-cache | ||
| - name: HOME | ||
| value: /tmp | ||
| resources: | ||
| requests: | ||
| cpu: "4" | ||
| memory: "16Gi" | ||
| limits: | ||
| cpu: "4" | ||
| memory: "16Gi" | ||
| volumeMounts: | ||
| - name: go-cache | ||
| mountPath: /cache/go-build | ||
| volumes: | ||
| - name: go-cache | ||
| persistentVolumeClaim: | ||
| claimName: go-cache-pvc | ||
Uh oh!
There was an error while loading. Please reload this page.