|
|
|
@@ -459,12 +459,19 @@ public class K8sClientUtil { |
|
|
|
// 配置卷和卷挂载 |
|
|
|
List<V1VolumeMount> volumeMounts = new ArrayList<>(); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("workspace").mountPath("/opt/notebooks")); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("data").mountPath("/opt/dataset").subPath(datasetPath).readOnly(true)); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("data").mountPath("/opt/model").subPath(modelPath).readOnly(true)); |
|
|
|
|
|
|
|
List<V1Volume> volumes = new ArrayList<>(); |
|
|
|
volumes.add(new V1Volume().name("workspace").hostPath(new V1HostPathVolumeSource().path(hostPath + "/" + podName + "/notebooks").type("DirectoryOrCreate"))); |
|
|
|
volumes.add(new V1Volume().name("data").hostPath(new V1HostPathVolumeSource().path(hostPath).type("DirectoryOrCreate"))); |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(datasetPath)) { |
|
|
|
volumeMounts.add(new V1VolumeMount().name("data").mountPath("/opt/dataset").subPath(datasetPath).readOnly(true)); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(modelPath)) { |
|
|
|
volumeMounts.add(new V1VolumeMount().name("data").mountPath("/opt/model").subPath(modelPath).readOnly(true)); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(datasetPath) || StringUtils.isNotEmpty(modelPath)) { |
|
|
|
volumes.add(new V1Volume().name("data").hostPath(new V1HostPathVolumeSource().path(hostPath).type("DirectoryOrCreate"))); |
|
|
|
} |
|
|
|
|
|
|
|
// 配置卷和卷挂载 |
|
|
|
// List<V1VolumeMount> volumeMounts = new ArrayList<>(); |
|
|
|
|