@leverege/build-tools 2.53.5 → 2.53.6

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.
Files changed (27) hide show
  1. package/package.json +5 -6
  2. package/registry-compass.yaml +20 -0
  3. package/src/Docker.mjs +0 -1
  4. package/src/chart-compass.mjs +96 -0
  5. package/src/docker-to-registry.mjs +3 -2
  6. package/src/helm-charts/api-server/values-local.yaml +1 -1
  7. package/src/helm-charts/authz-server/values-local.yaml +1 -1
  8. package/src/helm-charts/cnpg-db-recovery/.nohelm +0 -0
  9. package/src/helm-charts/cnpg-db-recovery/.nohelmdn +0 -0
  10. package/src/helm-charts/cnpg-db-recovery/cluster.yaml.ovh +106 -0
  11. package/src/helm-charts/cnpg-db-recovery/gitignore +2 -0
  12. package/src/helm-charts/cnpg-db-recovery/helmdn.plugin +12 -0
  13. package/src/helm-charts/cnpg-db-recovery/helmup.plugin +6 -0
  14. package/src/helm-charts/cnpg-db-recovery/pooler.yaml +20 -0
  15. package/src/helm-charts/db-curator/values-local.yaml +1 -1
  16. package/src/helm-charts/elasticsearch8/helmup.plugin +1 -1
  17. package/src/helm-charts/imagine/values-local.yaml +1 -1
  18. package/src/helm-charts/pubsub-pulse/values-local.yaml +1 -2
  19. package/src/helm-charts/reason/values-local.yaml +1 -1
  20. package/src/helm-charts/redis/helmup.plugin +1 -1
  21. package/src/helm-charts/resource-server/values-local.yaml +1 -1
  22. package/src/helm-charts/rule-engine/values-local.yaml +1 -1
  23. package/src/helm-charts/scheduler/values-local.yaml +1 -1
  24. package/src/helm-charts/transponder-bq/values-local.yaml +1 -1
  25. package/src/helm-charts/transponder-dh/values-local.yaml +1 -1
  26. package/src/helm-charts/transponder-rt/values-local.yaml +1 -1
  27. package/src/helm-charts/transponder-tsdb/values-local.yaml +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.53.5",
3
+ "version": "2.53.6",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -56,7 +56,6 @@
56
56
  "license": "SEE LICENSE IN LICENSE.md",
57
57
  "dependencies": {
58
58
  "@google-cloud/artifact-registry": "^3.4.0",
59
- "@leverege/build-tools": "^2.53.2-beta.1",
60
59
  "ansi-colors": "^4.1.3",
61
60
  "chalk": "^5.3.0",
62
61
  "command-line-args": "^6.0.0",
@@ -66,20 +65,20 @@
66
65
  "execa": "^9.4.0",
67
66
  "glob": "^11.0.0",
68
67
  "handlebars": "^4.7.8",
69
- "inquirer": "^11.1.0",
68
+ "inquirer": "^12.0.0",
70
69
  "js-yaml": "^4.1.0",
71
70
  "ms": "^2.1.3",
72
- "npm-registry-fetch": "^18.0.0",
71
+ "npm-registry-fetch": "^18.0.1",
73
72
  "package-up": "^5.0.0",
74
73
  "parse-gitignore": "^2.0.0",
75
74
  "read-pkg": "^9.0.1",
76
75
  "readline-sync": "^1.4.10",
77
76
  "semver": "^7.6.3",
78
77
  "simple-git": "^3.27.0",
79
- "zx": "^8.1.8"
78
+ "zx": "^8.1.9"
80
79
  },
81
80
  "devDependencies": {
82
81
  "@leverege/eslint-config-leverege": "^4.2.0",
83
- "npm": "^10.8.3"
82
+ "npm": "^10.9.0"
84
83
  }
85
84
  }
@@ -0,0 +1,20 @@
1
+ registry:
2
+ - root: us-docker.pkg.dev
3
+ - repositories:
4
+ - name: stack
5
+ charts:
6
+ - api-server
7
+ - authz-server
8
+ - emailer
9
+ - message-processor
10
+ - name: leverege
11
+ charts:
12
+ - pubsub-pulse
13
+ - pusher
14
+ - overdose
15
+ - name: cox-health
16
+ charts:
17
+ - actions-server
18
+ - analytics-server
19
+ - centrak-healthz
20
+ - centrak-ingestor
package/src/Docker.mjs CHANGED
@@ -304,7 +304,6 @@ const buildContainerImage = async ( {
304
304
  ${gcloudLogs} \\
305
305
  ${gcloudTags}
306
306
  ` ) )
307
-
308
307
 
309
308
  if ( process.env.DRY_RUN === '1' ) {
310
309
  log( '\n***Exiting from DRY_RUN\n' )
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * chart-to-registry will...
4
+ */
5
+ import fs from 'node:fs'
6
+
7
+ import chalk from 'chalk'
8
+ import commandLineArgs from 'command-line-args'
9
+ import commandLineUsage from 'command-line-usage'
10
+ import { lt as semverLt } from 'semver'
11
+ import YAML from 'js-yaml'
12
+
13
+ import {
14
+ condir,
15
+ debug,
16
+ errorExit,
17
+ log,
18
+ warning,
19
+ getGitRootDirectory,
20
+ parsePackageJson,
21
+ parseHelmChart,
22
+ shellCmd } from './Utils.mjs'
23
+
24
+ const commandLineOptions = [ // Use commandLineOptions to tie into the Usage statements
25
+ /* eslint-disable max-len */
26
+ {
27
+ name : 'location',
28
+ type : String,
29
+ description : '{green the location of the artifact registry the chart will be pushed to (default us-docker.pkg.dev)}',
30
+ },
31
+ {
32
+ name : 'project',
33
+ type : String,
34
+ description : '{green the name of the google project containing the npmrc and slack config secrets (default leverege-registry)}',
35
+ },
36
+ {
37
+ name : 'repository',
38
+ type : String,
39
+ description : '{green the target repository to receive the pushed chart}',
40
+ },
41
+ {
42
+ name : 'dry-run',
43
+ type : Boolean,
44
+ description : '{yellow perform everything except the actual chart push}',
45
+ },
46
+ {
47
+ name : 'help',
48
+ type : Boolean,
49
+ description : '{green display this help screen}',
50
+ },
51
+ /* eslint-enable max-len */
52
+ ]
53
+
54
+ const sections = [
55
+ {
56
+ header : 'Leverege Helm Chart Compass (for helmup)',
57
+ content : `{green This tool helps helmup navigate the helm charts stored in the
58
+ artifact-registries.}`
59
+ },
60
+ { header : 'Options',
61
+ optionList : commandLineOptions,
62
+ },
63
+ ]
64
+
65
+ const args = commandLineArgs( commandLineOptions, { camelCase : true, partial : true } )
66
+ const usage = commandLineUsage( sections )
67
+
68
+ if ( args.help ) {
69
+ log( usage )
70
+ process.exit( 0 )
71
+ }
72
+
73
+ /* eslint-disable no-underscore-dangle */
74
+ if ( args._unknown ) {
75
+ log( usage )
76
+ log( `\nUnrecognized argument [${chalk.bold.red( args._unknown )}]\n` )
77
+ process.exit( 1 )
78
+ }
79
+ /* eslint-enable no-underscore-dangle */
80
+
81
+ const minNodejsVersion = '18.0.0'
82
+ if ( semverLt( process.version, minNodejsVersion ) ) {
83
+ errorExit( `\n***ERROR: must be running at least node ${minNodejsVersion}\n` )
84
+ }
85
+
86
+ // First of all, fail if we are not in a git repository
87
+ let gitRoot
88
+ try {
89
+ gitRoot = await getGitRootDirectory()
90
+ } catch ( error ) {
91
+ errorExit( chalk.red.bold( error ), { errorCode : 5 } )
92
+ }
93
+
94
+ const chartCompass = YAML.load( fs.readFileSync( './registry-compass.yaml', 'utf8' ) )
95
+
96
+ condir( { chartCompass }, '<==Navigation' )
@@ -33,7 +33,7 @@ for ( let n = 2; n < process.argv.length; n++ ) {
33
33
  if ( process.argv[n].startsWith( '-' ) ) {
34
34
  const str = process.argv[n].slice( 1 )
35
35
  if ( str.indexOf( '=' ) > 0 ) {
36
- const [key, value] = str.split( '=' )
36
+ const [ key, value ] = str.split( '=' )
37
37
  options[key] = value
38
38
  } else {
39
39
  options[str] = true
@@ -165,8 +165,9 @@ if ( giveGuidance ) {
165
165
  }
166
166
 
167
167
  // do chart checks too
168
+ let chart
168
169
  if ( options?.helmChecks !== 'false' ) {
169
- const chart = helmChart?.yaml['Chart.yaml']
170
+ chart = helmChart?.yaml['Chart.yaml']
170
171
  const values = helmChart?.yaml['values.yaml']
171
172
  const expectedChartRegistry = `${artifactRegistry}/images`
172
173
 
@@ -5,7 +5,7 @@
5
5
  # - node tools/UpdateESMappingV2.js
6
6
  #
7
7
  image:
8
- tag: # v5.12.3
8
+ tag: # v5.16.0
9
9
 
10
10
  config:
11
11
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -4,7 +4,7 @@
4
4
  # - npm run sequelizeRunMigrations
5
5
  #
6
6
  image:
7
- tag: # v2.1.3
7
+ tag: # v2.2.0
8
8
 
9
9
  config:
10
10
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
File without changes
File without changes
@@ -0,0 +1,106 @@
1
+ # Artifact Chart => https://artifacthub.io/packages/helm/cloudnative-pg/cloudnative-pg
2
+ # Examples Charts => https://cloudnative-pg.io/documentation/current/samples/
3
+ apiVersion: postgresql.cnpg.io/v1
4
+ kind: Cluster
5
+ metadata:
6
+ name: cnpg-db-recovery
7
+ namespace: cnpg-operands
8
+ spec:
9
+ instances: 1
10
+ logLevel: info # warning debug
11
+
12
+ monitoring:
13
+ enablePodMonitor: false # set true once monitoring is setup
14
+
15
+ description: "Leverege CNPG DB (recovered)"
16
+ imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.4-cnpg-tsdb2-rel.1
17
+ bootstrap:
18
+ recovery:
19
+ volumeSnapshots:
20
+ storage:
21
+ name: <snapshot_name>
22
+ kind: VolumeSnapshot
23
+ apiGroup: snapshot.storage.k8s.io
24
+
25
+ enableSuperuserAccess: true
26
+ superuserSecret:
27
+ name: <postgres_password> # postgres db pw
28
+
29
+ affinity:
30
+ enablePodAntiAffinity: true
31
+ topologyKey: kubernetes.io/hostname # default value
32
+ nodeAffinity:
33
+ requiredDuringSchedulingIgnoredDuringExecution:
34
+ nodeSelectorTerms:
35
+ - matchExpressions:
36
+ - key: target-env
37
+ operator: In
38
+ values:
39
+ - database
40
+ tolerations:
41
+ - key: "database"
42
+ operator: "Equal"
43
+ value: "true"
44
+ effect: "NoSchedule"
45
+
46
+ # Parameters and pg_hba configuration will be append
47
+ # to the default ones to make the cluster work
48
+ postgresql:
49
+ parameters:
50
+ # max_connections: "100"
51
+ # max_worker_processes: "60"
52
+ # max_worker_processes: "8"
53
+ # max_parallel_workers: "8"
54
+ # shared_buffers: 2GB
55
+ # effective_cache_size: 6GB
56
+ # maintenance_work_mem: 1GB
57
+ # work_mem: 20MB
58
+
59
+ # - unsupervised: automated update of the primary once all
60
+ # replicas have been upgraded (default)
61
+ # - supervised: requires manual supervision to perform
62
+ # the switchover of the primary
63
+ primaryUpdateStrategy: unsupervised
64
+
65
+ serviceAccountTemplate:
66
+ metadata:
67
+ annotations:
68
+ iam.gke.io/gcp-service-account: cnpg-operands-sa@OVH:<PROJECT_ID>.iam.gserviceaccount.com
69
+
70
+ # Require 50Gi of space per instance using ssd storage class
71
+ storage:
72
+ storageClass: premium-rwo
73
+ size: 50Gi
74
+ # walStorage:
75
+ # storageClass: premium-rwo
76
+ # size: 1Gi
77
+
78
+ backup:
79
+ retentionPolicy: 7d # don't think this does anything?
80
+ volumeSnapshot:
81
+ labels:
82
+ snapshotOf: cnpg-db-recovery
83
+ className: cnpg-snapshotclass
84
+ barmanObjectStore:
85
+ destinationPath: gs://OVH:<PROJECT_ID>-barman
86
+ googleCredentials:
87
+ gkeEnvironment: true
88
+ tags:
89
+ cnpgCluster: cnpg-db-recovery
90
+ wal:
91
+ compression: gzip
92
+ maxParallel: 8
93
+ ---
94
+ apiVersion: postgresql.cnpg.io/v1
95
+ kind: ScheduledBackup
96
+ metadata:
97
+ name: cnpg-db-recovery-backup
98
+ namespace: cnpg-operands
99
+ spec:
100
+ # https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
101
+ schedule: "0 0 */12 * * *"
102
+ cluster:
103
+ name: cnpg-db-recovery
104
+ method: volumeSnapshot # barmanObjectStore
105
+ backupOwnerReference: self
106
+ immediate: true
@@ -0,0 +1,2 @@
1
+ *.swp
2
+ cluster.yaml
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ #
3
+ # We only want to hibernate unless the intent is to really delete EVERYTHING
4
+ # which includes PVCs and volume snapshots.
5
+ #
6
+ printf "\nHibernating the cnpg-db-recovery cluster...\n"
7
+ kubectl cnpg hibernate on -n cnpg-operands cnpg-db-recovery
8
+
9
+ # *** DANGER ***
10
+ # kubectl delete will destroy the cluster
11
+ # *** DANGER ***
12
+ # kubectl delete -f cnpg-db-recovery/cluster.yaml $K8S_WHAT
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ # ensures the PG_PASSWORD secret exists and correct
4
+ # ensureCnpgSecret PG_PASSWORD $SERVICE-postgres-pw
5
+
6
+ kubectl apply -f cnpg-db-recovery/cluster.yaml $K8S_WHAT
@@ -0,0 +1,20 @@
1
+ apiVersion: postgresql.cnpg.io/v1
2
+ kind: Pooler
3
+ metadata:
4
+ name: cnpg-db-recovery-pool-rw
5
+ namespace: cnpg-operands
6
+ spec:
7
+ cluster:
8
+ name: cnpg-db-recovery
9
+
10
+ instances: 1
11
+ type: rw
12
+ pgbouncer:
13
+ poolMode: session
14
+ parameters:
15
+ # https://www.pgbouncer.org/config.html#generic-settings
16
+ max_client_conn: "500"
17
+ default_pool_size: "10"
18
+ # https://www.pgbouncer.org/config.html#log-settings
19
+ log_connections: "0"
20
+ log_disconnections: "0"
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v4.2.4
2
+ tag: # v4.3.0
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -2,7 +2,7 @@
2
2
  #
3
3
  showInstalling "Elastic Search 8"
4
4
 
5
- [ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.3.17"
5
+ [ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.3.20"
6
6
 
7
7
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/elasticsearch"
8
8
 
@@ -1,5 +1,5 @@
1
1
  mage:
2
- tag: # v2.2.0
2
+ tag: # v2.4.1
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -1,6 +1,5 @@
1
1
  image:
2
- tag: # v1.3.5
3
- # registry: gcr.io/leverege-docker-images # deprecated
2
+ tag: # v1.6.3
4
3
  # registry: us-docker.pkg.dev/leverege-registry/leverege/images
5
4
 
6
5
  config:
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v2.2.1
2
+ tag: # v2.3.0
3
3
 
4
4
  config:
5
5
  CF_TRANSPORT_CONFIG: '{
@@ -4,7 +4,7 @@ showInstalling "Redis"
4
4
 
5
5
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/redis"
6
6
 
7
- [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="20.1.3"
7
+ [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="20.1.7"
8
8
 
9
9
  helm upgrade --install redis $OCI_CHART \
10
10
  --values redis/redis-local.yaml \
@@ -4,7 +4,7 @@
4
4
  # - npm run sequelizeRunMigrations
5
5
  #
6
6
  image:
7
- tag: # v1.2.2
7
+ tag: # v1.5.1
8
8
 
9
9
  config:
10
10
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v2.3.1
2
+ tag: # v2.6.0
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v3.1.1
2
+ tag: # v3.1.2
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -1,7 +1,7 @@
1
1
  nameOverride: transponder-bq
2
2
 
3
3
  image:
4
- tag: # v5.2.2
4
+ tag: # v5.2.4
5
5
 
6
6
  config:
7
7
  TRANSPONDER_RUN_MODE: "bigQueryJson"
@@ -1,7 +1,7 @@
1
1
  nameOverride: transponder-dh
2
2
 
3
3
  image:
4
- tag: # v5.2.2
4
+ tag: # v5.2.4
5
5
 
6
6
  config:
7
7
  TRANSPONDER_RUN_MODE: "denseHistoryCombined"
@@ -1,7 +1,7 @@
1
1
  nameOverride: transponder-rt
2
2
 
3
3
  image:
4
- tag: # v5.2.2
4
+ tag: # v5.2.4
5
5
 
6
6
  config:
7
7
  TRANSPONDER_RUN_MODE: "rt"
@@ -7,7 +7,7 @@
7
7
  nameOverride: transponder-tsdb
8
8
 
9
9
  image:
10
- tag: # v5.2.2
10
+ tag: # v5.2.4
11
11
 
12
12
  config:
13
13
  TRANSPONDER_RUN_MODE: "timescale"