Skip to content

Commit

Permalink
Update and clean up quickstart README
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Chen <[email protected]>

Add link

Signed-off-by: Yuan Chen <[email protected]>

Minor typo fix

Signed-off-by: Yuan Chen <[email protected]>

Add a new folder mig
  • Loading branch information
yuanchen8911 committed May 7, 2024
1 parent 917e1ce commit 110186f
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 46 deletions.
61 changes: 61 additions & 0 deletions demo/specs/mig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#### Show the current MIG configuration of the machine
```console
nvidia-smi --query-gpu=index,name,uuid,mig.mode.current --format=csv
nvidia-smi -L
```

#### Show current state of the cluster
```console
kubectl get pod -A
```

#### Show the yaml files for MIG example apps:
```console
vim -O gpu-test4.yaml gpu-test5.yaml gpu-test6.yaml
```

#### Deploy the 3 MIG example apps above:
```console
kubectl apply --filename=gpu-test{4,5,6}.yaml
```

#### Show all the pods starting up:
```console
kubectl get pod -A -l app=pod
```

#### Show the output of nvidia-smi:
```console
nvidia-smi -L
```

#### Show the MIG devices allocated to each pod in gpu-test4
```console
for pod in \
$(kubectl get pod \
-n gpu-test4 \
--output=jsonpath='{.items[*].metadata.name}'); \
do \
echo "${pod}:"
kubectl logs -n gpu-test4 ${pod} -c ctr0
kubectl logs -n gpu-test4 ${pod} -c ctr1
kubectl logs -n gpu-test4 ${pod} -c ctr2
kubectl logs -n gpu-test4 ${pod} -c ctr3
echo ""
done
```

#### Delete this MIG examples:
```console
kubectl delete --filename=gpu-test{4,5,6}.yaml
```

#### Show the pods terminating:
```console
kubectl get pods -A -l app=pod
```

#### Show the output of nvidia-smi
```console
nvidia-smi -L
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 10 additions & 46 deletions demo/specs/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,40 @@
kubectl get pod -A
```

#### Show the current MIG configuration of the machine
#### Show the yaml files for the first 3 example apps discussed in the [KubeCon presentation](https://sched.co/1R2oG)
```console
nvidia-smi --query-gpu=index,name,uuid,mig.mode.current --format=csv
nvidia-smi -L
vim -O gpu-test1.yaml gpu-test2.yaml gpu-test3.yaml
```

#### Deploy the 4 example apps discussed in the slides
#### Deploy the 3 example apps above
```console
kubectl apply --filename=gpu-test{1,2,3,4}.yaml
kubectl apply --filename=gpu-test{1,2,3}.yaml
```

#### Show all the pods starting up
```console
kubectl get pod -A
```

#### Show the yaml files for the first 3 example apps
```console
vim -O gpu-test1.yaml gpu-test2.yaml gpu-test3.yaml
```

#### Show the GPUs allocated to each
```console
kubectl logs -n gpu-test1 -l app=pod
kubectl logs -n gpu-test2 pod --all-containers
kubectl logs -n gpu-test3 -l app=pod
```

#### Show the yaml file for the complicated example with MIG devices
```console
vim -O gpu-test4.yaml
```

#### Show the pods running
```console
kubectl get pod -A
```

#### Show the output of nvidia-smi
```console
nvidia-smi -L
```
#### Show the MPS (Multi-Process Service) example

#### Show the MIG devices allocated to each pod
```console
for pod in \
$(kubectl get pod \
-n gpu-test4 \
--output=jsonpath='{.items[*].metadata.name}'); \
do \
echo "${pod}:"
kubectl logs -n gpu-test4 ${pod} -c ctr0
kubectl logs -n gpu-test4 ${pod} -c ctr1
kubectl logs -n gpu-test4 ${pod} -c ctr2
kubectl logs -n gpu-test4 ${pod} -c ctr3
echo ""
done
vim -O gpu-test-mps.yaml
```

#### Delete this example
#### Deploy the MPS example
```console
kubectl delete -f gpu-test4.yaml
```

#### Show the pods terminating
```console
kubectl get pod -A
kubectl apply -f gpu-test-mps.yaml
```

#### Show the output of nvidia-smi
#### Show the pod running
```console
nvidia-smi -L
kubectl get pod -n sharing-demo -l app=pod
```

0 comments on commit 110186f

Please sign in to comment.