Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple TimesSlicing sharing example to quickstart (WIP) #113

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions demo/specs/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,19 @@ kubectl get pod -A
```console
nvidia-smi -L
```

#### Show the TimeSlicing example

```console
vim -O gpu-test-timeslicing.yaml
```

#### Deploy the MPS example
```console
kubectl apply -f gpu-test-timeslicing.yaml
```

#### Show the pod running
```console
kubectl get pod -n test-timeslicing -l app=pod
```
75 changes: 75 additions & 0 deletions demo/specs/quickstart/gpu-test-timeslicing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Two pods share GPU via TimeSlicing

apiVersion: v1
kind: Namespace
metadata:
name: timeslicing-gpu-test

---
apiVersion: resource.k8s.io/v1alpha2
kind: ResourceClaimTemplate
metadata:
namespace: timeslicing-gpu-test
name: timeslicing-gpu-test
spec:
spec:
resourceClassName: gpu.nvidia.com
parametersRef:
apiGroup: gpu.resource.nvidia.com
kind: GpuClaimParameters
name: timeslicing-gpu-test
---
apiVersion: gpu.resource.nvidia.com/v1alpha1
kind: GpuClaimParameters
metadata:
namespace: timeslicing-gpu-test
name: timeslicing-gpu-test
spec:
sharing:
strategy: TimeSlicing
timeSlicingConfig:
timeSlice: Short

---
apiVersion: v1
kind: Pod
metadata:
namespace: timeslicing-gpu-test
name: gpu-pod-1
labels:
app: pod
spec:
containers:
- name: ctr
image: oguzpastirmaci/gpu-burn
args: ["30"] # 30 seconds
resources:
claims:
- name: shared-gpu
resourceClaims:
- name: shared-gpu
source:
resourceClaimTemplateName: timeslicing-gpu-test
restartPolicy: Never

---
apiVersion: v1
kind: Pod
metadata:
namespace: timeslicing-gpu-test
name: gpu-pod-2
labels:
app: pod
spec:
containers:
- name: ctr
image: oguzpastirmaci/gpu-burn
args: ["30"] # 30 seconds
resources:
claims:
- name: shared-gpu
resourceClaims:
- name: shared-gpu
source:
resourceClaimTemplateName: timeslicing-gpu-test
restartPolicy: Never