@leverege/build-tools 2.68.3-beta.4 β†’ 2.69.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "."
5
+ }
6
+ ],
7
+ "settings": {}
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.68.3-beta.4",
3
+ "version": "2.69.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -86,7 +86,7 @@
86
86
  "shell-quote": "^1.8.3",
87
87
  "simple-git": "^3.28.0",
88
88
  "toml": "^3.0.0",
89
- "zx": "^8.6.1"
89
+ "zx": "^8.7.1"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@leverege/eslint-config-leverege": "^5.0.1",
@@ -14,11 +14,13 @@ import {
14
14
  getGitBranchAndUpstream,
15
15
  gitRepoIsDirty,
16
16
  proceed,
17
- shellCmd } from './Utils.mjs'
17
+ shellCmd,
18
+ warning,
19
+ } from './Utils.mjs'
18
20
 
19
21
  import docker from './Docker.mjs'
20
22
 
21
- const minimumBuildToolsVersion = '2.68.0'
23
+ const minimumBuildToolsVersion = '2.69.0'
22
24
 
23
25
  // refresh-npm-token does not throw so no need to try, but it emits in debug
24
26
  const refreshErr = await shellCmd( 'refresh-npm-token' )
@@ -91,7 +93,8 @@ const repoDescr = await analyzeRepository( giveGuidance )
91
93
  debug( { repoDescr }, '<==The Repo Description' )
92
94
 
93
95
  if ( semver.lt( semver.coerce( repoDescr.buildToolsVersion ), minimumBuildToolsVersion ) ) {
94
- errorExit( `Error: package.json @leverege/build-tools minimum version is ^${minimumBuildToolsVersion}` )
96
+ warning( `package.json @leverege/build-tools preferred minimum version is ^${minimumBuildToolsVersion}\n` )
97
+ await proceed()
95
98
  }
96
99
 
97
100
  const {
@@ -12,6 +12,12 @@ const spinner = ora( 'Gathering Helm release info...' ).start()
12
12
  const limit = pLimit( 5 ) // limit concurrent shellCmds to avoid API overload
13
13
  const OMIT_NAMESPACES = new Set( [ 'estafette' ] )
14
14
 
15
+ process.on( 'SIGINT', () => {
16
+ // catch ctrl^C in order to reset terminal back to normal
17
+ spinner.stop()
18
+ process.exit( 1 )
19
+ } )
20
+
15
21
  async function getHelmReleases() {
16
22
  const json = await shellCmd( 'helm list -A -o json' )
17
23
  return JSON.parse( json ).filter( r => !OMIT_NAMESPACES.has( r.namespace ) )
@@ -6,5 +6,10 @@ config:
6
6
  UPLOADER_PROJECT_ID: "${PROJECT_ID}"
7
7
  UPLOADER_BUCKET: "${PROJECT_ID}-geotile-server"
8
8
 
9
+ # CNPG override
10
+ SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
11
+ SQL_PASSWORD_SECRET: "cnpg-db-psql-stack-postgres-pw"
12
+ SQL_PASSWORD_KEY: "password"
13
+
9
14
  serviceMonitor:
10
15
  enabled: true
@@ -0,0 +1,42 @@
1
+ # πŸ“Œ Optional Prometheus Custom Metrics
2
+
3
+ ## 🎯 Why we do this
4
+ We maintain a **single, consistent Prometheus baseline** for all clusters. Certain metrics β€” like GPU duty cycle percent or other node-type-specific stats β€” **do not exist in every cluster**. If we deploy scrape configs or custom adapter rules for optional metrics globally, we risk:
5
+
6
+ - Empty series queries β†’ scrape flapping.
7
+ - Duplicate or rejected samples.
8
+ - Confusing "phantom target down" or noisy alerts.
9
+
10
+ ## βœ… How we solve it
11
+ - **Baseline:**
12
+ Our base `prom-operator` Helm chart and Prometheus Adapter configs **do not contain cluster-specific custom metrics** by default.
13
+ - running _helmup prom-operator_ will deploy prometheus with the standard exporters
14
+
15
+ - **Specialized nodes:**
16
+ When clusters require optional metrics (e.g., GPU nodes, special sensors, vendor-specific exporters), we deploy those configs with a separate, explicit step:
17
+ - post helmup run _./prom-operator/gpu-hpa-metrics.sh_ to apply the prometheus-adapter.yaml which contains the GPU scraper
18
+
19
+ ## πŸ” Benefits
20
+ - Zero config drift: our core charts stay generic and versioned.
21
+ - No surprise scrape issues or prometheus TSDB rejects in clusters that don’t expose those metrics.
22
+ - Clusters only carry the scrape configs they can actually fulfill.
23
+
24
+ ## πŸ› οΈ Operational tips
25
+ - **Add custom metrics only when a cluster’s node pool truly provides them.**
26
+ - Keep custom metric configs organized in a clear, dedicated folder (`gpu-adapter-values.yaml`, `gpu-metrics.yaml`, etc.)
27
+ - When adding new clusters, verify whether specialized nodes are present and apply the custom metrics if needed.
28
+ - When GPU adoption grows, we can promote the configs to the baseline and gate them behind a `gpuEnabled` flag.
29
+
30
+ ## βš™οΈ Example
31
+ > Our `gpu_duty_cycle_percent` metric is installed *only* on clusters with GPU node pools.
32
+ > This is done by running:
33
+ >
34
+ > ```bash
35
+ > ./prom-operator/gpu-hpa-metrics.sh
36
+ > ```
37
+ > or directly with helm:
38
+ > ```bash
39
+ > helm upgrade prometheus-adapter -f gpu-adapter-values.yaml
40
+ > ```
41
+ >
42
+ > after the base Prometheus stack is installed.
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+
3
+ # https://artifacthub.io/packages/helm/prometheus-community/prometheus-adapter
4
+ showInstalling "The Prometheus Adapter (prom-operator custom HPA metrics)"
5
+ [ -z "$PROMETHEUS_ADAPTER_CHART_VERSION" ] && PROMETHEUS_ADAPTER_CHART_VERSION="4"
6
+ helm upgrade $NS --install prometheus-adapter prometheus-community/prometheus-adapter \
7
+ --values prom-operator/prometheus-adapter.yaml \
8
+ --version $PROMETHEUS_ADAPTER_CHART_VERSION $HELM_WHAT
9
+
10
+ # finally, apply the PrometheusRule to generate the GPU duty cycle metric
11
+ showInstalling "The Prometheus Rule (custom GPU metrics rule)"
12
+ kubectl apply -n prometheus -f prom-operator/stackdriver-exporter-gpu-rules.yaml
@@ -6,7 +6,7 @@ addHelmRepo prometheus-community https://prometheus-community.github.io/helm-cha
6
6
  NS="--namespace prometheus"
7
7
 
8
8
  showInstalling "The Prometheus Operator (kube-prometheus-stack)"
9
- [ -z "$PROMETHEUS_STACK_CHART_VERSION" ] && PROMETHEUS_STACK_CHART_VERSION="74"
9
+ [ -z "$PROMETHEUS_STACK_CHART_VERSION" ] && PROMETHEUS_STACK_CHART_VERSION="75"
10
10
 
11
11
  # https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack
12
12
  helm upgrade $NS --install prometheus-stack prometheus-community/kube-prometheus-stack \
@@ -27,15 +27,4 @@ helm upgrade $NS --install stackdriver-exporter prometheus-community/prometheus-
27
27
  --values prom-operator/stackdriver-exporter.yaml \
28
28
  --version $STACKDRIVER_EXPORTER_CHART_VERSION $HELM_WHAT
29
29
 
30
- # https://artifacthub.io/packages/helm/prometheus-community/prometheus-adapter
31
- showInstalling "The Prometheus Adapter (prom-operator custom HPA metrics)"
32
- [ -z "$PROMETHEUS_ADAPTER_CHART_VERSION" ] && PROMETHEUS_ADAPTER_CHART_VERSION="4"
33
- helm upgrade $NS --install prometheus-adapter prometheus-community/prometheus-adapter \
34
- --values prom-operator/prometheus-adapter.yaml \
35
- --version $PROMETHEUS_ADAPTER_CHART_VERSION $HELM_WHAT
36
-
37
- # finally, apply the PrometheusRule to generate the GPU duty cycle metric
38
- showInstalling "The Prometheus Rule (custom GPU metrics rule)"
39
- kubectl apply -n prometheus -f prom-operator/stackdriver-exporter-gpu-rules.yaml
40
-
41
30
  removeHelmRepo prometheus-community
@@ -174,7 +174,14 @@ spec:
174
174
  # VALUE = {{ $value }}
175
175
  # LABELS = {{ $labels }}
176
176
  - alert: ElasticsearchHighIndexingLatency
177
- expr: elasticsearch_indices_indexing_index_time_seconds_total / elasticsearch_indices_indexing_index_total > 0.010 # awesome was 0.0005
177
+ expr: | # ChatGPT rewrite of awesome rule due to noise
178
+ (
179
+ rate(elasticsearch_indices_indexing_index_time_seconds_total[5m])
180
+ /
181
+ rate(elasticsearch_indices_indexing_index_total[5m])
182
+ ) > 0.02
183
+ and
184
+ rate(elasticsearch_indices_indexing_index_total[5m]) > 0.5
178
185
  for: 10m
179
186
  labels:
180
187
  severity: warning
@@ -218,8 +218,8 @@ spec:
218
218
  VALUE = {{ $value }}
219
219
  LABELS = {{ $labels }}
220
220
  - alert: PrometheusTargetScrapeDuplicate
221
- expr: increase(prometheus_target_scrapes_sample_duplicate_timestamp_total[5m]) > 0
222
- for: 0m
221
+ expr: increase(prometheus_target_scrapes_sample_duplicate_timestamp_total[5m]) > 5
222
+ for: 5m # awesome was => 0m
223
223
  labels:
224
224
  severity: warning
225
225
  annotations:
@@ -4,7 +4,7 @@
4
4
  # - npm run sequelizeRunMigrations
5
5
  #
6
6
  image:
7
- tag: # v1.14.1
7
+ tag: # v1.16.0
8
8
 
9
9
  config:
10
10
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
package/src/helmup.sh CHANGED
@@ -50,7 +50,6 @@ AUXILIARY=(
50
50
 
51
51
  # zombie-killer re-enabled 20240801
52
52
  SYSTEM=(
53
- prom-operator
54
53
  elasticsearch8
55
54
  redis
56
55
  cnpg-operator
@@ -62,6 +61,7 @@ SYSTEM=(
62
61
  velero
63
62
  cnpg-db-psql-stack
64
63
  cnpg-db-tsdb-basic
64
+ prom-operator
65
65
  )
66
66
 
67
67
  SYSTEM_LEGACY=(
@@ -1,3 +0,0 @@
1
- {
2
- "editor.formatOnSave": false
3
- }