From dd4be07a26ad1db10a0f5bdccd01f2045892dfa8 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Mon, 24 Mar 2025 11:00:23 +0800 Subject: [PATCH 01/20] =?UTF-8?q?chore:=20=E5=AE=89=E8=A3=85=20caniuse-lit?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/package.json | 1 + react-ui/src/components/ResourceSelect/index.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/react-ui/package.json b/react-ui/package.json index de0314c2..e4d95504 100644 --- a/react-ui/package.json +++ b/react-ui/package.json @@ -67,6 +67,7 @@ "@types/crypto-js": "^4.2.2", "@umijs/route-utils": "^4.0.1", "antd": "~5.21.4", + "caniuse-lite": "~1.0.30001707", "classnames": "^2.3.2", "crypto-js": "^4.2.0", "echarts": "^5.5.0", diff --git a/react-ui/src/components/ResourceSelect/index.tsx b/react-ui/src/components/ResourceSelect/index.tsx index a7e02ce3..ccec75f1 100644 --- a/react-ui/src/components/ResourceSelect/index.tsx +++ b/react-ui/src/components/ResourceSelect/index.tsx @@ -6,7 +6,7 @@ import KFIcon from '@/components/KFIcon'; import ResourceSelectorModal, { - ResourceSelectorResponse, + type ResourceSelectorResponse, ResourceSelectorType, selectorTypeConfig, } from '@/components/ResourceSelectorModal'; From 400108a4b8aed4107357c86e4f9096259918975e Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Mon, 24 Mar 2025 14:29:51 +0800 Subject: [PATCH 02/20] =?UTF-8?q?styles:=20=E5=B7=A5=E4=BD=9C=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/AutoML/components/ExperimentInstance/index.tsx | 2 +- .../pages/Workspace/components/TotalStatistics/index.less | 8 +++++++- react-ui/src/pages/Workspace/index.less | 8 ++++++-- react-ui/src/pages/Workspace/index.tsx | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/react-ui/src/pages/AutoML/components/ExperimentInstance/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentInstance/index.tsx index aded5f2a..e7837120 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentInstance/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentInstance/index.tsx @@ -107,7 +107,7 @@ function ExperimentInstanceComponent({ }; if (!experimentInsList || experimentInsList.length === 0) { - return
暂无实验实例
; + return
暂无数据
; } return ( diff --git a/react-ui/src/pages/Workspace/components/TotalStatistics/index.less b/react-ui/src/pages/Workspace/components/TotalStatistics/index.less index 0fdef0b0..34aa2a67 100644 --- a/react-ui/src/pages/Workspace/components/TotalStatistics/index.less +++ b/react-ui/src/pages/Workspace/components/TotalStatistics/index.less @@ -1,12 +1,18 @@ .total-statistics { display: flex; align-items: center; + justify-content: center; height: 140px; padding: 0 16px; + // 媒体查询 + @media screen and (max-width: 1600px) { + flex: 1 1 content; + } + &__icon { width: 63px; - margin-right: 15px; + margin-right: 16px; } &__title { diff --git a/react-ui/src/pages/Workspace/index.less b/react-ui/src/pages/Workspace/index.less index d498e652..59ea0a44 100644 --- a/react-ui/src/pages/Workspace/index.less +++ b/react-ui/src/pages/Workspace/index.less @@ -8,7 +8,6 @@ &__overview { flex: 1; gap: 15px; - margin-bottom: 16px; padding: 20px 30px; background-color: white; border-radius: 4px; @@ -22,7 +21,6 @@ &__content { display: flex; - flex-wrap: wrap; gap: 15px; align-items: center; @@ -35,6 +33,11 @@ rgba(22, 100, 255, 0.02) 58.35% ); border-radius: 4px; + + // 媒体查询 + @media screen and (max-width: 1600px) { + flex: 1 1 content; + } } } } @@ -44,6 +47,7 @@ gap: 15px; align-items: flex-start; width: 100%; + margin-top: 16px; } &__user { diff --git a/react-ui/src/pages/Workspace/index.tsx b/react-ui/src/pages/Workspace/index.tsx index efda7e70..b88f3d58 100644 --- a/react-ui/src/pages/Workspace/index.tsx +++ b/react-ui/src/pages/Workspace/index.tsx @@ -46,7 +46,7 @@ function Workspace() { return (
- +
运行概览
@@ -59,7 +59,7 @@ function Workspace() { Date: Mon, 24 Mar 2025 17:19:51 +0800 Subject: [PATCH 03/20] =?UTF-8?q?feat:=20=E5=AE=9E=E9=AA=8C=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E6=B7=BB=E5=8A=A0message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/public/fonts/font.css | 10 ---------- react-ui/src/components/IFramePage/index.tsx | 3 --- .../components/ExperimentDrawer/index.less | 1 - .../components/ExperimentDrawer/index.tsx | 14 +++++++++++++- react-ui/src/pages/Points/index.tsx | 5 +++++ react-ui/src/types.ts | 1 + 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/react-ui/public/fonts/font.css b/react-ui/public/fonts/font.css index 06af2fdb..012b9f59 100644 --- a/react-ui/public/fonts/font.css +++ b/react-ui/public/fonts/font.css @@ -4,16 +4,6 @@ font-display: swap; } -@font-face { - font-family: 'TaoBaoMaiCaiTi'; - src: url('./TaoBaoMaiCaiTi-Regular.woff2') format('woff2'), /* 最优先使用 woff2 */ - url('./TaoBaoMaiCaiTi-Regular.woff') format('woff'), /* 兼容性较好的 woff */ - url('./TaoBaoMaiCaiTi-Regular.ttf') format('truetype'), /* ttf 作为备选 */ - url('./TaoBaoMaiCaiTi-Regular.otf') format('opentype'); /* otf 作为最后选项 */ - font-display: swap; /* 优化页面加载时的字体显示 */ -} - - @font-face { font-family: 'DingTalk-JinBuTi'; src: url('./DingTalk-JinBuTi.woff2') format('woff2'), /* 最优先使用 woff2 */ diff --git a/react-ui/src/components/IFramePage/index.tsx b/react-ui/src/components/IFramePage/index.tsx index aa292d47..6a1ddbdc 100644 --- a/react-ui/src/components/IFramePage/index.tsx +++ b/react-ui/src/components/IFramePage/index.tsx @@ -48,12 +48,9 @@ function IframePage({ type, className, style }: IframePageProps) { useEffect(() => { const requestIframeUrl = async () => { - setLoading(true); const [res] = await to(getRequestAPI(type)()); if (res && res.data) { setIframeUrl(res.data); - } else { - setLoading(false); } }; diff --git a/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.less b/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.less index e524a987..4f45b3f8 100644 --- a/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.less +++ b/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.less @@ -13,7 +13,6 @@ } &__tabs { - height: calc(100% - 169px); :global { .ant-tabs-nav { padding-left: 24px; diff --git a/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.tsx b/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.tsx index c1a70141..8326ae8d 100644 --- a/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.tsx +++ b/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.tsx @@ -129,6 +129,11 @@ const ExperimentDrawer = ({ '--' )}
+ {instanceNodeData.message && ( +
+ 消息:{instanceNodeData.message ?? '--'} +
+ )}
启动时间:{formatDate(instanceNodeStartTime)}
@@ -137,7 +142,14 @@ const ExperimentDrawer = ({ {elapsedTime(instanceNodeStartTime, instanceNodeEndTime)}
- + ); }; diff --git a/react-ui/src/pages/Points/index.tsx b/react-ui/src/pages/Points/index.tsx index 20843820..0fa3a1d8 100644 --- a/react-ui/src/pages/Points/index.tsx +++ b/react-ui/src/pages/Points/index.tsx @@ -216,6 +216,11 @@ function PointsDetail() { label: '进行中', color: themes['primaryColor'], }, + { + value: 0, + label: '准备中', + color: themes['pendingColor'], + }, ]), }, ]; diff --git a/react-ui/src/types.ts b/react-ui/src/types.ts index f9d1734b..e3c219ee 100644 --- a/react-ui/src/types.ts +++ b/react-ui/src/types.ts @@ -71,6 +71,7 @@ export type PipelineNodeModel = { component_label: string; icon_path: string; workflowId?: string; + message?: string; }; // 流水线节点模型数据 From fde3be8dcdd1ea8b859e071d8a2eeafee1ec9312 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Tue, 25 Mar 2025 08:33:11 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/platform/service/impl/ServiceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ServiceServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ServiceServiceImpl.java index e8b25a2c..09941c67 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ServiceServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ServiceServiceImpl.java @@ -323,7 +323,7 @@ public class ServiceServiceImpl implements ServiceService { // 记录开始扣积分 if (reRun) { resourceOccupyService.startDeduce(serviceVersion.getComputingResourceId(), serviceVersion.getReplicas(), Constant.TaskType_Service, serviceVersion.getServiceId(), serviceVersion.getId(), null, service.getServiceName(), null, null); - } else if (Constant.Running.equals(serviceVersionById.getRunState())) { + } else if (Constant.Running.equals(serviceVersionById.getRunState()) || Constant.Pending.equals(serviceVersionById.getRunState())) { resourceOccupyService.update(Constant.TaskType_Service, serviceVersion.getServiceId(), serviceVersion.getId(), serviceVersion.getComputingResourceId(), serviceVersion.getReplicas()); } return "修改成功"; From e982a49a78c34b2620c4f3e69f03531abd8f7975 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Tue, 25 Mar 2025 08:44:10 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=97=B6=E5=85=88=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E8=A2=AB?= =?UTF-8?q?=E8=B6=85=E5=8F=82=E6=95=B0=E8=87=AA=E5=8A=A8=E5=AF=BB=E4=BC=98?= =?UTF-8?q?=E5=8D=A0=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/platform/mapper/RayDao.java | 8 +++++ .../service/impl/CodeConfigServiceImpl.java | 14 +++++++++ .../service/impl/ImageServiceImpl.java | 23 ++++++++------ .../service/impl/ImageVersionServiceImpl.java | 31 +++++++++++++------ .../service/impl/ModelsServiceImpl.java | 25 ++++++++++++--- .../service/impl/NewDatasetServiceImpl.java | 20 +++++++++--- .../managementPlatform/RayDaoMapper.xml | 28 +++++++++++++++++ 7 files changed, 120 insertions(+), 29 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/RayDao.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/RayDao.java index dad71b0f..d7dd4014 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/RayDao.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/RayDao.java @@ -18,4 +18,12 @@ public interface RayDao { int save(@Param("ray") Ray ray); int edit(@Param("ray") Ray ray); + + List queryByDatasetId(@Param("datasetId") String datasetId); + + List queryByModelId(@Param("modelId") String modelId); + + List queryByImageId(@Param("imageId") String imageId); + + List queryByCodeConfig(@Param("codeConfig") String codeConfig); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/CodeConfigServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/CodeConfigServiceImpl.java index 9e791c55..b27e9df6 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/CodeConfigServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/CodeConfigServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.platform.service.impl; +import com.alibaba.fastjson2.JSON; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.platform.constant.Constant; import com.ruoyi.platform.domain.AssetWorkflow; @@ -13,9 +14,12 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; +import com.ruoyi.platform.domain.Ray; +import com.ruoyi.platform.mapper.RayDao; import javax.annotation.Resource; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -26,6 +30,8 @@ public class CodeConfigServiceImpl implements CodeConfigService { private CodeConfigDao codeConfigDao; @Resource private AssetWorkflowDao assetWorkflowDao; + @Resource + private RayDao rayDao; @Override public Page queryByPage(CodeConfig codeConfig, PageRequest pageRequest) { @@ -88,6 +94,14 @@ public class CodeConfigServiceImpl implements CodeConfigService { throw new Exception("该代码配置被流水线:" + workflows + "使用,不能删除,请先删除流水线。"); } + HashMap map = new HashMap<>(); + map.put("code_path", codeConfig.getGitUrl()); + List rayList = rayDao.queryByCodeConfig(JSON.toJSONString(map)); + if (rayList != null && !rayList.isEmpty()) { + String rays = String.join(",", rayList.stream().map(Ray::getName).collect(Collectors.toSet())); + throw new Exception("该代码配置被超参数自动寻优:" + rays + "使用,不能删除,请先删除超参数自动寻优。"); + } + LoginUser loginUser = SecurityUtils.getLoginUser(); String username = loginUser.getUsername(); String createBy = codeConfig.getCreateBy(); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java index 3520c398..22b2ed75 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java @@ -1,16 +1,11 @@ package com.ruoyi.platform.service.impl; +import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.util.DateUtils; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.platform.constant.Constant; -import com.ruoyi.platform.domain.AssetWorkflow; -import com.ruoyi.platform.domain.DevEnvironment; -import com.ruoyi.platform.domain.Image; -import com.ruoyi.platform.domain.ImageVersion; -import com.ruoyi.platform.mapper.AssetWorkflowDao; -import com.ruoyi.platform.mapper.DevEnvironmentDao; -import com.ruoyi.platform.mapper.ImageDao; -import com.ruoyi.platform.mapper.ImageVersionDao; +import com.ruoyi.platform.domain.*; +import com.ruoyi.platform.mapper.*; import com.ruoyi.platform.service.ImageService; import com.ruoyi.platform.service.ImageVersionService; import com.ruoyi.platform.service.MinioService; @@ -53,10 +48,10 @@ public class ImageServiceImpl implements ImageService { private ImageVersionDao imageVersionDao; @Resource private DevEnvironmentDao devEnvironmentDao; - @Resource private AssetWorkflowDao assetWorkflowDao; - + @Resource + private RayDao rayDao; @Resource private ImageVersionService imageVersionService; @@ -182,6 +177,14 @@ public class ImageServiceImpl implements ImageService { throw new Exception("该镜像被流水线:" + workflows + "使用,不能删除,请先删除流水线。"); } + HashMap map = new HashMap<>(); + map.put("id", String.valueOf(id)); + List rayList = rayDao.queryByImageId(JSON.toJSONString(map)); + if (rayList != null && !rayList.isEmpty()) { + String rays = String.join(",", rayList.stream().map(Ray::getName).collect(Collectors.toSet())); + throw new Exception("该镜像被超参数自动寻优:" + rays + "使用,不能删除,请先删除超参数自动寻优。"); + } + //判断权限,只有admin和创建者本身可以删除该数据集 LoginUser loginUser = SecurityUtils.getLoginUser(); String username = loginUser.getUsername(); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageVersionServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageVersionServiceImpl.java index 551a330c..4b913351 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageVersionServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageVersionServiceImpl.java @@ -1,23 +1,25 @@ package com.ruoyi.platform.service.impl; +import com.alibaba.fastjson2.JSON; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.platform.constant.Constant; import com.ruoyi.platform.domain.AssetWorkflow; import com.ruoyi.platform.domain.ImageVersion; +import com.ruoyi.platform.domain.Ray; import com.ruoyi.platform.mapper.AssetWorkflowDao; -import com.ruoyi.platform.mapper.ImageDao; import com.ruoyi.platform.mapper.ImageVersionDao; -import com.ruoyi.platform.domain.ModelsVersion; +import com.ruoyi.platform.mapper.RayDao; import com.ruoyi.platform.service.ImageVersionService; import com.ruoyi.system.api.model.LoginUser; import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; +import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -31,9 +33,10 @@ import java.util.stream.Collectors; public class ImageVersionServiceImpl implements ImageVersionService { @Resource private ImageVersionDao imageVersionDao; - @Resource private AssetWorkflowDao assetWorkflowDao; + @Resource + private RayDao rayDao; /** * 通过ID查询单条数据 @@ -50,7 +53,7 @@ public class ImageVersionServiceImpl implements ImageVersionService { * 分页查询 * * @param imageVersion 筛选条件 - * @param pageRequest 分页对象 + * @param pageRequest 分页对象 * @return 查询结果 */ @Override @@ -60,14 +63,14 @@ public class ImageVersionServiceImpl implements ImageVersionService { } @Override - public List queryByImageId(Integer imageId){ + public List queryByImageId(Integer imageId) { return imageVersionDao.queryByImageId(imageId); } @Override public String removeById(Integer id) throws Exception { ImageVersion imageVersion = this.imageVersionDao.queryById(id); - if (imageVersion == null){ + if (imageVersion == null) { return "该版本下模型文件信息不存在"; } @@ -77,16 +80,24 @@ public class ImageVersionServiceImpl implements ImageVersionService { throw new Exception("该镜像版本被流水线:" + workflows + "使用,不能删除,请先删除流水线。"); } + HashMap map = new HashMap<>(); + map.put("version", String.valueOf(id)); + List rayList = rayDao.queryByImageId(JSON.toJSONString(map)); + if (rayList != null && !rayList.isEmpty()) { + String rays = String.join(",", rayList.stream().map(Ray::getName).collect(Collectors.toSet())); + throw new Exception("该镜像版本被超参数自动寻优:" + rays + "使用,不能删除,请先删除超参数自动寻优。"); + } + //判断权限,只有admin和创建者本身可以删除该数据集 LoginUser loginUser = SecurityUtils.getLoginUser(); String username = loginUser.getUsername(); String createdBy = imageVersion.getCreateBy(); - if (!(StringUtils.equals(username,"admin") || StringUtils.equals(username,createdBy))){ + if (!(StringUtils.equals(username, "admin") || StringUtils.equals(username, createdBy))) { return "无权限删除该版本下模型信息"; } imageVersion.setState(0); - return this.imageVersionDao.update(imageVersion)>0?"删除成功":"删除失败"; + return this.imageVersionDao.update(imageVersion) > 0 ? "删除成功" : "删除失败"; } @@ -117,7 +128,7 @@ public class ImageVersionServiceImpl implements ImageVersionService { @Override public ImageVersion update(ImageVersion imageVersion) { int currentState = imageVersion.getState(); - if(currentState == 0){ + if (currentState == 0) { throw new RuntimeException("镜像版本已被删除,无法更新。"); } LoginUser loginUser = SecurityUtils.getLoginUser(); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java index 9f9bd757..1cafc87d 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java @@ -9,10 +9,7 @@ import com.ruoyi.platform.annotations.CheckDuplicate; import com.ruoyi.platform.constant.Constant; import com.ruoyi.platform.domain.*; import com.ruoyi.platform.domain.dependencydomain.TrainTaskDepency; -import com.ruoyi.platform.mapper.AssetWorkflowDao; -import com.ruoyi.platform.mapper.ModelDependency1Dao; -import com.ruoyi.platform.mapper.ModelsDao; -import com.ruoyi.platform.mapper.ModelsVersionDao; +import com.ruoyi.platform.mapper.*; import com.ruoyi.platform.service.*; import com.ruoyi.platform.utils.*; import com.ruoyi.platform.vo.*; @@ -67,7 +64,8 @@ public class ModelsServiceImpl implements ModelsService { private ModelsDao modelsDao; @Resource private ModelsVersionDao modelsVersionDao; - + @Resource + private RayDao rayDao; @Resource private ModelsVersionService modelsVersionService; @@ -1154,6 +1152,14 @@ public class ModelsServiceImpl implements ModelsService { throw new Exception("该模型被流水线:" + workflows + "使用,不能删除,请先删除流水线。"); } + HashMap queryMap = new HashMap<>(); + queryMap.put("id", String.valueOf(repoId)); + List rayList = rayDao.queryByModelId(JSON.toJSONString(queryMap)); + if (rayList != null && !rayList.isEmpty()) { + String rays = String.join(",", rayList.stream().map(Ray::getName).collect(Collectors.toSet())); + throw new Exception("该模型被超参数自动寻优:" + rays + "使用,不能删除,请先删除超参数自动寻优。"); + } + String token = gitService.checkoutToken(); gitService.deleteProject(token, owner, identifier); //删除模型依赖 @@ -1177,6 +1183,15 @@ public class ModelsServiceImpl implements ModelsService { throw new Exception("该模型版本被流水线:" + workflows + "使用,不能删除,请先删除流水线。"); } + HashMap queryMap = new HashMap<>(); + queryMap.put("id", String.valueOf(repoId)); + queryMap.put("version", version); + List rayList = rayDao.queryByModelId(JSON.toJSONString(queryMap)); + if (rayList != null && !rayList.isEmpty()) { + String rays = String.join(",", rayList.stream().map(Ray::getName).collect(Collectors.toSet())); + throw new Exception("该数据集版本被超参数自动寻优:" + rays + "使用,不能删除,请先删除超参数自动寻优。"); + } + String token = gitService.checkoutToken(); String rootPath = Paths.get(localPath + "/" + relativePath).getParent().toString(); gitService.deleteBranch(token, owner, identifier, version, rootPath); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java index d6dbe494..ceba3677 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java @@ -4,12 +4,10 @@ import com.alibaba.fastjson2.JSON; import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.platform.constant.Constant; -import com.ruoyi.platform.domain.AssetWorkflow; -import com.ruoyi.platform.domain.AutoMl; -import com.ruoyi.platform.domain.Dataset; -import com.ruoyi.platform.domain.DatasetTempStorage; +import com.ruoyi.platform.domain.*; import com.ruoyi.platform.mapper.AssetWorkflowDao; import com.ruoyi.platform.mapper.AutoMlDao; +import com.ruoyi.platform.mapper.RayDao; import com.ruoyi.platform.service.DatasetTempStorageService; import com.ruoyi.platform.service.GitService; import com.ruoyi.platform.service.NewDatasetService; @@ -56,6 +54,8 @@ public class NewDatasetServiceImpl implements NewDatasetService { private AssetWorkflowDao assetWorkflowDao; @Resource private AutoMlDao autoMlDao; + @Resource + private RayDao rayDao; @Value("${spring.redis.host}") private String redisHost; @@ -421,6 +421,12 @@ public class NewDatasetServiceImpl implements NewDatasetService { throw new Exception("该数据集被自动机器学习:" + autoMls + "使用,不能删除,请先删除自动机器学习。"); } + List rayList = rayDao.queryByDatasetId(JSON.toJSONString(map)); + if (rayList != null && !rayList.isEmpty()) { + String rays = String.join(",", rayList.stream().map(Ray::getName).collect(Collectors.toSet())); + throw new Exception("该数据集被超参数自动寻优:" + rays + "使用,不能删除,请先删除超参数自动寻优。"); + } + String token = gitService.checkoutToken(); gitService.deleteProject(token, owner, repo); @@ -446,6 +452,12 @@ public class NewDatasetServiceImpl implements NewDatasetService { throw new Exception("该数据集版本被自动机器学习:" + autoMls + "使用,不能删除,请先删除自动机器学习。"); } + List rayList = rayDao.queryByDatasetId(JSON.toJSONString(map)); + if (rayList != null && !rayList.isEmpty()) { + String rays = String.join(",", rayList.stream().map(Ray::getName).collect(Collectors.toSet())); + throw new Exception("该数据集版本被超参数自动寻优:" + rays + "使用,不能删除,请先删除超参数自动寻优。"); + } + String token = gitService.checkoutToken(); String rootPath = Paths.get(localPathlocal + "/" + relativePath).getParent().toString(); gitService.deleteBranch(token, owner, repo, version, rootPath); diff --git a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/RayDaoMapper.xml b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/RayDaoMapper.xml index 72aebb6e..7355d286 100644 --- a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/RayDaoMapper.xml +++ b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/RayDaoMapper.xml @@ -109,6 +109,34 @@ where id = #{id} + + + + + + + + state = 1 From 2db254e7ffd4b645aa5c823bbdf214504471325c Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Tue, 25 Mar 2025 09:27:18 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/service/impl/ResourceOccupyServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ResourceOccupyServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ResourceOccupyServiceImpl.java index 62c23526..c204ced7 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ResourceOccupyServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ResourceOccupyServiceImpl.java @@ -33,8 +33,8 @@ public class ResourceOccupyServiceImpl implements ResourceOccupyService { ComputingResource computingResource = computingResourceDao.queryById(computingResourceId); LoginUser loginUser = SecurityUtils.getLoginUser(); - if (loginUser.getSysUser().getCredit() == 0) { - throw new Exception("当前积分为零"); + if (loginUser.getSysUser().getCredit() <= 0) { + throw new Exception("当前积分不足"); } if (Constant.Computing_Resource_GPU.equals(computingResource.getComputingResource())) { if (resourceOccupyDao.haveResource(computingResource.getResourceId(), computingResource.getGpuNums() * replicas)) { From 29e19dfbe405585a134ab605315f68fe108fd7f6 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 09:28:48 +0800 Subject: [PATCH 07/20] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=9C=8D=E5=8A=A1=E7=89=88=E6=9C=AC=E6=9C=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E6=95=B0=E9=87=8F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/ModelDeployment/ServiceInfo/index.less | 1 + .../src/pages/ModelDeployment/ServiceInfo/index.tsx | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.less b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.less index a8c3ce14..13c224f4 100644 --- a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.less +++ b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.less @@ -18,6 +18,7 @@ &__table { flex: 1; + min-height: 0; margin-top: 24px; } } diff --git a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx index 124d4627..57b4bd91 100644 --- a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx +++ b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx @@ -133,17 +133,18 @@ function ServiceInfo() { if (res) { message.success('删除成功'); // 如果是一页的唯一数据,删除时,请求第一页的数据 - // 否则直接刷新这一页的数据 - // 避免回到第一页 - if (tableData.length > 1) { + // 否则直接刷新这一页的数据,避免回到第一页 + if (tableData.length === 1) { setPagination((prev) => ({ ...prev, current: 1, })); } else { - getServiceInfo(); - getServiceVersions(); + setPagination((prev) => ({ + ...prev, + })); } + getServiceInfo(); } }; From 5f05931356e722f23d6c194c59375fbe7d1b97fe Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 09:43:13 +0800 Subject: [PATCH 08/20] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E9=95=BF0=E5=88=8629=E7=A7=92=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA29=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/utils/date.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/react-ui/src/utils/date.ts b/react-ui/src/utils/date.ts index fbc83e35..97e7f32d 100644 --- a/react-ui/src/utils/date.ts +++ b/react-ui/src/utils/date.ts @@ -41,7 +41,10 @@ export const elapsedTime = (begin?: string | null, end?: string | null): string if (hours !== 0) { return `${hours}小时${minutes}分`; } - return `${minutes}分${seconds}秒`; + if (minutes !== 0) { + return `${minutes}分${seconds}秒`; + } + return `${seconds}秒`; }; /** From f4833d69de2248ab749a20ef6ba8ac7540a9a5b7 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 10:28:40 +0800 Subject: [PATCH 09/20] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=85=8D=E7=BD=AEtag=E5=A4=AA=E9=95=BF=E6=BA=A2?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/components/CodeConfigItem/index.tsx | 15 +++++++++++++-- .../components/CodeConfigItem/index.tsx | 7 ++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/react-ui/src/components/CodeConfigItem/index.tsx b/react-ui/src/components/CodeConfigItem/index.tsx index 673bca40..ff48368c 100644 --- a/react-ui/src/components/CodeConfigItem/index.tsx +++ b/react-ui/src/components/CodeConfigItem/index.tsx @@ -2,6 +2,7 @@ import { AvailableRange } from '@/enums'; import { type CodeConfigData } from '@/pages/CodeConfig/List'; import { Flex, Typography } from 'antd'; import classNames from 'classnames'; +import { useState } from 'react'; import styles from './index.less'; type CodeConfigItemProps = { @@ -10,6 +11,7 @@ type CodeConfigItemProps = { }; function CodeConfigItem({ item, onClick }: CodeConfigItemProps) { + const [isEllipsis, setIsEllipsis] = useState(false); return (
onClick?.(item)}> @@ -32,11 +34,20 @@ function CodeConfigItem({ item, onClick }: CodeConfigItemProps) { setIsEllipsis(ellipsis), + }} > {item.git_url} -
{item.git_branch}
+ + {item.git_branch} +
); } diff --git a/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx b/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx index de903f47..fd9c967d 100644 --- a/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx +++ b/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx @@ -70,7 +70,12 @@ function CodeConfigItem({ item, onClick, onEdit, onRemove }: CodeConfigItemProps > {item.git_url} -
{item.git_branch}
+ + {item.git_branch} +
From 30e7c6193af9deb0bb24626f3028a0bf023b69bc Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 11:45:46 +0800 Subject: [PATCH 10/20] =?UTF-8?q?fix:=20=E9=95=9C=E5=83=8F=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=B7=BB=E5=8A=A0=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/config/routes.ts | 13 ++++++++++- react-ui/src/pages/Mirror/Create/index.tsx | 20 ++++++++--------- react-ui/src/pages/Mirror/Info/index.tsx | 19 +++++++++++----- react-ui/src/pages/Mirror/List/index.tsx | 6 ++--- react-ui/src/utils/table.tsx | 26 ++++++++++++++-------- 5 files changed, 55 insertions(+), 29 deletions(-) diff --git a/react-ui/config/routes.ts b/react-ui/config/routes.ts index a45883ab..bf51980e 100644 --- a/react-ui/config/routes.ts +++ b/react-ui/config/routes.ts @@ -271,7 +271,18 @@ export default [ { name: '镜像详情', path: 'info/:id', - component: './Mirror/Info', + routes: [ + { + name: '镜像详情', + path: '', + component: './Mirror/Info', + }, + { + name: '新增镜像版本', + path: 'add-version', + component: './Mirror/Create', + }, + ], }, { name: '创建镜像', diff --git a/react-ui/src/pages/Mirror/Create/index.tsx b/react-ui/src/pages/Mirror/Create/index.tsx index 7db2f4d0..cab4289b 100644 --- a/react-ui/src/pages/Mirror/Create/index.tsx +++ b/react-ui/src/pages/Mirror/Create/index.tsx @@ -44,7 +44,7 @@ const mirrorRadioItems: KFRadioItem[] = [ function MirrorCreate() { const navigate = useNavigate(); const [form] = Form.useForm(); - const [nameDisabled, setNameDisabled] = useState(false); + const [isAddVersion, setIsAddVersion] = useState(false); // 是制作镜像还是新增镜像版本 const { message } = App.useApp(); const uploadProps: UploadProps = { @@ -60,7 +60,7 @@ function MirrorCreate() { const name = SessionStorage.getItem(SessionStorage.mirrorNameKey); if (name) { form.setFieldValue('name', name); - setNameDisabled(true); + setIsAddVersion(true); } return () => { SessionStorage.removeItem(SessionStorage.mirrorNameKey); @@ -120,7 +120,7 @@ function MirrorCreate() { return (
- +
@@ -174,22 +174,22 @@ function MirrorCreate() { rules={[ { required: true, - message: '请输入镜像Tag', + message: '请输入镜像版本', }, { pattern: /^[a-zA-Z0-9._-]+$/, - message: '版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', + message: '镜像版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', }, ]} > - + )}