|
|
|
@@ -9,6 +9,7 @@ import com.ruoyi.platform.service.RayInsService; |
|
|
|
import com.ruoyi.platform.utils.DateUtils; |
|
|
|
import com.ruoyi.platform.utils.HttpUtils; |
|
|
|
import com.ruoyi.platform.utils.JsonUtils; |
|
|
|
import com.ruoyi.platform.utils.MinioUtil; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.data.domain.Page; |
|
|
|
@@ -39,6 +40,9 @@ public class RayInsServiceImpl implements RayInsService { |
|
|
|
@Resource |
|
|
|
private RayDao rayDao; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private MinioUtil minioUtil; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Page<RayIns> queryByPage(Long rayId, PageRequest pageRequest) throws IOException { |
|
|
|
long total = this.rayInsDao.count(rayId); |
|
|
|
@@ -161,7 +165,7 @@ public class RayInsServiceImpl implements RayInsService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public RayIns getDetailById(Long id) throws IOException { |
|
|
|
public RayIns getDetailById(Long id) throws Exception { |
|
|
|
RayIns rayIns = rayInsDao.queryById(id); |
|
|
|
if (Constant.Running.equals(rayIns.getStatus()) || Constant.Pending.equals(rayIns.getStatus())) { |
|
|
|
rayIns = queryStatusFromArgo(rayIns); |
|
|
|
@@ -260,8 +264,13 @@ public class RayInsServiceImpl implements RayInsService { |
|
|
|
return rayInsDao.queryByRayInsIsNotTerminated(); |
|
|
|
} |
|
|
|
|
|
|
|
public ArrayList<Map<String, Object>> getTrialList(String directoryPath) throws IOException { |
|
|
|
public ArrayList<Map<String, Object>> getTrialList(String directoryPath) throws Exception { |
|
|
|
// 获取指定路径下的所有文件 |
|
|
|
String bucketName = directoryPath.substring(0, directoryPath.indexOf("/")); |
|
|
|
String prefix = directoryPath.substring(directoryPath.indexOf("/") + 1, directoryPath.length()) + "/"; |
|
|
|
|
|
|
|
List<Map> maps = minioUtil.listFilesInDirectory(bucketName, prefix); |
|
|
|
|
|
|
|
Path dirPath = Paths.get(directoryPath); |
|
|
|
Path experimentState = Files.list(dirPath).filter(path -> Files.isRegularFile(path) && path.getFileName().toString().startsWith("experiment_state")).collect(Collectors.toList()).get(0); |
|
|
|
String content = new String(Files.readAllBytes(experimentState)); |
|
|
|
|