Skip to content

Commit 8b3282e

Browse files
committed
Final fixes
Signed-off-by: William Yao <william2000yao@gmail.com>
1 parent 83d62eb commit 8b3282e

4 files changed

Lines changed: 15 additions & 18 deletions

File tree

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ select and configure resources in various ways:
247247
kubectl apply --filename=demo/basic-resourceclaimtemplate.yaml \
248248
--filename=demo/basic-multiple-requests.yaml \
249249
--filename=demo/basic-shared-claim-across-containers.yaml \
250-
--filename=demo/shared-claim-across-pods.yaml \
250+
--filename=demo/basic-shared-claim-across-pods.yaml \
251251
--filename=demo/basic-resourceclaim-opaque-config.yaml
252252
```
253253

@@ -261,21 +261,18 @@ basic-resourceclaimtemplate pod1 0/1 Pending 0
261261
basic-multiple-requests pod0 0/2 Pending 0 2s
262262
basic-shared-claim-across-containers pod0 0/1 ContainerCreating 0 2s
263263
basic-shared-claim-across-containers pod1 0/1 ContainerCreating 0 2s
264-
shared-claim-across-pods pod0 0/1 Pending 0 2s
264+
basic-shared-claim-across-pods pod0 0/1 Pending 0 2s
265265
basic-resourceclaim-opaque-config pod0 0/4 Pending 0 2s
266266
...
267267
```
268268

269269
Use your favorite editor to look through each of the `basic-*.yaml`
270-
files and see what they are doing. The semantics of each match the figure
271-
below:
272-
273-
![Demo Apps Figure](demo/demo-apps.png?raw=true "Semantics of the applications requesting resources from the example DRA resource driver.")
270+
files and see what they are doing.
274271

275272
Then dump the logs of each app to verify that GPUs were allocated to them
276273
according to these semantics:
277274
```bash
278-
for ns in basic-resourceclaimtemplate basic-multiple-requests basic-shared-claim-across-containers shared-claim-across-pods basic-resourceclaim-opaque-config; do \
275+
for ns in basic-resourceclaimtemplate basic-multiple-requests basic-shared-claim-across-containers basic-shared-claim-across-pods basic-resourceclaim-opaque-config; do \
279276
echo "${ns}:"
280277
for pod in $(kubectl get pod -n ${ns} --output=jsonpath='{.items[*].metadata.name}'); do \
281278
for ctr in $(kubectl get pod -n ${ns} ${pod} -o jsonpath='{.spec.containers[*].name}'); do \
@@ -310,7 +307,7 @@ declare -x GPU_DEVICE_2="gpu-2"
310307
declare -x GPU_DEVICE_2_SHARING_STRATEGY="TimeSlicing"
311308
declare -x GPU_DEVICE_2_TIMESLICE_INTERVAL="Default"
312309

313-
shared-claim-across-pods:
310+
basic-shared-claim-across-pods:
314311
pod0 ctr0:
315312
declare -x GPU_DEVICE_3="gpu-3"
316313
declare -x GPU_DEVICE_3_SHARING_STRATEGY="TimeSlicing"
@@ -402,7 +399,7 @@ example apps:
402399
kubectl delete --wait=false --filename=demo/basic-resourceclaimtemplate.yaml \
403400
--filename=demo/basic-multiple-requests.yaml \
404401
--filename=demo/basic-shared-claim-across-containers.yaml \
405-
--filename=demo/shared-claim-across-pods.yaml \
402+
--filename=demo/basic-shared-claim-across-pods.yaml \
406403
--filename=demo/basic-resourceclaim-opaque-config.yaml \
407404
--filename=demo/admin-access.yaml
408405
```
@@ -417,7 +414,7 @@ basic-resourceclaimtemplate pod1 1/1 Terminating 0 3
417414
basic-multiple-requests pod0 2/2 Terminating 0 31m
418415
basic-shared-claim-across-containers pod0 1/1 Terminating 0 31m
419416
basic-shared-claim-across-containers pod1 1/1 Terminating 0 31m
420-
shared-claim-across-pods pod0 1/1 Terminating 0 31m
417+
basic-shared-claim-across-pods pod0 1/1 Terminating 0 31m
421418
basic-resourceclaim-opaque-config pod0 4/4 Terminating 0 31m
422419
admin-access pod0 1/1 Terminating 0 31m
423420
...
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# object that multiple pods can reference by name.
88
#
99
# Expected: Both pods see the same GPU. Check with:
10-
# kubectl logs -n shared-claim-across-pods pod0 -c ctr0 | grep GPU_DEVICE
11-
# kubectl logs -n shared-claim-across-pods pod1 -c ctr0 | grep GPU_DEVICE
10+
# kubectl logs -n basic-shared-claim-across-pods pod0 -c ctr0 | grep GPU_DEVICE
11+
# kubectl logs -n basic-shared-claim-across-pods pod1 -c ctr0 | grep GPU_DEVICE
1212
# Both pods should show the same GPU ID.
1313
#
1414
# Driver requirements:
@@ -22,13 +22,13 @@
2222
apiVersion: v1
2323
kind: Namespace
2424
metadata:
25-
name: shared-claim-across-pods
25+
name: basic-shared-claim-across-pods
2626

2727
---
2828
apiVersion: resource.k8s.io/v1
2929
kind: ResourceClaim
3030
metadata:
31-
namespace: shared-claim-across-pods
31+
namespace: basic-shared-claim-across-pods
3232
name: single-gpu
3333
spec:
3434
devices:
@@ -41,7 +41,7 @@ spec:
4141
apiVersion: v1
4242
kind: Pod
4343
metadata:
44-
namespace: shared-claim-across-pods
44+
namespace: basic-shared-claim-across-pods
4545
name: pod0
4646
labels:
4747
app: pod
@@ -62,7 +62,7 @@ spec:
6262
apiVersion: v1
6363
kind: Pod
6464
metadata:
65-
namespace: shared-claim-across-pods
65+
namespace: basic-shared-claim-across-pods
6666
name: pod1
6767
labels:
6868
app: pod

test/e2e/e2e_setup_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var demoFiles = []string{
5050
"basic-multiple-requests.yaml",
5151
"basic-shared-claim-across-containers.yaml",
5252
"admin-access.yaml", // deploying this earlier to ensure the pod can access in-use devices and does not block future allocations of the same devices
53-
"shared-claim-across-pods.yaml",
53+
"basic-shared-claim-across-pods.yaml",
5454
"basic-resourceclaim-opaque-config.yaml",
5555
"initcontainer-shared-gpu.yaml",
5656
"cel-selector.yaml",

test/e2e/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ var _ = Describe("Test GPU allocation", func() {
9191
})
9292
})
9393
Context("Two pods sharing a global ResourceClaim with TimeSlicing and Default interval", func() {
94-
namespace := "shared-claim-across-pods"
94+
namespace := "basic-shared-claim-across-pods"
9595
pods := []string{"pod0", "pod1"}
9696
containers := []string{"ctr0"}
9797
expectedGPUCount := 1

0 commit comments

Comments
 (0)