|
|
|
@@ -8,6 +8,7 @@ import com.ruoyi.platform.service.TensorBoardService; |
|
|
|
import com.ruoyi.platform.utils.K8sClientUtil; |
|
|
|
import com.ruoyi.platform.vo.FrameLogPathVo; |
|
|
|
import com.ruoyi.platform.vo.PodStatusVo; |
|
|
|
import com.ruoyi.system.api.constant.Constant; |
|
|
|
import com.ruoyi.system.api.model.LoginUser; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@@ -32,7 +33,6 @@ 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())) { |
|
|
|
@@ -49,14 +49,18 @@ public class TensorBoardServiceImpl implements TensorBoardService { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
podReady = k8sClientUtil.getPodReady(podName, StringUtils.isEmpty(frameLogPathVo.getNamespace()) ? "default" : frameLogPathVo.getNamespace()); |
|
|
|
Boolean podReady = k8sClientUtil.getPodReady(podName, StringUtils.isEmpty(frameLogPathVo.getNamespace()) ? "default" : frameLogPathVo.getNamespace()); |
|
|
|
if (Constant.Running.equals(status) && !podReady) { |
|
|
|
status = Constant.Pending; |
|
|
|
} else if (Constant.Running.equals(status) && podReady) { |
|
|
|
status = Constant.Running; |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
return tensorboardStatusVo; |
|
|
|
} |
|
|
|
String url = redisService.getCacheObject(podName); |
|
|
|
tensorboardStatusVo.setStatus(status); |
|
|
|
tensorboardStatusVo.setUrl(url); |
|
|
|
tensorboardStatusVo.setReady(podReady); |
|
|
|
return tensorboardStatusVo; |
|
|
|
} |
|
|
|
|
|
|
|
|