cache (yarn,npm,...) #8172
-
Hi, i'm trying toget the caching of npm, yarn, etc to work while running in kubernetes. I was under the impression renovate would use $cachedir automatically for yarn/npm etc. caches but the folders are pretty empty:
Also setting env var ---
apiVersion: v1
kind: ConfigMap
metadata:
name: renovate-config
data:
config.json: |-
{
"logLevel" : "debug",
"dryRun" : false,
"persistRepoData": true,
"onboardingConfig": {
"extends": [
"config:base",
":labels(bot)",
]
}
}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: $CI_ENVIRONMENT_SLUG-renovate-bot
labels:
team: sys
annotations:
app.gitlab.com/env: $CI_ENVIRONMENT_SLUG
app.gitlab.com/app: $CI_PROJECT_PATH_SLUG
config/revision: "${REVISION}"
spec:
schedule: '@hourly'
concurrencyPolicy: Forbid
jobTemplate:
spec:
parallelism: 1
template:
metadata:
labels:
team: sys
cronjob: renovate-bot
annotations:
app.gitlab.com/env: $CI_ENVIRONMENT_SLUG
app.gitlab.com/app: $CI_PROJECT_PATH_SLUG
spec:
# so we don't pull the 3,5GB image on all nodes
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- node19
initContainers:
- image: busybox
name: renovate-init
command: ["sh", "-c", "chown -R 1000:1000 /renovate"]
volumeMounts:
- name: work-volume
mountPath: /renovate/
containers:
- image: renovate/renovate:24.11
imagePullPolicy: IfNotPresent
name: renovate-bot
env:
- name: RENOVATE_PLATFORM
value: 'gitlab'
- name: RENOVATE_TOKEN
valueFrom:
secretKeyRef:
name: renovate-secret
key: gitlab-token
# - name: RENOVATE_AUTODISCOVER
# value: 'false'
- name: GITHUB_COM_TOKEN
valueFrom:
secretKeyRef:
name: renovate-secret
key: github-token
- name: RENOVATE_BASE_DIR
value: '/renovate'
- name: RENOVATE_ENDPOINT
value: "https://XYZ/api/v4"
- name: RENOVATE_CONFIG_FILE
value: '/opt/renovate/config.json'
volumeMounts:
- name: config-volume
mountPath: /opt/renovate/
- name: work-volume
mountPath: /renovate/
- name: ssh-key-volume
readOnly: true
mountPath: '/home/ubuntu/.ssh'
restartPolicy: Never
volumes:
- name: config-volume
configMap:
name: renovate-config
- name: work-volume
persistentVolumeClaim:
claimName: renovate-work
- name: ssh-key-volume
secret:
secretName: ssh-config
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: renovate-work
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi regards, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
The cache location is determined by each package manager individually. Typically Renovate needs to pass some environment variable to customize that location, like the renovate/lib/manager/npm/post-update/index.ts Lines 465 to 466 in 5d99ff9 renovate/lib/manager/npm/post-update/index.ts Line 459 in 5d99ff9 |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Wow that was fast. Thank you ;)
|
Beta Was this translation helpful? Give feedback.
-
I needed to revert the previous change, so this now requires #8343 to be implemented |
Beta Was this translation helpful? Give feedback.
I needed to revert the previous change, so this now requires #8343 to be implemented