|
|
|
@@ -32,6 +32,7 @@ public class TensorBoardServiceImpl implements TensorBoardService { |
|
|
|
@Override |
|
|
|
public PodStatusVo getTensorBoardStatus(FrameLogPathVo frameLogPathVo) { |
|
|
|
String status = PodStatus.Terminated.getName(); |
|
|
|
Boolean podReady = false; |
|
|
|
PodStatusVo tensorboardStatusVo = new PodStatusVo(); |
|
|
|
tensorboardStatusVo.setStatus(status); |
|
|
|
if (StringUtils.isEmpty(frameLogPathVo.getPath())) { |
|
|
|
@@ -48,12 +49,14 @@ public class TensorBoardServiceImpl implements TensorBoardService { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
podReady = k8sClientUtil.getPodReady(podName, StringUtils.isEmpty(frameLogPathVo.getNamespace()) ? "default" : frameLogPathVo.getNamespace()); |
|
|
|
} catch (Exception e) { |
|
|
|
return tensorboardStatusVo; |
|
|
|
} |
|
|
|
String url = redisService.getCacheObject(podName); |
|
|
|
tensorboardStatusVo.setStatus(status); |
|
|
|
tensorboardStatusVo.setUrl(url); |
|
|
|
tensorboardStatusVo.setReady(podReady); |
|
|
|
return tensorboardStatusVo; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -66,7 +69,7 @@ public class TensorBoardServiceImpl implements TensorBoardService { |
|
|
|
throw new Exception("存储路径为空"); |
|
|
|
} |
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
|
String podName = loginUser.getUsername().toLowerCase()+"-"+frameLogPathVo.getPath().split("/")[1]+ "-tensorboard-pod"; |
|
|
|
String podName = loginUser.getUsername().toLowerCase() + "-" + frameLogPathVo.getPath().split("/")[1] + "-tensorboard-pod"; |
|
|
|
|
|
|
|
// Integer podPort = k8sClientUtil.createPodWithSubPath(podName, StringUtils.isEmpty(frameLogPathVo.getNamespace()) ? "default" : frameLogPathVo.getNamespace(), port, mountPath, frameLogPathVo.getPath(), frameLogPathVo.getPvcName(), image); |
|
|
|
Integer podPort = k8sClientUtil.createPodWithSubPath(podName, StringUtils.isEmpty(frameLogPathVo.getNamespace()) ? "default" : frameLogPathVo.getNamespace(), port, mountPath, frameLogPathVo.getPath(), image); |
|
|
|
|