underpost 2.8.7 → 2.8.8
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/.vscode/extensions.json +34 -2
- package/README.md +7 -5
- package/bin/db.js +1 -0
- package/bin/deploy.js +259 -74
- package/cli.md +88 -9
- package/conf.js +4 -0
- package/docker-compose.yml +1 -1
- package/manifests/deployment/adminer/service.yaml +1 -1
- package/manifests/deployment/dd-template-development/deployment.yaml +167 -0
- package/manifests/deployment/dd-template-development/proxy.yaml +46 -0
- package/manifests/deployment/fastapi/initial_data.sh +56 -0
- package/manifests/deployment/spark/spark-pi-py.yaml +21 -0
- package/manifests/envoy-service-nodeport.yaml +23 -0
- package/manifests/kubelet-config.yaml +65 -0
- package/manifests/lxd/lxd-admin-profile.yaml +17 -0
- package/manifests/lxd/lxd-preseed.yaml +30 -0
- package/manifests/lxd/underpost-setup.sh +163 -0
- package/manifests/maas/lxd-preseed.yaml +32 -0
- package/manifests/maas/maas-setup.sh +82 -0
- package/manifests/mariadb/statefulset.yaml +2 -1
- package/manifests/mariadb/storage-class.yaml +10 -0
- package/manifests/mongodb/kustomization.yaml +1 -1
- package/manifests/mongodb/statefulset.yaml +12 -11
- package/manifests/mongodb/storage-class.yaml +9 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +2 -2
- package/manifests/mysql/kustomization.yaml +7 -0
- package/manifests/mysql/pv-pvc.yaml +27 -0
- package/manifests/mysql/statefulset.yaml +55 -0
- package/manifests/postgresql/statefulset.yaml +1 -1
- package/manifests/valkey/service.yaml +3 -9
- package/manifests/valkey/statefulset.yaml +12 -15
- package/package.json +1 -1
- package/src/cli/baremetal.js +60 -0
- package/src/cli/cluster.js +506 -207
- package/src/cli/deploy.js +47 -14
- package/src/cli/env.js +2 -2
- package/src/cli/image.js +83 -9
- package/src/cli/index.js +68 -61
- package/src/cli/lxd.js +395 -0
- package/src/cli/repository.js +9 -6
- package/src/index.js +17 -1
- package/src/runtime/lampp/Dockerfile +1 -1
- package/src/server/conf.js +58 -0
- package/src/server/logger.js +3 -3
- package/src/server/runtime.js +1 -1
- package/src/server/valkey.js +3 -3
- package/manifests/calico-custom-resources.yaml +0 -25
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.8.
|
|
1
|
+
## underpost ci/cd cli v2.8.8
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -10,17 +10,17 @@ 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>
|
|
17
|
-
config <operator> [key] [value]
|
|
17
|
+
config [options] <operator> [key] [value] Manage configuration, operators
|
|
18
18
|
root Get npm root path
|
|
19
19
|
cluster [options] [pod-name] Manage cluster, for default initialization base kind cluster
|
|
20
|
-
deploy [options]
|
|
20
|
+
deploy [options] [deploy-list] [env] Manage deployment, for default deploy development pods
|
|
21
21
|
secret [options] <platform> Manage secrets
|
|
22
22
|
dockerfile-image-build [options] Build image from Dockerfile
|
|
23
|
-
dockerfile-pull-base-images
|
|
23
|
+
dockerfile-pull-base-images [options] Pull underpost dockerfile images requirements
|
|
24
24
|
install Fast import underpost npm dependencies
|
|
25
25
|
db [options] <deploy-list> Manage databases
|
|
26
26
|
script [options] <operator> <script-name> [script-value] Supports a number of built-in underpost global scripts and their preset life cycle events as well as arbitrary scripts
|
|
@@ -28,6 +28,8 @@ Commands:
|
|
|
28
28
|
fs [options] [path] File storage management, for default upload file
|
|
29
29
|
test [options] [deploy-list] Manage Test, for default run current underpost default test
|
|
30
30
|
monitor [options] <deploy-id> [env] Monitor health server management
|
|
31
|
+
lxd [options] Lxd management
|
|
32
|
+
baremetal [options] Baremetal management
|
|
31
33
|
help [command] display help for command
|
|
32
34
|
|
|
33
35
|
```
|
|
@@ -79,6 +81,7 @@ Arguments:
|
|
|
79
81
|
|
|
80
82
|
Options:
|
|
81
83
|
--bare Clone only .git files
|
|
84
|
+
-g8 Use g8 repo extension
|
|
82
85
|
-h, --help display help for command
|
|
83
86
|
|
|
84
87
|
```
|
|
@@ -95,6 +98,7 @@ Arguments:
|
|
|
95
98
|
uri e.g. username/repository
|
|
96
99
|
|
|
97
100
|
Options:
|
|
101
|
+
-g8 Use g8 repo extension
|
|
98
102
|
-h, --help display help for command
|
|
99
103
|
|
|
100
104
|
```
|
|
@@ -134,6 +138,7 @@ Arguments:
|
|
|
134
138
|
|
|
135
139
|
Options:
|
|
136
140
|
-f Force push overwriting repository
|
|
141
|
+
-g8 Use g8 repo extension
|
|
137
142
|
-h, --help display help for command
|
|
138
143
|
|
|
139
144
|
```
|
|
@@ -167,6 +172,7 @@ Arguments:
|
|
|
167
172
|
value Config value
|
|
168
173
|
|
|
169
174
|
Options:
|
|
175
|
+
--plain Print plain value
|
|
170
176
|
-h, --help display help for command
|
|
171
177
|
|
|
172
178
|
```
|
|
@@ -196,21 +202,29 @@ Arguments:
|
|
|
196
202
|
Options:
|
|
197
203
|
--reset Delete all clusters and prune all data and caches
|
|
198
204
|
--mariadb Init with mariadb statefulset
|
|
205
|
+
--mysql Init with mysql statefulset
|
|
199
206
|
--mongodb Init with mongodb statefulset
|
|
200
207
|
--postgresql Init with postgresql statefulset
|
|
201
208
|
--mongodb4 Init with mongodb 4.4 service
|
|
202
|
-
--istio Init base istio cluster
|
|
203
209
|
--valkey Init with valkey service
|
|
204
210
|
--contour Init with project contour base HTTPProxy and envoy
|
|
205
211
|
--cert-manager Init with letsencrypt-prod ClusterIssuer
|
|
212
|
+
--dedicated-gpu Init with dedicated gpu base resources env
|
|
206
213
|
--info Get all kinds objects deployed
|
|
207
214
|
--full Init with all statefulsets and services available
|
|
208
215
|
--ns-use <ns-name> Switches current context to namespace
|
|
216
|
+
--kubeadm Init with kubeadm controlplane management
|
|
209
217
|
--dev init with dev cluster
|
|
210
218
|
--list-pods Display list pods information
|
|
211
219
|
--info-capacity display current total machine capacity info
|
|
212
220
|
--info-capacity-pod display current machine capacity pod info
|
|
213
221
|
--pull-image Set optional pull associated image
|
|
222
|
+
--init-host Install k8s node necessary cli env: kind, kubeadm,
|
|
223
|
+
docker, podman, helm
|
|
224
|
+
--config Set k8s base node config
|
|
225
|
+
--worker Set worker node context
|
|
226
|
+
--chown Set k8s kube chown
|
|
227
|
+
--k3s Initialize the cluster using K3s
|
|
214
228
|
-h, --help display help for command
|
|
215
229
|
|
|
216
230
|
```
|
|
@@ -218,7 +232,7 @@ Options:
|
|
|
218
232
|
|
|
219
233
|
### `deploy` :
|
|
220
234
|
```
|
|
221
|
-
Usage: underpost deploy [options]
|
|
235
|
+
Usage: underpost deploy [options] [deploy-list] [env]
|
|
222
236
|
|
|
223
237
|
Manage deployment, for default deploy development pods
|
|
224
238
|
|
|
@@ -244,6 +258,8 @@ Options:
|
|
|
244
258
|
--disable-update-deployment Disable update deployments
|
|
245
259
|
--info-traffic get traffic conf form current resources
|
|
246
260
|
deployments
|
|
261
|
+
--kubeadm Enable kubeadm context
|
|
262
|
+
--restore-hosts Restore defautl etc hosts
|
|
247
263
|
--rebuild-clients-bundle Inside container, rebuild clients bundle,
|
|
248
264
|
only static public or storage client files
|
|
249
265
|
-h, --help display help for command
|
|
@@ -282,9 +298,11 @@ Options:
|
|
|
282
298
|
--dockerfile-name [dockerfile-name] set Dockerfile name
|
|
283
299
|
--podman-save Export tar file from podman
|
|
284
300
|
--kind-load Import tar image to Kind cluster
|
|
301
|
+
--kubeadm-load Import tar image to Kubeadm cluster
|
|
285
302
|
--secrets Dockerfile env secrets
|
|
286
303
|
--secrets-path [secrets-path] Dockerfile custom path env secrets
|
|
287
|
-
--
|
|
304
|
+
--reset Build without using cache
|
|
305
|
+
--k3s-load Load image into K3s cluster.
|
|
288
306
|
-h, --help display help for command
|
|
289
307
|
|
|
290
308
|
```
|
|
@@ -297,7 +315,12 @@ Options:
|
|
|
297
315
|
Pull underpost dockerfile images requirements
|
|
298
316
|
|
|
299
317
|
Options:
|
|
300
|
-
|
|
318
|
+
--path [path] Dockerfile path
|
|
319
|
+
--kind-load Import tar image to Kind cluster
|
|
320
|
+
--kubeadm-load Import tar image to Kubeadm cluster
|
|
321
|
+
--version Set custom version
|
|
322
|
+
--k3s-load Load image into K3s cluster.
|
|
323
|
+
-h, --help display help for command
|
|
301
324
|
|
|
302
325
|
```
|
|
303
326
|
|
|
@@ -448,4 +471,60 @@ Options:
|
|
|
448
471
|
-h, --help display help for command
|
|
449
472
|
|
|
450
473
|
```
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
### `lxd` :
|
|
477
|
+
```
|
|
478
|
+
Usage: underpost lxd [options]
|
|
479
|
+
|
|
480
|
+
Lxd management
|
|
481
|
+
|
|
482
|
+
Options:
|
|
483
|
+
--init Init lxd
|
|
484
|
+
--reset Reset lxd on current machine
|
|
485
|
+
--install Install lxd on current machine
|
|
486
|
+
--dev Set dev context env
|
|
487
|
+
--create-virtual-network Create lxd virtual network bridge
|
|
488
|
+
--create-admin-profile Create admin profile for lxd management
|
|
489
|
+
--control set control node vm context
|
|
490
|
+
--worker set worker node context
|
|
491
|
+
--create-vm <vm-id> Create default virtual machines
|
|
492
|
+
--init-vm <vm-id> Get init vm underpost script
|
|
493
|
+
--info-vm <vm-id> Get all info vm
|
|
494
|
+
--test <vm-id> Test health, status and network connectivity
|
|
495
|
+
for a VM
|
|
496
|
+
--root-size <gb-size> Set root size vm
|
|
497
|
+
--k3s Flag to indicate K3s cluster type for VM
|
|
498
|
+
initialization
|
|
499
|
+
--join-node <nodes> Comma separated worker and control node e.
|
|
500
|
+
g. k8s-worker-1,k8s-control
|
|
501
|
+
--expose <vm-name-ports> Vm name and : separated with Comma separated
|
|
502
|
+
vm port to expose e. g. k8s-control:80,443
|
|
503
|
+
--delete-expose <vm-name-ports> Vm name and : separated with Comma separated
|
|
504
|
+
vm port to remove expose e. g.
|
|
505
|
+
k8s-control:80,443
|
|
506
|
+
--auto-expose-k8s-ports <vm-id> Automatically expose common Kubernetes ports
|
|
507
|
+
for the VM.
|
|
508
|
+
-h, --help display help for command
|
|
509
|
+
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
### `baremetal` :
|
|
514
|
+
```
|
|
515
|
+
Usage: underpost baremetal [options]
|
|
516
|
+
|
|
517
|
+
Baremetal management
|
|
518
|
+
|
|
519
|
+
Options:
|
|
520
|
+
--control-server-install Install baremetal control server
|
|
521
|
+
--control-server-init-db Setup database baremetal control server
|
|
522
|
+
--control-server-init Init baremetal control server
|
|
523
|
+
--control-server-uninstall Uninstall baremetal control server
|
|
524
|
+
--control-server-stop Stop baremetal control server
|
|
525
|
+
--control-server-start Start baremetal control server
|
|
526
|
+
--dev Set dev context env
|
|
527
|
+
-h, --help display help for command
|
|
528
|
+
|
|
529
|
+
```
|
|
451
530
|
|
package/conf.js
CHANGED
package/docker-compose.yml
CHANGED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: Deployment
|
|
4
|
+
metadata:
|
|
5
|
+
name: dd-template-development-blue
|
|
6
|
+
labels:
|
|
7
|
+
app: dd-template-development-blue
|
|
8
|
+
spec:
|
|
9
|
+
replicas: 1
|
|
10
|
+
selector:
|
|
11
|
+
matchLabels:
|
|
12
|
+
app: dd-template-development-blue
|
|
13
|
+
template:
|
|
14
|
+
metadata:
|
|
15
|
+
labels:
|
|
16
|
+
app: dd-template-development-blue
|
|
17
|
+
spec:
|
|
18
|
+
containers:
|
|
19
|
+
- name: dd-template-development-blue
|
|
20
|
+
image: localhost/debian-underpost:v2.8.8
|
|
21
|
+
# resources:
|
|
22
|
+
# requests:
|
|
23
|
+
# memory: "124Ki"
|
|
24
|
+
# cpu: "100m"
|
|
25
|
+
# limits:
|
|
26
|
+
# memory: "1992Ki"
|
|
27
|
+
# cpu: "1600m"
|
|
28
|
+
command:
|
|
29
|
+
- /bin/sh
|
|
30
|
+
- -c
|
|
31
|
+
- >
|
|
32
|
+
npm install -g npm@11.2.0 &&
|
|
33
|
+
npm install -g underpost &&
|
|
34
|
+
cd $(underpost root)/underpost &&
|
|
35
|
+
node bin/deploy update-default-conf template &&
|
|
36
|
+
mkdir -p /home/dd &&
|
|
37
|
+
cd /home/dd &&
|
|
38
|
+
underpost new engine
|
|
39
|
+
---
|
|
40
|
+
apiVersion: v1
|
|
41
|
+
kind: Service
|
|
42
|
+
metadata:
|
|
43
|
+
name: dd-template-development-blue-service
|
|
44
|
+
spec:
|
|
45
|
+
selector:
|
|
46
|
+
app: dd-template-development-blue
|
|
47
|
+
ports:
|
|
48
|
+
- name: "tcp-4001"
|
|
49
|
+
protocol: TCP
|
|
50
|
+
port: 4001
|
|
51
|
+
targetPort: 4001
|
|
52
|
+
- name: "udp-4001"
|
|
53
|
+
protocol: UDP
|
|
54
|
+
port: 4001
|
|
55
|
+
targetPort: 4001
|
|
56
|
+
|
|
57
|
+
- name: "tcp-4002"
|
|
58
|
+
protocol: TCP
|
|
59
|
+
port: 4002
|
|
60
|
+
targetPort: 4002
|
|
61
|
+
- name: "udp-4002"
|
|
62
|
+
protocol: UDP
|
|
63
|
+
port: 4002
|
|
64
|
+
targetPort: 4002
|
|
65
|
+
|
|
66
|
+
- name: "tcp-4003"
|
|
67
|
+
protocol: TCP
|
|
68
|
+
port: 4003
|
|
69
|
+
targetPort: 4003
|
|
70
|
+
- name: "udp-4003"
|
|
71
|
+
protocol: UDP
|
|
72
|
+
port: 4003
|
|
73
|
+
targetPort: 4003
|
|
74
|
+
|
|
75
|
+
- name: "tcp-4004"
|
|
76
|
+
protocol: TCP
|
|
77
|
+
port: 4004
|
|
78
|
+
targetPort: 4004
|
|
79
|
+
- name: "udp-4004"
|
|
80
|
+
protocol: UDP
|
|
81
|
+
port: 4004
|
|
82
|
+
targetPort: 4004
|
|
83
|
+
type: LoadBalancer
|
|
84
|
+
---
|
|
85
|
+
apiVersion: apps/v1
|
|
86
|
+
kind: Deployment
|
|
87
|
+
metadata:
|
|
88
|
+
name: dd-template-development-green
|
|
89
|
+
labels:
|
|
90
|
+
app: dd-template-development-green
|
|
91
|
+
spec:
|
|
92
|
+
replicas: 1
|
|
93
|
+
selector:
|
|
94
|
+
matchLabels:
|
|
95
|
+
app: dd-template-development-green
|
|
96
|
+
template:
|
|
97
|
+
metadata:
|
|
98
|
+
labels:
|
|
99
|
+
app: dd-template-development-green
|
|
100
|
+
spec:
|
|
101
|
+
containers:
|
|
102
|
+
- name: dd-template-development-green
|
|
103
|
+
image: localhost/debian-underpost:v2.8.8
|
|
104
|
+
# resources:
|
|
105
|
+
# requests:
|
|
106
|
+
# memory: "124Ki"
|
|
107
|
+
# cpu: "100m"
|
|
108
|
+
# limits:
|
|
109
|
+
# memory: "1992Ki"
|
|
110
|
+
# cpu: "1600m"
|
|
111
|
+
command:
|
|
112
|
+
- /bin/sh
|
|
113
|
+
- -c
|
|
114
|
+
- >
|
|
115
|
+
npm install -g npm@11.2.0 &&
|
|
116
|
+
npm install -g underpost &&
|
|
117
|
+
cd $(underpost root)/underpost &&
|
|
118
|
+
node bin/deploy update-default-conf template &&
|
|
119
|
+
mkdir -p /home/dd &&
|
|
120
|
+
cd /home/dd &&
|
|
121
|
+
underpost new engine
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
apiVersion: v1
|
|
125
|
+
kind: Service
|
|
126
|
+
metadata:
|
|
127
|
+
name: dd-template-development-green-service
|
|
128
|
+
spec:
|
|
129
|
+
selector:
|
|
130
|
+
app: dd-template-development-green
|
|
131
|
+
ports:
|
|
132
|
+
- name: "tcp-4001"
|
|
133
|
+
protocol: TCP
|
|
134
|
+
port: 4001
|
|
135
|
+
targetPort: 4001
|
|
136
|
+
- name: "udp-4001"
|
|
137
|
+
protocol: UDP
|
|
138
|
+
port: 4001
|
|
139
|
+
targetPort: 4001
|
|
140
|
+
|
|
141
|
+
- name: "tcp-4002"
|
|
142
|
+
protocol: TCP
|
|
143
|
+
port: 4002
|
|
144
|
+
targetPort: 4002
|
|
145
|
+
- name: "udp-4002"
|
|
146
|
+
protocol: UDP
|
|
147
|
+
port: 4002
|
|
148
|
+
targetPort: 4002
|
|
149
|
+
|
|
150
|
+
- name: "tcp-4003"
|
|
151
|
+
protocol: TCP
|
|
152
|
+
port: 4003
|
|
153
|
+
targetPort: 4003
|
|
154
|
+
- name: "udp-4003"
|
|
155
|
+
protocol: UDP
|
|
156
|
+
port: 4003
|
|
157
|
+
targetPort: 4003
|
|
158
|
+
|
|
159
|
+
- name: "tcp-4004"
|
|
160
|
+
protocol: TCP
|
|
161
|
+
port: 4004
|
|
162
|
+
targetPort: 4004
|
|
163
|
+
- name: "udp-4004"
|
|
164
|
+
protocol: UDP
|
|
165
|
+
port: 4004
|
|
166
|
+
targetPort: 4004
|
|
167
|
+
type: LoadBalancer
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# "http://default.net:4001/socket.io": "http://localhost:4001/socket.io",
|
|
2
|
+
# "http://default.net:4002/peer": "http://localhost:4002/peer",
|
|
3
|
+
# "http://default.net:4001/": "http://localhost:4001/",
|
|
4
|
+
# "http://www.default.net:4003/": "http://localhost:4003/"
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
apiVersion: projectcontour.io/v1
|
|
8
|
+
kind: HTTPProxy
|
|
9
|
+
metadata:
|
|
10
|
+
name: default.net
|
|
11
|
+
spec:
|
|
12
|
+
virtualhost:
|
|
13
|
+
fqdn: default.net
|
|
14
|
+
routes:
|
|
15
|
+
- conditions:
|
|
16
|
+
- prefix: /
|
|
17
|
+
enableWebsockets: true
|
|
18
|
+
services:
|
|
19
|
+
- name: dd-template-development-blue-service
|
|
20
|
+
port: 4001
|
|
21
|
+
weight: 100
|
|
22
|
+
|
|
23
|
+
- conditions:
|
|
24
|
+
- prefix: /peer
|
|
25
|
+
enableWebsockets: true
|
|
26
|
+
services:
|
|
27
|
+
- name: dd-template-development-blue-service
|
|
28
|
+
port: 4002
|
|
29
|
+
weight: 100
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
apiVersion: projectcontour.io/v1
|
|
33
|
+
kind: HTTPProxy
|
|
34
|
+
metadata:
|
|
35
|
+
name: www.default.net
|
|
36
|
+
spec:
|
|
37
|
+
virtualhost:
|
|
38
|
+
fqdn: www.default.net
|
|
39
|
+
routes:
|
|
40
|
+
- conditions:
|
|
41
|
+
- prefix: /
|
|
42
|
+
enableWebsockets: true
|
|
43
|
+
services:
|
|
44
|
+
- name: dd-template-development-blue-service
|
|
45
|
+
port: 4003
|
|
46
|
+
weight: 100
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# IMPORTANT: For non-interactive scripts, 'conda activate' can be problematic
|
|
4
|
+
# because it relies on the shell's initialization.
|
|
5
|
+
# A more robust and recommended way to run commands within a Conda environment
|
|
6
|
+
# from a script is to use 'conda run'. This command directly executes a process
|
|
7
|
+
# in the specified environment without needing to manually source 'conda.sh'.
|
|
8
|
+
|
|
9
|
+
# Navigate to the application's root directory for module discovery.
|
|
10
|
+
# This is crucial for Python to correctly find your 'app' module using 'python -m'.
|
|
11
|
+
#
|
|
12
|
+
# Let's assume a common project structure:
|
|
13
|
+
# full-stack-fastapi-template/
|
|
14
|
+
# ├── backend/
|
|
15
|
+
# │ ├── app/
|
|
16
|
+
# │ │ └── initial_data.py (the Python script you want to run)
|
|
17
|
+
# │ └── initial_data.sh (this shell script)
|
|
18
|
+
# └── ...
|
|
19
|
+
#
|
|
20
|
+
# If `initial_data.sh` is located in `full-stack-fastapi-template/backend/`,
|
|
21
|
+
# and `app` is a subdirectory of `backend/`, then the Python command
|
|
22
|
+
# `python -m app.initial_data` needs to be executed from the `backend/` directory.
|
|
23
|
+
#
|
|
24
|
+
# If you are running this shell script from a different directory (e.g., `engine/`),
|
|
25
|
+
# Python's module import system won't automatically find 'app' unless the parent
|
|
26
|
+
# directory of 'app' is in the `PYTHONPATH` or you change the current working directory.
|
|
27
|
+
#
|
|
28
|
+
# The safest way is to change the current working directory to the script's location.
|
|
29
|
+
|
|
30
|
+
# Store the current directory to return to it later if needed (good practice for multi-step scripts).
|
|
31
|
+
CURRENT_DIR=$(pwd)
|
|
32
|
+
|
|
33
|
+
# Get the absolute path of the directory where this script is located.
|
|
34
|
+
# This is a robust way to ensure we always navigate to the correct 'backend' directory.
|
|
35
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
|
36
|
+
cd "$SCRIPT_DIR"
|
|
37
|
+
|
|
38
|
+
# Execute your Python script within the specified Conda environment using 'conda run'.
|
|
39
|
+
# -n fastapi_env specifies the Conda environment to use.
|
|
40
|
+
# This completely avoids the 'source conda.sh' issue and is generally more reliable.
|
|
41
|
+
conda run -n fastapi_env python -m app.initial_data
|
|
42
|
+
|
|
43
|
+
# Important Note: The 'ModuleNotFoundError: No module named 'sqlmodel'' indicates that
|
|
44
|
+
# the 'sqlmodel' package is not installed in your 'fastapi_env' Conda environment.
|
|
45
|
+
# After running this script, if you still get the 'sqlmodel' error,
|
|
46
|
+
# you will need to activate your environment manually and install it:
|
|
47
|
+
#
|
|
48
|
+
# conda activate fastapi_env
|
|
49
|
+
# pip install sqlmodel
|
|
50
|
+
# # or if it's a conda package:
|
|
51
|
+
# # conda install sqlmodel
|
|
52
|
+
#
|
|
53
|
+
# Then try running this script again.
|
|
54
|
+
|
|
55
|
+
# Optional Good Practice: Return to the original directory if the script is part of a larger workflow.
|
|
56
|
+
cd "$CURRENT_DIR"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
apiVersion: sparkoperator.k8s.io/v1beta2
|
|
2
|
+
kind: SparkApplication
|
|
3
|
+
metadata:
|
|
4
|
+
name: spark-pi-python
|
|
5
|
+
namespace: default
|
|
6
|
+
spec:
|
|
7
|
+
type: Python
|
|
8
|
+
pythonVersion: '3'
|
|
9
|
+
mode: cluster
|
|
10
|
+
image: spark:3.5.5
|
|
11
|
+
imagePullPolicy: IfNotPresent
|
|
12
|
+
mainApplicationFile: local:///opt/spark/examples/src/main/python/pi.py
|
|
13
|
+
sparkVersion: 3.5.5
|
|
14
|
+
driver:
|
|
15
|
+
cores: 1
|
|
16
|
+
memory: 512m
|
|
17
|
+
serviceAccount: spark-operator-spark
|
|
18
|
+
executor:
|
|
19
|
+
instances: 1
|
|
20
|
+
cores: 1
|
|
21
|
+
memory: 512m
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: Service
|
|
3
|
+
metadata:
|
|
4
|
+
labels:
|
|
5
|
+
app: envoy
|
|
6
|
+
name: envoy
|
|
7
|
+
namespace: projectcontour
|
|
8
|
+
spec:
|
|
9
|
+
externalTrafficPolicy: Cluster
|
|
10
|
+
ports:
|
|
11
|
+
- name: http
|
|
12
|
+
nodePort: 30080
|
|
13
|
+
port: 80
|
|
14
|
+
protocol: TCP
|
|
15
|
+
targetPort: 8080
|
|
16
|
+
- name: https
|
|
17
|
+
nodePort: 30443
|
|
18
|
+
port: 443
|
|
19
|
+
protocol: TCP
|
|
20
|
+
targetPort: 8443
|
|
21
|
+
selector:
|
|
22
|
+
app: envoy
|
|
23
|
+
type: NodePort
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
data:
|
|
3
|
+
kubelet: |
|
|
4
|
+
apiVersion: kubelet.config.k8s.io/v1beta1
|
|
5
|
+
authentication:
|
|
6
|
+
anonymous:
|
|
7
|
+
enabled: false
|
|
8
|
+
webhook:
|
|
9
|
+
cacheTTL: 0s
|
|
10
|
+
enabled: true
|
|
11
|
+
x509:
|
|
12
|
+
clientCAFile: /etc/kubernetes/pki/ca.crt
|
|
13
|
+
authorization:
|
|
14
|
+
mode: Webhook
|
|
15
|
+
webhook:
|
|
16
|
+
cacheAuthorizedTTL: 0s
|
|
17
|
+
cacheUnauthorizedTTL: 0s
|
|
18
|
+
cgroupDriver: systemd
|
|
19
|
+
clusterDNS:
|
|
20
|
+
- 10.96.0.10
|
|
21
|
+
clusterDomain: cluster.local
|
|
22
|
+
containerRuntimeEndpoint: unix:///run/containerd/containerd.sock
|
|
23
|
+
cpuManagerReconcilePeriod: 0s
|
|
24
|
+
crashLoopBackOff: {}
|
|
25
|
+
evictionHard:
|
|
26
|
+
imagefs.available: "5%" # Adjusted for more tolerance
|
|
27
|
+
memory.available: "100Mi"
|
|
28
|
+
nodefs.available: "5%" # Adjusted for more tolerance
|
|
29
|
+
nodefs.inodesFree: "5%"
|
|
30
|
+
evictionPressureTransitionPeriod: 0s
|
|
31
|
+
fileCheckFrequency: 0s
|
|
32
|
+
healthzBindAddress: 127.0.0.1
|
|
33
|
+
healthzPort: 10248
|
|
34
|
+
httpCheckFrequency: 0s
|
|
35
|
+
imageMaximumGCAge: 0s
|
|
36
|
+
imageMinimumGCAge: 0s
|
|
37
|
+
kind: KubeletConfiguration
|
|
38
|
+
logging:
|
|
39
|
+
flushFrequency: 0
|
|
40
|
+
options:
|
|
41
|
+
json:
|
|
42
|
+
infoBufferSize: "0"
|
|
43
|
+
text:
|
|
44
|
+
infoBufferSize: "0"
|
|
45
|
+
verbosity: 0
|
|
46
|
+
memorySwap: {}
|
|
47
|
+
nodeStatusReportFrequency: 0s
|
|
48
|
+
nodeStatusUpdateFrequency: 0s
|
|
49
|
+
rotateCertificates: true
|
|
50
|
+
runtimeRequestTimeout: 0s
|
|
51
|
+
shutdownGracePeriod: 0s
|
|
52
|
+
shutdownGracePeriodCriticalPods: 0s
|
|
53
|
+
staticPodPath: /etc/kubernetes/manifests
|
|
54
|
+
streamingConnectionIdleTimeout: 0s
|
|
55
|
+
syncFrequency: 0s
|
|
56
|
+
volumeStatsAggPeriod: 0s
|
|
57
|
+
kind: ConfigMap
|
|
58
|
+
metadata:
|
|
59
|
+
annotations:
|
|
60
|
+
kubeadm.kubernetes.io/component-config.hash: sha256:26488e9fc7c5cb5fdda9996cda2e6651a9af5febce07ea02de11bd3ef3f49e9c
|
|
61
|
+
creationTimestamp: "2025-06-30T12:42:00Z"
|
|
62
|
+
name: kubelet-config
|
|
63
|
+
namespace: kube-system
|
|
64
|
+
resourceVersion: "204"
|
|
65
|
+
uid: a85321a8-f3e0-40fa-8e4e-9d33b8842e7a
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
config:
|
|
2
|
+
limits.cpu: "2"
|
|
3
|
+
limits.memory: 4GB
|
|
4
|
+
description: vm nat network
|
|
5
|
+
devices:
|
|
6
|
+
eth0:
|
|
7
|
+
name: eth0
|
|
8
|
+
network: lxdbr0
|
|
9
|
+
type: nic
|
|
10
|
+
ipv4.address: 10.250.250.100
|
|
11
|
+
root:
|
|
12
|
+
path: /
|
|
13
|
+
pool: local # lxc storage list
|
|
14
|
+
size: 100GB
|
|
15
|
+
type: disk
|
|
16
|
+
name: admin-profile
|
|
17
|
+
used_by: []
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
config:
|
|
2
|
+
core.https_address: 127.0.0.1:8443
|
|
3
|
+
networks: []
|
|
4
|
+
storage_pools:
|
|
5
|
+
- config:
|
|
6
|
+
size: 100GiB
|
|
7
|
+
description: ""
|
|
8
|
+
name: local
|
|
9
|
+
driver: zfs
|
|
10
|
+
storage_volumes: []
|
|
11
|
+
profiles:
|
|
12
|
+
- config: {}
|
|
13
|
+
description: ""
|
|
14
|
+
devices:
|
|
15
|
+
root:
|
|
16
|
+
path: /
|
|
17
|
+
pool: local
|
|
18
|
+
type: disk
|
|
19
|
+
name: default
|
|
20
|
+
projects: []
|
|
21
|
+
cluster:
|
|
22
|
+
server_name: lxd-node1
|
|
23
|
+
enabled: true
|
|
24
|
+
member_config: []
|
|
25
|
+
cluster_address: ""
|
|
26
|
+
cluster_certificate: ""
|
|
27
|
+
server_address: ""
|
|
28
|
+
cluster_password: ""
|
|
29
|
+
cluster_token: ""
|
|
30
|
+
cluster_certificate_path: ""
|