diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/ActiveLearn.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/ActiveLearn.java index 7c0f51c7..33cd6426 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/ActiveLearn.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/ActiveLearn.java @@ -23,8 +23,11 @@ public class ActiveLearn { @ApiModelProperty(value = "任务类型:classification, regression") private String taskType; + @ApiModelProperty(value = "预训练模型") + private String model; + @ApiModelProperty(value = "模型文件路径") - private String modelPath; + private String modelPy; @ApiModelProperty(value = "模型类名称") private String modelClassName; @@ -36,17 +39,22 @@ public class ActiveLearn { private String regressorAlg; @ApiModelProperty(value = "dataset文件路径") - private String dataset; + private String datasetPy; @ApiModelProperty(value = "dataset类名") private String datasetClassName; @ApiModelProperty(value = "数据集文件路径") - private String datasetPath; + private String dataset; @ApiModelProperty(value = "数据量") private Integer dataSize; + @ApiModelProperty(value = "镜像") + private String image; + + private Integer computingResourceId; + @ApiModelProperty(value = "是否随机打乱") private Boolean shuffle; @@ -66,7 +74,7 @@ public class ActiveLearn { private String queryStrategy; @ApiModelProperty(value = "loss文件路径") - private String lossPath; + private String lossPy; @ApiModelProperty(value = "loss类名") private String lossClassName; diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ActiveLearnDao.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ActiveLearnDao.java index e2d07475..3db769d8 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ActiveLearnDao.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ActiveLearnDao.java @@ -11,11 +11,19 @@ public interface ActiveLearnDao { List queryByPage(@Param("name") String name, @Param("pageable") Pageable pageable); - ActiveLearn getActiveLearnByName(@Param("name") String name); + ActiveLearn getActiveLearnByName(@Param("name") String name); int save(@Param("activeLearn") ActiveLearn activeLearn); int edit(@Param("activeLearn") ActiveLearn activeLearn); ActiveLearn getActiveLearnById(@Param("id") Long id); + + List queryByDatasetId(@Param("datasetId") String datasetId); + + List queryByModelId(@Param("modelId") String modelId); + + List queryByImageId(@Param("imageId") String imageId); + + List queryByCodeConfigId(@Param("codeConfigId") String codeConfigId); } 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/ActiveLearnServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java index 48ba0232..ba41dca3 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java @@ -43,14 +43,9 @@ public class ActiveLearnServiceImpl implements ActiveLearnService { activeLearn.setCreateBy(username); activeLearn.setUpdateBy(username); - String datasetJson = JacksonUtil.toJSONString(activeLearnVo.getDataset()); - activeLearn.setDataset(datasetJson); - String modelJson = JacksonUtil.toJSONString(activeLearnVo.getModelPath()); - activeLearn.setModelPath(modelJson); - String datasetPathJson = JacksonUtil.toJSONString(activeLearnVo.getDatasetPath()); - activeLearn.setDatasetPath(datasetPathJson); - String lossPathJson = JacksonUtil.toJSONString(activeLearnVo.getLossPath()); - activeLearn.setLossPath(lossPathJson); + activeLearn.setImage(JacksonUtil.toJSONString(activeLearnVo.getImage())); + activeLearn.setModel(JacksonUtil.toJSONString(activeLearnVo.getModel())); + activeLearn.setDataset(JacksonUtil.toJSONString(activeLearnVo.getDataset())); activeLearnDao.save(activeLearn); return activeLearn; @@ -68,14 +63,9 @@ public class ActiveLearnServiceImpl implements ActiveLearnService { String username = SecurityUtils.getLoginUser().getUsername(); activeLearn.setUpdateBy(username); - String datasetJson = JacksonUtil.toJSONString(activeLearnVo.getDataset()); - activeLearn.setDataset(datasetJson); - String modelJson = JacksonUtil.toJSONString(activeLearnVo.getModelPath()); - activeLearn.setModelPath(modelJson); - String datasetPathJson = JacksonUtil.toJSONString(activeLearnVo.getDatasetPath()); - activeLearn.setDatasetPath(datasetPathJson); - String lossPathJson = JacksonUtil.toJSONString(activeLearnVo.getLossPath()); - activeLearn.setLossPath(lossPathJson); + activeLearn.setImage(JacksonUtil.toJSONString(activeLearnVo.getImage())); + activeLearn.setModel(JacksonUtil.toJSONString(activeLearnVo.getModel())); + activeLearn.setDataset(JacksonUtil.toJSONString(activeLearnVo.getDataset())); activeLearnDao.edit(activeLearn); @@ -87,17 +77,17 @@ public class ActiveLearnServiceImpl implements ActiveLearnService { ActiveLearn activeLearn = activeLearnDao.getActiveLearnById(id); ActiveLearnVo activeLearnVo = new ActiveLearnVo(); BeanUtils.copyProperties(activeLearn, activeLearnVo); - if (StringUtils.isNotEmpty(activeLearn.getDataset())) { - activeLearnVo.setDatasetPath(JsonUtils.jsonToMap(activeLearn.getDatasetPath())); + if (StringUtils.isNotEmpty(activeLearn.getDatasetPy())) { + activeLearnVo.setDataset(JsonUtils.jsonToMap(activeLearn.getDataset())); } - if (StringUtils.isNotEmpty(activeLearn.getModelPath())) { - activeLearnVo.setModelPath(JsonUtils.jsonToMap(activeLearn.getModelPath())); + if (StringUtils.isNotEmpty(activeLearn.getModel())) { + activeLearnVo.setModel(JsonUtils.jsonToMap(activeLearn.getModel())); } if (StringUtils.isNotEmpty(activeLearn.getDataset())) { activeLearnVo.setDataset(JsonUtils.jsonToMap(activeLearn.getDataset())); } - if (StringUtils.isNotEmpty(activeLearn.getLossPath())) { - activeLearnVo.setLossPath(JsonUtils.jsonToMap(activeLearn.getLossPath())); + if (StringUtils.isNotEmpty(activeLearn.getImage())) { + activeLearnVo.setImage(JsonUtils.jsonToMap(activeLearn.getImage())); } return activeLearnVo; } @@ -126,10 +116,9 @@ public class ActiveLearnServiceImpl implements ActiveLearnService { ActiveLearnVo activeLearnParam = new ActiveLearnVo(); BeanUtils.copyProperties(activeLearn, activeLearnParam); - activeLearnParam.setDatasetPath(JsonUtils.jsonToMap(activeLearn.getDatasetPath())); activeLearnParam.setDataset(JsonUtils.jsonToMap(activeLearn.getDataset())); - activeLearnParam.setModelPath(JsonUtils.jsonToMap(activeLearn.getModelPath())); - activeLearnParam.setLossPath(JsonUtils.jsonToMap(activeLearn.getLossPath())); + activeLearnParam.setImage(JsonUtils.jsonToMap(activeLearn.getImage())); + activeLearnParam.setModel(JsonUtils.jsonToMap(activeLearn.getModel())); String param = JsonUtils.objectToJson(activeLearnParam); 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..9578e929 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 @@ -4,8 +4,10 @@ import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.platform.constant.Constant; import com.ruoyi.platform.domain.AssetWorkflow; import com.ruoyi.platform.domain.CodeConfig; +import com.ruoyi.platform.mapper.ActiveLearnDao; import com.ruoyi.platform.mapper.AssetWorkflowDao; import com.ruoyi.platform.mapper.CodeConfigDao; +import com.ruoyi.platform.mapper.RayDao; import com.ruoyi.platform.service.CodeConfigService; import com.ruoyi.system.api.model.LoginUser; import org.apache.commons.lang3.StringUtils; @@ -26,6 +28,10 @@ public class CodeConfigServiceImpl implements CodeConfigService { private CodeConfigDao codeConfigDao; @Resource private AssetWorkflowDao assetWorkflowDao; + @Resource + private RayDao rayDao; + @Resource + private ActiveLearnDao activeLearnDao; @Override public Page queryByPage(CodeConfig codeConfig, PageRequest pageRequest) { @@ -88,6 +94,8 @@ public class CodeConfigServiceImpl implements CodeConfigService { throw new Exception("该代码配置被流水线:" + workflows + "使用,不能删除,请先删除流水线。"); } +// rayDao.queryByCodeConfig() + 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..591b957a 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,12 @@ public class ImageServiceImpl implements ImageService { private ImageVersionDao imageVersionDao; @Resource private DevEnvironmentDao devEnvironmentDao; - @Resource private AssetWorkflowDao assetWorkflowDao; - + @Resource + private RayDao rayDao; + @Resource + private ActiveLearnDao activeLearnDao; @Resource private ImageVersionService imageVersionService; @@ -182,6 +179,20 @@ 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 + "使用,不能删除,请先删除超参数自动寻优。"); + } + + List activeLearnList = activeLearnDao.queryByImageId(JSON.toJSONString(map)); + if (activeLearnList != null && !activeLearnList.isEmpty()) { + String activeLearns = String.join(",", activeLearnList.stream().map(ActiveLearn::getName).collect(Collectors.toSet())); + throw new Exception("该镜像被主动学习:" + activeLearns + "使用,不能删除,请先删除主动学习。"); + } + //判断权限,只有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..1fa596b7 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,13 +1,10 @@ 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.mapper.AssetWorkflowDao; -import com.ruoyi.platform.mapper.ImageDao; -import com.ruoyi.platform.mapper.ImageVersionDao; -import com.ruoyi.platform.domain.ModelsVersion; +import com.ruoyi.platform.domain.*; +import com.ruoyi.platform.mapper.*; import com.ruoyi.platform.service.ImageVersionService; import com.ruoyi.system.api.model.LoginUser; import org.apache.commons.lang3.StringUtils; @@ -18,6 +15,7 @@ import org.springframework.data.domain.PageRequest; import javax.annotation.Resource; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -31,10 +29,12 @@ import java.util.stream.Collectors; public class ImageVersionServiceImpl implements ImageVersionService { @Resource private ImageVersionDao imageVersionDao; - @Resource private AssetWorkflowDao assetWorkflowDao; - + @Resource + private RayDao rayDao; + @Resource + private ActiveLearnDao activeLearnDao; /** * 通过ID查询单条数据 * @@ -77,6 +77,20 @@ 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 + "使用,不能删除,请先删除超参数自动寻优。"); + } + + List activeLearnList = activeLearnDao.queryByImageId(JSON.toJSONString(map)); + if (activeLearnList != null && !activeLearnList.isEmpty()) { + String activeLearns = String.join(",", activeLearnList.stream().map(ActiveLearn::getName).collect(Collectors.toSet())); + throw new Exception("该镜像版本被主动学习:" + activeLearns + "使用,不能删除,请先删除主动学习。"); + } + //判断权限,只有admin和创建者本身可以删除该数据集 LoginUser loginUser = SecurityUtils.getLoginUser(); String username = loginUser.getUsername(); 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..cf919b12 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,10 @@ public class ModelsServiceImpl implements ModelsService { private ModelsDao modelsDao; @Resource private ModelsVersionDao modelsVersionDao; - + @Resource + private RayDao rayDao; + @Resource + private ActiveLearnDao activeLearnDao; @Resource private ModelsVersionService modelsVersionService; @@ -1154,6 +1154,20 @@ 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 + "使用,不能删除,请先删除超参数自动寻优。"); + } + + List activeLearnList = activeLearnDao.queryByModelId(JSON.toJSONString(queryMap)); + if (activeLearnList != null && !activeLearnList.isEmpty()) { + String rays = String.join(",", activeLearnList.stream().map(ActiveLearn::getName).collect(Collectors.toSet())); + throw new Exception("该模型被主动学习:" + rays + "使用,不能删除,请先删除主动学习。"); + } + String token = gitService.checkoutToken(); gitService.deleteProject(token, owner, identifier); //删除模型依赖 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..5d1aaf76 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,11 @@ 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.ActiveLearnDao; 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 +55,10 @@ public class NewDatasetServiceImpl implements NewDatasetService { private AssetWorkflowDao assetWorkflowDao; @Resource private AutoMlDao autoMlDao; + @Resource + private RayDao rayDao; + @Resource + private ActiveLearnDao activeLearnDao; @Value("${spring.redis.host}") private String redisHost; @@ -421,6 +424,18 @@ 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 + "使用,不能删除,请先删除超参数自动寻优。"); + } + + List activeLearnList = activeLearnDao.queryByDatasetId(JSON.toJSONString(map)); + if (activeLearnList != null && !activeLearnList.isEmpty()) { + String activeLearns = String.join(",", activeLearnList.stream().map(ActiveLearn::getName).collect(Collectors.toSet())); + throw new Exception("该数据集被主动学习:" + activeLearns + "使用,不能删除,请先删除主动学习。"); + } + String token = gitService.checkoutToken(); gitService.deleteProject(token, owner, repo); @@ -446,6 +461,18 @@ 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 + "使用,不能删除,请先删除超参数自动寻优。"); + } + + List activeLearnList = activeLearnDao.queryByDatasetId(JSON.toJSONString(map)); + if (activeLearnList != null && !activeLearnList.isEmpty()) { + String activeLearns = String.join(",", activeLearnList.stream().map(ActiveLearn::getName).collect(Collectors.toSet())); + throw new Exception("该数据集版本被主动学习:" + activeLearns + "使用,不能删除,请先删除主动学习。"); + } + 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/java/com/ruoyi/platform/vo/ActiveLearnVo.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/ActiveLearnVo.java index b9e6adf1..2cb72a5a 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/ActiveLearnVo.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/ActiveLearnVo.java @@ -24,8 +24,11 @@ public class ActiveLearnVo { @ApiModelProperty(value = "任务类型:classification, regression") private String taskType; + @ApiModelProperty(value = "预训练模型") + private Map model; + @ApiModelProperty(value = "模型文件路径") - private Map modelPath; + private String modelPy; @ApiModelProperty(value = "模型类名称") private String modelClassName; @@ -37,17 +40,22 @@ public class ActiveLearnVo { private String regressorAlg; @ApiModelProperty(value = "dataset文件路径") - private Map dataset; + private String datasetPy; @ApiModelProperty(value = "dataset类名") private String datasetClassName; @ApiModelProperty(value = "数据集") - private Map datasetPath; + private Map dataset; @ApiModelProperty(value = "数据量") private Integer dataSize; + @ApiModelProperty(value = "镜像") + private Map image; + + private Integer computingResourceId; + @ApiModelProperty(value = "是否随机打乱") private Boolean shuffle; @@ -67,7 +75,7 @@ public class ActiveLearnVo { private String queryStrategy; @ApiModelProperty(value = "loss文件路径") - private Map lossPath; + private String lossPy; @ApiModelProperty(value = "loss类名") private String lossClassName; diff --git a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ActiveLearnDaoMapper.xml b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ActiveLearnDaoMapper.xml index 70b3cc01..7e764f73 100644 --- a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ActiveLearnDaoMapper.xml +++ b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ActiveLearnDaoMapper.xml @@ -2,14 +2,17 @@ - insert into active_learn(name, description, task_type, model_path, model_class_name, classifier_alg, - regressor_alg, dataset, dataset_class_name, dataset_path, data_size, + insert into active_learn(name, description, task_type, model, model_py, model_class_name, classifier_alg, + regressor_alg, dataset_py, dataset_class_name, dataset, data_size, image, + computing_resource_id, shuffle, train_size, n_initial, n_queries, n_instances, query_strategy, loss_path, loss_class_name, n_checkpoint, batch_size, epochs, lr, create_by, update_by) - values (#{activeLearn.name}, #{activeLearn.description}, #{activeLearn.taskType}, #{activeLearn.modelPath}, + values (#{activeLearn.name}, #{activeLearn.description}, #{activeLearn.taskType}, #{activeLearn.model}, + #{activeLearn.modelPy}, #{activeLearn.modelClassName}, #{activeLearn.classifierAlg}, #{activeLearn.regressorAlg}, - #{activeLearn.dataset}, #{activeLearn.datasetClassName}, #{activeLearn.datasetPath}, - #{activeLearn.dataSize}, #{activeLearn.shuffle}, #{activeLearn.trainSize}, + #{activeLearn.datasetPy}, #{activeLearn.datasetClassName}, #{activeLearn.dataset}, + #{activeLearn.dataSize}, #{activeLearn.image}, #{activeLearn.computingResourceId}, + #{activeLearn.shuffle}, #{activeLearn.trainSize}, #{activeLearn.nInitial}, #{activeLearn.nQueries}, #{activeLearn.nInstances}, #{activeLearn.queryStrategy}, #{activeLearn.lossPath}, #{activeLearn.lossClassName}, #{activeLearn.nCheckpoint}, @@ -29,8 +32,11 @@ task_type = #{activeLearn.taskType}, - - model_path = #{activeLearn.modelPath}, + + model = #{activeLearn.model}, + + + model_py = #{activeLearn.modelPy}, model_class_name = #{activeLearn.modelClassName}, @@ -41,18 +47,24 @@ regressor_alg = #{activeLearn.regressorAlg}, - - dataset = #{activeLearn.dataset}, + + dataset_py = #{activeLearn.datasetPy}, dataset_class_name = #{activeLearn.datasetClassName}, - - dataset_path = #{activeLearn.datasetPath}, + + dataset = #{activeLearn.dataset}, data_size = #{activeLearn.dataSize}, + + image = #{activeLearn.image}, + + + computing_resource_id = #{activeLearn.computingResourceId}, + shuffle = #{activeLearn.shuffle}, @@ -125,6 +137,27 @@ where id = #{id} + + + + + + state = 1 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..c306c980 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,33 @@ where id = #{id} + + + + + + + + state = 1