-

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Templat

apiVersion: workspace.jupyter.org/v1alpha1 kind: WorkspaceTemplate metadata: name: my-jupyter-template namespace: my-namespace labels: kueue.x-k8s.io/priority-class: <user-input>-priority spec: displayName: "My Custom Jupyter Lab" description: "Custom Jupyter Lab with specific configurations" defaultImage: "public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu" allowedImages: - "public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu" - "public.ecr.aws/sagemaker/sagemaker-distribution:latest-gpu" defaultResources: requests: cpu: "1" memory: "4Gi" limits: cpu: "4" memory: "16Gi" primaryStorage: defaultSize: "10Gi" minSize: "5Gi" maxSize: "50Gi" defaultStorageClassName: "sagemaker-spaces-default-storage-class" defaultMountPath: "/home/sagemaker-user" defaultContainerConfig: command: ["/opt/amazon/sagemaker/workspace/bin/entrypoint-workspace-jupyterlab"] defaultPodSecurityContext: fsGroup: 1000 defaultOwnershipType: "Public" defaultAccessStrategy: name: "hyperpod-access-strategy" allowSecondaryStorages: true appType: "jupyterlab"

  • Windows 10

  • Linux

catatan

cat <<EOF | kubectl apply -n "namespace_1" -f - apiVersion: apps/v1 kind: DaemonSet metadata: name: image-preload-ds spec: selector: matchLabels: app: image-preloader template: metadata: labels: app: image-preloader spec: containers: - name: preloader-3-4-2 image: public.ecr.aws/sagemaker/sagemaker-distribution:3.4.2-gpu command: ["sleep"] args: ["infinity"] resources: requests: cpu: 1m memory: 16Mi limits: cpu: 5m memory: 32Mi - name: preloader-3-3-2 image: public.ecr.aws/sagemaker/sagemaker-distribution:3.3.2-gpu command: ["sleep"] args: ["infinity"] resources: requests: cpu: 1m memory: 16Mi limits: cpu: 5m memory: 32Mi EOF

Cara Kerjanya

Siklus hidup

idleShutdown: enabled: true idleShutdownTimeoutMinutes: 30 detection: httpGet: path: /api/idle port: 8888 scheme: HTTP

Parameter

apiVersion: workspace.jupyter.org/v1alpha1 kind: Workspace metadata: name: my-workspace spec: displayName: "Development Workspace" image: jupyter/scipy-notebook:latest idleShutdown: enabled: true idleShutdownTimeoutMinutes: 30 detection: httpGet: path: /api/idle port: 8888

apiVersion: workspace.jupyter.org/v1alpha1 kind: WorkspaceTemplate metadata: name: jupyter-template spec: displayName: "Jupyter Template" defaultImage: jupyter/scipy-notebook:latest defaultIdleShutdown: enabled: true idleShutdownTimeoutMinutes: 30 detection: httpGet: path: /api/idle port: 8888 idleShutdownOverrides: allow: true minTimeoutMinutes: 60 maxTimeoutMinutes: 240

apiVersion: workspace.jupyter.org/v1alpha1 kind: Workspace metadata: name: my-workspace spec: displayName: "My Workspace" templateRef: name: jupyter-template # Inherits defaultIdleShutdown from template

apiVersion: workspace.jupyter.org/v1alpha1 kind: Workspace metadata: name: my-workspace spec: displayName: "My Workspace" templateRef: name: jupyter-template idleShutdown: enabled: true idleShutdownTimeoutMinutes: 60 # Must be within template bounds detection: httpGet: path: /api/idle port: 8888

apiVersion: workspace.jupyter.org/v1alpha1 kind: WorkspaceTemplate metadata: name: locked-template spec: displayName: "Locked Template" defaultImage: jupyter/scipy-notebook:latest defaultIdleShutdown: enabled: true idleShutdownTimeoutMinutes: 30 detection: httpGet: path: /api/idle port: 8888 idleShutdownOverrides: allow: false # Workspaces cannot override

Perilaku

### 1. Create a Space Template hyp create hyp-space-template --file template.yaml ### 2. List Space Templates hyp list hyp-space-template hyp list hyp-space-template --output json ### 3. Describe a Space Template hyp describe hyp-space-template --name my-template hyp describe hyp-space-template --name my-template --output json ### 4. Update a Space Template hyp update hyp-space-template --name my-template --file updated-template.yaml ### 5. Delete a Space Template hyp delete hyp-space-template --name my-template

apiVersion: workspace.jupyter.org/v1alpha1 kind: WorkspaceTemplate metadata: name: my-jupyter-template namespace: my-namespace spec: displayName: "My Custom Jupyter Lab" description: "Custom Jupyter Lab with specific configurations" defaultImage: "public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu" allowedImages: - "public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu" - "public.ecr.aws/sagemaker/sagemaker-distribution:latest-gpu" defaultResources: requests: cpu: "1" memory: "4Gi" limits: cpu: "4" memory: "16Gi" primaryStorage: defaultSize: "10Gi" minSize: "5Gi" maxSize: "50Gi" defaultStorageClassName: "sagemaker-spaces-default-storage-class" defaultMountPath: "/home/sagemaker-user" defaultContainerConfig: command: ["/opt/amazon/sagemaker/workspace/bin/entrypoint-workspace-jupyterlab"] defaultPodSecurityContext: fsGroup: 1000 defaultOwnershipType: "Public" defaultAccessStrategy: name: "hyperpod-access-strategy" allowSecondaryStorages: true appType: "jupyterlab"

apiVersion: workspace.jupyter.org/v1alpha1 kind: WorkspaceTemplate metadata: name: my-code-editor-template namespace: my-namespace spec: displayName: "My Custom Code Editor" description: "Custom Code Editor with specific configurations" defaultImage: "public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu" allowedImages: - "public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu" - "public.ecr.aws/sagemaker/sagemaker-distribution:latest-gpu" defaultResources: requests: cpu: "1" memory: "4Gi" limits: cpu: "4" memory: "16Gi" primaryStorage: defaultSize: "10Gi" minSize: "5Gi" maxSize: "50Gi" defaultStorageClassName: "sagemaker-spaces-default-storage-class" defaultMountPath: "/home/sagemaker-user" defaultContainerConfig: command: ["/opt/amazon/sagemaker/workspace/bin/entrypoint-workspace-code-editor"] defaultPodSecurityContext: fsGroup: 1000 defaultOwnershipType: "Public" defaultAccessStrategy: name: "hyperpod-access-strategy" allowSecondaryStorages: true appType: "code-editor"