underpost 2.8.836 → 2.8.837
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/README.md +4 -2
- package/cli.md +21 -10
- package/docker-compose.yml +1 -1
- package/manifests/deployment/dd-template-development/deployment.yaml +2 -2
- package/package.json +1 -1
- package/src/cli/deploy.js +5 -0
- package/src/cli/index.js +5 -0
- package/src/cli/run.js +46 -10
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -23,15 +23,17 @@ template
|
|
|
23
23
|
<div align="center">
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
|
|
26
27
|
<!-- badges -->
|
|
27
28
|
|
|
28
29
|
|
|
29
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [](https://www.npmjs.com/package/underpost) [](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.8.837) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
<!-- end-badges -->
|
|
33
34
|
|
|
34
35
|
|
|
36
|
+
|
|
35
37
|
</div>
|
|
36
38
|
|
|
37
39
|
<div align="center">
|
|
@@ -76,7 +78,7 @@ Run dev client server
|
|
|
76
78
|
npm run dev
|
|
77
79
|
```
|
|
78
80
|
<!-- -->
|
|
79
|
-
## underpost ci/cd cli v2.8.
|
|
81
|
+
## underpost ci/cd cli v2.8.837
|
|
80
82
|
|
|
81
83
|
### Usage: `underpost [options] [command]`
|
|
82
84
|
```
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.8.
|
|
1
|
+
## underpost ci/cd cli v2.8.837
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -554,17 +554,28 @@ Options:
|
|
|
554
554
|
Runs a script from the specified path.
|
|
555
555
|
|
|
556
556
|
Arguments:
|
|
557
|
-
runner-id
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
557
|
+
runner-id The runner ID to run. Options:
|
|
558
|
+
spark-template, gpu-env, tf-gpu-test, ide,
|
|
559
|
+
tf-vae-test, deploy-job.
|
|
560
|
+
path The absolute or relative directory path
|
|
561
|
+
where the script is located.
|
|
561
562
|
|
|
562
563
|
Options:
|
|
563
|
-
--command <command-array>
|
|
564
|
-
--args <args-array>
|
|
565
|
-
--dev
|
|
566
|
-
|
|
567
|
-
-
|
|
564
|
+
--command <command-array> Array of commands to run.
|
|
565
|
+
--args <args-array> Array of arguments to pass to the command.
|
|
566
|
+
--dev Sets the development context environment
|
|
567
|
+
for the script.
|
|
568
|
+
--pod-name <pod-name> Optional: Specifies the pod name for test
|
|
569
|
+
execution.
|
|
570
|
+
--volume-name <volume-name> Optional: Specifies the volume name for
|
|
571
|
+
test execution.
|
|
572
|
+
--image-name <image-name> Optional: Specifies the image name for
|
|
573
|
+
test execution.
|
|
574
|
+
--container-name <container-name> Optional: Specifies the container name for
|
|
575
|
+
test execution.
|
|
576
|
+
--namespace <namespace> Optional: Specifies the namespace for test
|
|
577
|
+
execution.
|
|
578
|
+
-h, --help display help for command
|
|
568
579
|
|
|
569
580
|
```
|
|
570
581
|
|
package/docker-compose.yml
CHANGED
|
@@ -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.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.8.837
|
|
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.
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.8.837
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
package/package.json
CHANGED
package/src/cli/deploy.js
CHANGED
|
@@ -296,6 +296,11 @@ kind: StatefulSet
|
|
|
296
296
|
metadata:
|
|
297
297
|
name: ...
|
|
298
298
|
EOF
|
|
299
|
+
|
|
300
|
+
https://org.ngc.nvidia.com/setup/api-keys
|
|
301
|
+
docker login nvcr.io
|
|
302
|
+
Username: $oauthtoken
|
|
303
|
+
Password: <Your Key>
|
|
299
304
|
`);
|
|
300
305
|
if (deployList === 'dd' && fs.existsSync(`./engine-private/deploy/dd.router`))
|
|
301
306
|
deployList = fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8');
|
package/src/cli/index.js
CHANGED
|
@@ -323,6 +323,11 @@ program
|
|
|
323
323
|
.option('--command <command-array>', 'Array of commands to run.')
|
|
324
324
|
.option('--args <args-array>', 'Array of arguments to pass to the command.')
|
|
325
325
|
.option('--dev', 'Sets the development context environment for the script.')
|
|
326
|
+
.option('--pod-name <pod-name>', 'Optional: Specifies the pod name for test execution.')
|
|
327
|
+
.option('--volume-name <volume-name>', 'Optional: Specifies the volume name for test execution.')
|
|
328
|
+
.option('--image-name <image-name>', 'Optional: Specifies the image name for test execution.')
|
|
329
|
+
.option('--container-name <container-name>', 'Optional: Specifies the container name for test execution.')
|
|
330
|
+
.option('--namespace <namespace>', 'Optional: Specifies the namespace for test execution.')
|
|
326
331
|
.description('Runs a script from the specified path.')
|
|
327
332
|
.action(UnderpostRun.API.callback);
|
|
328
333
|
|
package/src/cli/run.js
CHANGED
|
@@ -8,7 +8,14 @@ import fs from 'fs-extra';
|
|
|
8
8
|
const logger = loggerFactory(import.meta);
|
|
9
9
|
|
|
10
10
|
class UnderpostRun {
|
|
11
|
-
static DEFAULT_OPTION = {
|
|
11
|
+
static DEFAULT_OPTION = {
|
|
12
|
+
dev: false,
|
|
13
|
+
podName: '',
|
|
14
|
+
volumeName: '',
|
|
15
|
+
imageName: '',
|
|
16
|
+
containerName: '',
|
|
17
|
+
namespace: '',
|
|
18
|
+
};
|
|
12
19
|
static RUNNERS = {
|
|
13
20
|
'spark-template': (path, options = UnderpostRun.DEFAULT_OPTION) => {
|
|
14
21
|
const dir = '/home/dd/spark-template';
|
|
@@ -45,23 +52,48 @@ class UnderpostRun {
|
|
|
45
52
|
const { underpostRoot } = options;
|
|
46
53
|
shellExec(`node ${underpostRoot}/bin/vs ${path}`);
|
|
47
54
|
},
|
|
48
|
-
'
|
|
49
|
-
const
|
|
50
|
-
|
|
55
|
+
'tf-vae-test': async (path, options = UnderpostRun.DEFAULT_OPTION) => {
|
|
56
|
+
const { underpostRoot } = options;
|
|
57
|
+
await UnderpostRun.RUNNERS['deploy-job']('', {
|
|
58
|
+
args: [
|
|
59
|
+
`pip install --upgrade \
|
|
60
|
+
nbconvert \
|
|
61
|
+
tensorflow-probability==0.23.0 \
|
|
62
|
+
imageio \
|
|
63
|
+
git+https://github.com/tensorflow/docs \
|
|
64
|
+
matplotlib \
|
|
65
|
+
"numpy<1.25,>=1.21"`,
|
|
66
|
+
'mkdir -p /home/dd',
|
|
67
|
+
'cd /home/dd',
|
|
68
|
+
'git clone https://github.com/tensorflow/docs.git',
|
|
69
|
+
'cd docs',
|
|
70
|
+
'jupyter nbconvert --to python site/en/tutorials/generative/cvae.ipynb',
|
|
71
|
+
'ipython site/en/tutorials/generative/cvae.py',
|
|
72
|
+
],
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
'deploy-job': async (path, options = UnderpostRun.DEFAULT_OPTION) => {
|
|
76
|
+
const podName = options.podName || 'deploy-job';
|
|
77
|
+
const volumeName = options.volumeName || `${podName}-volume`;
|
|
51
78
|
const args = (options.args ? options.args : path ? [`python ${path}`] : []).filter((c) => c.trim());
|
|
79
|
+
const imageName = options.imageName || 'nvcr.io/nvidia/tensorflow:24.04-tf2-py3';
|
|
80
|
+
const containerName = options.containerName || `${podName}-container`;
|
|
81
|
+
const gpuEnable = imageName.match('nvidia');
|
|
82
|
+
const runtimeClassName = gpuEnable ? 'nvidia' : '';
|
|
83
|
+
const namespace = options.namespace || 'default';
|
|
52
84
|
|
|
53
85
|
const cmd = `kubectl apply -f - <<EOF
|
|
54
86
|
apiVersion: v1
|
|
55
87
|
kind: Pod
|
|
56
88
|
metadata:
|
|
57
89
|
name: ${podName}
|
|
58
|
-
namespace:
|
|
90
|
+
namespace: ${namespace}
|
|
59
91
|
spec:
|
|
60
92
|
restartPolicy: Never
|
|
61
|
-
runtimeClassName:
|
|
93
|
+
${runtimeClassName ? ` runtimeClassName: ${runtimeClassName}` : ''}
|
|
62
94
|
containers:
|
|
63
|
-
- name:
|
|
64
|
-
image:
|
|
95
|
+
- name: ${containerName}
|
|
96
|
+
image: ${imageName}
|
|
65
97
|
imagePullPolicy: IfNotPresent
|
|
66
98
|
tty: true
|
|
67
99
|
stdin: true
|
|
@@ -73,12 +105,16 @@ ${
|
|
|
73
105
|
${args.map((arg) => ` ${arg}`).join('\n')}`
|
|
74
106
|
: ''
|
|
75
107
|
}
|
|
76
|
-
|
|
108
|
+
${
|
|
109
|
+
gpuEnable
|
|
110
|
+
? ` resources:
|
|
77
111
|
limits:
|
|
78
112
|
nvidia.com/gpu: '1'
|
|
79
113
|
env:
|
|
80
114
|
- name: NVIDIA_VISIBLE_DEVICES
|
|
81
|
-
value: all
|
|
115
|
+
value: all`
|
|
116
|
+
: ''
|
|
117
|
+
}
|
|
82
118
|
${
|
|
83
119
|
path
|
|
84
120
|
? `
|