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 tool for creating and updating svg demos #116

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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