|
|
|
@@ -33,6 +33,10 @@ import java.util.*; |
|
|
|
@Slf4j |
|
|
|
@Component |
|
|
|
public class K8sClientUtil { |
|
|
|
|
|
|
|
@Value("${jupyter.hostPath}") |
|
|
|
private String hostPath; |
|
|
|
|
|
|
|
private String http; |
|
|
|
private String token; |
|
|
|
/** |
|
|
|
@@ -446,13 +450,24 @@ public class K8sClientUtil { |
|
|
|
|
|
|
|
// 配置卷和卷挂载 |
|
|
|
List<V1VolumeMount> volumeMounts = new ArrayList<>(); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("workspace").mountPath(mountPath)); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("minio-pvc").mountPath("/opt/data").subPath(datasetPath).readOnly(true)); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("minio-pvc").mountPath("/opt/model").subPath(modelPath).readOnly(true)); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("workspace").mountPath("/opt/notebooks")); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("dataset").mountPath("/opt/dataset").readOnly(true)); |
|
|
|
volumeMounts.add(new V1VolumeMount().name("model").mountPath("/opt/model").readOnly(true)); |
|
|
|
|
|
|
|
List<V1Volume> volumes = new ArrayList<>(); |
|
|
|
volumes.add(new V1Volume().name("workspace").persistentVolumeClaim(new V1PersistentVolumeClaimVolumeSource().claimName(pvc.getMetadata().getName()))); |
|
|
|
volumes.add(new V1Volume().name("minio-pvc").persistentVolumeClaim(new V1PersistentVolumeClaimVolumeSource().claimName(dataPvcName))); |
|
|
|
volumes.add(new V1Volume().name("workspace").hostPath(new V1HostPathVolumeSource().path(hostPath + "/notebooks").type("DirectoryOrCreate"))); |
|
|
|
volumes.add(new V1Volume().name("dataset").hostPath(new V1HostPathVolumeSource().path(hostPath + "/dataset").type("DirectoryOrCreate"))); |
|
|
|
volumes.add(new V1Volume().name("model").hostPath(new V1HostPathVolumeSource().path(hostPath + "/model").type("DirectoryOrCreate"))); |
|
|
|
|
|
|
|
// 配置卷和卷挂载 |
|
|
|
// List<V1VolumeMount> volumeMounts = new ArrayList<>(); |
|
|
|
// volumeMounts.add(new V1VolumeMount().name("workspace").mountPath(mountPath)); |
|
|
|
// volumeMounts.add(new V1VolumeMount().name("minio-pvc").mountPath("/opt/data").subPath(datasetPath).readOnly(true)); |
|
|
|
// volumeMounts.add(new V1VolumeMount().name("minio-pvc").mountPath("/opt/model").subPath(modelPath).readOnly(true)); |
|
|
|
// |
|
|
|
// List<V1Volume> volumes = new ArrayList<>(); |
|
|
|
// volumes.add(new V1Volume().name("workspace").persistentVolumeClaim(new V1PersistentVolumeClaimVolumeSource().claimName(pvc.getMetadata().getName()))); |
|
|
|
// volumes.add(new V1Volume().name("minio-pvc").persistentVolumeClaim(new V1PersistentVolumeClaimVolumeSource().claimName(dataPvcName))); |
|
|
|
|
|
|
|
|
|
|
|
//配置资源 |
|
|
|
|