Browse Source

新增批量删除实验实例接口

dev-lhz
chenzhihang 1 year ago
parent
commit
40d19ec204
1 changed files with 5 additions and 7 deletions
  1. +5
    -7
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AimServiceImpl.java

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

@@ -5,9 +5,9 @@ import com.ruoyi.platform.domain.ExperimentIns;
import com.ruoyi.platform.service.AimService;
import com.ruoyi.platform.service.ExperimentInsService;
import com.ruoyi.platform.utils.AIM64EncoderUtil;
import com.ruoyi.platform.utils.HttpUtils;
import com.ruoyi.platform.utils.JacksonUtil;
import com.ruoyi.platform.utils.JsonUtils;
import com.ruoyi.platform.utils.NewHttpUtils;
import com.ruoyi.platform.vo.InsMetricInfoVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
@@ -28,8 +28,6 @@ public class AimServiceImpl implements AimService {
private String aimUrl;
@Value("${aim.proxyUrl}")
private String aimProxyUrl;
@Resource
private NewHttpUtils httpUtils;

@Override
public List<InsMetricInfoVo> getExpTrainInfos(Integer experimentId) throws Exception {
@@ -54,7 +52,7 @@ public class AimServiceImpl implements AimService {
}
String encodedUrlString = URLEncoder.encode("run.experiment==\"" + experimentName + "\"", "UTF-8");
String url = aimProxyUrl + "/api/runs/search/run?query=" + encodedUrlString;
String s = httpUtils.sendGet(url, null);
String s = HttpUtils.sendGet(url, null);
List<Map<String, Object>> response = JacksonUtil.parseJSONStr2MapList(s);
System.out.println("response: " + JacksonUtil.toJSONString(response));
if (response == null || response.size() == 0) {
@@ -144,7 +142,7 @@ public class AimServiceImpl implements AimService {
public List<InsMetricInfoVo> getExpTrainInfos1(boolean isTrain, Integer experimentId, String runId) throws Exception {
String encodedUrlString = URLEncoder.encode("run.id==\"" + runId + "\"", "UTF-8");
String url = aimProxyUrl + "/api/runs/search/run?query=" + encodedUrlString;
String s = httpUtils.sendGet(url, null);
String s = HttpUtils.sendGet(url, null);
List<Map<String, Object>> response = JacksonUtil.parseJSONStr2MapList(s);
System.out.println("response: " + JacksonUtil.toJSONString(response));
if (response == null || response.size() == 0) {
@@ -252,7 +250,7 @@ public class AimServiceImpl implements AimService {
public HashMap<String, Object> queryMetricsParams(String runId) throws UnsupportedEncodingException {
String encodedUrlString = URLEncoder.encode("run.id==\"" + runId + "\"", "UTF-8");
String url = aimProxyUrl + "/api/runs/search/run?query=" + encodedUrlString;
String s = httpUtils.sendGet(url, null);
String s = HttpUtils.sendGet(url, null);
List<Map<String, Object>> response = JacksonUtil.parseJSONStr2MapList(s);
if (response == null || response.size() == 0) {
return new HashMap<>();
@@ -280,7 +278,7 @@ public class AimServiceImpl implements AimService {
@Override
public List<Map<String, Object>> getBatchMetric(String runHash, String params) {
String url = aimUrl + "/api/runs/" + runHash + "/metric/get-batch";
String response = httpUtils.sendPost(url, null, params);
String response = HttpUtils.sendPost(url, params);
if (StringUtils.isNotEmpty(response)) {
return JacksonUtil.parseJSONStr2MapList(response);
}


Loading…
Cancel
Save