-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a timeslicing sharing example to quickstart
Signed-off-by: Yuan Chen <[email protected]> Update namespace Signed-off-by: Yuan Chen <[email protected]> Update the timeslicing example Signed-off-by: Yuan Chen <[email protected]>
- Loading branch information
1 parent
bbaffa0
commit e2351eb
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |