From 603a91db9e64fa62557459b298ef6ee56c99c158 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, 13 Jun 2024 17:22:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9Ejupyter=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=8A=B6=E6=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/platform/service/JupyterService.java | 2 +- .../platform/service/impl/JupyterServiceImpl.java | 11 ++++------- .../managementPlatform/ModelDependencyDaoMapper.xml | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/JupyterService.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/JupyterService.java index f1aeb2cf..09a7fc68 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/JupyterService.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/JupyterService.java @@ -12,7 +12,7 @@ public interface JupyterService { void mlflow(); - String runJupyterService(Integer id); + String runJupyterService(Integer id) throws Exception; String stopJupyterService(Integer id) throws Exception; 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 b3eb4bdf..c57b498a 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 @@ -76,13 +76,11 @@ public class JupyterServiceImpl implements JupyterService { } @Override - public String runJupyterService(Integer id) { + public String runJupyterService(Integer id) throws Exception { DevEnvironment devEnvironment = this.devEnvironmentDao.queryById(id); -// if(devEnvironment == null){ -// -// } - String envName = devEnvironment.getName(); - //TODO 设置环境变量 + if(devEnvironment == null){ + throw new Exception("开发环境配置不存在"); + } // 提取数据集,模型信息,得到数据集模型的path Map dataset = JacksonUtil.parseJSONStr2Map(devEnvironment.getDataset()); @@ -132,7 +130,6 @@ public class JupyterServiceImpl implements JupyterService { if(StringUtils.isEmpty(frameLogPathVo.getPath())){ return JupyterStatusVo; } - LoginUser loginUser = SecurityUtils.getLoginUser(); String podName = loginUser.getUsername().toLowerCase() + "-editor-pod"; diff --git a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ModelDependencyDaoMapper.xml b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ModelDependencyDaoMapper.xml index 939df96e..1275528f 100644 --- a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ModelDependencyDaoMapper.xml +++ b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ModelDependencyDaoMapper.xml @@ -321,7 +321,7 @@ state = #{state}, - where id = #{id} and state = 1 + where id = #{id}