diff --git a/.circleci/config.yml b/.circleci/config.yml index 09af531b7..a37497e9e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/prombench/docs/kind.md b/prombench/docs/kind.md index c2ee5d126..1b997b6f8 100644 --- a/prombench/docs/kind.md +++ b/prombench/docs/kind.md @@ -114,7 +114,13 @@ If used with the GitHub integration: export PR_NUMBER= ``` -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. diff --git a/prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml b/prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml index b6a729663..1600f51da 100644 --- a/prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml +++ b/prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml @@ -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 @@ -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 @@ -163,9 +165,9 @@ 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 }}" @@ -173,11 +175,13 @@ spec: 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 diff --git a/tools/prometheus-builder/Dockerfile b/tools/prometheus-builder/Dockerfile index a040a5884..d353c5674 100644 --- a/tools/prometheus-builder/Dockerfile +++ b/tools/prometheus-builder/Dockerfile @@ -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"] diff --git a/tools/prometheus-builder/build.sh b/tools/prometheus-builder/build.sh index e40f5294a..3730d269a 100755 --- a/tools/prometheus-builder/build.sh +++ b/tools/prometheus-builder/build.sh @@ -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 @@ -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" diff --git a/tools/prometheus-builder/key.sh b/tools/prometheus-builder/key.sh old mode 100644 new mode 100755 index 270f82803..1184e2a27 --- a/tools/prometheus-builder/key.sh +++ b/tools/prometheus-builder/key.sh @@ -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 @@ -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