underpost 2.89.37 → 2.89.44

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.
Files changed (42) hide show
  1. package/README.md +3 -2
  2. package/bin/deploy.js +22 -15
  3. package/cli.md +22 -2
  4. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  5. package/manifests/deployment/dd-test-development/deployment.yaml +6 -2
  6. package/manifests/deployment/dd-test-development/proxy.yaml +2 -0
  7. package/manifests/deployment/kafka/deployment.yaml +0 -2
  8. package/manifests/deployment/spark/spark-pi-py.yaml +0 -1
  9. package/manifests/deployment/tensorflow/tf-gpu-test.yaml +0 -2
  10. package/manifests/envoy-service-nodeport.yaml +0 -1
  11. package/manifests/kubeadm-calico-config.yaml +10 -115
  12. package/manifests/letsencrypt-prod.yaml +0 -1
  13. package/manifests/mariadb/statefulset.yaml +1 -1
  14. package/manifests/mongodb/statefulset.yaml +11 -11
  15. package/manifests/mongodb-4.4/service-deployment.yaml +1 -3
  16. package/manifests/mysql/pv-pvc.yaml +1 -1
  17. package/manifests/mysql/statefulset.yaml +1 -1
  18. package/manifests/valkey/service.yaml +0 -1
  19. package/manifests/valkey/statefulset.yaml +2 -3
  20. package/package.json +1 -1
  21. package/scripts/device-scan.sh +43 -21
  22. package/scripts/rpmfusion-ffmpeg-setup.sh +1 -0
  23. package/src/cli/cluster.js +51 -26
  24. package/src/cli/deploy.js +52 -28
  25. package/src/cli/index.js +22 -1
  26. package/src/cli/monitor.js +9 -5
  27. package/src/cli/repository.js +1 -1
  28. package/src/cli/run.js +30 -18
  29. package/src/client/components/core/Logger.js +1 -1
  30. package/src/client/components/core/Modal.js +5 -0
  31. package/src/client/components/core/ObjectLayerEngineModal.js +334 -71
  32. package/src/client/components/core/ObjectLayerEngineViewer.js +170 -403
  33. package/src/client/components/core/Router.js +10 -1
  34. package/src/client/services/default/default.management.js +25 -5
  35. package/src/index.js +1 -1
  36. package/src/server/client-build.js +5 -4
  37. package/src/server/conf.js +1 -1
  38. package/manifests/kubelet-config.yaml +0 -65
  39. package/manifests/mongodb/backup-access.yaml +0 -16
  40. package/manifests/mongodb/backup-cronjob.yaml +0 -42
  41. package/manifests/mongodb/backup-pv-pvc.yaml +0 -22
  42. package/manifests/mongodb/configmap.yaml +0 -26
package/src/cli/run.js CHANGED
@@ -81,7 +81,7 @@ class UnderpostRun {
81
81
  volumeMountPath: '',
82
82
  imageName: '',
83
83
  containerName: '',
84
- namespace: '',
84
+ namespace: 'default',
85
85
  build: false,
86
86
  replicas: 1,
87
87
  k3s: false,
@@ -209,10 +209,10 @@ class UnderpostRun {
209
209
  * @memberof UnderpostRun
210
210
  */
211
211
  'tf-gpu-test': (path, options = UnderpostRun.DEFAULT_OPTION) => {
212
- const { underpostRoot } = options;
213
- shellExec(`kubectl delete configmap tf-gpu-test-script`);
214
- shellExec(`kubectl delete pod tf-gpu-test-pod`);
215
- shellExec(`kubectl apply -f ${underpostRoot}/manifests/deployment/tensorflow/tf-gpu-test.yaml`);
212
+ const { underpostRoot, namespace } = options;
213
+ shellExec(`kubectl delete configmap tf-gpu-test-script -n ${namespace} --ignore-not-found`);
214
+ shellExec(`kubectl delete pod tf-gpu-test-pod -n ${namespace} --ignore-not-found`);
215
+ shellExec(`kubectl apply -f ${underpostRoot}/manifests/deployment/tensorflow/tf-gpu-test.yaml -n ${namespace}`);
216
216
  },
217
217
  /**
218
218
  * @method dev-cluster
@@ -510,11 +510,13 @@ class UnderpostRun {
510
510
  shellExec(
511
511
  `${baseCommand} deploy --kubeadm --build-manifest --sync --info-router --replicas ${
512
512
  replicas ? replicas : 1
513
- } --node ${node}${image ? ` --image ${image}` : ''}${versions ? ` --versions ${versions}` : ''} dd ${env}`,
513
+ } --node ${node}${image ? ` --image ${image}` : ''}${versions ? ` --versions ${versions}` : ''}${options.namespace ? ` --namespace ${options.namespace}` : ''} dd ${env}`,
514
514
  );
515
515
 
516
516
  if (isDeployRunnerContext(path, options)) {
517
- shellExec(`${baseCommand} deploy --kubeadm --disable-update-proxy ${deployId} ${env} --versions ${versions}`);
517
+ shellExec(
518
+ `${baseCommand} deploy --kubeadm --disable-update-proxy ${deployId} ${env} --versions ${versions}${options.namespace ? ` --namespace ${options.namespace}` : ''}`,
519
+ );
518
520
  if (!targetTraffic) targetTraffic = UnderpostDeploy.API.getCurrentTraffic(deployId);
519
521
  await UnderpostDeploy.API.monitorReadyRunner(deployId, env, targetTraffic);
520
522
  UnderpostDeploy.API.switchTraffic(deployId, env, targetTraffic);
@@ -619,7 +621,7 @@ class UnderpostRun {
619
621
  `docker exec -i kind-worker bash -c "chown -R 1000:1000 ${volumeHostPath} || true; chmod -R 755 ${volumeHostPath}"`,
620
622
  );
621
623
  } else {
622
- shellExec(`kubectl apply -f ${options.underpostRoot}/manifests/pv-pvc-dd.yaml`);
624
+ shellExec(`kubectl apply -f ${options.underpostRoot}/manifests/pv-pvc-dd.yaml -n ${options.namespace}`);
623
625
  }
624
626
 
625
627
  if (!currentImage)
@@ -682,7 +684,7 @@ class UnderpostRun {
682
684
  switch (path) {
683
685
  case 'tf-vae-test':
684
686
  {
685
- const nameSpace = 'default';
687
+ const nameSpace = options.namespace || 'default';
686
688
  const podName = path;
687
689
  const basePath = '/home/dd';
688
690
  const scriptPath = '/site/en/tutorials/generative/cvae.py';
@@ -764,8 +766,8 @@ class UnderpostRun {
764
766
  // For kubeadm/k3s, ensure it's available for containerd
765
767
  shellExec(`sudo crictl pull ${image}`);
766
768
 
767
- shellExec(`kubectl delete deployment adminer`);
768
- shellExec(`kubectl apply -k ${underpostRoot}/manifests/deployment/adminer/.`);
769
+ shellExec(`kubectl delete deployment adminer -n ${options.namespace} --ignore-not-found`);
770
+ shellExec(`kubectl apply -k ${underpostRoot}/manifests/deployment/adminer/. -n ${options.namespace}`);
769
771
  const successInstance = await UnderpostTest.API.statusMonitor('adminer', 'Running', 'pods', 1000, 60 * 10);
770
772
 
771
773
  if (successInstance) {
@@ -922,7 +924,7 @@ class UnderpostRun {
922
924
  const env = 'production';
923
925
  const ignorePods = UnderpostDeploy.API.get(`${deployId}-${env}-${targetTraffic}`).map((p) => p.NAME);
924
926
 
925
- shellExec(`sudo kubectl rollout restart deployment/${deployId}-${env}-${targetTraffic}`);
927
+ shellExec(`sudo kubectl rollout restart deployment/${deployId}-${env}-${targetTraffic} -n ${options.namespace}`);
926
928
 
927
929
  await UnderpostDeploy.API.monitorReadyRunner(deployId, env, targetTraffic, ignorePods);
928
930
 
@@ -1043,9 +1045,9 @@ class UnderpostRun {
1043
1045
  );
1044
1046
  switch (serviceId) {
1045
1047
  case 'mongo-express-service': {
1046
- shellExec(`kubectl delete svc mongo-express-service --ignore-not-found`);
1047
- shellExec(`kubectl delete deployment mongo-express --ignore-not-found`);
1048
- shellExec(`kubectl apply -f manifests/deployment/mongo-express/deployment.yaml`);
1048
+ shellExec(`kubectl delete svc mongo-express-service -n ${options.namespace} --ignore-not-found`);
1049
+ shellExec(`kubectl delete deployment mongo-express -n ${options.namespace} --ignore-not-found`);
1050
+ shellExec(`kubectl apply -f manifests/deployment/mongo-express/deployment.yaml -n ${options.namespace}`);
1049
1051
  podToMonitor = 'mongo-express';
1050
1052
  break;
1051
1053
  }
@@ -1225,6 +1227,16 @@ class UnderpostRun {
1225
1227
  const imagePullPolicy = options.imagePullPolicy || 'IfNotPresent';
1226
1228
  const hostNetwork = options.hostNetwork ? options.hostNetwork : '';
1227
1229
  const apiVersion = options.apiVersion || 'v1';
1230
+ const labels = options.labels
1231
+ ? options.labels
1232
+ .split(',')
1233
+ .map((keyValue) => {
1234
+ const [key, value] = keyValue.split('=');
1235
+ return ` ${key}: ${value}
1236
+ `;
1237
+ })
1238
+ .join('')
1239
+ : ` app: ${podName}`;
1228
1240
  if (options.volumeType === 'dev') options.volumeType = 'FileOrCreate';
1229
1241
  const volumeType =
1230
1242
  options.volumeType || (enableVolumeMount && volumeHostPath && fs.statSync(volumeHostPath).isDirectory())
@@ -1240,7 +1252,7 @@ metadata:
1240
1252
  name: ${podName}
1241
1253
  namespace: ${namespace}
1242
1254
  labels:
1243
- app: ${podName}
1255
+ ${labels}
1244
1256
  spec:
1245
1257
  restartPolicy: ${restartPolicy}
1246
1258
  ${runtimeClassName ? ` runtimeClassName: ${runtimeClassName}` : ''}
@@ -1278,13 +1290,13 @@ ${
1278
1290
  : ''
1279
1291
  }
1280
1292
  EOF`;
1281
- shellExec(`kubectl delete pod ${podName} --ignore-not-found`);
1293
+ shellExec(`kubectl delete pod ${podName} -n ${namespace} --ignore-not-found`);
1282
1294
  console.log(cmd);
1283
1295
  shellExec(cmd, { disableLog: true });
1284
1296
  const successInstance = await UnderpostTest.API.statusMonitor(podName);
1285
1297
  if (successInstance) {
1286
1298
  options.on?.init ? await options.on.init() : null;
1287
- shellExec(`kubectl logs -f ${podName}`);
1299
+ shellExec(`kubectl logs -f ${podName} -n ${namespace}`);
1288
1300
  }
1289
1301
  },
1290
1302
  };
@@ -6,7 +6,7 @@ const loggerFactory = (meta, options = { trace: false }) => {
6
6
  const logger = {
7
7
  log: function (type, args) {
8
8
  if (!window.renderPayload.dev) return;
9
- if (options.trace === true) args.push(getCurrentTrace().split('Logger.js:23')[1]);
9
+ if (options.trace === true) args.push(getCurrentTrace().split('Logger.js')[1]);
10
10
  return console[type](`[${meta}] ${new Date().toISOString()} ${type}:`, ...args);
11
11
  },
12
12
  };
@@ -87,6 +87,7 @@ const Modal = {
87
87
  onExpandUiListener: {},
88
88
  onBarUiOpen: {},
89
89
  onBarUiClose: {},
90
+ onReloadModalListener: {},
90
91
  onHome: {},
91
92
  homeModals: options.homeModals ? options.homeModals : [],
92
93
  query: options.query ? `${window.location.search}` : undefined,
@@ -121,6 +122,7 @@ const Modal = {
121
122
  top = `${windowGetH() / 2 - height / 2}px`;
122
123
  left = `${windowGetW() / 2 - width / 2}px`;
123
124
  },
125
+ ...this.Data[idModal],
124
126
  };
125
127
 
126
128
  if (options && 'mode' in options) {
@@ -1387,6 +1389,9 @@ const Modal = {
1387
1389
  if (options.zIndexSync) this.zIndexSync({ idModal });
1388
1390
 
1389
1391
  if (s(`.${idModal}`)) {
1392
+ for (const event of Object.keys(Modal.Data[idModal].onReloadModalListener))
1393
+ await Modal.Data[idModal].onReloadModalListener[event]();
1394
+
1390
1395
  s(`.btn-maximize-${idModal}`).click();
1391
1396
  return;
1392
1397
  }