@@ -36,22 +36,19 @@ out()
36
36
cleanup ()
37
37
{
38
38
clear
39
- out ' Cleanup demo artifacts' 20
40
- out ' delete test pod:' 20
41
- command ' kubectl delete pod test-fpga-region || true' 20
42
- out ' delete mappings' 20
43
- command ' kubectl delete -f plugins/deployments/fpga_admissionwebhook/mappings-collection.yaml || true' 200
44
- out ' delete namespace and all the objects in the intelfpgaplugin-system namespace:' 20
45
- command ' kubectl delete namespace intelfpgaplugin-system || true' 20
46
- out ' delete node annotation:' 20
47
- command ' kubectl annotate node --all fpga.intel.com/device-plugin-mode- || true' 20
39
+ out ' Cleanup demo artifacts' 200
40
+ command ' kubectl delete pod test-fpga-orchestrated || true' 200
41
+ command ' kubectl delete -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/deployments/fpga_admissionwebhook/mappings-collection.yaml || true' 200
42
+ command ' kubectl delete namespace intelfpgaplugin-system || true' 200
43
+ command ' kubectl annotate node --all fpga.intel.com/device-plugin-mode-' 200
48
44
}
49
45
46
+
50
47
record ()
51
48
{
52
49
clear
53
50
out ' Record this screencast'
54
- command " asciinema rec -t 'Intel FPGA Device Plugin for Kubernetes in orchestrated mode with $DRIVER kernel driver.' Intel-FPGA-Device-Plugin-for-Kubernetes-orchestrated-$DRIVER -Demo.cast -c 'sh ./screencast-fpga-orchestrated.sh play'"
51
+ command " asciinema rec -t 'Intel FPGA Device Plugin for Kubernetes in orchestrated mode with $DRIVER kernel driver.' Intel-FPGA-Device-Plugin-for-Kubernetes-orchestrated-$DRIVER -Demo.cast -c 'sh ./screencast-fpga-orchestrated.sh play'" 300
55
52
}
56
53
57
54
screen1 ()
@@ -61,86 +58,79 @@ screen1()
61
58
out " Let's get started!"
62
59
out ' 1. Check if Kubernetes node is in good shape:'
63
60
command ' kubectl get nodes'
64
- command ' kubectl get pods --all-namespaces'
65
- out ' Check if CRI-O is running k8s pods:'
66
- command ' sudo crictl ps'
61
+ command ' kubectl get pods -n kube-system'
62
+ sleep 2
67
63
out ' Check if cert-manager is running:'
68
- command ' kubectl get pods --namespace cert-manager'
64
+ command ' kubectl get pods -n cert-manager'
65
+ sleep 2
66
+ out ' Check if CRI-O is running k8s pods:'
67
+ command ' sudo crictl ps -o json | jq .containers[].metadata.name'
68
+ sleep 1
69
69
}
70
70
71
71
screen2 ()
72
72
{
73
73
clear
74
- rm -rf $GOPATH /src/github.com/intel/intel-device-plugins-for-kubernetes
75
- out ' 2. Clone Intel Device Plugins for Kubernetes repository from github to the $GOPATH/src/github.com/intel directory'
76
- command " mkdir -p $GOPATH /src/github.com/intel/; cd $GOPATH /src/github.com/intel; git clone https://github.com/intel/intel-device-plugins-for-kubernetes" 15
74
+ out ' 2. Deploy FPGA plugin'
75
+ command ' kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/fpga_plugin/overlays/region' 100
76
+ sleep 2
77
+ out ' Deploy example mappings:'
78
+ command ' kubectl apply -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/deployments/fpga_admissionwebhook/mappings-collection.yaml' 100
79
+ sleep 2
80
+ out ' Check if the plugin pods are running:'
81
+ command ' kubectl get pods -n intelfpgaplugin-system'
82
+ sleep 2
83
+ out ' Check webhook pod logs:'
84
+ command " kubectl logs $( kubectl get pods -n intelfpgaplugin-system| grep intelfpgaplugin-webhook | awk ' {print $1}' ) -n intelfpgaplugin-system"
85
+ sleep 2
86
+ out ' Check if resource fpga.intel.com/region-<id> is allocatable:'
87
+ command ' kubectl describe node |grep -A3 Allocatable'
88
+ sleep 2
77
89
}
78
90
79
91
screen3 ()
80
92
{
81
93
clear
82
- cd /srv/demo
83
- sudo rm -rf /srv/intel.com/fpga/Arria10.dcp1.2 /srv/intel.com/fpga/69528db6eb31577a8c3668f9faa081f6
84
- out ' 3. Create bistream storage'
85
- out ' Create directory for Arria10.dcp1.2 interface id:'
86
- command ' sudo mkdir -p /srv/intel.com/fpga/69528db6eb31577a8c3668f9faa081f6'
87
- out ' Create Arria10.dcp1.2 symlink for convenience:'
88
- command ' cd /srv/intel.com/fpga ; sudo ln -s 69528db6eb31577a8c3668f9faa081f6 Arria10.dcp1.2'
89
- out ' Add OPAE NLB0 and NLB3 bitstreams:'
90
- command " sudo cp -v f7*.gbs d8*.gbs /srv/intel.com/fpga/Arria10.dcp1.2/"
94
+ out ' 3. Install bistreams'
95
+ command ' sudo /opt/intel/fpga-sw/fpgatool -b nlb0.gbs install'
96
+ command ' sudo /opt/intel/fpga-sw/fpgatool -b nlb3.gbs install'
91
97
out ' Create convenience symlinks:'
98
+ command ' cd /srv/intel.com/fpga ; sudo ln -s 69528db6eb31577a8c3668f9faa081f6 Arria10.dcp1.2'
92
99
command " cd /srv/intel.com/fpga/Arria10.dcp1.2 ; sudo ln -s d8*.gbs nlb0.gbs ; sudo ln -s f7*.gbs nlb3.gbs"
93
- out ' Directory content should look like this:'
94
- command ' ls -la /srv/intel.com/fpga/ | grep Arria10.dcp1.2'
95
- command ' ls -la /srv/intel.com/fpga/Arria10.dcp1.2/'
96
- }
97
-
98
- screen4 ()
99
- {
100
- clear
101
- cd $GOPATH /src/github.com/intel/intel-device-plugins-for-kubernetes
102
- out ' 4. Deploy FPGA plugin'
103
- command ' kubectl apply -k deployments/fpga_plugin/overlays/region'
100
+ out ' The bitstream storage diretory should look like this:'
101
+ command ' ls -lR /srv/intel.com/fpga/'
104
102
sleep 2
105
- out ' Check if its pods are running:'
106
- command ' kubectl get pods -n intelfpgaplugin-system'
107
- out ' Deploy the mappings:'
108
- command ' kubectl apply -f deployments/fpga_admissionwebhook/mappings-collection.yaml'
109
- out ' Check webhook pod logs:'
110
- command " kubectl logs $( kubectl get pods -n intelfpgaplugin-system| grep intelfpgaplugin-webhook | awk ' {print $1}' ) -n intelfpgaplugin-system"
111
- out ' Check if the plugin runs in ' region' mode:'
112
- command " kubectl logs $( kubectl get pods --namespace intelfpgaplugin-system | grep fpgadeviceplugin| cut -f1 -d' ' ) --namespace intelfpgaplugin-system"
113
- out ' Check if resource fpga.intel.com/region-<FPGA interface id> is allocatable:'
114
- command ' kubectl describe node |grep -A5 Allocatable'
115
103
}
116
104
117
- screen5 ()
105
+ screen4 ()
118
106
{
119
107
clear
120
- cd $GOPATH /src/github.com/intel/intel-device-plugins-for-kubernetes
121
108
out ' 5. Run OPAE workload that uses NLB3 bitstream'
122
- out ' Program devices with a NLB0 bitstream that is not wanted by the workload:'
109
+ out ' Program devices with NLB0 bitstream that is not wanted by the workload:'
123
110
command " sudo /opt/intel/fpga-sw/fpgatool -b /srv/intel.com/fpga/Arria10.dcp1.2/nlb0.gbs -d ${DEVICE_PREFIX} .0 pr"
124
111
command " sudo /opt/intel/fpga-sw/fpgatool -b /srv/intel.com/fpga/Arria10.dcp1.2/nlb0.gbs -d ${DEVICE_PREFIX} .1 pr"
125
112
out ' Check if devices are programmed with it:'
126
113
command ' cat /sys/class/*/*/*/afu_id'
127
114
out ' Run workload:'
128
- command ' kubectl create -f demo/test-fpga-region.yaml'
115
+ command ' curl https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/demo/test-fpga-orchestrated.yaml' 100
116
+ command ' kubectl create -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/demo/test-fpga-orchestrated.yaml' 100
129
117
sleep 5
130
118
out ' Look at the test output'
131
119
command ' kubectl logs test-fpga-region'
120
+ sleep 2
132
121
out ' Check if orchestration reprogrammed one device with required(NLB3) bitstream:'
133
122
command ' cat /sys/class/*/*/*/afu_id'
123
+ sleep 1
134
124
}
135
125
136
- screen6 ()
126
+ screen5 ()
137
127
{
138
128
clear
139
129
out ' Summary:' 15
140
130
out " This screencast demonstrated 'Orchestration programmed' use case for FPGA:" 15
141
- out ' - FPGA device was programmed by the kubernetes machinery' 15
142
- out ' - desired bitstream resource was specified in the pod spec as fpga.intel.com/arria10.dcp1.2-nlb3' 15
143
- out ' - the machinery mapped arria10-nlb3 into the pair of region id/AFU id using admission controller webhook' 15
131
+ out ' - FPGA device was programmed by the kubernetes machinery before running the workload ' 15
132
+ out ' - desired bitstream resource was specified in the pod spec as fpga.intel.com/arria10.dcp1.2-nlb3-orchestrated ' 15
133
+ out ' - the machinery mapped arria10.dcp1.2 -nlb3-orchestrated into the pair of region id/AFU id using admission controller webhook' 15
144
134
out ' - programming was done by fpgatool utility installed by the init container into /opt/intel/fpga-sw' 15
145
135
out
146
136
out ' More detailed information about Intel Device Plugins can be found at https://github.com/intel/intel-device-plugins-for-kubernetes' 15
@@ -150,7 +140,7 @@ if [ "$1" == 'play' ] ; then
150
140
if [ -n " $2 " ] ; then
151
141
screen$2
152
142
else
153
- for n in $( seq 6 ) ; do screen$n ; sleep 3; done
143
+ for n in $( seq 5 ) ; do screen$n ; sleep 3; done
154
144
fi
155
145
elif [ " $1 " == ' cleanup' ] ; then
156
146
cleanup
0 commit comments