From 3893b5809492c0fd82ef2fb50f7969917e4affab Mon Sep 17 00:00:00 2001 From: Purelind Date: Fri, 8 Nov 2024 17:41:49 +0800 Subject: [PATCH] feat(prod/jenkins): add cronjob to monitor s3 codecache size (#1319) Add cronjob to monitor s3 code cache size. --------- Co-authored-by: wuhuizuo --- apps/prod/jenkins/pre/cronjobs.yaml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/apps/prod/jenkins/pre/cronjobs.yaml b/apps/prod/jenkins/pre/cronjobs.yaml index b23ba5bd7..9a687f807 100644 --- a/apps/prod/jenkins/pre/cronjobs.yaml +++ b/apps/prod/jenkins/pre/cronjobs.yaml @@ -32,3 +32,41 @@ spec: limits: memory: "512Mi" cpu: "500m" +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: fix-ci-code-cache-size + namespace: apps +spec: + schedule: "*/30 * * * *" + jobTemplate: + spec: + template: + spec: + restartPolicy: OnFailure + containers: + - name: deno + image: "denoland/deno:2.0.5" + tty: true + args: + - run + - --allow-net + - --allow-env + - https://github.com/PingCAP-QE/ci/raw/main/scripts/plugins/monitor-s3-object-size.ts + - --path="git/PingCAP-QE/tidb-test" + - --threshold-mb=2500 + - --feishu-webhook="${CI_MONITOR_FEISHU_WEBHOOK_URL}" + - --cleanup + envFrom: + - secretRef: + name: ci-pipeline-cache2 + - configMapRef: + name: s3-ci-pipeline-cache2 + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "500m"