Skip to content

Commit a9dbd72

Browse files
authored
Merge pull request #416 from bart0sh/PR0086-update-fpga-demos
fpga: update demo
2 parents c923b71 + 30a0e8c commit a9dbd72

4 files changed

+66
-90
lines changed

demo/readme.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,19 @@ The demos begin with a fully [configured Kubernetes cluster](https://kubernetes.
9090
### Demo steps
9191

9292
1. Validate the status of the [Kubernetes cluster](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/).
93-
2. Clone the [Intel Device Plugins for Kubernetes source](https://github.com/intel/intel-device-plugins-for-kubernetes).
94-
3. Provision the [admission controller webhook](https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/cmd/fpga_admissionwebhook/README.md).
95-
4. Create bitstream storage (for orchestrated mode only)
96-
5. Provision the [Intel® FPGA Device Plugin](https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/cmd/fpga_plugin/README.md).
97-
6. Run the NLB3 or OpenCL workload.
93+
2. Provision the [Intel® FPGA Device Plugin](https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/cmd/fpga_plugin/README.md).
94+
3. Create bitstream storage (for orchestrated mode only)
95+
4. Run the NLB3 or OpenCL workload.
9896

9997
### Screencasts
10098

101-
- Intel® FPGA Device Plugin deployment in preprogrammed mode
99+
- Intel® FPGA Device Plugin deployment in preprogrammed mode and NLB workload:
102100

103-
[<img src="https://asciinema.org/a/78iLCNz4W344vm4oSrDuJ6g6i.svg" width="700">](https://asciinema.org/a/78iLCNz4W344vm4oSrDuJ6g6i)
101+
[<img src="https://asciinema.org/a/oIwOtM8hflsWTDu6UhNVS8401.svg" width="700">](https://asciinema.org/a/oIwOtM8hflsWTDu6UhNVS8401)
104102

105103
- Intel® FPGA Device Plugin deployment with orchestrated/region mode and NLB workload:
106104

107-
[<img src="https://asciinema.org/a/JuYzNxx9n0eQ1vQBzy86GYBki.svg" width="700">](https://asciinema.org/a/JuYzNxx9n0eQ1vQBzy86GYBki)
105+
[<img src="https://asciinema.org/a/sUnLNwpazbUXKdpC66g09W5w1.svg" width="700">](https://asciinema.org/a/sUnLNwpazbUXKdpC66g09W5w1)
108106

109107
- Intel® FPGA Device Plugin deployment with orchestrated/region mode and OpenCL workload:
110108

demo/screencast-fpga-orchestrated.sh

Lines changed: 46 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,19 @@ out()
3636
cleanup()
3737
{
3838
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
4844
}
4945

46+
5047
record()
5148
{
5249
clear
5350
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
5552
}
5653

5754
screen1()
@@ -61,86 +58,79 @@ screen1()
6158
out "Let's get started!"
6259
out '1. Check if Kubernetes node is in good shape:'
6360
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
6763
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
6969
}
7070

7171
screen2()
7272
{
7373
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
7789
}
7890

7991
screen3()
8092
{
8193
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'
9197
out 'Create convenience symlinks:'
98+
command 'cd /srv/intel.com/fpga ; sudo ln -s 69528db6eb31577a8c3668f9faa081f6 Arria10.dcp1.2'
9299
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/'
104102
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'
115103
}
116104

117-
screen5()
105+
screen4()
118106
{
119107
clear
120-
cd $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes
121108
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:'
123110
command "sudo /opt/intel/fpga-sw/fpgatool -b /srv/intel.com/fpga/Arria10.dcp1.2/nlb0.gbs -d ${DEVICE_PREFIX}.0 pr"
124111
command "sudo /opt/intel/fpga-sw/fpgatool -b /srv/intel.com/fpga/Arria10.dcp1.2/nlb0.gbs -d ${DEVICE_PREFIX}.1 pr"
125112
out 'Check if devices are programmed with it:'
126113
command 'cat /sys/class/*/*/*/afu_id'
127114
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
129117
sleep 5
130118
out 'Look at the test output'
131119
command 'kubectl logs test-fpga-region'
120+
sleep 2
132121
out 'Check if orchestration reprogrammed one device with required(NLB3) bitstream:'
133122
command 'cat /sys/class/*/*/*/afu_id'
123+
sleep 1
134124
}
135125

136-
screen6()
126+
screen5()
137127
{
138128
clear
139129
out 'Summary:' 15
140130
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
144134
out ' - programming was done by fpgatool utility installed by the init container into /opt/intel/fpga-sw' 15
145135
out
146136
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
150140
if [ -n "$2" ] ; then
151141
screen$2
152142
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
154144
fi
155145
elif [ "$1" == 'cleanup' ] ; then
156146
cleanup

demo/screencast-fpga-preprogrammed.sh

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ cleanup()
3838
clear
3939
out 'Cleanup demo artifacts' 200
4040
command 'kubectl delete pod test-fpga-preprogrammed || true' 200
41-
command 'kubectl delete -f plugins/deployments/fpga_admissionwebhook/mappings-collection.yaml || true' 200
42-
command 'kubectl delete namespace intelfpgaplugin-system || true' 20
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
4343
command 'kubectl annotate node --all fpga.intel.com/device-plugin-mode-' 200
44-
command 'rm -rf plugins' 200
4544
}
4645

4746
record()
@@ -71,50 +70,39 @@ screen1()
7170
screen2()
7271
{
7372
clear
74-
rm -rf plugins
75-
out '2. Clone Intel Device Plugins for Kubernetes repository'
76-
command "git clone https://github.com/intel/intel-device-plugins-for-kubernetes plugins" 15
77-
sleep 1
78-
}
79-
80-
screen3()
81-
{
82-
clear
83-
out '3. Deploy FPGA plugin'
84-
command 'kubectl apply -k plugins/deployments/fpga_plugin/overlays/af'
85-
sleep 3
73+
out '2. Deploy FPGA plugin'
74+
command 'kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/fpga_plugin/overlays/af' 100
75+
sleep 2
8676
out 'Deploy example mappings:'
87-
command 'kubectl apply -f plugins/deployments/fpga_admissionwebhook/mappings-collection.yaml'
88-
sleep 3
77+
command 'kubectl apply -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/deployments/fpga_admissionwebhook/mappings-collection.yaml' 100
78+
sleep 2
8979
out 'Check if the plugin pods are running:'
9080
command 'kubectl get pods -n intelfpgaplugin-system'
9181
sleep 2
9282
out 'Check webhook pod logs:'
9383
command "kubectl logs $(kubectl get pods -n intelfpgaplugin-system| grep intelfpgaplugin-webhook | awk '{print $1}') -n intelfpgaplugin-system"
94-
out 'Check if the plugin runs in 'region' mode:'
95-
command "kubectl logs $(kubectl get pods --namespace intelfpgaplugin-system |grep fpgadeviceplugin|cut -f1 -d' ') --namespace intelfpgaplugin-system"
9684
sleep 2
9785
out 'Check if resource fpga.intel.com/af-<af id> is allocatable:'
9886
command 'kubectl describe node |grep -A4 Allocatable'
9987
sleep 2
10088
}
10189

102-
screen4()
90+
screen3()
10391
{
10492
clear
105-
out '4. Run OPAE workload that uses NLB3 bitstream'
93+
out '3. Run OPAE workload that uses NLB3 bitstream'
10694
out 'Check if devices are programmed with NLB3:'
10795
command 'cat /sys/class/*/*/*/afu_id'
10896
out 'Run workload:'
109-
command 'cat plugins/demo/test-fpga-preprogrammed.yaml'
110-
command 'kubectl create -f plugins/demo/test-fpga-preprogrammed.yaml'
97+
command 'curl https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/demo/test-fpga-preprogrammed.yaml' 100
98+
command 'kubectl create -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/demo/test-fpga-preprogrammed.yaml' 100
11199
sleep 5
112100
out 'Look at the test output'
113101
command 'kubectl logs test-fpga-preprogrammed'
114102
sleep 2
115103
}
116104

117-
screen5()
105+
screen4()
118106
{
119107
clear
120108
out 'Summary:' 15
@@ -130,7 +118,7 @@ if [ "$1" == 'play' ] ; then
130118
if [ -n "$2" ] ; then
131119
screen$2
132120
else
133-
for n in $(seq 5) ; do screen$n ; sleep 3; done
121+
for n in $(seq 4) ; do screen$n ; sleep 3; done
134122
fi
135123
elif [ "$1" == 'cleanup' ] ; then
136124
cleanup

demo/test-fpga-region.yaml renamed to demo/test-fpga-orchestrated.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Pod
33
metadata:
4-
name: test-fpga-region
4+
name: test-fpga-orchestrated
55
spec:
66
containers:
77
- name: test-container

0 commit comments

Comments
 (0)