|
|
@@ -9,7 +9,7 @@ import com.ruoyi.platform.domain.dependencydomain.TrainTaskDepency; |
|
|
import com.ruoyi.platform.mapper.ExperimentDao; |
|
|
import com.ruoyi.platform.mapper.ExperimentDao; |
|
|
import com.ruoyi.platform.mapper.ExperimentInsDao; |
|
|
import com.ruoyi.platform.mapper.ExperimentInsDao; |
|
|
import com.ruoyi.platform.service.*; |
|
|
import com.ruoyi.platform.service.*; |
|
|
import com.ruoyi.platform.utils.DVCUtils; |
|
|
|
|
|
|
|
|
import com.ruoyi.platform.utils.HttpUtils; |
|
|
import com.ruoyi.platform.utils.JacksonUtil; |
|
|
import com.ruoyi.platform.utils.JacksonUtil; |
|
|
import com.ruoyi.platform.utils.JsonUtils; |
|
|
import com.ruoyi.platform.utils.JsonUtils; |
|
|
import com.ruoyi.platform.utils.NewHttpUtils; |
|
|
import com.ruoyi.platform.utils.NewHttpUtils; |
|
|
@@ -59,8 +59,6 @@ public class ExperimentServiceImpl implements ExperimentService { |
|
|
@Resource |
|
|
@Resource |
|
|
@Lazy |
|
|
@Lazy |
|
|
private ExperimentInsService experimentInsService; |
|
|
private ExperimentInsService experimentInsService; |
|
|
@Resource |
|
|
|
|
|
private NewHttpUtils httpUtils; |
|
|
|
|
|
@Value("${argo.url}") |
|
|
@Value("${argo.url}") |
|
|
private String argoUrl; |
|
|
private String argoUrl; |
|
|
@Value("${argo.convert}") |
|
|
@Value("${argo.convert}") |
|
|
@@ -225,7 +223,7 @@ public class ExperimentServiceImpl implements ExperimentService { |
|
|
String dag = workflow.getDag(); |
|
|
String dag = workflow.getDag(); |
|
|
// 调argo转换接口 |
|
|
// 调argo转换接口 |
|
|
try { |
|
|
try { |
|
|
String convertRes = httpUtils.sendPost(argoUrl + argoConvert, null, dag); |
|
|
|
|
|
|
|
|
String convertRes = HttpUtils.sendPost(argoUrl + argoConvert, dag); |
|
|
if (convertRes == null || StringUtils.isEmpty(convertRes)) { |
|
|
if (convertRes == null || StringUtils.isEmpty(convertRes)) { |
|
|
throw new RuntimeException("转换流水线失败"); |
|
|
throw new RuntimeException("转换流水线失败"); |
|
|
} |
|
|
} |
|
|
@@ -244,7 +242,7 @@ public class ExperimentServiceImpl implements ExperimentService { |
|
|
|
|
|
|
|
|
Map<String, Object> output = (Map<String, Object>) converMap.get("output"); |
|
|
Map<String, Object> output = (Map<String, Object>) converMap.get("output"); |
|
|
// 调argo运行接口 |
|
|
// 调argo运行接口 |
|
|
String runRes = httpUtils.sendPost(argoUrl + argoWorkflowRun, null, JsonUtils.mapToJson(runReqMap)); |
|
|
|
|
|
|
|
|
String runRes = HttpUtils.sendPost(argoUrl + argoWorkflowRun, JsonUtils.mapToJson(runReqMap)); |
|
|
|
|
|
|
|
|
if (runRes == null || StringUtils.isEmpty(runRes)) { |
|
|
if (runRes == null || StringUtils.isEmpty(runRes)) { |
|
|
throw new RuntimeException("Failed to run workflow."); |
|
|
throw new RuntimeException("Failed to run workflow."); |
|
|
@@ -324,10 +322,10 @@ public class ExperimentServiceImpl implements ExperimentService { |
|
|
List<Map<String, Object>> datasets = (List<Map<String, Object>>) trainInfoDetails.get("datasets"); |
|
|
List<Map<String, Object>> datasets = (List<Map<String, Object>>) trainInfoDetails.get("datasets"); |
|
|
if (datasets != null) { |
|
|
if (datasets != null) { |
|
|
//查询名字再回填 |
|
|
//查询名字再回填 |
|
|
for (int i = 0; i < datasets.size(); i++) { |
|
|
|
|
|
Dataset dataset = datasetService.queryById((Integer) datasets.get(i).get("dataset_id")); |
|
|
|
|
|
datasets.get(i).put("dataset_name", dataset.getName()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// for (int i = 0; i < datasets.size(); i++) { |
|
|
|
|
|
// Dataset dataset = datasetService.queryById(Integer.valueOf((String) datasets.get(i).get("dataset_id"))); |
|
|
|
|
|
// datasets.get(i).put("dataset_name", dataset.getName()); |
|
|
|
|
|
// } |
|
|
metricRecordItem.put("datasets", datasets); |
|
|
metricRecordItem.put("datasets", datasets); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|