@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.
- package/.vscode/build-tools.code-workspace +8 -0
- package/package.json +2 -2
- package/src/docker-to-registry.mjs +6 -3
- package/src/helm-audit.mjs +6 -0
- package/src/helm-charts/geotile-server/values-local.yaml +5 -0
- package/src/helm-charts/prom-operator/README-GPU.md +42 -0
- package/src/helm-charts/prom-operator/gpu-hpa-metrics.sh +12 -0
- package/src/helm-charts/prom-operator/helmup.plugin +1 -12
- package/src/helm-charts/prom-operator/rules/elasticsearch-rules.yaml +8 -1
- package/src/helm-charts/prom-operator/rules/prometheus-rules.yaml +2 -2
- package/src/helm-charts/resource-server/values-local.yaml +1 -1
- package/src/helmup.sh +1 -1
- package/.vscode/settings.json +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
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.
|
|
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
|
|
17
|
+
shellCmd,
|
|
18
|
+
warning,
|
|
19
|
+
} from './Utils.mjs'
|
|
18
20
|
|
|
19
21
|
import docker from './Docker.mjs'
|
|
20
22
|
|
|
21
|
-
const minimumBuildToolsVersion = '2.
|
|
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
|
-
|
|
96
|
+
warning( `package.json @leverege/build-tools preferred minimum version is ^${minimumBuildToolsVersion}\n` )
|
|
97
|
+
await proceed()
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
const {
|
package/src/helm-audit.mjs
CHANGED
|
@@ -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="
|
|
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:
|
|
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]) >
|
|
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:
|
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=(
|
package/.vscode/settings.json
DELETED