Skip to content

Commit 41a380d

Browse files
Adding Bucket-config in configMap instead on prometheus Repository.
Signed-off-by: Kushal Shukla <kushalshukla110@gmail.com>
1 parent 23a7a07 commit 41a380d

File tree

4 files changed

+17
-69
lines changed

4 files changed

+17
-69
lines changed

prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: blocksync-config
5+
namespace: prombench-{{ .PR_NUMBER }}
6+
data:
7+
bucket-config.yml: |
8+
path: gendata
9+
minTime: 1729694072541
10+
maxTime: 1729706400000
11+
---
112
apiVersion: apps/v1
213
kind: Deployment
314
metadata:
@@ -45,8 +56,6 @@ spec:
4556
value: "{{ .GITHUB_ORG }}"
4657
- name: GITHUB_REPO
4758
value: "{{ .GITHUB_REPO }}"
48-
- name: STORAGE
49-
value: "/storage-paths"
5059
volumeMounts:
5160
- name: prometheus-executable
5261
mountPath: /prometheus-builder
@@ -107,7 +116,8 @@ spec:
107116
secret:
108117
secretName: bucket-secret
109118
- name: key
110-
emptyDir: {}
119+
configMap:
120+
name: blocksync-config
111121
terminationGracePeriodSeconds: 300
112122
nodeSelector:
113123
node-name: prometheus-{{ .PR_NUMBER }}
@@ -165,22 +175,6 @@ spec:
165175
securityContext:
166176
runAsUser: 0
167177
initContainers:
168-
- name: download-key
169-
image: docker.io/prominfra/prometheus-builder:master
170-
imagePullPolicy: Always
171-
command: [ "/go/src/github.com/key.sh" ]
172-
env:
173-
- name: PR_NUMBER
174-
value: "{{ .PR_NUMBER }}"
175-
- name: GITHUB_ORG
176-
value: "{{ .GITHUB_ORG }}"
177-
- name: GITHUB_REPO
178-
value: "{{ .GITHUB_REPO }}"
179-
- name: STORAGE
180-
value: "/storage-paths"
181-
volumeMounts:
182-
- name: key
183-
mountPath: /storage-paths
184178
- name: data-downloader
185179
image: docker.io/prominfra/block-sync:master
186180
imagePullPolicy: Always
@@ -224,7 +218,8 @@ spec:
224218
secret:
225219
secretName: bucket-secret
226220
- name: key
227-
emptyDir: {}
221+
configMap:
222+
name: blocksync-config
228223
terminationGracePeriodSeconds: 300
229224
nodeSelector:
230225
node-name: prometheus-{{ .PR_NUMBER }}

tools/prometheus-builder/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ RUN mkdir -p /go/src/github.com
44

55
COPY ./build.sh /go/src/github.com/build.sh
66

7-
COPY ./key.sh /go/src/github.com/key.sh
8-
9-
RUN chmod +x /go/src/github.com/*
7+
RUN chmod +x /go/src/github.com/build.sh
108

119
ENTRYPOINT ["/go/src/github.com/build.sh"]

tools/prometheus-builder/build.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
DIR="/go/src/github.com/prometheus/prometheus"
44

5-
if [[ -z $PR_NUMBER || -z $VOLUME_DIR || -z $STORAGE || -z $GITHUB_ORG || -z $GITHUB_REPO ]]; then
5+
if [[ -z $PR_NUMBER || -z $VOLUME_DIR || -z $GITHUB_ORG || -z $GITHUB_REPO ]]; then
66
echo "ERROR:: environment variables not set correctly"
77
exit 1;
88
fi
@@ -24,16 +24,6 @@ fi
2424

2525
git checkout pr-branch
2626

27-
# Here, STORAGE is specified as an environment variable of the prometheus-builder init container,
28-
# where it will copy the bucket-config.yml file from the Prometheus directory to the volume section of the
29-
# emptyDir. This file will later be used by the data-downloader init container.
30-
if [ -f "$DIR/bucket-config.yml" ]; then
31-
echo "INFO:: bucket-config.yml file is Present on $DIR/bucket-config.yml directory so download the block from ObjecStorage."
32-
cp "$DIR/bucket-config.yml" "$STORAGE/bucket-config.yml"
33-
else
34-
echo "INFO:: bucket-config.yml File does not exist on $DIR/bucket-config.yml directory so data is not downloaded from ObjectStorage."
35-
fi
36-
3727
echo ">> Creating prometheus binaries"
3828
if ! make build PROMU_BINARIES="prometheus"; then
3929
echo "ERROR:: Building of binaries failed"

tools/prometheus-builder/key.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)