Browse Source

优化运行空流水线报错提示

dev-active_learn
chenzhihang 10 months ago
parent
commit
24de7456d5
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java

+ 7
- 6
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java View File

@@ -5,7 +5,6 @@ import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.platform.annotations.CheckDuplicate;
import com.ruoyi.system.api.constant.Constant;
import com.ruoyi.platform.domain.*;
import com.ruoyi.platform.domain.dependencydomain.ProjectDepency;
import com.ruoyi.platform.domain.dependencydomain.TrainTaskDepency;
@@ -18,6 +17,7 @@ import com.ruoyi.platform.utils.JsonUtils;
import com.ruoyi.platform.utils.YamlUtils;
import com.ruoyi.platform.vo.ModelsVo;
import com.ruoyi.platform.vo.NewDatasetVo;
import com.ruoyi.system.api.constant.Constant;
import com.ruoyi.system.api.model.LoginUser;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
@@ -231,12 +231,15 @@ public class ExperimentServiceImpl implements ExperimentService {
try {
String convertRes = HttpUtils.sendPost(argoUrl + argoConvert, dag);
if (convertRes == null || StringUtils.isEmpty(convertRes)) {
throw new RuntimeException("转换流水线失败");
throw new Exception("转换流水线失败");
}
Map<String, Object> converMap = JsonUtils.jsonToMap(convertRes);

// 判断积分和资源是否足够
Map<String, Map<String, Object>> resourceInfo = (Map<String, Map<String, Object>>) converMap.get("resource_info");
if (resourceInfo == null) {
throw new Exception("未配置运行所需资源");
}
for (Map.Entry<String, Map<String, Object>> entry : resourceInfo.entrySet()) {
Map<String, Object> node = entry.getValue();
resourceOccupyService.haveResource((Integer) node.get("computing_resource_id"), 1);
@@ -276,7 +279,7 @@ public class ExperimentServiceImpl implements ExperimentService {
experimentIns.setExperimentId(experiment.getId());
experimentIns.setArgoInsNs((String) metadata.get("namespace"));
experimentIns.setArgoInsName((String) metadata.get("name"));
experimentIns.setStatus("Pending");
experimentIns.setStatus(Constant.Pending);

//传入实验全局参数
experimentIns.setGlobalParam(experiment.getGlobalParam());
@@ -314,9 +317,8 @@ public class ExperimentServiceImpl implements ExperimentService {
Map<String, Object> node = entry.getValue();
resourceOccupyService.startDeduce((Integer) node.get("computing_resource_id"), 1, Constant.TaskType_Workflow, Long.valueOf(id), Long.valueOf(insert.getId()), experiment.getWorkflowId(), experiment.getName(), entry.getKey(), Constant.State_building);
}

} catch (Exception e) {
throw new RuntimeException(e);
throw new Exception(e);
}
List<ExperimentIns> updatedExperimentInsList = experimentInsService.getByExperimentId(id);
experiment.setExperimentInsList(updatedExperimentInsList);
@@ -523,7 +525,6 @@ public class ExperimentServiceImpl implements ExperimentService {
}
}
}

}

private void insertModelDependencyNew(Map<String, Object> dependendcy, Map<String, Object> trainInfo, Map<String, Object> output, String metricRecord, Integer experimentInsId, Long workflowId, Integer experimentId, String experimentName, String globalParam) {


Loading…
Cancel
Save