From 53b59fd26f3624213e879fd56f8f1a82159d63e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E5=A4=A7=E9=94=90?= <1070211640@qq.com> Date: Thu, 18 Jul 2024 10:23:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=A8=A1=E5=9E=8B=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/platform/service/impl/JupyterServiceImpl.java | 9 ++++++--- .../java/com/ruoyi/platform/utils/AIM64EncoderUtil.java | 1 + .../main/java/com/ruoyi/platform/utils/MlflowUtil.java | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java index da967b22..538bbe4f 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java @@ -73,6 +73,7 @@ public class JupyterServiceImpl implements JupyterService { V1PersistentVolumeClaim pvc = k8sClientUtil.createPvc(namespace, pvcName, storage,storageClassName); Integer podPort = k8sClientUtil.createPod(podName, namespace, port, mountPath, pvc, image); return masterIp + ":" + podPort; + } @Override @@ -84,12 +85,13 @@ public class JupyterServiceImpl implements JupyterService { // 提取数据集,模型信息,得到数据集模型的path Map dataset = JacksonUtil.parseJSONStr2Map(devEnvironment.getDataset()); - String datasetPath = (String) dataset.get("path"); + String datasetPath = "argo-workflow" + dataset.get("path"); + Map model = JacksonUtil.parseJSONStr2Map(devEnvironment.getModel()); - String modelPath = (String) model.get("path"); + String modelPath = "argo-workflow" + model.get("path"); LoginUser loginUser = SecurityUtils.getLoginUser(); - //手动构造pod名称 + //构造pod名称 String podName = loginUser.getUsername().toLowerCase() +"-editor-pod" + "-" + id; String pvcName = loginUser.getUsername().toLowerCase() + "-editor-pvc"; //新建编辑器的pvc @@ -109,6 +111,7 @@ public class JupyterServiceImpl implements JupyterService { } + @Override public String stopJupyterService(Integer id) throws Exception { DevEnvironment devEnvironment = this.devEnvironmentDao.queryById(id); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/AIM64EncoderUtil.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/AIM64EncoderUtil.java index 31e2701c..29b97cc2 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/AIM64EncoderUtil.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/AIM64EncoderUtil.java @@ -104,5 +104,6 @@ public class AIM64EncoderUtil { String searchQuery = encode(map, false); // 返回查询字符串 return searchQuery; + } } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/MlflowUtil.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/MlflowUtil.java index 0745b1df..f3c9bbbd 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/MlflowUtil.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/MlflowUtil.java @@ -7,7 +7,8 @@ import org.springframework.stereotype.Component; import java.util.List; @Component -public class MlflowUtil { +public class +MlflowUtil { private static String trackingUri = "http://172.20.32.181:32005"; private MlflowClient client;