@leverege/build-tools 2.50.8 → 2.50.10
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 +8 -8
- package/src/Utils.mjs +9 -1
- package/src/bash-funcs +8 -1
- package/src/helm-charts/cnpg-db-pgbench/pooler.yaml +4 -0
- package/src/helm-charts/cnpg-db-psql-stack/cluster.yaml.ovh +21 -8
- package/src/helm-charts/cnpg-db-psql-stack/pooler.yaml +4 -0
- package/src/helm-charts/cnpg-db-tsdb-basic/cluster.yaml.ovh +3 -0
- package/src/helm-charts/cnpg-db-tsdb-basic/pooler.yaml +4 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/cluster.yaml.ovh +3 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/pooler.yaml +4 -0
- package/src/helmup.sh +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.50.
|
|
3
|
+
"version": "2.50.10",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"author": "Leverege Devs",
|
|
55
55
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@google-cloud/artifact-registry": "^3.
|
|
57
|
+
"@google-cloud/artifact-registry": "^3.4.0",
|
|
58
58
|
"ansi-colors": "^4.1.3",
|
|
59
59
|
"chalk": "^5.3.0",
|
|
60
60
|
"command-line-args": "^5.2.1",
|
|
@@ -62,22 +62,22 @@
|
|
|
62
62
|
"deepmerge": "^4.3.1",
|
|
63
63
|
"enquirer": "^2.4.1",
|
|
64
64
|
"execa": "^8.0.1",
|
|
65
|
-
"glob": "^10.3.
|
|
65
|
+
"glob": "^10.3.16",
|
|
66
66
|
"handlebars": "^4.7.8",
|
|
67
|
-
"inquirer": "^9.2.
|
|
67
|
+
"inquirer": "^9.2.22",
|
|
68
68
|
"js-yaml": "^4.1.0",
|
|
69
69
|
"ms": "^2.1.3",
|
|
70
|
-
"npm-registry-fetch": "^17.0.
|
|
70
|
+
"npm-registry-fetch": "^17.0.1",
|
|
71
71
|
"package-up": "^5.0.0",
|
|
72
72
|
"parse-gitignore": "^2.0.0",
|
|
73
73
|
"read-pkg": "^9.0.1",
|
|
74
74
|
"readline-sync": "^1.4.10",
|
|
75
|
-
"semver": "^7.6.
|
|
75
|
+
"semver": "^7.6.2",
|
|
76
76
|
"simple-git": "^3.24.0",
|
|
77
|
-
"zx": "^8.0
|
|
77
|
+
"zx": "^8.1.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@leverege/eslint-config-leverege": "^4.2.0",
|
|
81
|
-
"npm": "^10.
|
|
81
|
+
"npm": "^10.8.0"
|
|
82
82
|
}
|
|
83
83
|
}
|
package/src/Utils.mjs
CHANGED
|
@@ -76,7 +76,11 @@ export const getDateTimestamp = () => {
|
|
|
76
76
|
|
|
77
77
|
export const getGcpAccount = async () => {
|
|
78
78
|
const fullAccount = await shellCmd( 'gcloud config get account' )
|
|
79
|
-
const [
|
|
79
|
+
const [ principal, domain ] = fullAccount.split( '@' )
|
|
80
|
+
|
|
81
|
+
// for non-email principals, such as Workforce Identity federated users
|
|
82
|
+
const nameFields = principal.split( '/' )
|
|
83
|
+
const fullName = nameFields[nameFields.length - 1]
|
|
80
84
|
return { fullAccount, fullName, domain }
|
|
81
85
|
}
|
|
82
86
|
|
|
@@ -345,6 +349,10 @@ export const parseHelmChart = async ( helmroot = './helm' ) => {
|
|
|
345
349
|
const chartVersion = chartYaml.version
|
|
346
350
|
const chartPackage = `${chartName}-${chartVersion}.tgz`
|
|
347
351
|
const valuesYaml = YAML.load( readFileSync( `${helmroot}/values.yaml`, 'utf8' ) )
|
|
352
|
+
debug( valuesYaml, '<== helm/values.yaml' )
|
|
353
|
+
if ( !valuesYaml.image ) {
|
|
354
|
+
errorExit( 'Error: legacy helm chart detected - must upgrade to latest ignition template to proceed' )
|
|
355
|
+
}
|
|
348
356
|
const imageRegistry = valuesYaml.image?.registry
|
|
349
357
|
const registryComponents = imageRegistry.split( '/' )
|
|
350
358
|
/* eslint-enable security/detect-non-literal-fs-filename */
|
package/src/bash-funcs
CHANGED
|
@@ -169,13 +169,20 @@ function ifPluggedIn() {
|
|
|
169
169
|
local INVOKED_AS=`basename $0`
|
|
170
170
|
local PLUGIN=
|
|
171
171
|
case "$INVOKED_AS" in
|
|
172
|
-
"helmup"|"helmwhat" )
|
|
172
|
+
"helmup"|"helmwhat"|"helmcycle" )
|
|
173
173
|
PLUGIN="$1/helmup.plugin"
|
|
174
174
|
;;
|
|
175
175
|
"helmdn" )
|
|
176
176
|
PLUGIN="$1/helmdn.plugin"
|
|
177
177
|
;;
|
|
178
178
|
*)
|
|
179
|
+
cat<<PLUGIN_INVOKED_AS_ERROR
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
$RED_ERROR bash-funcs ifPluggedIn: unknown INVOKED_AS=[`color r $INVOKED_AS`]
|
|
183
|
+
|
|
184
|
+
PLUGIN_INVOKED_AS_ERROR
|
|
185
|
+
exit 1
|
|
179
186
|
;;
|
|
180
187
|
esac
|
|
181
188
|
|
|
@@ -12,5 +12,9 @@ spec:
|
|
|
12
12
|
pgbouncer:
|
|
13
13
|
poolMode: session
|
|
14
14
|
parameters:
|
|
15
|
+
# https://www.pgbouncer.org/config.html#generic-settings
|
|
15
16
|
max_client_conn: "500"
|
|
16
17
|
default_pool_size: "10"
|
|
18
|
+
# https://www.pgbouncer.org/config.html#log-settings
|
|
19
|
+
log_connections: "0"
|
|
20
|
+
log_disconnections: "0"
|
|
@@ -13,24 +13,35 @@ spec:
|
|
|
13
13
|
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.2-cnpg-tsdb2-beta.4
|
|
14
14
|
bootstrap:
|
|
15
15
|
initdb:
|
|
16
|
-
|
|
16
|
+
# database: models
|
|
17
17
|
postInitSQL:
|
|
18
|
+
# - CREATE DATABASE app; # operator expects this
|
|
19
|
+
# - CREATE ROLE app; # and this to exist on restore
|
|
20
|
+
# create the stack databases
|
|
18
21
|
- CREATE DATABASE authz;
|
|
19
22
|
- CREATE DATABASE fota;
|
|
20
23
|
- CREATE DATABASE geotile;
|
|
21
24
|
- CREATE DATABASE models;
|
|
22
25
|
- CREATE DATABASE scheduler;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
# owner: imagine
|
|
27
|
+
# secret:
|
|
28
|
+
# name: cnpg-db-psql-stack-imagine-pw # imagine db pw
|
|
26
29
|
|
|
27
30
|
enableSuperuserAccess: true
|
|
28
31
|
superuserSecret:
|
|
29
32
|
name: cnpg-db-psql-stack-postgres-pw # postgres db pw
|
|
30
33
|
|
|
31
34
|
affinity:
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
enablePodAntiAffinity: true
|
|
36
|
+
topologyKey: kubernetes.io/hostname # default value
|
|
37
|
+
nodeAffinity:
|
|
38
|
+
requiredDuringSchedulingIgnoredDuringExecution:
|
|
39
|
+
nodeSelectorTerms:
|
|
40
|
+
- matchExpressions:
|
|
41
|
+
- key: target-env
|
|
42
|
+
operator: In
|
|
43
|
+
values:
|
|
44
|
+
- database
|
|
34
45
|
tolerations:
|
|
35
46
|
- key: "database"
|
|
36
47
|
operator: "Equal"
|
|
@@ -83,6 +94,7 @@ spec:
|
|
|
83
94
|
cnpgCluster: cnpg-db-psql-stack
|
|
84
95
|
wal:
|
|
85
96
|
compression: gzip
|
|
97
|
+
maxParallel: 4
|
|
86
98
|
---
|
|
87
99
|
apiVersion: postgresql.cnpg.io/v1
|
|
88
100
|
kind: ScheduledBackup
|
|
@@ -91,8 +103,9 @@ metadata:
|
|
|
91
103
|
namespace: cnpg-operands
|
|
92
104
|
spec:
|
|
93
105
|
# https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
|
|
94
|
-
schedule: "0 0
|
|
106
|
+
schedule: "0 0 */12 * * *"
|
|
95
107
|
cluster:
|
|
96
|
-
|
|
108
|
+
name: cnpg-db-psql-stack
|
|
109
|
+
method: barmanObjectStore # volumeSnapshot
|
|
97
110
|
backupOwnerReference: self
|
|
98
111
|
immediate: true
|
|
@@ -12,5 +12,9 @@ spec:
|
|
|
12
12
|
pgbouncer:
|
|
13
13
|
poolMode: session
|
|
14
14
|
parameters:
|
|
15
|
+
# https://www.pgbouncer.org/config.html#generic-settings
|
|
15
16
|
max_client_conn: "500"
|
|
16
17
|
default_pool_size: "10"
|
|
18
|
+
# https://www.pgbouncer.org/config.html#log-settings
|
|
19
|
+
log_connections: "0"
|
|
20
|
+
log_disconnections: "0"
|
|
@@ -19,6 +19,8 @@ spec:
|
|
|
19
19
|
postInitTemplateSQL:
|
|
20
20
|
- CREATE EXTENSION timescaledb;
|
|
21
21
|
- CREATE EXTENSION jsquery;
|
|
22
|
+
- CREATE DATABASE app; # for the operator restores
|
|
23
|
+
- CREATE ROLE app; # same
|
|
22
24
|
database: imagine
|
|
23
25
|
owner: imagine
|
|
24
26
|
secret:
|
|
@@ -94,6 +96,7 @@ spec:
|
|
|
94
96
|
cnpgCluster: cnpg-db-tsdb-basic
|
|
95
97
|
wal:
|
|
96
98
|
compression: gzip
|
|
99
|
+
maxParallel: 4
|
|
97
100
|
---
|
|
98
101
|
apiVersion: postgresql.cnpg.io/v1
|
|
99
102
|
kind: ScheduledBackup
|
|
@@ -12,5 +12,9 @@ spec:
|
|
|
12
12
|
pgbouncer:
|
|
13
13
|
poolMode: session
|
|
14
14
|
parameters:
|
|
15
|
+
# https://www.pgbouncer.org/config.html#generic-settings
|
|
15
16
|
max_client_conn: "500"
|
|
16
17
|
default_pool_size: "10"
|
|
18
|
+
# https://www.pgbouncer.org/config.html#log-settings
|
|
19
|
+
log_connections: "0"
|
|
20
|
+
log_disconnections: "0"
|
|
@@ -19,6 +19,8 @@ spec:
|
|
|
19
19
|
postInitTemplateSQL:
|
|
20
20
|
- CREATE EXTENSION timescaledb;
|
|
21
21
|
- CREATE EXTENSION jsquery;
|
|
22
|
+
- CREATE DATABASE app; # for the operator restores
|
|
23
|
+
- CREATE ROLE app; # same
|
|
22
24
|
database: imagine
|
|
23
25
|
owner: imagine
|
|
24
26
|
secret:
|
|
@@ -93,6 +95,7 @@ spec:
|
|
|
93
95
|
cnpgCluster: cnpg-db-tsdb-dense
|
|
94
96
|
wal:
|
|
95
97
|
compression: gzip
|
|
98
|
+
maxParallel: 4
|
|
96
99
|
---
|
|
97
100
|
apiVersion: postgresql.cnpg.io/v1
|
|
98
101
|
kind: ScheduledBackup
|
|
@@ -12,5 +12,9 @@ spec:
|
|
|
12
12
|
pgbouncer:
|
|
13
13
|
poolMode: session
|
|
14
14
|
parameters:
|
|
15
|
+
# https://www.pgbouncer.org/config.html#generic-settings
|
|
15
16
|
max_client_conn: "500"
|
|
16
17
|
default_pool_size: "10"
|
|
18
|
+
# https://www.pgbouncer.org/config.html#log-settings
|
|
19
|
+
log_connections: "0"
|
|
20
|
+
log_disconnections: "0"
|
package/src/helmup.sh
CHANGED
|
@@ -794,7 +794,13 @@ doHelmup() {
|
|
|
794
794
|
[ ! -z "$FROM_VERSIONS" ] && from="`color y \"<= from Versions.json\"`"
|
|
795
795
|
printf "$doing $from\n"
|
|
796
796
|
eval $helmup
|
|
797
|
-
|
|
797
|
+
case "$INVOKED_AS" in
|
|
798
|
+
"helmup"|"helmdn")
|
|
799
|
+
sendToSlack "$helmup"
|
|
800
|
+
;;
|
|
801
|
+
*)
|
|
802
|
+
;;
|
|
803
|
+
esac
|
|
798
804
|
}
|
|
799
805
|
|
|
800
806
|
# not a fan of global vars but bash forced me to - set by getServiceAndChartVersion
|
|
@@ -814,7 +820,7 @@ function doInstall() {
|
|
|
814
820
|
# slap additional helm syntax in there if the version is set
|
|
815
821
|
[ ! -z "$CHARTVER" ] && CHARTVER="--version $CHARTVER"
|
|
816
822
|
|
|
817
|
-
|
|
823
|
+
INVOKED_AS=`basename $0`
|
|
818
824
|
# set the dry-run flag on what
|
|
819
825
|
[ "$INVOKED_AS" == "helmwhat" ] && HELM_WHAT="--dry-run --debug" && K8S_WHAT="--dry-run=server -o yaml"
|
|
820
826
|
|