2021-05-20 17:29:27 +02:00
|
|
|
# Copyright 2021 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://llvm.org/LICENSE.txt
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
|
|
apiVersion: batch/v1beta1
|
|
|
|
kind: CronJob
|
|
|
|
metadata:
|
2021-05-20 18:11:55 +02:00
|
|
|
name: uptime-stats
|
2021-05-20 17:29:27 +02:00
|
|
|
namespace: buildkite
|
|
|
|
spec:
|
2021-05-20 18:11:55 +02:00
|
|
|
schedule: "20 * * * *"
|
2021-05-20 17:29:27 +02:00
|
|
|
concurrencyPolicy: Forbid
|
|
|
|
successfulJobsHistoryLimit: 24
|
|
|
|
failedJobsHistoryLimit: 3
|
|
|
|
jobTemplate:
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: collect-buildkite-stats
|
|
|
|
image: gcr.io/llvm-premerge-checks/stats:latest
|
2021-05-20 18:11:55 +02:00
|
|
|
args: ["/root/llvm-premerge-checks/scripts/metrics/connect_db.sh python3 server_monitoring.py"]
|
2021-05-20 17:29:27 +02:00
|
|
|
env:
|
|
|
|
- name: BUILDKITE_AGENT_TOKEN
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: buildkite-agent-token
|
|
|
|
key: token
|
|
|
|
- name: POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: CONDUIT_TOKEN
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: conduit-api-token
|
|
|
|
key: token
|
|
|
|
- name: BUILDKITE_API_TOKEN
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: buildkite-api-token
|
|
|
|
key: token
|
|
|
|
- name: DB_PASSWORD
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: db-stats
|
|
|
|
key: password
|
2021-05-20 18:11:55 +02:00
|
|
|
- name: SCRIPTS_REFSPEC
|
2021-05-31 15:59:27 +02:00
|
|
|
value: "main"
|
2021-05-20 17:29:27 +02:00
|
|
|
restartPolicy: Never
|
|
|
|
nodeSelector:
|
|
|
|
cloud.google.com/gke-nodepool: service
|