Skip to content

Commit

Permalink
1. Changed Image name
Browse files Browse the repository at this point in the history
2. Modified Prometheus deployment yml file
3. changed Prometheus Builder Docker file
Signed-off-by: Kushal Shukla <[email protected]>
  • Loading branch information
kushalShukla-web committed Nov 14, 2024
1 parent b18501c commit 42e7b36
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 20 deletions.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ jobs:
organization: "$DOCKER_ORG"
login_variable: DOCKER_LOGIN
password_variable: DOCKER_PASSWORD
- prometheus/publish_images:
container_image_name: block-sync
dockerfile_path: "tools/block-sync/Dockerfile"
dockerbuild_context: "tools/block-sync/"
registry: docker.io
organization: "$DOCKER_ORG"
login_variable: DOCKER_LOGIN
password_variable: DOCKER_PASSWORD
workflows:
version: 2
test-infra:
Expand Down
8 changes: 7 additions & 1 deletion prombench/docs/kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ If used with the GitHub integration:
export PR_NUMBER=<PR to benchmark against the selected $RELEASE>
```

2. Before applying benchmarking objects , You have two choices to make:
2. ### Setting Up Benchmarking Data

When setting up a benchmarking environment, it’s often useful to have pre-generated data available. This data can help speed up testing and make benchmarks more realistic by simulating actual workloads.

In this setup, you have two choices:

Here’s how each option works:
- **Option 1: Download data from object storage**

To download data from object storage, create a Kubernetes secret with exact named `bucket-config` and file name ```object-config.yml``` with the necessary credentials as per your object storage. This secret enables access to the stored data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
runAsUser: 0
initContainers:
- name: prometheus-builder
image: kushalshukla/builder
image: docker.io/prominfra/prometheus-builder:master
imagePullPolicy: Always
env:
- name: PR_NUMBER
Expand All @@ -45,13 +45,15 @@ spec:
value: "{{ .GITHUB_ORG }}"
- name: GITHUB_REPO
value: "{{ .GITHUB_REPO }}"
- name: STORAGE
value: "/storage-paths"
volumeMounts:
- name: prometheus-executable
mountPath: /prometheus-builder
- name: key
mountPath: /config
mountPath: /storage-paths
- name: data-downloader
image: kushalshukla/writer
image: docker.io/prominfra/block-sync:master
imagePullPolicy: Always
volumeMounts:
- name: instance-ssd
Expand Down Expand Up @@ -163,21 +165,23 @@ spec:
runAsUser: 0
initContainers:
- name: download-key
image: kushalshukla/builder
image: docker.io/prominfra/prometheus-builder:master
imagePullPolicy: Always
command: [ "/download-key/key.sh" ]
command: [ "/go/src/github.com/key.sh" ]
env:
- name: PR_NUMBER
value: "{{ .PR_NUMBER }}"
- name: GITHUB_ORG
value: "{{ .GITHUB_ORG }}"
- name: GITHUB_REPO
value: "{{ .GITHUB_REPO }}"
- name: STORAGE
value: "/storage-paths"
volumeMounts:
- name: key
mountPath: /config
mountPath: /storage-paths
- name: data-downloader
image: kushalshukla/writer
image: docker.io/prominfra/block-sync:master
imagePullPolicy: Always
volumeMounts:
- name: instance-ssd
Expand Down
4 changes: 2 additions & 2 deletions tools/prometheus-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ RUN mkdir -p /go/src/github.com

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

COPY ./key.sh /download-key/key.sh
COPY ./key.sh /go/src/github.com/key.sh

RUN chmod +x /go/src/github.com/build.sh
RUN chmod +x /go/src/github.com/*

ENTRYPOINT ["/go/src/github.com/build.sh"]
11 changes: 5 additions & 6 deletions tools/prometheus-builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

if [[ -z $PR_NUMBER || -z $VOLUME_DIR || -z $GITHUB_ORG || -z $GITHUB_REPO ]]; then
if [[ -z $PR_NUMBER || -z $VOLUME_DIR || -z $STORAGE || -z $GITHUB_ORG || -z $GITHUB_REPO ]]; then
echo "ERROR:: environment variables not set correctly"
exit 1;
fi
Expand All @@ -24,15 +24,14 @@ fi

git checkout pr-branch

# Here, MKDIR is specified in the volumeMount section of the prometheus-builder init container,
# Here, STORAGE is specified as an environment variable of the prometheus-builder init container,
# where it will copy the key.yml file from the Prometheus directory to the volume section of the
# emptyDir. This file will later be used by the data-downloader init container.
MKDIR="/config"
if [ -f "$DIR/key.yml" ]; then
echo "File exists."
cp "$DIR/key.yml" "$MKDIR/key.yml"
echo "INFO:: key.yml file is Present on $DIR/key.yml directory."
cp "$DIR/key.yml" "$STORAGE/key.yml"
else
echo "File does not exist."
echo "INFO:: key.yml File does not exist on $DIR/key.yml directory."
fi

echo ">> Creating prometheus binaries"
Expand Down
7 changes: 3 additions & 4 deletions tools/prometheus-builder/key.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

if [[ -z $PR_NUMBER || -z $VOLUME_DIR || -z $GITHUB_ORG || -z $GITHUB_REPO ]]; then
if [[ -z $PR_NUMBER || -z $STORAGE || -z $GITHUB_ORG || -z $GITHUB_REPO ]]; then
echo "ERROR:: environment variables not set correctly"
exit 1;
fi
Expand All @@ -24,13 +24,12 @@ fi

git checkout pr-branch

# Here, MKDIR is specified in the volumeMount section of the prometheus-builder init container,
# Here, STORAGE is specified as an environment variable of the download-key init container,
# where it will copy the key.yml file from the Prometheus directory to the volume section of the
# emptyDir. This file will later be used by the data-downloader init container.
MKDIR="/config"
if [ -f "$DIR/key.yml" ]; then
echo "File exists."
cp "$DIR/key.yml" "$MKDIR/key.yml"
cp "$DIR/key.yml" "$STORAGE/key.yml"
else
echo "File does not exist."
fi

0 comments on commit 42e7b36

Please sign in to comment.