diff --git a/demo/demo-apps.png b/demo/demo-apps.png index e7237e90..af44b9fd 100644 Binary files a/demo/demo-apps.png and b/demo/demo-apps.png differ diff --git a/demo/gpu-test1.yaml b/demo/gpu-test1.yaml index ad1082dd..409fc78a 100644 --- a/demo/gpu-test1.yaml +++ b/demo/gpu-test1.yaml @@ -12,7 +12,7 @@ apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaimTemplate metadata: namespace: gpu-test1 - name: gpu.example.com + name: single-gpu spec: spec: devices: @@ -39,7 +39,7 @@ spec: - name: gpu resourceClaims: - name: gpu - resourceClaimTemplateName: gpu.example.com + resourceClaimTemplateName: single-gpu --- apiVersion: v1 @@ -60,4 +60,4 @@ spec: - name: gpu resourceClaims: - name: gpu - resourceClaimTemplateName: gpu.example.com + resourceClaimTemplateName: single-gpu diff --git a/demo/gpu-test2.yaml b/demo/gpu-test2.yaml index 1f466b39..68493a92 100644 --- a/demo/gpu-test2.yaml +++ b/demo/gpu-test2.yaml @@ -1,5 +1,5 @@ -# One pod, two containers -# Each asking for shared access to a single GPU +# One pod, one container +# Asking for 2 distinct GPUs --- apiVersion: v1 @@ -12,13 +12,15 @@ apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaimTemplate metadata: namespace: gpu-test2 - name: gpu.example.com + name: multiple-gpus spec: spec: devices: requests: - - name: gpu + - name: gpus deviceClassName: gpu.example.com + allocationMode: ExactCount + count: 2 --- apiVersion: v1 @@ -26,6 +28,8 @@ kind: Pod metadata: namespace: gpu-test2 name: pod0 + labels: + app: pod spec: containers: - name: ctr0 @@ -34,14 +38,7 @@ spec: args: ["export; sleep 9999"] resources: claims: - - name: shared-gpu - - name: ctr1 - image: ubuntu:22.04 - command: ["bash", "-c"] - args: ["export; sleep 9999"] - resources: - claims: - - name: shared-gpu + - name: gpus resourceClaims: - - name: shared-gpu - resourceClaimTemplateName: gpu.example.com + - name: gpus + resourceClaimTemplateName: multiple-gpus diff --git a/demo/gpu-test3.yaml b/demo/gpu-test3.yaml index 02dd4c50..e7543388 100644 --- a/demo/gpu-test3.yaml +++ b/demo/gpu-test3.yaml @@ -1,5 +1,5 @@ -# One shared, global claim providing access to a GPU -# Two pods, each asking for access to the shared GPU +# One pod, two containers +# Each asking for shared access to a single GPU --- apiVersion: v1 @@ -9,15 +9,16 @@ metadata: --- apiVersion: resource.k8s.io/v1alpha3 -kind: ResourceClaim +kind: ResourceClaimTemplate metadata: namespace: gpu-test3 - name: shared-gpu + name: single-gpu spec: - devices: - requests: - - name: gpu - deviceClassName: gpu.example.com + spec: + devices: + requests: + - name: gpu + deviceClassName: gpu.example.com --- apiVersion: v1 @@ -25,8 +26,6 @@ kind: Pod metadata: namespace: gpu-test3 name: pod0 - labels: - app: pod spec: containers: - name: ctr0 @@ -36,21 +35,7 @@ spec: resources: claims: - name: shared-gpu - resourceClaims: - - name: shared-gpu - resourceClaimName: shared-gpu - ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: gpu-test3 - name: pod1 - labels: - app: pod -spec: - containers: - - name: ctr0 + - name: ctr1 image: ubuntu:22.04 command: ["bash", "-c"] args: ["export; sleep 9999"] @@ -59,4 +44,4 @@ spec: - name: shared-gpu resourceClaims: - name: shared-gpu - resourceClaimName: shared-gpu + resourceClaimTemplateName: single-gpu diff --git a/demo/gpu-test4.yaml b/demo/gpu-test4.yaml index 46285c19..138eea61 100644 --- a/demo/gpu-test4.yaml +++ b/demo/gpu-test4.yaml @@ -1,5 +1,5 @@ -# One pod, one container -# Asking for 4 distinct GPUs +# One shared, global claim providing access to a GPU +# Two pods, each asking for access to the shared GPU --- apiVersion: v1 @@ -9,18 +9,15 @@ metadata: --- apiVersion: resource.k8s.io/v1alpha3 -kind: ResourceClaimTemplate +kind: ResourceClaim metadata: namespace: gpu-test4 - name: multiple-gpus + name: single-gpu spec: - spec: - devices: - requests: - - name: gpus - deviceClassName: gpu.example.com - allocationMode: ExactCount - count: 4 + devices: + requests: + - name: gpu + deviceClassName: gpu.example.com --- apiVersion: v1 @@ -38,7 +35,28 @@ spec: args: ["export; sleep 9999"] resources: claims: - - name: gpus + - name: shared-gpu resourceClaims: - - name: gpus - resourceClaimTemplateName: multiple-gpus + - name: shared-gpu + resourceClaimName: single-gpu + +--- +apiVersion: v1 +kind: Pod +metadata: + namespace: gpu-test4 + name: pod1 + labels: + app: pod +spec: + containers: + - name: ctr0 + image: ubuntu:22.04 + command: ["bash", "-c"] + args: ["export; sleep 9999"] + resources: + claims: + - name: shared-gpu + resourceClaims: + - name: shared-gpu + resourceClaimName: single-gpu diff --git a/demo/gpu-test5.yaml b/demo/gpu-test5.yaml new file mode 100644 index 00000000..4f87052c --- /dev/null +++ b/demo/gpu-test5.yaml @@ -0,0 +1,88 @@ +# One pod, 1 container +# Run as deployment with 1 replica + +--- +apiVersion: v1 +kind: Namespace +metadata: + name: gpu-test5 + +--- +apiVersion: resource.k8s.io/v1alpha3 +kind: ResourceClaimTemplate +metadata: + namespace: gpu-test5 + name: multiple-gpus +spec: + spec: + devices: + requests: + - name: ts-gpu + deviceClassName: gpu.example.com + - name: sp-gpu + deviceClassName: gpu.example.com + config: + - requests: ["ts-gpu"] + opaque: + driver: gpu.example.com + parameters: + apiVersion: gpu.resource.example.com/v1alpha1 + kind: GpuConfig + sharing: + strategy: TimeSlicing + timeSlicingConfig: + duration: Long + - requests: ["sp-gpu"] + opaque: + driver: gpu.example.com + parameters: + apiVersion: gpu.resource.example.com/v1alpha1 + kind: GpuConfig + sharing: + strategy: SpacePartitioning + spacePartitioningConfig: + partitionCount: 10 + +--- +apiVersion: v1 +kind: Pod +metadata: + namespace: gpu-test5 + name: pod0 +spec: + containers: + - name: ts-ctr0 + image: ubuntu:22.04 + command: ["bash", "-c"] + args: ["export; sleep 9999"] + resources: + claims: + - name: shared-gpus + request: ts-gpu + - name: ts-ctr1 + image: ubuntu:22.04 + command: ["bash", "-c"] + args: ["export; sleep 9999"] + resources: + claims: + - name: shared-gpus + request: ts-gpu + - name: sp-ctr0 + image: ubuntu:22.04 + command: ["bash", "-c"] + args: ["export; sleep 9999"] + resources: + claims: + - name: shared-gpus + request: sp-gpu + - name: sp-ctr1 + image: ubuntu:22.04 + command: ["bash", "-c"] + args: ["export; sleep 9999"] + resources: + claims: + - name: shared-gpus + request: sp-gpu + resourceClaims: + - name: shared-gpus + resourceClaimTemplateName: multiple-gpus