underpost 2.8.75 → 2.8.77
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 +2 -2
- package/bin/deploy.js +1 -1
- package/cli.md +6 -2
- package/docker-compose.yml +1 -1
- package/manifests/deployment/spark/spark-pi-py.yaml +2 -2
- package/package.json +1 -1
- package/src/cli/deploy.js +2 -2
- package/src/cli/index.js +4 -0
- package/src/cli/repository.js +9 -6
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ Run dev client server
|
|
|
68
68
|
npm run dev
|
|
69
69
|
```
|
|
70
70
|
<!-- -->
|
|
71
|
-
## underpost ci/cd cli v2.8.
|
|
71
|
+
## underpost ci/cd cli v2.8.77
|
|
72
72
|
|
|
73
73
|
### Usage: `underpost [options] [command]`
|
|
74
74
|
```
|
|
@@ -80,7 +80,7 @@ Commands:
|
|
|
80
80
|
new <app-name> Create a new project
|
|
81
81
|
start [options] <deploy-id> [env] Start up server, build pipelines, or services
|
|
82
82
|
clone [options] <uri> Clone github repository
|
|
83
|
-
pull <path> <uri>
|
|
83
|
+
pull [options] <path> <uri> Pull github repository
|
|
84
84
|
cmt [options] <path> <commit-type> [module-tag] [message] Commit github repository
|
|
85
85
|
push [options] <path> <uri> Push github repository
|
|
86
86
|
env <deploy-id> [env] Set environment variables files and conf related to <deploy-id>
|
package/bin/deploy.js
CHANGED
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.8.
|
|
1
|
+
## underpost ci/cd cli v2.8.77
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -10,7 +10,7 @@ Commands:
|
|
|
10
10
|
new <app-name> Create a new project
|
|
11
11
|
start [options] <deploy-id> [env] Start up server, build pipelines, or services
|
|
12
12
|
clone [options] <uri> Clone github repository
|
|
13
|
-
pull <path> <uri>
|
|
13
|
+
pull [options] <path> <uri> Pull github repository
|
|
14
14
|
cmt [options] <path> <commit-type> [module-tag] [message] Commit github repository
|
|
15
15
|
push [options] <path> <uri> Push github repository
|
|
16
16
|
env <deploy-id> [env] Set environment variables files and conf related to <deploy-id>
|
|
@@ -79,6 +79,7 @@ Arguments:
|
|
|
79
79
|
|
|
80
80
|
Options:
|
|
81
81
|
--bare Clone only .git files
|
|
82
|
+
-g8 Use g8 repo extension
|
|
82
83
|
-h, --help display help for command
|
|
83
84
|
|
|
84
85
|
```
|
|
@@ -95,6 +96,7 @@ Arguments:
|
|
|
95
96
|
uri e.g. username/repository
|
|
96
97
|
|
|
97
98
|
Options:
|
|
99
|
+
-g8 Use g8 repo extension
|
|
98
100
|
-h, --help display help for command
|
|
99
101
|
|
|
100
102
|
```
|
|
@@ -134,6 +136,7 @@ Arguments:
|
|
|
134
136
|
|
|
135
137
|
Options:
|
|
136
138
|
-f Force push overwriting repository
|
|
139
|
+
-g8 Use g8 repo extension
|
|
137
140
|
-h, --help display help for command
|
|
138
141
|
|
|
139
142
|
```
|
|
@@ -246,6 +249,7 @@ Options:
|
|
|
246
249
|
--disable-update-deployment Disable update deployments
|
|
247
250
|
--info-traffic get traffic conf form current resources
|
|
248
251
|
deployments
|
|
252
|
+
--kubeadm Enable kubeadm context
|
|
249
253
|
--rebuild-clients-bundle Inside container, rebuild clients bundle,
|
|
250
254
|
only static public or storage client files
|
|
251
255
|
-h, --help display help for command
|
package/docker-compose.yml
CHANGED
|
@@ -7,10 +7,10 @@ spec:
|
|
|
7
7
|
type: Python
|
|
8
8
|
pythonVersion: '3'
|
|
9
9
|
mode: cluster
|
|
10
|
-
image: spark:3.5.
|
|
10
|
+
image: spark:3.5.5
|
|
11
11
|
imagePullPolicy: IfNotPresent
|
|
12
12
|
mainApplicationFile: local:///opt/spark/examples/src/main/python/pi.py
|
|
13
|
-
sparkVersion: 3.5.
|
|
13
|
+
sparkVersion: 3.5.5
|
|
14
14
|
driver:
|
|
15
15
|
cores: 1
|
|
16
16
|
memory: 512m
|
package/package.json
CHANGED
package/src/cli/deploy.js
CHANGED
|
@@ -21,13 +21,13 @@ const logger = loggerFactory(import.meta);
|
|
|
21
21
|
class UnderpostDeploy {
|
|
22
22
|
static NETWORK = {};
|
|
23
23
|
static API = {
|
|
24
|
-
sync(deployList, { versions, replicas }) {
|
|
24
|
+
sync(deployList, { versions, replicas, kubeadm = false }) {
|
|
25
25
|
const deployGroupId = 'dd.router';
|
|
26
26
|
fs.writeFileSync(`./engine-private/deploy/${deployGroupId}`, deployList, 'utf8');
|
|
27
27
|
const totalPods = deployList.split(',').length * versions.split(',').length * parseInt(replicas);
|
|
28
28
|
const limitFactor = 0.8;
|
|
29
29
|
const reserveFactor = 0.05;
|
|
30
|
-
const resources = UnderpostCluster.API.getResourcesCapacity();
|
|
30
|
+
const resources = UnderpostCluster.API.getResourcesCapacity(kubeadm);
|
|
31
31
|
const memory = parseInt(resources.memory.value / totalPods);
|
|
32
32
|
const cpu = parseInt(resources.cpu.value / totalPods);
|
|
33
33
|
UnderpostRootEnv.API.set(
|
package/src/cli/index.js
CHANGED
|
@@ -34,6 +34,7 @@ program
|
|
|
34
34
|
.command('clone')
|
|
35
35
|
.argument(`<uri>`, 'e.g. username/repository')
|
|
36
36
|
.option('--bare', 'Clone only .git files')
|
|
37
|
+
.option('-g8', 'Use g8 repo extension')
|
|
37
38
|
.description('Clone github repository')
|
|
38
39
|
.action(Underpost.repo.clone);
|
|
39
40
|
|
|
@@ -42,6 +43,7 @@ program
|
|
|
42
43
|
.argument('<path>', 'Absolute or relative directory')
|
|
43
44
|
.argument(`<uri>`, 'e.g. username/repository')
|
|
44
45
|
.description('Pull github repository')
|
|
46
|
+
.option('-g8', 'Use g8 repo extension')
|
|
45
47
|
.action(Underpost.repo.pull);
|
|
46
48
|
|
|
47
49
|
program
|
|
@@ -61,6 +63,7 @@ program
|
|
|
61
63
|
.argument('<path>', 'Absolute or relative directory')
|
|
62
64
|
.argument(`<uri>`, 'e.g. username/repository')
|
|
63
65
|
.option('-f', 'Force push overwriting repository')
|
|
66
|
+
.option('-g8', 'Use g8 repo extension')
|
|
64
67
|
.description('Push github repository')
|
|
65
68
|
.action(Underpost.repo.push);
|
|
66
69
|
|
|
@@ -126,6 +129,7 @@ program
|
|
|
126
129
|
.option('--traffic <traffic-versions>', 'Comma separated custom deployment traffic')
|
|
127
130
|
.option('--disable-update-deployment', 'Disable update deployments')
|
|
128
131
|
.option('--info-traffic', 'get traffic conf form current resources deployments')
|
|
132
|
+
.option('--kubeadm', 'Enable kubeadm context')
|
|
129
133
|
.option(
|
|
130
134
|
'--rebuild-clients-bundle',
|
|
131
135
|
'Inside container, rebuild clients bundle, only static public or storage client files',
|
package/src/cli/repository.js
CHANGED
|
@@ -12,23 +12,25 @@ const logger = loggerFactory(import.meta);
|
|
|
12
12
|
|
|
13
13
|
class UnderpostRepository {
|
|
14
14
|
static API = {
|
|
15
|
-
clone(gitUri = 'underpostnet/pwa-microservices-template', options = { bare: false }) {
|
|
15
|
+
clone(gitUri = 'underpostnet/pwa-microservices-template', options = { bare: false, g8: false }) {
|
|
16
|
+
const gExtension = options.g8 === true ? '.g8' : '.git';
|
|
16
17
|
const repoName = gitUri.split('/').pop();
|
|
17
18
|
if (fs.existsSync(`./${repoName}`)) fs.removeSync(`./${repoName}`);
|
|
18
19
|
shellExec(
|
|
19
20
|
`git clone ${options?.bare === true ? ` --bare ` : ''}https://${
|
|
20
21
|
process.env.GITHUB_TOKEN ? `${process.env.GITHUB_TOKEN}@` : ''
|
|
21
|
-
}github.com/${gitUri}
|
|
22
|
+
}github.com/${gitUri}${gExtension}`,
|
|
22
23
|
{
|
|
23
24
|
disableLog: true,
|
|
24
25
|
},
|
|
25
26
|
);
|
|
26
27
|
},
|
|
27
|
-
pull(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template') {
|
|
28
|
+
pull(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template', options = { g8: false }) {
|
|
29
|
+
const gExtension = options.g8 === true ? '.g8' : '.git';
|
|
28
30
|
shellExec(
|
|
29
31
|
`cd ${repoPath} && git pull https://${
|
|
30
32
|
process.env.GITHUB_TOKEN ? `${process.env.GITHUB_TOKEN}@` : ''
|
|
31
|
-
}github.com/${gitUri}
|
|
33
|
+
}github.com/${gitUri}${gExtension}`,
|
|
32
34
|
{
|
|
33
35
|
disableLog: true,
|
|
34
36
|
},
|
|
@@ -57,9 +59,10 @@ class UnderpostRepository {
|
|
|
57
59
|
shellExec(`cd ${repoPath} && git commit ${options?.empty ? `--allow-empty ` : ''}-m "${_message}"`);
|
|
58
60
|
},
|
|
59
61
|
|
|
60
|
-
push(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template', options = { f: false }) {
|
|
62
|
+
push(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template', options = { f: false, g8: false }) {
|
|
63
|
+
const gExtension = options.g8 === true ? '.g8' : '.git';
|
|
61
64
|
shellExec(
|
|
62
|
-
`cd ${repoPath} && git push https://${process.env.GITHUB_TOKEN}@github.com/${gitUri}
|
|
65
|
+
`cd ${repoPath} && git push https://${process.env.GITHUB_TOKEN}@github.com/${gitUri}${gExtension}${
|
|
63
66
|
options?.f === true ? ' --force' : ''
|
|
64
67
|
}`,
|
|
65
68
|
{
|