@leverege/build-tools 2.99.0 → 2.99.2-quinn.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/leverege-build-tools-2.21.13.tgz +0 -0
- package/lib/server/build-tools.js +138 -0
- package/lib/server/firebaseDeploy.js +195 -0
- package/lib/server/firebaseServe.js +116 -0
- package/lib/server/getfbcfg.js +25 -0
- package/lib/server/getjson.js +70 -0
- package/lib/server/overwhelm.js +447 -0
- package/lib/server/push-my-chart.js +18 -0
- package/lib/server/refresh-npm-token.js +135 -0
- package/lib/server/tag-release.js +681 -0
- package/lib/server/unleash.js +50 -0
- package/lib/web/build-tools.js +138 -0
- package/lib/web/firebaseDeploy.js +195 -0
- package/lib/web/firebaseServe.js +116 -0
- package/lib/web/getfbcfg.js +25 -0
- package/lib/web/getjson.js +70 -0
- package/lib/web/overwhelm.js +447 -0
- package/lib/web/push-my-chart.js +18 -0
- package/lib/web/refresh-npm-token.js +135 -0
- package/lib/web/tag-release.js +681 -0
- package/lib/web/unleash.js +50 -0
- package/package.json +3 -3
- package/src/helm-charts/api-server/values-local.yaml +3 -3
- package/src/helm-charts/authz-server/values-local.yaml +1 -1
- package/src/helm-charts/cnpg-db-psql-stack/cluster.yaml.ovh +23 -0
- package/src/helm-charts/cnpg-db-tsdb-basic/cluster.yaml.ovh +23 -0
- package/src/helm-charts/fota-server/values-local.yaml +2 -2
- package/src/helm-charts/geotile-server/values-local.yaml +1 -1
- package/src/helm-charts/prom-operator/prometheus-stack.yaml.ovh +12 -2
- 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/helm-charts/rule-engine/values-local.yaml +1 -1
- package/src/helm-charts/scheduler/values-local.yaml +1 -1
- package/src/helm-charts/traefik/helmup.plugin +4 -5
- package/src/helm-charts/traefik/values-local.yaml +1 -1
- package/src/helm-charts/transponder-dh/values-local.yaml +1 -1
- package/src/helm-charts/transponder-tsdb/values-local.yaml +2 -2
- package/src/helmup.sh +2 -0
- package/src/helm-charts/cnpg-db-psql-stack/pooler.yaml +0 -22
- package/src/helm-charts/cnpg-db-tsdb-basic/pooler.yaml +0 -22
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _execa = _interopRequireDefault(require("execa"));
|
|
5
|
+
var _simpleGit = _interopRequireDefault(require("simple-git"));
|
|
6
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
7
|
+
const git = new _simpleGit.default();
|
|
8
|
+
const getCurrentBranchName = async () => {
|
|
9
|
+
const branchInfo = await git.branch();
|
|
10
|
+
|
|
11
|
+
// first check to see if there are no branches - new repo?
|
|
12
|
+
if (Object.keys(branchInfo.branches).length === 0) {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
15
|
+
return Object.entries(branchInfo.branches).find(([name, info]) => info.current)[0];
|
|
16
|
+
};
|
|
17
|
+
const isProtected = async () => {
|
|
18
|
+
const theBranch = await getCurrentBranchName();
|
|
19
|
+
const protectedBranches = ['main', 'master', 'development'];
|
|
20
|
+
const additionalProtectedBranches = [...process.argv.slice(2)];
|
|
21
|
+
|
|
22
|
+
// Check if the current branch starts with any of the additional
|
|
23
|
+
// protected branch name
|
|
24
|
+
let matchesAdditionalBranch = false;
|
|
25
|
+
for (let i = 0; i < additionalProtectedBranches.length; i++) {
|
|
26
|
+
matchesAdditionalBranch = matchesAdditionalBranch || theBranch.startsWith(additionalProtectedBranches[i]);
|
|
27
|
+
}
|
|
28
|
+
return protectedBranches.includes(theBranch) || matchesAdditionalBranch;
|
|
29
|
+
};
|
|
30
|
+
const npmRunner = async script => {
|
|
31
|
+
try {
|
|
32
|
+
const results = await (0, _execa.default)('npm', ['run', script], {
|
|
33
|
+
stdio: 'inherit'
|
|
34
|
+
});
|
|
35
|
+
return results;
|
|
36
|
+
} catch (err) {
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
};
|
|
41
|
+
(async () => {
|
|
42
|
+
if (await isProtected()) {
|
|
43
|
+
const script = ['test', 'lint'];
|
|
44
|
+
for (let i = 0; i < script.length; i++) {
|
|
45
|
+
await npmRunner(script[i]); // eslint-disable-line no-await-in-loop
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.99.
|
|
3
|
+
"version": "2.99.2-quinn.1",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"prepack": "npm exec prepack"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
|
-
"build-and-push": "src/build-and-push.sh",
|
|
20
19
|
"build-cnpg-image": "src/build-cnpg-image.mjs",
|
|
21
20
|
"build-tools": "src/build-tools.mjs",
|
|
22
21
|
"change-up": "src/change-up.sh",
|
|
@@ -29,7 +28,6 @@
|
|
|
29
28
|
"dirty-git": "src/dirty-git.sh",
|
|
30
29
|
"docker-to-registry": "src/docker-to-registry.mjs",
|
|
31
30
|
"docker-to-registry-py": "src/docker-to-registry-py.mjs",
|
|
32
|
-
"docker-to-registry.sh": "src/docker-to-registry.sh",
|
|
33
31
|
"dockreate": "src/dockreate.sh",
|
|
34
32
|
"encrypt-secrets": "src/encrypt-secrets.sh",
|
|
35
33
|
"firebaseDeploy": "src/firebaseDeploy.mjs",
|
|
@@ -80,6 +78,8 @@
|
|
|
80
78
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
81
79
|
"dependencies": {
|
|
82
80
|
"@leverege/jsdoc-template": "^1.0.1",
|
|
81
|
+
"@yarnpkg/core": "^4.5.0",
|
|
82
|
+
"@yarnpkg/fslib": "^3.1.4",
|
|
83
83
|
"chalk": "^5.6.2",
|
|
84
84
|
"command-line-args": "^6.0.1",
|
|
85
85
|
"command-line-usage": "^7.0.4",
|
|
@@ -12,10 +12,10 @@ config:
|
|
|
12
12
|
|
|
13
13
|
# CNPG overrides
|
|
14
14
|
# stock pgsql
|
|
15
|
-
MODEL_SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands"
|
|
16
|
-
PG_MODELS_HOST: "cnpg-db-psql-stack-rw.cnpg-operands"
|
|
15
|
+
MODEL_SQL_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands"
|
|
16
|
+
PG_MODELS_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands"
|
|
17
17
|
# timescale
|
|
18
|
-
PG_HOST: "cnpg-db-tsdb-basic-r.cnpg-operands"
|
|
18
|
+
PG_HOST: "cnpg-db-tsdb-basic-pool-r.cnpg-operands"
|
|
19
19
|
# imagine db is legacy - newer setups use timescale as the db name
|
|
20
20
|
PG_DATABASE: "timescale"
|
|
21
21
|
PG_DENSE_HISTORY_DATABASE: "timescale"
|
|
@@ -10,7 +10,7 @@ config:
|
|
|
10
10
|
LOG_CONFIG: '{"type":"pino","level":"warn"}'
|
|
11
11
|
|
|
12
12
|
# CNPG override
|
|
13
|
-
SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
|
|
13
|
+
SQL_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands" # vs postgres-postgresql
|
|
14
14
|
|
|
15
15
|
serviceMonitor:
|
|
16
16
|
enabled: true
|
|
@@ -118,3 +118,26 @@ spec:
|
|
|
118
118
|
method: volumeSnapshot # barmanObjectStore
|
|
119
119
|
backupOwnerReference: self
|
|
120
120
|
immediate: true
|
|
121
|
+
---
|
|
122
|
+
apiVersion: postgresql.cnpg.io/v1
|
|
123
|
+
kind: Pooler
|
|
124
|
+
metadata:
|
|
125
|
+
name: cnpg-db-psql-stack-pool-rw
|
|
126
|
+
namespace: cnpg-operands
|
|
127
|
+
spec:
|
|
128
|
+
cluster:
|
|
129
|
+
name: cnpg-db-psql-stack
|
|
130
|
+
|
|
131
|
+
instances: 2
|
|
132
|
+
type: rw
|
|
133
|
+
pgbouncer:
|
|
134
|
+
poolMode: transaction
|
|
135
|
+
parameters:
|
|
136
|
+
# https://www.pgbouncer.org/config.html#generic-settings
|
|
137
|
+
max_client_conn: "500"
|
|
138
|
+
default_pool_size: "5"
|
|
139
|
+
# https://www.pgbouncer.org/config.html#log-settings
|
|
140
|
+
log_connections: "0"
|
|
141
|
+
log_disconnections: "0"
|
|
142
|
+
monitoring:
|
|
143
|
+
enablePodMonitor: true
|
|
@@ -117,3 +117,26 @@ spec:
|
|
|
117
117
|
method: volumeSnapshot # barmanObjectStore
|
|
118
118
|
backupOwnerReference: self
|
|
119
119
|
immediate: true
|
|
120
|
+
---
|
|
121
|
+
apiVersion: postgresql.cnpg.io/v1
|
|
122
|
+
kind: Pooler
|
|
123
|
+
metadata:
|
|
124
|
+
name: cnpg-db-tsdb-basic-pool-rw
|
|
125
|
+
namespace: cnpg-operands
|
|
126
|
+
spec:
|
|
127
|
+
cluster:
|
|
128
|
+
name: cnpg-db-tsdb-basic
|
|
129
|
+
|
|
130
|
+
instances: 2
|
|
131
|
+
type: rw
|
|
132
|
+
pgbouncer:
|
|
133
|
+
poolMode: transaction
|
|
134
|
+
parameters:
|
|
135
|
+
# https://www.pgbouncer.org/config.html#generic-settings
|
|
136
|
+
max_client_conn: "500"
|
|
137
|
+
default_pool_size: "5"
|
|
138
|
+
# https://www.pgbouncer.org/config.html#log-settings
|
|
139
|
+
log_connections: "0"
|
|
140
|
+
log_disconnections: "0"
|
|
141
|
+
monitoring:
|
|
142
|
+
enablePodMonitor: true
|
|
@@ -8,7 +8,7 @@ config:
|
|
|
8
8
|
NETWORK_ID: 'set-me-in-values-local'
|
|
9
9
|
|
|
10
10
|
# CNPG override
|
|
11
|
-
SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
|
|
11
|
+
SQL_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands" # vs postgres-postgresql
|
|
12
12
|
|
|
13
13
|
serviceMonitor:
|
|
14
|
-
enabled:
|
|
14
|
+
enabled: true
|
|
@@ -7,7 +7,7 @@ config:
|
|
|
7
7
|
UPLOADER_BUCKET: "${PROJECT_ID}-geotile-server"
|
|
8
8
|
|
|
9
9
|
# CNPG override
|
|
10
|
-
SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
|
|
10
|
+
SQL_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands" # vs postgres-postgresql
|
|
11
11
|
SQL_PASSWORD_SECRET: "cnpg-db-psql-stack-postgres-pw"
|
|
12
12
|
SQL_PASSWORD_KEY: "password"
|
|
13
13
|
|
|
@@ -44,12 +44,22 @@ crds:
|
|
|
44
44
|
enabled: true
|
|
45
45
|
upgradeJob:
|
|
46
46
|
enabled: true
|
|
47
|
-
forceConflicts:
|
|
47
|
+
forceConflicts: false # See README-CRD-UPGRADES.md
|
|
48
48
|
|
|
49
49
|
kubeControllerManager:
|
|
50
50
|
enabled: false
|
|
51
51
|
nodeExporter:
|
|
52
52
|
enabled: false
|
|
53
|
+
|
|
54
|
+
kubelet:
|
|
55
|
+
serviceMonitor:
|
|
56
|
+
metricRelabelings:
|
|
57
|
+
# prober_probe_duration_seconds is high-cardinality (1 histogram per
|
|
58
|
+
# container probe × node) and not referenced by any alerts or dashboards
|
|
59
|
+
- sourceLabels: [__name__]
|
|
60
|
+
regex: prober_probe_duration_seconds.*|kubelet_runtime_operations_duration_seconds.*
|
|
61
|
+
action: drop
|
|
62
|
+
|
|
53
63
|
defaultRules:
|
|
54
64
|
create: true
|
|
55
65
|
rules:
|
|
@@ -61,7 +71,7 @@ defaultRules:
|
|
|
61
71
|
kubeApiserver: true # GPT Keep an eye on API server availability
|
|
62
72
|
kubeApiserverAvailability: false
|
|
63
73
|
kubeApiserverSlos: false
|
|
64
|
-
kubelet:
|
|
74
|
+
kubelet: false # GKE manages node/kubelet health; no fat nodes so pod limit irrelevant
|
|
65
75
|
kubeProxy: false
|
|
66
76
|
kubePrometheusGeneral: false
|
|
67
77
|
kubePrometheusNodeRecording: false
|
|
@@ -306,8 +306,8 @@ spec:
|
|
|
306
306
|
VALUE = {{ $value }}
|
|
307
307
|
LABELS = {{ $labels }}
|
|
308
308
|
- alert: PrometheusTimeseriesCardinality
|
|
309
|
-
expr: label_replace(count by(__name__) ({__name__=~".+"}), "name", "$1", "__name__", "(.+)") >
|
|
310
|
-
for:
|
|
309
|
+
expr: label_replace(count by(__name__) ({__name__=~".+"}), "name", "$1", "__name__", "(.+)") > 15000
|
|
310
|
+
for: 10m
|
|
311
311
|
labels:
|
|
312
312
|
severity: warning
|
|
313
313
|
annotations:
|
|
@@ -15,7 +15,7 @@ config:
|
|
|
15
15
|
UPLOADER_LOCATION: "${GCE_REGION}"
|
|
16
16
|
|
|
17
17
|
# CNPG override
|
|
18
|
-
SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
|
|
18
|
+
SQL_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands" # vs postgres-postgresql
|
|
19
19
|
# SQL_READ_REPLICATION_CONFIG: '[ { "host": "cnpg-db-psql-stack-r.cnpg-operands" } ]'
|
|
20
20
|
# TRANSACTION_MAX_RETRIES: "5"
|
|
21
21
|
|
|
@@ -5,7 +5,7 @@ config:
|
|
|
5
5
|
LOG_CONFIG: '{"type":"pino","level":"warn"}'
|
|
6
6
|
|
|
7
7
|
# CNPG override
|
|
8
|
-
MODELS_SEQUELIZE_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
|
|
8
|
+
MODELS_SEQUELIZE_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands" # vs postgres-postgresql
|
|
9
9
|
# MODELS_SEQUELIZE_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands" # cnpg pooled (pgbouncer)
|
|
10
10
|
|
|
11
11
|
# Limit the SQL connections from the defaults of 10
|
|
@@ -5,7 +5,7 @@ config:
|
|
|
5
5
|
LOG_CONFIG: '{"type":"pino","level":"warn"}'
|
|
6
6
|
|
|
7
7
|
# CNPG override
|
|
8
|
-
SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
|
|
8
|
+
SQL_HOST: "cnpg-db-psql-stack-pool-rw.cnpg-operands" # vs postgres-postgresql
|
|
9
9
|
|
|
10
10
|
serviceMonitor:
|
|
11
11
|
enabled: true
|
|
@@ -15,12 +15,11 @@ showInstalling "Traefik v3 Load Balancer / Router"
|
|
|
15
15
|
|
|
16
16
|
TRAEFIK_NAMESPACE="traefik"
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
OCI_CHART="oci://ghcr.io/traefik/helm/traefik"
|
|
19
19
|
|
|
20
|
-
[ -z "$TRAEFIK_CHART_VERSION" ] && TRAEFIK_CHART_VERSION="38"
|
|
21
|
-
|
|
20
|
+
[ -z "$TRAEFIK_CHART_VERSION" ] && TRAEFIK_CHART_VERSION="38.0.2"
|
|
21
|
+
|
|
22
|
+
helm upgrade --install traefik $OCI_CHART \
|
|
22
23
|
--namespace $TRAEFIK_NAMESPACE --create-namespace \
|
|
23
24
|
--values traefik/values.yaml \
|
|
24
25
|
--version $TRAEFIK_CHART_VERSION $HELM_WHAT
|
|
25
|
-
|
|
26
|
-
removeHelmRepo traefik
|
|
@@ -10,7 +10,7 @@ config:
|
|
|
10
10
|
DENSE_HISTORY_TDB_CACHE_KEY_PREFIX: "timescale-dh"
|
|
11
11
|
DENSE_HISTORY_MIGRATE_PAGE_SIZE_LIMIT: "50"
|
|
12
12
|
|
|
13
|
-
PG_HOST: "cnpg-db-tsdb-dense-rw.cnpg-operands"
|
|
13
|
+
PG_HOST: "cnpg-db-tsdb-dense-pool-rw.cnpg-operands"
|
|
14
14
|
# PG_HOST: "cnpg-db-tsdb-dense-pool-rw.cnpg-operands"
|
|
15
15
|
# PG_DATABASE: "timescale" # "imagine" is legacy and default
|
|
16
16
|
|
|
@@ -14,8 +14,8 @@ config:
|
|
|
14
14
|
LOG_CONFIG: '{"type":"pino","level":"warn"}'
|
|
15
15
|
|
|
16
16
|
# CNPG override
|
|
17
|
-
PG_HOST: "cnpg-db-tsdb-basic-rw.cnpg-operands"
|
|
18
|
-
|
|
17
|
+
PG_HOST: "cnpg-db-tsdb-basic-pool-rw.cnpg-operands"
|
|
18
|
+
PG_DATABASE: "timescale" # "imagine" is legacy and default
|
|
19
19
|
|
|
20
20
|
PG_PASSWORD_SECRET: "cnpg-db-tsdb-basic-postgres-pw"
|
|
21
21
|
PG_PASSWORD_KEY: "password"
|
package/src/helmup.sh
CHANGED
|
@@ -617,6 +617,8 @@ function doHelmup() {
|
|
|
617
617
|
local from=
|
|
618
618
|
[ ! -z "$FROM_VERSIONS" ] && from="`color y \"<= from Versions.json\"`"
|
|
619
619
|
printf "$doing $from\n"
|
|
620
|
+
# plugins pass HELMUP as a single quoted string - split it into args without using eval
|
|
621
|
+
[[ $# -eq 1 ]] && set -- $1
|
|
620
622
|
"$@" --set "helmup.culprit=$culprit" --set "helmup.deployT=$deployT"
|
|
621
623
|
|
|
622
624
|
# usually the helm command will run without error but a common failure is caused
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
apiVersion: postgresql.cnpg.io/v1
|
|
2
|
-
kind: Pooler
|
|
3
|
-
metadata:
|
|
4
|
-
name: cnpg-db-psql-stack-pool-rw
|
|
5
|
-
namespace: cnpg-operands
|
|
6
|
-
spec:
|
|
7
|
-
cluster:
|
|
8
|
-
name: cnpg-db-psql-stack
|
|
9
|
-
|
|
10
|
-
instances: 1
|
|
11
|
-
type: rw
|
|
12
|
-
pgbouncer:
|
|
13
|
-
poolMode: transaction
|
|
14
|
-
parameters:
|
|
15
|
-
# https://www.pgbouncer.org/config.html#generic-settings
|
|
16
|
-
max_client_conn: "500"
|
|
17
|
-
default_pool_size: "5"
|
|
18
|
-
# https://www.pgbouncer.org/config.html#log-settings
|
|
19
|
-
log_connections: "0"
|
|
20
|
-
log_disconnections: "0"
|
|
21
|
-
monitoring:
|
|
22
|
-
enablePodMonitor: true
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
apiVersion: postgresql.cnpg.io/v1
|
|
2
|
-
kind: Pooler
|
|
3
|
-
metadata:
|
|
4
|
-
name: cnpg-db-tsdb-basic-pool-rw
|
|
5
|
-
namespace: cnpg-operands
|
|
6
|
-
spec:
|
|
7
|
-
cluster:
|
|
8
|
-
name: cnpg-db-tsdb-basic
|
|
9
|
-
|
|
10
|
-
instances: 1
|
|
11
|
-
type: rw
|
|
12
|
-
pgbouncer:
|
|
13
|
-
poolMode: transaction
|
|
14
|
-
parameters:
|
|
15
|
-
# https://www.pgbouncer.org/config.html#generic-settings
|
|
16
|
-
max_client_conn: "500"
|
|
17
|
-
default_pool_size: "5"
|
|
18
|
-
# https://www.pgbouncer.org/config.html#log-settings
|
|
19
|
-
log_connections: "0"
|
|
20
|
-
log_disconnections: "0"
|
|
21
|
-
monitoring:
|
|
22
|
-
enablePodMonitor: true
|