@leverege/build-tools 2.113.1 β†’ 2.113.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.113.1",
3
+ "version": "2.113.4",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -97,18 +97,18 @@
97
97
  "glob": "^13.0.6",
98
98
  "googleapis": "^173.0.0",
99
99
  "handlebars": "^4.7.9",
100
- "ignore": "^7.0.5",
100
+ "ignore": "^7.0.6",
101
101
  "inquirer": "^14.0.2",
102
102
  "js-yaml": "^4.2.0",
103
103
  "jsdoc": "^4.0.5",
104
104
  "ms": "^2.1.3",
105
105
  "npm-registry-fetch": "^20.0.1",
106
106
  "ora": "^9.4.1",
107
- "p-limit": "^7.3.0",
107
+ "p-limit": "^7.3.1",
108
108
  "package-up": "^5.0.0",
109
109
  "readline-sync": "^1.4.10",
110
110
  "semver": "^7.8.5",
111
- "shell-quote": "^1.9.0",
111
+ "shell-quote": "^1.10.0",
112
112
  "simple-git": "^3.36.0",
113
113
  "sloc": "^0.3.2",
114
114
  "superstruct": "^2.0.2",
package/src/Utils.mjs CHANGED
@@ -599,9 +599,12 @@ export const parseHelmChart = async ( helmroot = './helm' ) => {
599
599
 
600
600
  depsOutOfSync = mismatches.length > 0
601
601
 
602
- // One final check - if the helm/charts dir is missing then we also need to update dependencies
602
+ // Check if the helm/charts dir is missing or tarballs don't match locked versions
603
603
  if ( hasDependencies && !chartFiles.includes( 'charts' ) ) {
604
604
  depsOutOfSync = true
605
+ } else if ( !depsOutOfSync ) {
606
+ const lockedTarballs = chartLock.dependencies.map( d => `charts/${d.name}-${d.version}.tgz` )
607
+ depsOutOfSync = lockedTarballs.some( t => !chartFiles.includes( t ) )
605
608
  }
606
609
  }
607
610
  /* eslint-enable security/detect-non-literal-fs-filename */
@@ -1,7 +1,7 @@
1
1
  version: 2.1
2
2
 
3
3
  orbs:
4
- leverege: leverege/circle-nodejs-ci@2.2.1
4
+ leverege: leverege/circle-nodejs-ci@2.2.2
5
5
 
6
6
  workflows:
7
7
  build-and-verify:
@@ -18,7 +18,7 @@ import {
18
18
  warning,
19
19
  } from '../Utils.mjs'
20
20
 
21
- const ORB_VERSION = '2.2.1' // Keep this in sync with the versions in circle-npm.yml and circle-yarn.yml
21
+ const ORB_VERSION = '2.2.2' // Keep this in sync with the versions in circle-npm.yml and circle-yarn.yml
22
22
  const CIRCLE_DIR = '.circleci'
23
23
  const CIRCLE_YML = `${CIRCLE_DIR}/config.yml`
24
24
  const CIRCLE_NPM_TEMPLATE = path.join( BUILD_TOOLS_ROOT, 'circle-orb-it', 'circle-npm.yml' )
@@ -1,7 +1,7 @@
1
1
  version: 2.1
2
2
 
3
3
  orbs:
4
- leverege: leverege/circle-nodejs-ci@2.2.1
4
+ leverege: leverege/circle-nodejs-ci@2.2.2
5
5
 
6
6
  workflows:
7
7
  build-and-verify:
@@ -5,6 +5,8 @@
5
5
  OPVER="1.26.1" # 10/08/2025
6
6
  BARMAN_VER="0.11.0"
7
7
 
8
+ createNamespaceIfNeeded cnpg-system
9
+
8
10
  # --- CNPG operator ---
9
11
  kubectl apply --server-side -f \
10
12
  "https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-${OPVER%.*}/releases/cnpg-${OPVER}.yaml" \
@@ -69,63 +69,67 @@ x-esSchduling: &esScheduling
69
69
  value: "true"
70
70
  effect: "NoSchedule"
71
71
 
72
- # coord nodes needed a heapSize and memory boost
72
+ # Always set explicit heapSize for all node types. Bitnami defaults to 128m
73
+ # which is too small for any real workload and will cause circuit breaker trips
74
+ # under load. Scale these up per-cluster based on node pool size and workload.
75
+ # Rule of thumb: memory limit >= 2x heapSize to cover off-heap overhead (metaspace,
76
+ # code cache, thread stacks). Setting limit == heapSize will pin the container at 100%.
77
+ #
73
78
  coordinating:
74
79
  <<: *esScheduling
75
80
  replicaCount: 3
76
- heapSize: 384m
81
+ heapSize: 512m
77
82
  resources:
78
83
  limits:
79
84
  cpu: 750m
80
- memory: 2Gi
85
+ memory: 1Gi
81
86
  ephemeral-storage: 2Gi
82
87
  requests:
83
- cpu: 500m
84
- memory: 512Mi
88
+ cpu: 250m
89
+ memory: 768Mi
85
90
  ephemeral-storage: 50Mi
86
91
 
87
92
  data:
88
93
  <<: *esScheduling
89
94
  replicaCount: 3
95
+ heapSize: 1024m
90
96
  resources:
91
97
  limits:
92
98
  cpu: 750m
93
99
  ephemeral-storage: 2Gi
94
- memory: 8Gi # def was 1536Mi
100
+ memory: 2Gi
95
101
  requests:
96
102
  cpu: 500m
97
103
  ephemeral-storage: 50Mi
98
- memory: 4Gi
104
+ memory: 1536Mi
99
105
  persistence:
100
106
  enabled: true
101
- size: 64Gi
107
+ size: 20Gi # scale up based on expected data volume
102
108
 
103
109
  ingest:
104
110
  <<: *esScheduling
105
111
  replicaCount: 3
106
- #resourcesPreset: "medium"
112
+ heapSize: 256m
107
113
  resources:
108
114
  limits:
109
115
  cpu: 750m
110
- ephemeral-storage: 4Gi
111
- memory: 1536Mi
116
+ ephemeral-storage: 2Gi
117
+ memory: 512Mi
112
118
  requests:
113
- cpu: 500m
114
- ephemeral-storage: 100Mi
115
- memory: 1024Mi
116
- # no default resources specified
119
+ cpu: 250m
120
+ ephemeral-storage: 50Mi
121
+ memory: 384Mi
117
122
 
118
123
  master:
119
124
  <<: *esScheduling
120
125
  replicaCount: 3
121
- # resources: # example from the bitnami chart
122
- # ## Example:
123
- # ## limits:
124
- # ## cpu: 500m
125
- # ## memory: 1Gi
126
- # limits: {}
127
- # ## Examples:
128
- # ## requests:
129
- # ## cpu: 250m
130
- # ## memory: 256Mi
131
- # requests: {}
126
+ heapSize: 256m
127
+ resources:
128
+ limits:
129
+ cpu: 500m
130
+ ephemeral-storage: 2Gi
131
+ memory: 768Mi
132
+ requests:
133
+ cpu: 250m
134
+ ephemeral-storage: 50Mi
135
+ memory: 512Mi
@@ -0,0 +1,46 @@
1
+ # πŸ“Œ Optional HPA 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 PubSub subscription backlog β€” **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 clusters:**
16
+ When clusters require optional HPA metrics (e.g., GPU nodes, PubSub-based scaling), we deploy those configs with a separate, explicit step:
17
+ - post helmup run _./prom-operator/hpa-metrics.sh_ to apply the prometheus-adapter.yaml and any cluster-specific PrometheusRules
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 truly provides them.**
26
+ - Keep custom metric configs organized in a clear, dedicated folder alongside `hpa-metrics.sh`.
27
+ - When adding new clusters, verify whether specialized metrics are needed and apply them if so.
28
+ - When a metric type becomes universal, promote it to the baseline and gate it behind a feature flag.
29
+
30
+ ## βš™οΈ Metric types
31
+
32
+ **Custom metrics** (`custom.metrics.k8s.io`) β€” metrics tied to a Kubernetes object (pod, namespace).
33
+ Used with `type: Pods` or `type: Object` in HPA specs. Example: `gpu_duty_cycle_percent`.
34
+
35
+ **External metrics** (`external.metrics.k8s.io`) β€” metrics from outside Kubernetes (GCP, cloud services).
36
+ Used with `type: External` in HPA specs. Example: PubSub subscription backlog.
37
+
38
+ ## βš™οΈ Example
39
+ > Optional HPA metrics are installed by running:
40
+ >
41
+ > ```bash
42
+ > ./prom-operator/hpa-metrics.sh
43
+ > ```
44
+ >
45
+ > after the base Prometheus stack is installed. Cluster-specific rules (e.g., PubSub
46
+ > subscription IDs) are added to `prometheus-adapter.yaml` in the cluster’s branch.
@@ -1,9 +1,17 @@
1
1
  #!/bin/bash
2
2
 
3
+ set -euo pipefail
4
+
5
+ # When sourced by helmup these are already set; provide standalone defaults.
6
+ NS="${NS:---namespace prometheus}"
7
+ HELM_WHAT="${HELM_WHAT:-}"
8
+ command -v showInstalling >/dev/null 2>&1 || showInstalling() { echo "==> Installing: $*"; }
9
+
3
10
  # https://artifacthub.io/packages/helm/prometheus-community/prometheus-adapter
4
11
  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 \
12
+ [ -z "${PROMETHEUS_ADAPTER_CHART_VERSION:-}" ] && PROMETHEUS_ADAPTER_CHART_VERSION="5.3.0"
13
+ OCI_CHART="oci://ghcr.io/prometheus-community/charts/prometheus-adapter"
14
+ helm upgrade $NS --install prometheus-adapter $OCI_CHART \
7
15
  --values prom-operator/prometheus-adapter.yaml \
8
16
  --version $PROMETHEUS_ADAPTER_CHART_VERSION $HELM_WHAT
9
17
 
@@ -4,7 +4,19 @@ prometheus:
4
4
  url: "http://prometheus-operated.prometheus.svc"
5
5
  port: 9090
6
6
 
7
+ # Stackdriver-exporter samples carry Cloud Monitoring's delayed timestamps
8
+ # (80-200s behind wall clock). With the chart default of 1m the series
9
+ # fall outside the discovery window intermittently, leaving the external
10
+ # metrics registry empty. 10m covers the lag with margin.
11
+ metricsRelistInterval: 10m
12
+
7
13
  rules:
14
+ # The chart's upstream default rule set matches ~100k+ series on a
15
+ # Prometheus loaded with stackdriver metrics. The 1m relist crawling
16
+ # that index wedges the adapter registry (empty listings, handler
17
+ # timeouts, high idle CPU). Nothing here consumes those custom metrics β€”
18
+ # resource HPAs use metrics-server. Only the explicit rules below are served.
19
+ default: false
8
20
  custom:
9
21
  - seriesQuery: 'gpu_duty_cycle_percent{namespace!="",pod!=""}'
10
22
  resources:
@@ -117,7 +117,7 @@ spec:
117
117
  # severity: critical
118
118
  # annotations:
119
119
  # summary: Postgresql commit rate low (instance {{ $labels.instance }})
120
- # description: "Postgresql seems to be processing very few transactions\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" - alert: PostgresqlCommitRateLow
120
+ # description: "Postgresql seems to be processing very few transactions\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
121
121
  # expr: rate(cnpg_pg_stat_database_xact_commit[1m]) < 10
122
122
  # for: 2m
123
123
  # labels:
@@ -6,7 +6,7 @@ showInstalling "Velero Backup System"
6
6
  # the version of the locally installed velero client application.
7
7
  #
8
8
  VELERO_CHART_VERSION="12.0.3"
9
- EXPECTED_CLIENT_VERSION="v1.18.1"
9
+ EXPECTED_CLIENT_VERSION="v1.18.2"
10
10
 
11
11
  addHelmRepo vmware-tanzu https://vmware-tanzu.github.io/helm-charts
12
12
 
package/src/helmup.sh CHANGED
@@ -52,6 +52,9 @@ for arg in "$@"; do
52
52
  --mutate)
53
53
  MUTATE_DEPLOYMENT=1
54
54
  ;;
55
+ --conflicts)
56
+ export FORCE_CONFLICTS=1
57
+ ;;
55
58
  --help|-h)
56
59
  giveHelp && exit 0
57
60
  ;;
@@ -235,7 +235,9 @@ export default class Config {
235
235
  fs.writeFileSync( `${harDir}/config.json`, JSON.stringify( CONFIG_CONTENT, null, 2 ), 'utf8' )
236
236
 
237
237
  const makeHarHookScript = async ( harScript ) => {
238
- const SCRIPT_CONTENT = 'hook-and-release'
238
+ const SCRIPT_CONTENT = `#!/bin/sh
239
+ PATH="$(git rev-parse --show-toplevel)/node_modules/.bin:$PATH"
240
+ hook-and-release`
239
241
 
240
242
  fs.writeFileSync( harScript, SCRIPT_CONTENT, 'utf8' )
241
243
  fs.chmodSync( harScript, 0o750 )
@@ -6,5 +6,5 @@ apiVersion: v2
6
6
  icon: https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.svg
7
7
  dependencies:
8
8
  - name: leverege
9
- version: "^1.3.0"
9
+ version: "^1.3.1"
10
10
  repository: "oci://us-docker.pkg.dev/leverege-registry/base-charts"
@@ -39,7 +39,6 @@ partOf: {{hbsPartOf}} # leverege-stack or project-x - OPTIONAL
39
39
  # name, http + metrics) and a companion <fullname>-loadbalancer service is rendered
40
40
  # to handle external traffic (http only, no metrics exposure).
41
41
  service:
42
- project_id: set-in-values-yaml
43
42
  preemptible: {{hbsServicePreemptible}} # true or false - OPTIONAL
44
43
  type: ClusterIP
45
44
 
@@ -6,6 +6,7 @@ import { Command } from 'commander'
6
6
  import {
7
7
  debug,
8
8
  errorExit,
9
+ establishOauthAccess,
9
10
  log,
10
11
  parseHelmChart,
11
12
  proceed,
@@ -47,6 +48,7 @@ if ( !chartAppVersion.startsWith( 'v' ) ) {
47
48
  if ( depsOutOfSync || opts.refreshDeps ) {
48
49
  try {
49
50
  log( chalk.yellow.bold( '\nChart dependedencies are out of sync - updating...\n' ) )
51
+ await establishOauthAccess()
50
52
  await shellCmd( 'helm dependency update ./helm', { stdio : 'inherit' } )
51
53
  } catch ( error ) {
52
54
  errorExit( error )
@@ -75,6 +75,19 @@ ${chalk.bold( 'Secret Manager Secrets (required)' )}
75
75
  ${chalk.bold( 'Environment Variables (optional)' )}
76
76
 
77
77
  ${chalk.bold( 'REFRESH_NPM_PROJECT' )} ${chalk.green( 'may be used in lieu of --project' )}
78
+
79
+ ${chalk.bold( 'Manually Bootstraping the Token' )}
80
+ ${chalk.green( `
81
+ There may be times when a token is expired, lost or a new developer needs
82
+ to seed their ~/.npmrc file for the first time. Help a brother out and let
83
+ them know to run this command to fetch the current npmrc file:
84
+
85
+ gcloud secrets versions access latest \\
86
+ --secret=REFRESH_NPM_NPMRC \\
87
+ --project=leverege-registry > ~/.npmrc
88
+
89
+ Note, ^^that command will need a different --project name for non-leverege
90
+ developers.` )}
78
91
  ` )
79
92
  .parse()
80
93
 
@@ -2,6 +2,7 @@
2
2
  "description": "Leverege read / write access to Storage Objects",
3
3
  "includedPermissions": [
4
4
  "storage.buckets.create",
5
+ "storage.buckets.delete",
5
6
  "storage.buckets.get",
6
7
  "storage.buckets.getIamPolicy",
7
8
  "storage.buckets.list",
@@ -1,42 +0,0 @@
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.