Integrating block-sync in an init-container#779
Integrating block-sync in an init-container#779kushalShukla-web wants to merge 7 commits intoprometheus:masterfrom
Conversation
94a489b to
85e464f
Compare
bboreham
left a comment
There was a problem hiding this comment.
I'm struggling to find my way around. Some trivial points stand out, but I need better orientation.
removed from block-sync:
Please explain each PR in terms of what it does, not what some other PR didn't do.
For example, you could describe the intended purpose of key.sh.
prombench/docs/kind.md
Outdated
| - **Option 2: Skip downloading data** | ||
|
|
||
| If you don’t need to download data, edit the `3b_prometheus-test_deployment.yaml` file: |
There was a problem hiding this comment.
Could we instead tell people to create an empty Secret?
| initContainers: | ||
| - name: prometheus-builder | ||
| image: docker.io/prominfra/prometheus-builder:master | ||
| image: kushalshukla/builder |
tools/prometheus-builder/build.sh
Outdated
| exit 1; | ||
| fi | ||
|
|
||
tools/prometheus-builder/Dockerfile
Outdated
| RUN chmod +x /go/src/github.com/build.sh | ||
|
|
||
| ENTRYPOINT ["/go/src/github.com/build.sh"] | ||
| ENTRYPOINT ["/go/src/github.com/build.sh"] No newline at end of file |
tools/prometheus-builder/Dockerfile
Outdated
|
|
||
| COPY ./build.sh /go/src/github.com/build.sh | ||
|
|
||
| COPY ./key.sh /download-key/key.sh |
There was a problem hiding this comment.
Why is this in such a different place from the other script?
tools/prometheus-builder/build.sh
Outdated
| # emptyDir. This file will later be used by the data-downloader init container. | ||
| MKDIR="/config" | ||
| if [ -f "$DIR/key.yml" ]; then | ||
| echo "File exists." |
There was a problem hiding this comment.
Who is expected to read this message, and what are they expected to do about it?
prombench/docs/kind.md
Outdated
| 2. Before applying benchmarking objects , You have two choices to make: | ||
| - **Option 1: Download data from object storage** |
There was a problem hiding this comment.
How would someone coming to this for the first time understand this choice?
Can we give some context why data might be downloaded?
65358a1 to
b18501c
Compare
tools/prometheus-builder/build.sh
Outdated
| # Here, MKDIR is specified in the volumeMount section 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" |
There was a problem hiding this comment.
I think you need to change the name.
tools/prometheus-builder/build.sh
Outdated
|
|
||
| git checkout pr-branch | ||
|
|
||
| # Here, MKDIR is specified in the volumeMount section of the prometheus-builder init container, |
There was a problem hiding this comment.
It would be better to have this in another script.
42e7b36 to
1dfe367
Compare
from block-sync. Signed-off-by: Kushal Shukla <kushalshukla110@gmail.com>
2. Modified Prometheus deployment yml file 3. changed Prometheus Builder Docker file Signed-off-by: Kushal Shukla <kushalshukla110@gmail.com>
8197ba6 to
1dbaaf1
Compare
…nfig file is empty. Signed-off-by: Kushal Shukla <kushalshukla110@gmail.com>
aab03cb to
18b922f
Compare
Signed-off-by: Kushal Shukla <kushalshukla110@gmail.com>
18b922f to
2c1f884
Compare
prombench/docs/eks.md
Outdated
| 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-secret` and file name ```object-config.yml``` with the necessary credentials as per your object storage. This secret enables access to the stored data. |
There was a problem hiding this comment.
| To download data from object storage, create a Kubernetes secret with exact named `bucket-secret` and file name ```object-config.yml``` with the necessary credentials as per your object storage. This secret enables access to the stored data. | |
| To download data from object storage, create a Kubernetes secret with exact named `bucket-secret` and file name `object-config.yml` with the necessary credentials as per your object storage. This secret enables access to the stored data. |
tools/prometheus-builder/build.sh
Outdated
| echo "INFO:: key.yml file is Present on $DIR/key.yml directory." | ||
| cp "$DIR/key.yml" "$STORAGE/key.yml" | ||
| else | ||
| echo "INFO:: key.yml File does not exist on $DIR/key.yml directory." |
There was a problem hiding this comment.
We should add more context or remove this line. e.g. File does not exists so we won't download XXX
tools/prometheus-builder/build.sh
Outdated
| # 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. | ||
| if [ -f "$DIR/key.yml" ]; then | ||
| echo "INFO:: key.yml file is Present on $DIR/key.yml directory." |
There was a problem hiding this comment.
"It exists so we will download the blocks from XXX."
93ba277 to
b795fea
Compare
Signed-off-by: Kushal Shukla <kushalshukla110@gmail.com>
b405f52 to
0f98ebd
Compare
Removed the code for exiting container when secret is not present. Signed-off-by: Kushal Shukla <kushalshukla110@gmail.com>
ec570f4 to
905b6b3
Compare
Signed-off-by: Kushal Shukla <kushalshukla110@gmail.com>
905b6b3 to
23a7a07
Compare
| @@ -0,0 +1,35 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Let's be more specific concerning the filename. key.sh is too generic.
| RUN chmod +x /go/src/github.com/build.sh | ||
| COPY ./key.sh /go/src/github.com/key.sh | ||
|
|
||
| RUN chmod +x /go/src/github.com/* |
There was a problem hiding this comment.
We should just give executable permission in this directory. This could create security issues. Just give all the known script names.
|
This needs a rebase @kushalShukla-web |
Integrated
download-keyin an init container that downloads thekey.ymlfile from the Prometheus repository. It uses thekey.shscript to fetch the pull request and copy thekey.ymlfile into the volumeMount section:data-downloaderon both pr and released side, which uses theblock-syncbinary to downloadpre-generatedblock data.prometheus-builderimage, modifying thebuilder.shfile to copy thekey.ymlfile into the volumeMount section so that the PR section can also download the pre-generated block data.