@leverege/build-tools 2.101.1 → 2.102.0

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 (42) hide show
  1. package/package.json +8 -8
  2. package/src/Utils.mjs +5 -0
  3. package/src/bash-funcs +27 -0
  4. package/src/dashboard/DashboardManager.mjs +192 -17
  5. package/src/dashboard/dashboard.mjs +29 -4
  6. package/src/dashboard/json/{standard/noc-rows-12.json → devops/devops-noc.json} +801 -61
  7. package/src/dashboard/json/{standard/pvc-all-usage.json → devops/pvc-usage.json} +2 -2
  8. package/src/dashboard/json/leverege/leverege-noc.json +2364 -0
  9. package/src/dashboard/json/{standard/redis.json → leverege/leverege-rule-engine.json} +695 -646
  10. package/src/dashboard/json/leverege/leverege-services.json +4757 -0
  11. package/src/dashboard/json/recovr/recovr-locators.json +1227 -0
  12. package/src/dashboard/json/recovr/recovr-noc.json +1949 -0
  13. package/src/dashboard/json/recovr/recovr-position-srvr.json +339 -0
  14. package/src/dashboard/json/recovr/recovr-server.json +1127 -0
  15. package/src/dashboard/json/siren/siren-services.json +2066 -0
  16. package/src/dashboard/json/{standard/cloudnative-pg-20417-rev4.json → system/cloudnative-pg.json} +241 -243
  17. package/src/dashboard/json/{standard → system}/elasticsearch8.json +123 -72
  18. package/src/dashboard/json/system/stackdriver.json +1189 -0
  19. package/src/dashboard/json/{standard/traefik-op.json → system/traefik.json} +44 -56
  20. package/src/dashboard/json/{standard → system}/valkey.json +91 -86
  21. package/src/dashboard/json/{standard → tpi}/gpu-autoscaling-dashboard-ui-import.json +1 -1
  22. package/src/dashboard/json/tpi/leverege-noc.json +3624 -0
  23. package/src/helm-charts/cnpg-operator/helmup.bootstrap +19 -21
  24. package/src/helm-charts/eso/helmup.bootstrap +4 -2
  25. package/src/helm-charts/prom-operator/README-CRD-UPGRADES.md +105 -0
  26. package/src/helm-charts/prom-operator/helmup.bootstrap +22 -14
  27. package/src/helm-charts/prom-operator/helmup.plugin +1 -1
  28. package/src/helm-charts/prom-operator/prometheus-stack.yaml.ovh +23 -45
  29. package/src/helm-charts/prom-operator/rules/gke-maintenance-rules.yaml +19 -0
  30. package/src/helm-charts/prom-operator/stackdriver-exporter.yaml.ovh +3 -2
  31. package/src/helm-charts/valkey/valkey-local.yaml +1 -0
  32. package/src/helm-charts/velero/helmup.bootstrap +2 -0
  33. package/src/helmup.sh +31 -4
  34. package/src/init-my-chart/Chartwright.mjs +2 -2
  35. package/src/init-my-chart/leaf-chart-templates/templates/extraobjects.yaml +1 -0
  36. package/src/init-my-chart/leaf-chart-templates/templates/ingressroute.yaml +1 -0
  37. package/src/overwhelm.mjs +5 -5
  38. package/src/service-man/config/secrets/npmrc.json +14 -0
  39. package/src/service-man/config/secrets/tsdb-dense-password.json +13 -0
  40. package/src/dashboard/json/standard/stackdriver.json +0 -624
  41. package/src/docker-to-registry-py.mjs +0 -287
  42. /package/src/dashboard/json/{standard → devops}/k8s-api-latency.json +0 -0
@@ -1,287 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * DEPRECATED - DO NOT MODIFY
4
- */
5
- import fs from 'node:fs'
6
-
7
- import toml from 'toml'
8
- import chalk from 'chalk'
9
-
10
- import {
11
- debug, log, warning,
12
- errorExit,
13
- getGitBranchAndUpstream,
14
- gitRepoIsDirty,
15
- parseHelmChart,
16
- proceed,
17
- shellCmd } from './Utils.mjs'
18
- import Docker from './DockerPy.mjs'
19
-
20
- // refresh-npm-token does not throw so no need to try, but it emits in debug
21
- // const refreshErr = await shellCmd( 'refresh-npm-token' )
22
- // if ( refreshErr && !process.env.BUILD_TOOLS_DEBUG ) {
23
- // log( refreshErr ) // most likely the token refreshed message
24
- // }
25
-
26
- warning( 'docker-to-registry-py has been DEPRECATED - use docker-to-registry' )
27
-
28
- const options = {}
29
- let imageVersion = null
30
- // Expected to be invoked like docker-to-registry-py v1.2.3
31
- for ( let n = 2; n < process.argv.length; n++ ) {
32
- if ( process.argv[n].startsWith( '-' ) ) {
33
- const str = process.argv[n].slice( 1 )
34
- if ( str.indexOf( '=' ) > 0 ) {
35
- const [ key, value ] = str.split( '=' )
36
- options[key] = value
37
- } else {
38
- options[str] = true
39
- }
40
- } else {
41
- imageVersion = process.argv[n]
42
- }
43
- }
44
- if ( !imageVersion ) {
45
- errorExit( '***Error: docker-to-registry-py requires an image version' )
46
- }
47
-
48
- // may use guide-me or guideme to ask for update guidance
49
- const giveGuidance = imageVersion.match( /^guide-*me$/ ) !== null
50
-
51
- const willGitTag = imageVersion.match( /^v\d+\.\d+\.\d+$/ )
52
- const tagInfo = willGitTag ?
53
- chalk.yellow.bold( 'will be git tagged' ) :
54
- chalk.red( 'BETA RELEASE WILL NOT BE GIT TAGGED' )
55
-
56
- const repoIsDirty = await gitRepoIsDirty()
57
-
58
- if ( willGitTag && repoIsDirty ) {
59
- log( `
60
- ${chalk.red.bold( '***ERROR: attempting to tag a non-beta dirty git repository' )}
61
-
62
- You are attempting to create a tagged release image for pushing to the
63
- artifact registry, but there are locally modified files. This is not
64
- allowed since the applied tag will not be relevant to the image version
65
- due to the pending commits.
66
-
67
- Available options for proceeding:
68
-
69
- ${chalk.green.bold( '1) cleanly commit all local mods assuming relevance' )}
70
- ${chalk.yellow( '2) eliminate unwanted local modifications' )}
71
- ${chalk.red( '3) stash anything that is irrelevant to this release' )}
72
-
73
- ` )
74
- process.exit( 1 )
75
- }
76
-
77
- if ( !fs.existsSync( './helm' ) ) {
78
- log( `
79
- ${chalk.red.bold( '***Error: docker-to-registry-py requires a helm chart directory' )}
80
-
81
- The docker-to-registry-py script expects to run in the root directory of a k8s
82
- service, which requires a helm chart directory. It also expects a docker
83
- directory but will build that if it does not exist.
84
-
85
- ` )
86
- process.exit( 1 )
87
- }
88
-
89
- const tomlStr = fs.readFileSync( './pyproject.toml' )
90
- const pyproject = toml.parse( tomlStr )
91
- const repoDescr = {
92
- artifactProject : pyproject.leverege.project || 'leverege-registry',
93
- containerName : pyproject.project.name,
94
- packageVersion : `v${pyproject.project.version}`,
95
- artifactRegistry : pyproject.leverege.registry || 'us-docker.pkg.dev/leverege-registry/stack',
96
- registryFolder : `${pyproject.leverege['registry-folder']}/images/${pyproject.project.name}`,
97
- imageBase : pyproject.leverege['image-base'],
98
- helmChart : await parseHelmChart(),
99
- }
100
-
101
- debug( { repoDescr }, '<==The Repo Description' )
102
-
103
- const dockerInfo = await Docker.generateDockerfile( {
104
- regvers : repoDescr.packageVersion,
105
- imageBase : repoDescr.imageBase,
106
- } )
107
-
108
- debug( { dockerInfo }, '<==The Docker Info' )
109
-
110
- const {
111
- artifactProject,
112
- artifactRegistry,
113
- packageVersion,
114
- containerName,
115
- helmChart,
116
- } = repoDescr
117
-
118
- if ( giveGuidance ) {
119
- await Docker.validateCloudBuildBucket( artifactProject )
120
- }
121
-
122
- const registryFolder = `${artifactRegistry}/images/${containerName}`
123
-
124
- // Update the dependencies...
125
- // log( chalk.green.bold( 'Updating dependencies and workspace...' ) )
126
- // await shellCmd( 'npm install', { stdio : 'inherit' } )
127
-
128
- if ( giveGuidance ) {
129
- await Docker.repoCleanup() // adjusts gitignore files and removes cruft
130
- log( `
131
-
132
-
133
-
134
- ${chalk.green.bold( '-------------------- Potential Helm Chart Mods --------------------' )}
135
-
136
- Moving to the new artifact-registry for docker image storage may also require
137
- helm chart changes depending on how old the current charts are. Charts that
138
- contain helm/values.yaml files resembling this:
139
-
140
- ${chalk.yellow.bold( `serviceConfig:
141
- VERSION: v1.2.3
142
- PREEMPTIBLE: true` )}
143
-
144
- are pre-ignition era charts and should be replaced with the latest helm chart
145
- templates available from ignition. Either dive in or ask devops for a hand
146
- when converting these legacy / deprecated charts.
147
-
148
-
149
- More recently updated helm charts that have already started the migration to
150
- the new approach may already have registry entries like this:
151
-
152
- ${chalk.yellow.bold( `image:
153
- registry: gcr.io/leverege-docker-images
154
- tag: ""` )}
155
-
156
- The above registry statement references the deprecated container registry and
157
- must be adjusted accordingly to resemble:
158
-
159
- ${chalk.green.bold( 'registry: us-docker.pkg.dev/leverege-registry/<registry folder>/images' )}
160
-
161
- There may also be a corresponding modification needed in the helm template
162
- deployment.yaml file in the container image spec:
163
-
164
- ${chalk.green.bold( 'image: {{ .Values.image.registry }}/{{ .Chart.Name }}:{{ default .Chart.AppVersion .Values.image.tag }}' )}
165
-
166
-
167
- ${chalk.magenta.bold( `Upgrading all service charts to the latest ignition template chart structure
168
- is the preferred approach to making the transition to the artifact registry.` )}
169
-
170
- ` )
171
- log( chalk.green.bold( '*** docker-to-registry-py guidance complete - ready for dockerization ***' ) )
172
- process.exit( 0 )
173
- }
174
-
175
- // do chart checks too
176
- let chart
177
- if ( options?.helmChecks !== 'false' ) {
178
- chart = helmChart?.yaml['Chart.yaml']
179
- const values = helmChart?.yaml['values.yaml']
180
- const expectedChartRegistry = `${artifactRegistry}/images`
181
-
182
- if ( expectedChartRegistry !== values.image?.registry ) {
183
- log( `
184
- ${chalk.red.bold( '***Error: mismatched package.json registry and helm/values.yaml' )}
185
-
186
- The registry specified in the package.json leverege stanza does not line up
187
- with the image registry in helm/values.yaml. The naming convention expects
188
- the '/images' suffix to be added to the package.json registry string and then
189
- stored as the image.registry in the helm/values.yaml file.
190
-
191
- Current settings:
192
- package.json registry => ${chalk.yellow.bold( artifactRegistry )}
193
- values.yaml registry => ${chalk.red.bold( values.image?.registry )}
194
-
195
- Expected settings:
196
- values.yaml registry => ${chalk.green.bold( expectedChartRegistry )}
197
- ` )
198
-
199
- if ( !values.image ) {
200
- log( `
201
- ${chalk.yellow.bold( '***DEPRECATED: legacy helm charts detected' )}
202
-
203
- The helm chart structure appears to be based on the pre-ignition helm chart
204
- layouts. The charts must be upgraded before docker-to-registry-py can complete
205
- its job.
206
-
207
- ` )
208
- }
209
-
210
- process.exit( 1 )
211
- }
212
- }
213
-
214
- // Give the summary and the user a chance to proceed or not
215
- log( `
216
- ${chalk.green.bold( 'Build Information:' )}
217
- Container: ${chalk.green.bold( containerName )}
218
- Version: ${chalk.green.bold( imageVersion )} ${tagInfo}
219
- Registry: ${chalk.green.bold( artifactRegistry )}
220
- Image Folder: ${chalk.yellow.bold( registryFolder )}
221
-
222
- ${chalk.green.bold( 'Docker Information:' )}
223
- NodeImage: ${chalk.green.bold( dockerInfo.imageBase || `node:${dockerInfo.nodeimage}` )}
224
- Run User: ${chalk.green.bold( dockerInfo.runuser )}
225
- Previous: ${chalk.yellow.bold( dockerInfo.previousBuild )}
226
- DateStamp: ${chalk.green.bold( dockerInfo.date )}
227
- ` )
228
-
229
- if ( imageVersion !== packageVersion ) {
230
- log( `
231
- ${chalk.yellow.bold( '***WARNING: specified version does not match project version' )}
232
- pyproject.toml => ${chalk.green.bold( packageVersion )}
233
- specified => ${chalk.red.bold( imageVersion )}
234
- ` )
235
-
236
- if ( willGitTag ) {
237
- log( chalk.red.bold( '... and you are attempting to release so NOPE!\n' ) )
238
- process.exit( 1 )
239
- }
240
- }
241
-
242
- const repoInfo = await getGitBranchAndUpstream()
243
-
244
- if ( willGitTag && !repoInfo.upstream ) {
245
- log( `
246
- ${chalk.red.bold( '***ERROR: the current branch must have an upstream' )}
247
-
248
- You are attempting to create a tagged release image for pushing to the
249
- container registry, but the current branch does not have an upstream to
250
- push to. This is not allowed since the applied tag will be stranded here
251
- in your local repository, which is what we are trying to avoid.
252
-
253
- Available options for proceeding:` )
254
- log( chalk.green.bold( `
255
- 1) set an upstream for this branch via:
256
- git push --set-upstream origin ${repoInfo.branch}` ) )
257
- log( chalk.yellow.bold( `
258
- 2) rebase, squash and merge onto a branch with an upstream` ) )
259
-
260
- process.exit( 1 )
261
- }
262
-
263
- if ( willGitTag ) {
264
- if ( chart.appVersion !== imageVersion ) {
265
- log( `
266
- ${chalk.yellow.bold( '***WARNING: the helm/Chart.yaml appVersion does not align with the build version' )}
267
- chart appVersion => ${chalk.yellow.bold( chart.appVersion )}
268
- build version => ${chalk.green.bold( imageVersion )}
269
- ` )
270
- }
271
- }
272
-
273
- await proceed()
274
-
275
- log( chalk.green.bold( 'Building the Docker Image...' ) )
276
- await Docker.buildContainerImage( { ...repoDescr, options, imageVersion } )
277
- log( chalk.blue.bold( 'Done Building the Docker Image...' ) )
278
-
279
- if ( willGitTag ) {
280
- const tagDescription = `docker_${imageVersion}`
281
- const fullImageTag = repoDescr.isMonoRepo ? `${repoDescr.containerName}/${imageVersion}` : imageVersion
282
- log( chalk.green.bold( `Tagging and Pushing ${fullImageTag}\n` ) )
283
- await shellCmd( `git tag -f ${fullImageTag} -m ${tagDescription}` )
284
- await shellCmd( 'git push --follow-tags' )
285
- } else {
286
- log( chalk.yellow.bold( '\n*** Skipped git tagging - beta release' ) )
287
- }