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 CHANGED
@@ -23,15 +23,17 @@ template
23
23
  <div align="center">
24
24
 
25
25
 
26
+
26
27
  <!-- badges -->
27
28
 
28
29
 
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
+ [![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.837)](https://socket.dev/npm/package/underpost/overview/2.8.837) [![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
 
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.836
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.836
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 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.
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> 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
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
 
@@ -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.836'
61
+ engine.version: '2.8.837'
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.836
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.836
103
+ image: localhost/rockylinux9-underpost:v2.8.837
104
104
  # resources:
105
105
  # requests:
106
106
  # memory: "124Ki"
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.836",
5
+ "version": "2.8.837",
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",
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 = { dev: false };
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
- 'single-job': async (path, options = UnderpostRun.DEFAULT_OPTION) => {
49
- const podName = 'single-job';
50
- const volumeName = 'single-job-volume';
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: default
90
+ namespace: ${namespace}
59
91
  spec:
60
92
  restartPolicy: Never
61
- runtimeClassName: nvidia
93
+ ${runtimeClassName ? ` runtimeClassName: ${runtimeClassName}` : ''}
62
94
  containers:
63
- - name: tensorflow-gpu-tester
64
- image: nvcr.io/nvidia/tensorflow:24.04-tf2-py3
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
- resources:
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
  ? `
package/src/index.js CHANGED
@@ -34,7 +34,7 @@ class Underpost {
34
34
  * @type {String}
35
35
  * @memberof Underpost
36
36
  */
37
- static version = 'v2.8.836';
37
+ static version = 'v2.8.837';
38
38
  /**
39
39
  * Repository cli API
40
40
  * @static