Skip to content

Commit

Permalink
Add a demo svg file showing the baisc DRA use
Browse files Browse the repository at this point in the history
Update demo

Adjust demo svg format

Update svg format

Update the description of demo.

update

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

Update tje demo svg description

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

Update the svg demo

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

Remove duplicated info.

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

Clean up

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

Add a demo creation tool and udpate the demo

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

Update the svg file
  • Loading branch information
yuanchen8911 committed May 8, 2024
1 parent bbaffa0 commit 3b5c528
Show file tree
Hide file tree
Showing 6 changed files with 476 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
!
! Copy from https://github.com/mbadolato/iTerm2-Color-Schemes/blob/master/Xresources/Darkside
!
*.foreground: #bababa
*.background: #222324
*.cursorColor: #bbbbbb
!
! Black
*.color0: #000000
*.color8: #000000
!
! Red
*.color1: #e8341c
*.color9: #e05a4f
!
! Green
*.color2: #68c256
*.color10: #77b869
!
! Yellow
*.color3: #f2d42c
*.color11: #efd64b
!
! Blue
*.color4: #1c98e8
*.color12: #387cd3
!
! Magenta
*.color5: #8e69c9
*.color13: #957bbe
!
! Cyan
*.color6: #1c98e8
*.color14: #3d97e2
!
! White
*.color7: #bababa
*.color15: #bababa
!
! Bold, Italic, Underline
*.colorBD: #ffffff
!*.colorIT:
!*.colorUL:
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,15 @@ PHONY: .shell
-w /work \
--user $$(id -u):$$(id -g) \
$(BUILDIMAGE)

.PRECIOUS: %.cast
%.cast: %.demo
@WORK_DIR=$(shell dirname $<) \
./hack/democtl.sh "$<" "$@" \
--ps1='\033[1;96m~/nvidia/k8s-dra-driver\033[1;94m$$\033[0m '

.PRECIOUS: %.svg
%.svg: %.cast
@./hack/democtl.sh "$<" "$@" \
--term xresources \
--profile ./.xresources
2 changes: 1 addition & 1 deletion demo/clusters/kind/scripts/create-kind-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ kind create cluster \

# Unmount the masked /proc/driver/nvidia to allow
# dynamically generated MIG devices to be discovered
docker exec -it "${KIND_CLUSTER_NAME}-worker" umount -R /proc/driver/nvidia
docker exec "${KIND_CLUSTER_NAME}-worker" umount -R /proc/driver/nvidia
38 changes: 38 additions & 0 deletions demo/specs/quickstart/basic-demo.demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Demonstrate the basic use of DRA in a kind cluster

# Prerequisites: follow the instructions in the README
# 1. Install kind
# 2. Install and configure the NVIDIA container toolkit

# Show the current set of GPUs on the machine
nvidia-smi -L

# Create a kind cluster to run the demo:
./demo/clusters/kind/create-cluster.sh

# Show the cluster information
kubectl cluster-info
kubectl get nodes

# Build the image for the example resource driver and the images for the kind cluster:
./demo/clusters/kind/build-dra-driver.sh

# Install the driver in the kind cluster
./demo/clusters/kind/install-dra-driver.sh

# Show two pods running in the nvidia-dra-driver namespace:
kubectl get pods -n nvidia-dra-driver

# Run the examples in the demo/specs/quickstart folder. The README in that directory shows the full script:
# For example, you can run the second test.
kubectl apply --filename=demo/specs/quickstart/gpu-test2.yaml
sleep 2

# Get the pod information
kubectl get pod -n gpu-test2

# Get the GPU resource information of the pod.
kubectl logs -n gpu-test2 pod --all-containers

# Delete the kind cluster and clean up the environment
./demo/clusters/kind/delete-cluster.sh
2 changes: 1 addition & 1 deletion demo/specs/quickstart/basic-demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3b5c528

Please sign in to comment.