underpost 2.8.821 → 2.8.836

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.
@@ -58,8 +58,8 @@ jobs:
58
58
  - name: Set git global credentials
59
59
  run: |
60
60
  git config --global credential.helper ""
61
- git config --global user.name 'underpost.net'
62
- git config --global user.email 'admin@underpost.net'
61
+ git config --global user.name 'underpostnet'
62
+ git config --global user.email 'fcoverdugoa@underpost.net'
63
63
 
64
64
  - name: Clone and Push to github package repository
65
65
  run: |
@@ -70,8 +70,8 @@ jobs:
70
70
  git config --global --add safe.directory /__w/pwa-microservices-template/pwa-microservices-template
71
71
  git remote set-url origin git@github.com:underpostnet/pwa-microservices-template-ghpkg.git
72
72
  git init
73
- git config user.name 'underpost.net'
74
- git config user.email 'admin@underpost.net'
73
+ git config user.name 'underpostnet'
74
+ git config user.email 'fcoverdugoa@underpost.net'
75
75
  git add .
76
76
  git status
77
77
  underpost cmt . ci package-pwa-microservices-template-ghpkg 'Update github repo package'
@@ -41,8 +41,8 @@ jobs:
41
41
  - name: Set git global credentials
42
42
  run: |
43
43
  git config --global credential.helper ""
44
- git config --global user.name 'underpost.net'
45
- git config --global user.email 'admin@underpost.net'
44
+ git config --global user.name 'underpostnet'
45
+ git config --global user.email 'fcoverdugoa@underpost.net'
46
46
 
47
47
  - name: Clone github package repository
48
48
  run: |
@@ -52,8 +52,8 @@ jobs:
52
52
  cd ../pwa-microservices-template
53
53
  git remote set-url origin git@github.com:underpostnet/pwa-microservices-template.git
54
54
  git add .
55
- git config user.name 'underpost.net'
56
- git config user.email 'admin@underpost.net'
55
+ git config user.name 'underpostnet'
56
+ git config user.email 'fcoverdugoa@underpost.net'
57
57
  underpost cmt . ci package-pwa-microservices-template-ghpkg 'Update npm repo package'
58
58
  underpost push . underpostnet/pwa-microservices-template
59
59
  # cd ../engine
@@ -6,7 +6,6 @@
6
6
  "eamodio.gitlens",
7
7
  "esbenp.prettier-vscode",
8
8
  "formulahendry.code-runner",
9
- "foxundermoon.shell-format",
10
9
  "github.codespaces",
11
10
  "github.vscode-github-actions",
12
11
  "golang.go",
@@ -31,6 +30,7 @@
31
30
  "scala-lang.scala",
32
31
  "scala-lang.scala-snippets",
33
32
  "scalameta.metals",
33
+ "shakram02.bash-beautify",
34
34
  "shardulm94.trailing-spaces",
35
35
  "streetsidesoftware.code-spell-checker",
36
36
  "tamasfe.even-better-toml",
@@ -81,50 +81,7 @@
81
81
  "[xml]": {
82
82
  "editor.defaultFormatter": "redhat.vscode-xml"
83
83
  },
84
- "docwriter.style": "Auto-detect",
85
- "docwriter.progress.trackFunctions": false,
86
- "docwriter.progress.trackMethods": false,
87
- "files.exclude": {
88
- "**/.git": true, // this is a default value
89
- "**/.DS_Store": true, // this is a default value
90
84
 
91
- "**/node_modules": true, // this excludes all folders
92
- // named "node_modules" from
93
- // the explore tree
94
-
95
- // alternative version
96
- "node_modules": true, // this excludes the folder
97
- // only from the root of
98
- // your workspace
99
- "public": true,
100
- "engine-private": true,
101
- "conf": true,
102
- "tmp": true,
103
- "bkt": true,
104
- "logs": true,
105
- "build": true,
106
- "coverage": true,
107
- "prometheus_data": true,
108
- "grafana_data": true,
109
- ".nyc_output": true
110
- },
111
- "[solidity]": {
112
- "editor.defaultFormatter": "JuanBlanco.solidity"
113
- },
114
- "[dockerfile]": {
115
- "editor.defaultFormatter": "foxundermoon.shell-format"
116
- },
117
- "[ignore]": {
118
- "editor.defaultFormatter": "foxundermoon.shell-format"
119
- },
120
- "docwriter.progress.trackTypes": true,
121
- "docwriter.hotkey.mac": "⌘ + .",
122
- "[dotenv]": {
123
- "editor.defaultFormatter": "foxundermoon.shell-format"
124
- },
125
- "[shellscript]": {
126
- "editor.defaultFormatter": "foxundermoon.shell-format"
127
- },
128
85
  "files.watcherExclude": {
129
86
  "**/target": true
130
87
  }
package/README.md CHANGED
@@ -22,7 +22,15 @@ template
22
22
 
23
23
  <div align="center">
24
24
 
25
- [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
25
+
26
+ <!-- badges -->
27
+
28
+
29
+ [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.8.836)](https://socket.dev/npm/package/underpost/overview/2.8.836) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
30
+
31
+
32
+ <!-- end-badges -->
33
+
26
34
 
27
35
  </div>
28
36
 
@@ -68,7 +76,7 @@ Run dev client server
68
76
  npm run dev
69
77
  ```
70
78
  <!-- -->
71
- ## underpost ci/cd cli v2.8.821
79
+ ## underpost ci/cd cli v2.8.836
72
80
 
73
81
  ### Usage: `underpost [options] [command]`
74
82
  ```
@@ -98,6 +106,7 @@ Commands:
98
106
  fs [options] [path] Manages file storage, defaulting to file upload operations.
99
107
  test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
100
108
  monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
109
+ run [options] <runner-id> [path] Runs a script from the specified path.
101
110
  lxd [options] Manages LXD containers and virtual machines.
102
111
  baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
103
112
  help [command] display help for command
package/bin/deploy.js CHANGED
@@ -744,7 +744,7 @@ try {
744
744
  fs.readFileSync(`./src/index.js`, 'utf8').replaceAll(`${version}`, `${newVersion}`),
745
745
  'utf8',
746
746
  );
747
- shellExec(`node bin/deploy cli-docs`);
747
+ shellExec(`node bin/deploy cli-docs ${version} ${newVersion}`);
748
748
  shellExec(`node bin/deploy update-dependencies`);
749
749
  shellExec(`auto-changelog`);
750
750
  shellExec(`node bin/build dd`);
@@ -1014,6 +1014,29 @@ EOF`);
1014
1014
  break;
1015
1015
  }
1016
1016
 
1017
+ case 'maas-db': {
1018
+ // DROP, ALTER, CREATE, WITH ENCRYPTED
1019
+ // sudo -u <user> -h <host> psql <db-name>
1020
+ shellExec(`DB_PG_MAAS_NAME=${process.env.DB_PG_MAAS_NAME}`);
1021
+ shellExec(`DB_PG_MAAS_PASS=${process.env.DB_PG_MAAS_PASS}`);
1022
+ shellExec(`DB_PG_MAAS_USER=${process.env.DB_PG_MAAS_USER}`);
1023
+ shellExec(`DB_PG_MAAS_HOST=${process.env.DB_PG_MAAS_HOST}`);
1024
+ shellExec(
1025
+ `sudo -i -u postgres psql -c "CREATE USER \"$DB_PG_MAAS_USER\" WITH ENCRYPTED PASSWORD '$DB_PG_MAAS_PASS'"`,
1026
+ );
1027
+ shellExec(
1028
+ `sudo -i -u postgres psql -c "ALTER USER \"$DB_PG_MAAS_USER\" WITH ENCRYPTED PASSWORD '$DB_PG_MAAS_PASS'"`,
1029
+ );
1030
+ const actions = ['LOGIN', 'SUPERUSER', 'INHERIT', 'CREATEDB', 'CREATEROLE', 'REPLICATION'];
1031
+ shellExec(`sudo -i -u postgres psql -c "ALTER USER \"$DB_PG_MAAS_USER\" WITH ${actions.join(' ')}"`);
1032
+ shellExec(`sudo -i -u postgres psql -c "\\du"`);
1033
+
1034
+ shellExec(`sudo -i -u postgres createdb -O "$DB_PG_MAAS_USER" "$DB_PG_MAAS_NAME"`);
1035
+
1036
+ shellExec(`sudo -i -u postgres psql -c "\\l"`);
1037
+ break;
1038
+ }
1039
+
1017
1040
  case 'valkey': {
1018
1041
  if (!process.argv.includes('server')) {
1019
1042
  if (process.argv.includes('rocky')) {
@@ -1083,7 +1106,7 @@ EOF`);
1083
1106
  }
1084
1107
 
1085
1108
  case 'cli-docs': {
1086
- buildCliDoc(program);
1109
+ buildCliDoc(program, process.argv[3], process.argv[4]);
1087
1110
  break;
1088
1111
  }
1089
1112
 
@@ -1692,14 +1715,6 @@ nvidia/gpu-operator \
1692
1715
  // sudo yum install sbt
1693
1716
  break;
1694
1717
  }
1695
-
1696
- case 'chrony': {
1697
- shellExec(`sudo dnf install chrony -y`);
1698
- // debian chroot: sudo apt install chrony
1699
- for (const cmd of chronySetUp(`/etc/chrony.conf`)) shellExec(cmd);
1700
-
1701
- break;
1702
- }
1703
1718
  }
1704
1719
  } catch (error) {
1705
1720
  logger.error(error, error.stack);
package/bin/file.js CHANGED
@@ -136,10 +136,27 @@ try {
136
136
  JSON.stringify(templatePackageLockJson, null, 4),
137
137
  'utf8',
138
138
  );
139
+ const badges = fs
140
+ .readFileSync(`./README.md`, 'utf8')
141
+ .split(`<!-- badges -->`)[1]
142
+ .split(`<!-- end-badges -->`)[0];
143
+ let originMd = fs.readFileSync(`../pwa-microservices-template/README.md`, 'utf8');
144
+
145
+ originMd =
146
+ originMd.split(`<!-- badges -->`)[0] +
147
+ `
148
+ <!-- badges -->
149
+ ` +
150
+ badges +
151
+ `
152
+ <!-- end-badges -->
153
+ ` +
154
+ originMd.split(`<!-- end-badges -->`)[1];
155
+
139
156
  const splitKeyword = '## underpost ci/cd cli';
140
157
  fs.writeFileSync(
141
158
  `../pwa-microservices-template/README.md`,
142
- fs.readFileSync(`../pwa-microservices-template/README.md`, 'utf8').split(`<!-- -->`)[0] +
159
+ originMd.split(`<!-- -->`)[0] +
143
160
  `<!-- -->
144
161
  ${splitKeyword + fs.readFileSync(`./README.md`, 'utf8').split(splitKeyword)[1]}`,
145
162
  'utf8',
package/bin/vs.js CHANGED
@@ -4,7 +4,11 @@ import { loggerFactory } from '../src/server/logger.js';
4
4
 
5
5
  const logger = loggerFactory(import.meta);
6
6
 
7
- const vsCodeRootPath = '/root/.vscode-root';
7
+ // const vsCodeRootPath = '/root/.vscode-root';
8
+ // const vsProgram = 'code';
9
+
10
+ const vsCodeRootPath = '/root/.windsurf';
11
+ const vsProgram = 'windsurf';
8
12
 
9
13
  switch (process.argv[2]) {
10
14
  case 'info': {
@@ -31,13 +35,17 @@ switch (process.argv[2]) {
31
35
  const extensions = JSON.parse(fs.readFileSync(`./.vscode/extensions.json`, 'utf8'));
32
36
  extensions.recommendations.map((extension) => {
33
37
  if (extension)
34
- shellExec(`sudo code --user-data-dir="${vsCodeRootPath}" --no-sandbox --install-extension ${extension}`);
38
+ shellExec(
39
+ `sudo ${vsProgram} --user-data-dir="${vsCodeRootPath}" --no-sandbox --install-extension ${extension}`,
40
+ );
35
41
  });
36
42
  }
37
43
  break;
38
44
  case 'export':
39
45
  {
40
- shellExec(`sudo code --user-data-dir="${vsCodeRootPath}" --no-sandbox --list-extensions > vs-extensions.txt`);
46
+ shellExec(
47
+ `sudo ${vsProgram} --user-data-dir="${vsCodeRootPath}" --no-sandbox --list-extensions > vs-extensions.txt`,
48
+ );
41
49
  fs.writeFileSync(
42
50
  `./.vscode/extensions.json`,
43
51
  JSON.stringify(
@@ -61,6 +69,6 @@ switch (process.argv[2]) {
61
69
  break;
62
70
  }
63
71
  default:
64
- shellExec(`sudo code ${process.argv[2]} --user-data-dir="${vsCodeRootPath}" --no-sandbox`);
72
+ shellExec(`sudo ${vsProgram} ${process.argv[2]} --user-data-dir="${vsCodeRootPath}" --no-sandbox`);
65
73
  break;
66
74
  }
package/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v2.8.821
1
+ ## underpost ci/cd cli v2.8.836
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
4
  ```
@@ -28,6 +28,7 @@ Commands:
28
28
  fs [options] [path] Manages file storage, defaulting to file upload operations.
29
29
  test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
30
30
  monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
31
+ run [options] <runner-id> [path] Runs a script from the specified path.
31
32
  lxd [options] Manages LXD containers and virtual machines.
32
33
  baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
33
34
  help [command] display help for command
@@ -240,6 +241,7 @@ Options:
240
241
  initialization.
241
242
  --init-host Installs necessary Kubernetes node CLI tools (e.g.,
242
243
  kind, kubeadm, docker, podman, helm).
244
+ --uninstall-host Uninstalls all host components installed by init-host.
243
245
  --config Sets the base Kubernetes node configuration.
244
246
  --worker Sets the context for a worker node.
245
247
  --chown Sets the appropriate ownership for Kubernetes kubeconfig
@@ -545,6 +547,28 @@ Options:
545
547
  ```
546
548
 
547
549
 
550
+ ### `run` :
551
+ ```
552
+ Usage: underpost run [options] <runner-id> [path]
553
+
554
+ Runs a script from the specified path.
555
+
556
+ Arguments:
557
+ runner-id The runner ID to run. Options: spark-template,
558
+ gpu-env, tf-gpu-test, ide, single-job.
559
+ path The absolute or relative directory path where the
560
+ script is located.
561
+
562
+ Options:
563
+ --command <command-array> Array of commands to run.
564
+ --args <args-array> Array of arguments to pass to the command.
565
+ --dev Sets the development context environment for the
566
+ script.
567
+ -h, --help display help for command
568
+
569
+ ```
570
+
571
+
548
572
  ### `lxd` :
549
573
  ```
550
574
  Usage: underpost lxd [options]
@@ -58,7 +58,7 @@ services:
58
58
  cpus: '0.25'
59
59
  memory: 20M
60
60
  labels: # labels in Compose file instead of Dockerfile
61
- engine.version: '2.8.821'
61
+ engine.version: '2.8.836'
62
62
  networks:
63
63
  - load-balancer
64
64
 
@@ -17,7 +17,7 @@ spec:
17
17
  spec:
18
18
  containers:
19
19
  - name: dd-template-development-blue
20
- image: localhost/rockylinux9-underpost:v2.8.821
20
+ image: localhost/rockylinux9-underpost:v2.8.836
21
21
  # resources:
22
22
  # requests:
23
23
  # memory: "124Ki"
@@ -100,7 +100,7 @@ spec:
100
100
  spec:
101
101
  containers:
102
102
  - name: dd-template-development-green
103
- image: localhost/rockylinux9-underpost:v2.8.821
103
+ image: localhost/rockylinux9-underpost:v2.8.836
104
104
  # resources:
105
105
  # requests:
106
106
  # memory: "124Ki"
@@ -0,0 +1,65 @@
1
+ ---
2
+ apiVersion: v1
3
+ kind: ConfigMap
4
+ metadata:
5
+ name: tf-gpu-test-script
6
+ namespace: default
7
+ data:
8
+ main_tf_gpu_test.py: |
9
+ import os
10
+ import tensorflow as tf
11
+
12
+ print("--- Starting GPU and Library Check ---")
13
+
14
+ gpus = tf.config.list_physical_devices("GPU")
15
+ if gpus:
16
+ try:
17
+ tf.config.set_visible_devices(gpus[0], "GPU")
18
+ logical_gpus = tf.config.list_logical_devices("GPU")
19
+ print(
20
+ f"TensorFlow detected {len(gpus)} Physical GPUs, {len(logical_gpus)} Logical GPUs. Using: {gpus[0].name}"
21
+ )
22
+ except RuntimeError as e:
23
+ print(f"RuntimeError during GPU configuration: {e}")
24
+ else:
25
+ print("TensorFlow did not detect any GPU devices. Running on CPU.")
26
+
27
+ print(f"XLA_FLAGS environment variable: {os.environ.get('XLA_FLAGS')}")
28
+ print(f"TF_XLA_FLAGS environment variable: {os.environ.get('TF_XLA_FLAGS')}")
29
+
30
+ print(f"TensorFlow version: {tf.__version__}")
31
+ print(f"Built with CUDA: {tf.test.is_built_with_cuda()}")
32
+ print(f"Is GPU available: {tf.config.list_physical_devices('GPU') != []}")
33
+
34
+ print("--- GPU and Library Check Complete ---")
35
+ ---
36
+ apiVersion: v1
37
+ kind: Pod
38
+ metadata:
39
+ name: tf-gpu-test-pod
40
+ namespace: default
41
+ spec:
42
+ restartPolicy: Never
43
+ runtimeClassName: nvidia
44
+ containers:
45
+ - name: tensorflow-gpu-tester
46
+ image: nvcr.io/nvidia/tensorflow:24.04-tf2-py3
47
+ imagePullPolicy: IfNotPresent
48
+ command: ['python']
49
+ args: ['/app/main_tf_gpu_test.py']
50
+ resources:
51
+ limits:
52
+ nvidia.com/gpu: '1'
53
+ env:
54
+ - name: NVIDIA_VISIBLE_DEVICES
55
+ value: all
56
+ volumeMounts:
57
+ - name: tf-script-volume
58
+ mountPath: /app
59
+ volumes:
60
+ - name: tf-script-volume
61
+ configMap:
62
+ name: tf-gpu-test-script
63
+ items:
64
+ - key: main_tf_gpu_test.py
65
+ path: main_tf_gpu_test.py
@@ -58,14 +58,14 @@ maas "$MAAS_ADMIN_USERNAME" maas set-config name=upstream_dns value=8.8.8.8
58
58
  # os="ubuntu" release="noble" arches="amd64" \
59
59
  # subarches="ga-24.04" labels="*"
60
60
 
61
- echo "Downloading Ubuntu Noble arm64/ga-24.04 image..."
62
- maas $MAAS_ADMIN_USERNAME boot-source-selections create 1 \
63
- os="ubuntu" release="noble" arches="arm64" \
64
- subarches="ga-24.04" labels="*"
61
+ # echo "Downloading Ubuntu Noble arm64/ga-24.04 image..."
62
+ # maas $MAAS_ADMIN_USERNAME boot-source-selections create 1 \
63
+ # os="ubuntu" release="noble" arches="arm64" \
64
+ # subarches="ga-24.04" labels="*"
65
65
 
66
66
  # Import the newly selected boot images
67
- echo "Importing boot images (this may take some time)..."
68
- maas "$MAAS_ADMIN_USERNAME" boot-resources import
67
+ # echo "Importing boot images (this may take some time)..."
68
+ # maas "$MAAS_ADMIN_USERNAME" boot-resources import
69
69
 
70
70
  # Disable the MAAS HTTP proxy
71
71
  echo "Disabling MAAS HTTP proxy..."
@@ -108,13 +108,13 @@ if [ -z "$FABRIC_ID" ]; then
108
108
  exit 1
109
109
  fi
110
110
 
111
- # Enable DHCP on the untagged VLAN (VLAN tag 0)
112
- echo "Enabling DHCP on VLAN 0 for fabric-1 (ID: $FABRIC_ID)..."
113
- maas "$MAAS_ADMIN_USERNAME" vlan update "$FABRIC_ID" 0 dhcp_on=true primary_rack="$RACK_CONTROLLER_ID"
114
-
115
111
  # Create a Dynamic IP Range for enlistment, commissioning, and deployment
116
112
  echo "Creating dynamic IP range from $START_IP to $END_IP..."
117
113
  maas "$MAAS_ADMIN_USERNAME" ipranges create type=dynamic start_ip="$START_IP" end_ip="$END_IP"
118
114
 
115
+ # Enable DHCP on the untagged VLAN (VLAN tag 0)
116
+ echo "Enabling DHCP on VLAN 0 for fabric-1 (ID: $FABRIC_ID)..."
117
+ maas "$MAAS_ADMIN_USERNAME" vlan update "$FABRIC_ID" 0 dhcp_on=true primary_rack="$RACK_CONTROLLER_ID"
118
+
119
119
  echo "Setting gateway IP for subnet $SUBNET_CIDR (ID: $SUBNET_ID) to $IP_ADDRESS..."
120
120
  maas "$MAAS_ADMIN_USERNAME" subnet update $SUBNET_ID gateway_ip=$IP_ADDRESS
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bash
2
+ # cleanup-snap.sh
3
+ # Remove all disabled snap revisions to free up disk space.
4
+
5
+ set -euo pipefail
6
+
7
+ # Ensure we’re running as root
8
+ if [[ $EUID -ne 0 ]]; then
9
+ echo "Please run this script with sudo or as root."
10
+ exit 1
11
+ fi
12
+
13
+ echo "Gathering list of snaps with disabled revisions..."
14
+ snap list --all \
15
+ | awk '/disabled/ {print $1, $3}' \
16
+ | while read -r pkg rev; do
17
+ echo " -> Removing $pkg (revision $rev)..."
18
+ snap remove "$pkg" --revision="$rev"
19
+ done
20
+
21
+ echo "Cleanup complete."
22
+ echo
23
+ echo "Tip: Limit how many revisions Snap retains by setting:"
24
+ echo " sudo snap set system refresh.retain=2"
25
+ echo "Then apply with:"
26
+ echo " sudo snap refresh"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.8.821",
5
+ "version": "2.8.836",
6
6
  "description": "pwa api rest template",
7
7
  "scripts": {
8
8
  "start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
@@ -91,7 +91,7 @@ class UnderpostBaremetal {
91
91
  const callbackMetaData = {
92
92
  args: { hostname, ipAddress, workflowId },
93
93
  options,
94
- runnerHost: { architecture: UnderpostBaremetal.API.getHostArch(), ip: getLocalIPv4Address() },
94
+ runnerHost: { architecture: UnderpostBaremetal.API.getHostArch().alias, ip: getLocalIPv4Address() },
95
95
  nfsHostPath,
96
96
  tftpRootPath,
97
97
  };
@@ -149,6 +149,7 @@ class UnderpostBaremetal {
149
149
  shellExec(`chmod +x ${underpostRoot}/manifests/maas/nat-iptables.sh`);
150
150
  shellExec(`${underpostRoot}/manifests/maas/maas-setup.sh`);
151
151
  shellExec(`${underpostRoot}/manifests/maas/nat-iptables.sh`);
152
+ return;
152
153
  }
153
154
 
154
155
  // Handle control server uninstallation.
@@ -166,6 +167,7 @@ class UnderpostBaremetal {
166
167
  shellExec(`sudo rm -rf /etc/maas`);
167
168
  shellExec(`sudo rm -rf /var/lib/maas`);
168
169
  shellExec(`sudo rm -rf /var/log/maas`);
170
+ return;
169
171
  }
170
172
 
171
173
  // Handle control server database installation.
@@ -175,12 +177,14 @@ class UnderpostBaremetal {
175
177
  shellExec(
176
178
  `node ${underpostRoot}/bin/deploy pg-drop-db ${process.env.DB_PG_MAAS_NAME} ${process.env.DB_PG_MAAS_USER}`,
177
179
  );
178
- shellExec(`node ${underpostRoot}/bin/deploy maas db`);
180
+ shellExec(`node ${underpostRoot}/bin/deploy maas-db`);
181
+ return;
179
182
  }
180
183
 
181
184
  // Handle control server database uninstallation.
182
185
  if (options.controlServerDbUninstall === true) {
183
186
  shellExec(`node ${underpostRoot}/bin/deploy ${dbProviderId} uninstall`);
187
+ return;
184
188
  }
185
189
 
186
190
  // Set debootstrap architecture.
@@ -941,8 +945,8 @@ EOF`);
941
945
  getHostArch() {
942
946
  // `uname -m` returns e.g. 'x86_64' or 'aarch64'
943
947
  const machine = shellExec('uname -m', { stdout: true }).trim();
944
- if (machine === 'x86_64') return 'amd64';
945
- if (machine === 'aarch64') return 'arm64';
948
+ if (machine === 'x86_64') return { alias: 'amd64', name: 'x86_64' };
949
+ if (machine === 'aarch64') return { alias: 'arm64', name: 'aarch64' };
946
950
  throw new Error(`Unsupported host architecture: ${machine}`);
947
951
  },
948
952