-
Notifications
You must be signed in to change notification settings - Fork 206
/
Copy pathscreencast-qat-dpdk.sh
115 lines (115 loc) · 3.21 KB
/
screencast-qat-dpdk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash -e
PV='pv -qL'
command()
{
speed=$2
[ -z "$speed" ] && speed=10
echo "> $1" | $PV $speed
sh -c "$1"
echo | $PV $speed
}
out()
{
speed=$2
[ -z "$speed" ] && speed=10
echo "$1" | $PV $speed
echo | $PV $speed
}
cleanup()
{
clear
kubectl delete daemonset intel-qat-plugin
kubectl delete pod dpdkqatuio
#out "cleanup done"
}
record()
{
clear
out 'Record this screencast'
command "asciinema rec -t 'Intel QAT Device Plugin for Kubernetes - Test Demo' Intel-QAT-Device-Plugin-for-Kubernetes-Test-Demo.cast -c 'sh $0 play'"
}
screen1()
{
# cleanup
clear
out "This video demonstrates the Intel(R) QuickAssist Technology device Plugin for Kubernetes"
out "Prerequisites:"
out "* Intel(R) QuickAssist Technology (Intel(R) QAT) DH895xcc Chipset with SR-IOV enabled"
out "* Kubernetes v1.14 cluster"
out "* Data Plane Development Kit (DPDK) drivers configured"
out "Let's get started!"
}
screen2()
{
clear
out "1. Check if Kubernetes nodes are healthy:"
command "kubectl get nodes"
command "kubectl get pods"
out "2. Check for allocatable resources:"
command "kubectl get nodes -o json | jq .items[].status.allocatable"
out "Here we see there are 0 allocatable QAT Virtual Functions"
sleep 5
out "3. List QAT Virtual Functions:"
command "/root/dpdk/usertools/dpdk-devbind.py -s | grep \"QAT Virtual Function\""
out "QAT Virtual Functions are bound to kernel drivers"
sleep 3
}
screen3()
{
clear
out "4. Deploy QAT device plugin as a DaemonSet:"
command "kubectl create -f ../deployments/qat_plugin/qat_plugin_default_configmap.yaml"
command "kubectl create -f ../deployments/qat_plugin/qat_plugin.yaml"
command "kubectl get daemonset"
command "kubectl get pods"
sleep 3
}
screen4()
{
clear
out "5. Check again for allocatable resources:"
command "kubectl get nodes -o json | jq .items[].status.allocatable"
out "Now we see there are 32 allocatable QAT Virtual Functions"
sleep 5
out "6. List QAT Virtual Functions:"
command "/root/dpdk/usertools/dpdk-devbind.py -s | grep \"QAT Virtual Function\""
out "Now QAT Virtual Functions are bound to DPDK driver"
sleep 3
}
screen5()
{
clear
out "7. View pod specification file for pod requesting QAT Virtual Functions (crypto):"
command "kubectl apply --dry-run -o yaml -k ../deployments/qat_dpdk_app/crypto-perf"
sleep 5
out "8. Create Pod requesting QAT Virtual Functions (crypto):"
command "kubectl apply -k ../deployments/qat_dpdk_app/crypto-perf"
sleep 2
command "kubectl get pods"
sleep 2
}
screen6()
{
clear
out "9. View pod specification file for pod requesting QAT Virtual Functions (compress):"
command "kubectl apply --dry-run -o yaml -k ../deployments/qat_dpdk_app/compress-perf"
sleep 5
out "10. Create Pod requesting QAT Virtual Functions (compress):"
command "kubectl apply -k ../deployments/qat_dpdk_app/compress-perf"
sleep 2
command "kubectl get pods"
sleep 10
}
if [ "$1" == 'play' ] ; then
if [ -n "$2" ] ; then
screen$2
else
for n in $(seq 7) ; do screen$n ; sleep 3; done
fi
elif [ "$1" == 'cleanup' ] ; then
cleanup
elif [ "$1" == 'record' ] ; then
record
else
echo "Usage: $0 [--help|help|-h] | [play [<screen number>]] | [cleanup] | [record]"
fi