| @@ -68,7 +68,7 @@ public class TensorBoardServiceImpl implements TensorBoardService { | |||||
| LoginUser loginUser = SecurityUtils.getLoginUser(); | LoginUser loginUser = SecurityUtils.getLoginUser(); | ||||
| String podName = loginUser.getUsername().toLowerCase()+"-"+frameLogPathVo.getPath().split("/")[2]+ "-tensorboard-pod"; | String podName = loginUser.getUsername().toLowerCase()+"-"+frameLogPathVo.getPath().split("/")[2]+ "-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); | |||||
| redisService.setCacheObject(podName, masterIp + ":" + podPort); | redisService.setCacheObject(podName, masterIp + ":" + podPort); | ||||
| return masterIp + ":" + podPort; | return masterIp + ":" + podPort; | ||||
| } | } | ||||
| @@ -315,9 +315,9 @@ public class K8sClientUtil { | |||||
| * @return 创建成功的pod,的nodePort端口 | * @return 创建成功的pod,的nodePort端口 | ||||
| */ | */ | ||||
| public Integer createPodWithSubPath(String podName, String namespace, Integer port, String mountPath, String subPath, String pvcName, String image) { | |||||
| public Integer createPodWithSubPath(String podName, String namespace, Integer port, String mountPath, String subPath, String image) { | |||||
| Map<String, String> selector = new LinkedHashMap<String, String>(); | |||||
| Map<String, String> selector = new LinkedHashMap<>(); | |||||
| selector.put("k8s-jupyter", podName); | selector.put("k8s-jupyter", podName); | ||||
| CoreV1Api api = new CoreV1Api(apiClient); | CoreV1Api api = new CoreV1Api(apiClient); | ||||
| @@ -366,7 +366,7 @@ public class K8sClientUtil { | |||||
| .endContainer() | .endContainer() | ||||
| .addNewVolume() | .addNewVolume() | ||||
| .withName("workspace") | .withName("workspace") | ||||
| .withHostPath(new V1HostPathVolumeSource().path(pvcName).type("DirectoryOrCreate")) | |||||
| .withHostPath(new V1HostPathVolumeSource().path(hostPath).type("DirectoryOrCreate")) | |||||
| // .withPersistentVolumeClaim(new V1PersistentVolumeClaimVolumeSource().claimName(pvcName)) | // .withPersistentVolumeClaim(new V1PersistentVolumeClaimVolumeSource().claimName(pvcName)) | ||||
| .endVolume() | .endVolume() | ||||
| .withTerminationGracePeriodSeconds(14400L) | .withTerminationGracePeriodSeconds(14400L) | ||||
| @@ -9,7 +9,6 @@ import java.io.Serializable; | |||||
| public class FrameLogPathVo implements Serializable { | public class FrameLogPathVo implements Serializable { | ||||
| String path; | String path; | ||||
| String namespace; | String namespace; | ||||
| String pvcName; | |||||
| public String getPath() { | public String getPath() { | ||||
| return path; | return path; | ||||
| @@ -26,12 +25,4 @@ public class FrameLogPathVo implements Serializable { | |||||
| public void setNamespace(String namespace) { | public void setNamespace(String namespace) { | ||||
| this.namespace = namespace; | this.namespace = namespace; | ||||
| } | } | ||||
| public String getPvcName() { | |||||
| return pvcName; | |||||
| } | |||||
| public void setPvcName(String pvcName) { | |||||
| this.pvcName = pvcName; | |||||
| } | |||||
| } | } | ||||