Skip to content

Commit

Permalink
Added empty secretes ,modified newstore function to normal stop if co…
Browse files Browse the repository at this point in the history
…nfig file is empty.

Signed-off-by: Kushal Shukla <[email protected]>
  • Loading branch information
kushalShukla-web committed Nov 15, 2024
1 parent beec55f commit 1dbaaf1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 14 additions & 6 deletions prombench/docs/kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ If used with the GitHub integration:

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.
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:

Expand All @@ -125,13 +125,21 @@ Here’s how each option works:

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.
> Note: Make sure this secret applied before ```3b_prometheus-test_deployment.yaml```
- **Option 2: Skip downloading data**
If you don’t need to download data, edit the `3b_prometheus-test_deployment.yaml` file:
- **Option 2: Skip downloading data**

- Remove the `bucket-config` volume section from.
- Remove the `volumeMount` section name `bucket-config` from `data-downloader`.
> Note: You have to remove these two sections from both prometheus-test-pr-{{ .PR_NUMBER }} and prometheus-test-{{ normalise .RELEASE }} deployments.
If you don’t Want to Download data create an empty secret like this -

```yaml
# Empty Secret to Skip Downloading Data
apiVersion: v1
kind: Secret
metadata:
name: bucket-secret
namespace: prombench-{{ .PR_NUMBER }}
type: Opaque
stringData:
object-config.yml:

3. Deploy the Kubernetes objects:
> **_Note:_** If you encounter a `too many files open` error caused by promtail, increase the default value of `/proc/sys/fs/inotify/max_user_instances` from 128 to 512:
Expand Down
4 changes: 4 additions & 0 deletions tools/block-sync/upload_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func newStore(tsdbPath, objectConfig, objectKey string, logger *slog.Logger) (*S
if err != nil {
return nil, fmt.Errorf("failed to read config file: %w", err)
}
if len(configBytes) == 0 {
fmt.Println("Config file is empty, exiting container.")
os.Exit(0)
}

bucket, err := client.NewBucket(log.NewNopLogger(), configBytes, "block-sync")
if err != nil {
Expand Down

0 comments on commit 1dbaaf1

Please sign in to comment.