| @@ -61,7 +61,7 @@ public class ExperimentInstanceStatusTask { | |||||
| String taskId = (String) trainMetricRecord.get("task_id"); | String taskId = (String) trainMetricRecord.get("task_id"); | ||||
| if (taskId.startsWith("model-train")) { | if (taskId.startsWith("model-train")) { | ||||
| String runId = (String) trainMetricRecord.get("run_id"); | String runId = (String) trainMetricRecord.get("run_id"); | ||||
| List<InsMetricInfoVo> expTrainInfos = aimService.getExpTrainInfos1(true, experimentIns.getExperimentId(), runId); | |||||
| List<InsMetricInfoVo> expTrainInfos = aimService.getExpInfos1(true, experimentIns.getExperimentId(), runId); | |||||
| for (InsMetricInfoVo expTrainInfo : expTrainInfos) { | for (InsMetricInfoVo expTrainInfo : expTrainInfos) { | ||||
| Map metrics = expTrainInfo.getMetrics(); | Map metrics = expTrainInfo.getMetrics(); | ||||
| trainMetricValue.putAll(metrics); | trainMetricValue.putAll(metrics); | ||||
| @@ -75,7 +75,7 @@ public class ExperimentInstanceStatusTask { | |||||
| String taskId = (String) evaluateMetricRecord.get("task_id"); | String taskId = (String) evaluateMetricRecord.get("task_id"); | ||||
| if (taskId.startsWith("model-evaluate")) { | if (taskId.startsWith("model-evaluate")) { | ||||
| String runId = (String) evaluateMetricRecord.get("run_id"); | String runId = (String) evaluateMetricRecord.get("run_id"); | ||||
| List<InsMetricInfoVo> expTrainInfos = aimService.getExpTrainInfos1(false, experimentIns.getExperimentId(), runId); | |||||
| List<InsMetricInfoVo> expTrainInfos = aimService.getExpInfos1(false, experimentIns.getExperimentId(), runId); | |||||
| for (InsMetricInfoVo expTrainInfo : expTrainInfos) { | for (InsMetricInfoVo expTrainInfo : expTrainInfos) { | ||||
| Map metrics = expTrainInfo.getMetrics(); | Map metrics = expTrainInfo.getMetrics(); | ||||
| evaluateMetricValue.putAll(metrics); | evaluateMetricValue.putAll(metrics); | ||||
| @@ -10,10 +10,10 @@ public interface AimService { | |||||
| List<InsMetricInfoVo> getExpTrainInfos(Integer experimentId, String offset, int limit) throws Exception; | List<InsMetricInfoVo> getExpTrainInfos(Integer experimentId, String offset, int limit) throws Exception; | ||||
| List<InsMetricInfoVo> getExpTrainInfos1(boolean isTrain, Integer experimentId, String runId) throws Exception; | |||||
| List<InsMetricInfoVo> getExpEvaluateInfos(Integer experimentId, String offset, int limit) throws Exception; | List<InsMetricInfoVo> getExpEvaluateInfos(Integer experimentId, String offset, int limit) throws Exception; | ||||
| List<InsMetricInfoVo> getExpInfos1(boolean isTrain, Integer experimentId, String runId) throws Exception; | |||||
| String getExpMetrics(List<String> runIds) throws Exception; | String getExpMetrics(List<String> runIds) throws Exception; | ||||
| HashMap<String, Object> queryMetricsParams(String runId) throws Exception; | HashMap<String, Object> queryMetricsParams(String runId) throws Exception; | ||||
| @@ -11,6 +11,7 @@ import com.ruoyi.platform.utils.JsonUtils; | |||||
| import com.ruoyi.platform.vo.InsMetricInfoVo; | import com.ruoyi.platform.vo.InsMetricInfoVo; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.data.domain.PageRequest; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| @@ -145,9 +146,13 @@ public class AimServiceImpl implements AimService { | |||||
| return aimRunInfoList; | return aimRunInfoList; | ||||
| } | } | ||||
| // private List<InsMetricInfoVo> getExpInfos(Integer experimentId, int page, int size){ | |||||
| // PageRequest pageRequest = PageRequest.of(page,size); | |||||
| // | |||||
| // } | |||||
| @Override | @Override | ||||
| public List<InsMetricInfoVo> getExpTrainInfos1(boolean isTrain, Integer experimentId, String runId) throws Exception { | |||||
| public List<InsMetricInfoVo> getExpInfos1(boolean isTrain, Integer experimentId, String runId) throws Exception { | |||||
| String encodedUrlString = URLEncoder.encode("run.id==\"" + runId + "\"", "UTF-8"); | String encodedUrlString = URLEncoder.encode("run.id==\"" + runId + "\"", "UTF-8"); | ||||
| String url = aimProxyUrl + "/api/runs/search/run?query=" + encodedUrlString; | String url = aimProxyUrl + "/api/runs/search/run?query=" + encodedUrlString; | ||||
| String s = HttpUtils.sendGet(url, null); | String s = HttpUtils.sendGet(url, null); | ||||
| @@ -172,15 +172,6 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { | |||||
| public Page<ExperimentIns> queryByPage(ExperimentIns experimentIns, PageRequest pageRequest) throws IOException { | public Page<ExperimentIns> queryByPage(ExperimentIns experimentIns, PageRequest pageRequest) throws IOException { | ||||
| long total = this.experimentInsDao.count(experimentIns); | long total = this.experimentInsDao.count(experimentIns); | ||||
| List<ExperimentIns> experimentInsList = this.experimentInsDao.queryAllByLimit(experimentIns, pageRequest); | List<ExperimentIns> experimentInsList = this.experimentInsDao.queryAllByLimit(experimentIns, pageRequest); | ||||
| // if (experimentInsList!=null && experimentInsList.size()>0) { | |||||
| // for (ExperimentIns ins : experimentInsList) { | |||||
| // //如果实验实例不为空或者 | |||||
| // if (ins != null && StringUtils.isEmpty(ins.getStatus())) { | |||||
| // ins = this.queryStatusFromArgo(ins); | |||||
| // this.update(ins); | |||||
| // } | |||||
| // } | |||||
| // } | |||||
| return new PageImpl<>(experimentInsList, pageRequest, total); | return new PageImpl<>(experimentInsList, pageRequest, total); | ||||
| } | } | ||||
| @@ -1300,7 +1300,7 @@ public class ModelsServiceImpl implements ModelsService { | |||||
| for (int i = 0; i < trainMetrics.size(); i++) { | for (int i = 0; i < trainMetrics.size(); i++) { | ||||
| JSONObject jsonObject = trainMetrics.getJSONObject(i); | JSONObject jsonObject = trainMetrics.getJSONObject(i); | ||||
| String runId = jsonObject.getString("run_id"); | String runId = jsonObject.getString("run_id"); | ||||
| List<InsMetricInfoVo> expTrainInfos = aimsService.getExpTrainInfos1(true, modelMetaVo.getTrainTask().getExperimentId(), runId); | |||||
| List<InsMetricInfoVo> expTrainInfos = aimsService.getExpInfos1(true, modelMetaVo.getTrainTask().getExperimentId(), runId); | |||||
| for (InsMetricInfoVo expTrainInfo : expTrainInfos) { | for (InsMetricInfoVo expTrainInfo : expTrainInfos) { | ||||
| Map metrics1 = expTrainInfo.getMetrics(); | Map metrics1 = expTrainInfo.getMetrics(); | ||||
| train.putAll(metrics1); | train.putAll(metrics1); | ||||
| @@ -1322,7 +1322,7 @@ public class ModelsServiceImpl implements ModelsService { | |||||
| for (int i = 0; i < testMetrics.size(); i++) { | for (int i = 0; i < testMetrics.size(); i++) { | ||||
| JSONObject jsonObject = testMetrics.getJSONObject(i); | JSONObject jsonObject = testMetrics.getJSONObject(i); | ||||
| String runId = jsonObject.getString("run_id"); | String runId = jsonObject.getString("run_id"); | ||||
| List<InsMetricInfoVo> expTestInfos = aimsService.getExpTrainInfos1(false, modelMetaVo.getTrainTask().getExperimentId(), runId); | |||||
| List<InsMetricInfoVo> expTestInfos = aimsService.getExpInfos1(false, modelMetaVo.getTrainTask().getExperimentId(), runId); | |||||
| for (InsMetricInfoVo expTestInfo : expTestInfos) { | for (InsMetricInfoVo expTestInfo : expTestInfos) { | ||||
| Map metrics1 = expTestInfo.getMetrics(); | Map metrics1 = expTestInfo.getMetrics(); | ||||
| evaluate.putAll(metrics1); | evaluate.putAll(metrics1); | ||||