|
|
|
@@ -20,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.io.IOException; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
@Service |
|
|
|
@@ -34,6 +35,10 @@ public class ActiveLearnInsServiceImpl implements ActiveLearnInsService { |
|
|
|
private String argoWorkflowTermination; |
|
|
|
@Value("${minio.endpointIp}") |
|
|
|
String endpoint; |
|
|
|
@Value("${aim.url}") |
|
|
|
private String aimUrl; |
|
|
|
@Value("${aim.proxyUrl}") |
|
|
|
private String aimProxyUrl; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private ActiveLearnInsDao activeLearnInsDao; |
|
|
|
@@ -269,6 +274,22 @@ public class ActiveLearnInsServiceImpl implements ActiveLearnInsService { |
|
|
|
return activeLearnInsDao.queryActiveLearnInsIsNotTerminated(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String getExpMetrics(String experimentInsId) throws Exception { |
|
|
|
String encodedUrlString = URLEncoder.encode("run.id in " + experimentInsId, "UTF-8"); |
|
|
|
String url = aimProxyUrl + "/api/runs/search/run?query=" + encodedUrlString; |
|
|
|
String s = HttpUtils.sendGet(url, null); |
|
|
|
List<Map<String, Object>> responses = JacksonUtil.parseJSONStr2MapList(s); |
|
|
|
|
|
|
|
List<String> runIds = new ArrayList<>(); |
|
|
|
for (Map response : responses) { |
|
|
|
runIds.add((String) response.get("run_hash")); |
|
|
|
} |
|
|
|
|
|
|
|
String decode = AIM64EncoderUtil.decode(runIds); |
|
|
|
return aimUrl + "/metrics?select=" + decode; |
|
|
|
} |
|
|
|
|
|
|
|
public void getTrialList(ActiveLearnIns ins) { |
|
|
|
String directoryPath = ins.getResultPath(); |
|
|
|
ins.setResultPath(endpoint + "/" + directoryPath + "/final_checkpoint/final_model_weights.pth"); |
|
|
|
|