From 30a0e8ccaa880e01bc02fede42c274730e560309 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 1 Jul 2020 18:36:37 +0300 Subject: [PATCH] fpga: update demo Updated FPGA demo screencasts: - used latest kustomize setup - got rid of cloning github repository - renamed test-fpga-region.yaml -> demo/test-fpga-orchestrated.yaml - updated readme --- demo/readme.md | 14 ++- demo/screencast-fpga-orchestrated.sh | 102 ++++++++---------- demo/screencast-fpga-preprogrammed.sh | 38 +++---- ...egion.yaml => test-fpga-orchestrated.yaml} | 2 +- 4 files changed, 66 insertions(+), 90 deletions(-) rename demo/{test-fpga-region.yaml => test-fpga-orchestrated.yaml} (92%) diff --git a/demo/readme.md b/demo/readme.md index 173b95f4..3841bf94 100644 --- a/demo/readme.md +++ b/demo/readme.md @@ -90,21 +90,19 @@ The demos begin with a fully [configured Kubernetes cluster](https://kubernetes. ### Demo steps 1. Validate the status of the [Kubernetes cluster](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/). -2. Clone the [Intel Device Plugins for Kubernetes source](https://github.com/intel/intel-device-plugins-for-kubernetes). -3. Provision the [admission controller webhook](https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/cmd/fpga_admissionwebhook/README.md). -4. Create bitstream storage (for orchestrated mode only) -5. Provision the [Intel® FPGA Device Plugin](https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/cmd/fpga_plugin/README.md). -6. Run the NLB3 or OpenCL workload. +2. Provision the [Intel® FPGA Device Plugin](https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/cmd/fpga_plugin/README.md). +3. Create bitstream storage (for orchestrated mode only) +4. Run the NLB3 or OpenCL workload. ### Screencasts -- Intel® FPGA Device Plugin deployment in preprogrammed mode +- Intel® FPGA Device Plugin deployment in preprogrammed mode and NLB workload: -[](https://asciinema.org/a/78iLCNz4W344vm4oSrDuJ6g6i) +[](https://asciinema.org/a/oIwOtM8hflsWTDu6UhNVS8401) - Intel® FPGA Device Plugin deployment with orchestrated/region mode and NLB workload: -[](https://asciinema.org/a/JuYzNxx9n0eQ1vQBzy86GYBki) +[](https://asciinema.org/a/sUnLNwpazbUXKdpC66g09W5w1) - Intel® FPGA Device Plugin deployment with orchestrated/region mode and OpenCL workload: diff --git a/demo/screencast-fpga-orchestrated.sh b/demo/screencast-fpga-orchestrated.sh index 9d3da43b..c4438990 100755 --- a/demo/screencast-fpga-orchestrated.sh +++ b/demo/screencast-fpga-orchestrated.sh @@ -36,22 +36,19 @@ out() cleanup() { clear - out 'Cleanup demo artifacts' 20 - out 'delete test pod:' 20 - command 'kubectl delete pod test-fpga-region || true' 20 - out 'delete mappings' 20 - command 'kubectl delete -f plugins/deployments/fpga_admissionwebhook/mappings-collection.yaml || true' 200 - out 'delete namespace and all the objects in the intelfpgaplugin-system namespace:' 20 - command 'kubectl delete namespace intelfpgaplugin-system || true' 20 - out 'delete node annotation:' 20 - command 'kubectl annotate node --all fpga.intel.com/device-plugin-mode- || true' 20 + out 'Cleanup demo artifacts' 200 + command 'kubectl delete pod test-fpga-orchestrated || true' 200 + command 'kubectl delete -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/deployments/fpga_admissionwebhook/mappings-collection.yaml || true' 200 + command 'kubectl delete namespace intelfpgaplugin-system || true' 200 + command 'kubectl annotate node --all fpga.intel.com/device-plugin-mode-' 200 } + record() { clear out 'Record this screencast' - 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'" + 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 } screen1() @@ -61,86 +58,79 @@ screen1() out "Let's get started!" out '1. Check if Kubernetes node is in good shape:' command 'kubectl get nodes' - command 'kubectl get pods --all-namespaces' - out 'Check if CRI-O is running k8s pods:' - command 'sudo crictl ps' + command 'kubectl get pods -n kube-system' + sleep 2 out 'Check if cert-manager is running:' - command 'kubectl get pods --namespace cert-manager' + command 'kubectl get pods -n cert-manager' + sleep 2 + out 'Check if CRI-O is running k8s pods:' + command 'sudo crictl ps -o json | jq .containers[].metadata.name' + sleep 1 } screen2() { clear - rm -rf $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes - out '2. Clone Intel Device Plugins for Kubernetes repository from github to the $GOPATH/src/github.com/intel directory' - 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 + out '2. Deploy FPGA plugin' + command 'kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/fpga_plugin/overlays/region' 100 + sleep 2 + out 'Deploy example mappings:' + command 'kubectl apply -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/deployments/fpga_admissionwebhook/mappings-collection.yaml' 100 + sleep 2 + out 'Check if the plugin pods are running:' + command 'kubectl get pods -n intelfpgaplugin-system' + sleep 2 + out 'Check webhook pod logs:' + command "kubectl logs $(kubectl get pods -n intelfpgaplugin-system| grep intelfpgaplugin-webhook | awk '{print $1}') -n intelfpgaplugin-system" + sleep 2 + out 'Check if resource fpga.intel.com/region- is allocatable:' + command 'kubectl describe node |grep -A3 Allocatable' + sleep 2 } screen3() { clear - cd /srv/demo - sudo rm -rf /srv/intel.com/fpga/Arria10.dcp1.2 /srv/intel.com/fpga/69528db6eb31577a8c3668f9faa081f6 - out '3. Create bistream storage' - out 'Create directory for Arria10.dcp1.2 interface id:' - command 'sudo mkdir -p /srv/intel.com/fpga/69528db6eb31577a8c3668f9faa081f6' - out 'Create Arria10.dcp1.2 symlink for convenience:' - command 'cd /srv/intel.com/fpga ; sudo ln -s 69528db6eb31577a8c3668f9faa081f6 Arria10.dcp1.2' - out 'Add OPAE NLB0 and NLB3 bitstreams:' - command "sudo cp -v f7*.gbs d8*.gbs /srv/intel.com/fpga/Arria10.dcp1.2/" + out '3. Install bistreams' + command 'sudo /opt/intel/fpga-sw/fpgatool -b nlb0.gbs install' + command 'sudo /opt/intel/fpga-sw/fpgatool -b nlb3.gbs install' out 'Create convenience symlinks:' + command 'cd /srv/intel.com/fpga ; sudo ln -s 69528db6eb31577a8c3668f9faa081f6 Arria10.dcp1.2' command "cd /srv/intel.com/fpga/Arria10.dcp1.2 ; sudo ln -s d8*.gbs nlb0.gbs ; sudo ln -s f7*.gbs nlb3.gbs" - out 'Directory content should look like this:' - command 'ls -la /srv/intel.com/fpga/ | grep Arria10.dcp1.2' - command 'ls -la /srv/intel.com/fpga/Arria10.dcp1.2/' + out 'The bitstream storage diretory should look like this:' + command 'ls -lR /srv/intel.com/fpga/' + sleep 2 } screen4() { clear - cd $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes - out '4. Deploy FPGA plugin' - command 'kubectl apply -k deployments/fpga_plugin/overlays/region' - sleep 2 - out 'Check if its pods are running:' - command 'kubectl get pods -n intelfpgaplugin-system' - out 'Deploy the mappings:' - command 'kubectl apply -f deployments/fpga_admissionwebhook/mappings-collection.yaml' - out 'Check webhook pod logs:' - command "kubectl logs $(kubectl get pods -n intelfpgaplugin-system| grep intelfpgaplugin-webhook | awk '{print $1}') -n intelfpgaplugin-system" - out 'Check if the plugin runs in 'region' mode:' - command "kubectl logs $(kubectl get pods --namespace intelfpgaplugin-system |grep fpgadeviceplugin|cut -f1 -d' ') --namespace intelfpgaplugin-system" - out 'Check if resource fpga.intel.com/region- is allocatable:' - command 'kubectl describe node |grep -A5 Allocatable' -} - -screen5() -{ - clear - cd $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes out '5. Run OPAE workload that uses NLB3 bitstream' - out 'Program devices with a NLB0 bitstream that is not wanted by the workload:' + out 'Program devices with NLB0 bitstream that is not wanted by the workload:' command "sudo /opt/intel/fpga-sw/fpgatool -b /srv/intel.com/fpga/Arria10.dcp1.2/nlb0.gbs -d ${DEVICE_PREFIX}.0 pr" command "sudo /opt/intel/fpga-sw/fpgatool -b /srv/intel.com/fpga/Arria10.dcp1.2/nlb0.gbs -d ${DEVICE_PREFIX}.1 pr" out 'Check if devices are programmed with it:' command 'cat /sys/class/*/*/*/afu_id' out 'Run workload:' - command 'kubectl create -f demo/test-fpga-region.yaml' + command 'curl https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/demo/test-fpga-orchestrated.yaml' 100 + command 'kubectl create -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/demo/test-fpga-orchestrated.yaml' 100 sleep 5 out 'Look at the test output' command 'kubectl logs test-fpga-region' + sleep 2 out 'Check if orchestration reprogrammed one device with required(NLB3) bitstream:' command 'cat /sys/class/*/*/*/afu_id' + sleep 1 } -screen6() +screen5() { clear out 'Summary:' 15 out "This screencast demonstrated 'Orchestration programmed' use case for FPGA:" 15 - out ' - FPGA device was programmed by the kubernetes machinery' 15 - out ' - desired bitstream resource was specified in the pod spec as fpga.intel.com/arria10.dcp1.2-nlb3' 15 - out ' - the machinery mapped arria10-nlb3 into the pair of region id/AFU id using admission controller webhook' 15 + out ' - FPGA device was programmed by the kubernetes machinery before running the workload' 15 + out ' - desired bitstream resource was specified in the pod spec as fpga.intel.com/arria10.dcp1.2-nlb3-orchestrated' 15 + out ' - the machinery mapped arria10.dcp1.2-nlb3-orchestrated into the pair of region id/AFU id using admission controller webhook' 15 out ' - programming was done by fpgatool utility installed by the init container into /opt/intel/fpga-sw' 15 out 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 if [ -n "$2" ] ; then screen$2 else - for n in $(seq 6) ; do screen$n ; sleep 3; done + for n in $(seq 5) ; do screen$n ; sleep 3; done fi elif [ "$1" == 'cleanup' ] ; then cleanup diff --git a/demo/screencast-fpga-preprogrammed.sh b/demo/screencast-fpga-preprogrammed.sh index cfa47b80..506f0390 100755 --- a/demo/screencast-fpga-preprogrammed.sh +++ b/demo/screencast-fpga-preprogrammed.sh @@ -38,10 +38,9 @@ cleanup() clear out 'Cleanup demo artifacts' 200 command 'kubectl delete pod test-fpga-preprogrammed || true' 200 - command 'kubectl delete -f plugins/deployments/fpga_admissionwebhook/mappings-collection.yaml || true' 200 - command 'kubectl delete namespace intelfpgaplugin-system || true' 20 + command 'kubectl delete -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/deployments/fpga_admissionwebhook/mappings-collection.yaml || true' 200 + command 'kubectl delete namespace intelfpgaplugin-system || true' 200 command 'kubectl annotate node --all fpga.intel.com/device-plugin-mode-' 200 - command 'rm -rf plugins' 200 } record() @@ -71,50 +70,39 @@ screen1() screen2() { clear - rm -rf plugins - out '2. Clone Intel Device Plugins for Kubernetes repository' - command "git clone https://github.com/intel/intel-device-plugins-for-kubernetes plugins" 15 - sleep 1 -} - -screen3() -{ - clear - out '3. Deploy FPGA plugin' - command 'kubectl apply -k plugins/deployments/fpga_plugin/overlays/af' - sleep 3 + out '2. Deploy FPGA plugin' + command 'kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/fpga_plugin/overlays/af' 100 + sleep 2 out 'Deploy example mappings:' - command 'kubectl apply -f plugins/deployments/fpga_admissionwebhook/mappings-collection.yaml' - sleep 3 + command 'kubectl apply -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/deployments/fpga_admissionwebhook/mappings-collection.yaml' 100 + sleep 2 out 'Check if the plugin pods are running:' command 'kubectl get pods -n intelfpgaplugin-system' sleep 2 out 'Check webhook pod logs:' command "kubectl logs $(kubectl get pods -n intelfpgaplugin-system| grep intelfpgaplugin-webhook | awk '{print $1}') -n intelfpgaplugin-system" - out 'Check if the plugin runs in 'region' mode:' - command "kubectl logs $(kubectl get pods --namespace intelfpgaplugin-system |grep fpgadeviceplugin|cut -f1 -d' ') --namespace intelfpgaplugin-system" sleep 2 out 'Check if resource fpga.intel.com/af- is allocatable:' command 'kubectl describe node |grep -A4 Allocatable' sleep 2 } -screen4() +screen3() { clear - out '4. Run OPAE workload that uses NLB3 bitstream' + out '3. Run OPAE workload that uses NLB3 bitstream' out 'Check if devices are programmed with NLB3:' command 'cat /sys/class/*/*/*/afu_id' out 'Run workload:' - command 'cat plugins/demo/test-fpga-preprogrammed.yaml' - command 'kubectl create -f plugins/demo/test-fpga-preprogrammed.yaml' + command 'curl https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/demo/test-fpga-preprogrammed.yaml' 100 + command 'kubectl create -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/master/demo/test-fpga-preprogrammed.yaml' 100 sleep 5 out 'Look at the test output' command 'kubectl logs test-fpga-preprogrammed' sleep 2 } -screen5() +screen4() { clear out 'Summary:' 15 @@ -130,7 +118,7 @@ if [ "$1" == 'play' ] ; then if [ -n "$2" ] ; then screen$2 else - for n in $(seq 5) ; do screen$n ; sleep 3; done + for n in $(seq 4) ; do screen$n ; sleep 3; done fi elif [ "$1" == 'cleanup' ] ; then cleanup diff --git a/demo/test-fpga-region.yaml b/demo/test-fpga-orchestrated.yaml similarity index 92% rename from demo/test-fpga-region.yaml rename to demo/test-fpga-orchestrated.yaml index 8f083a71..2c5e5233 100644 --- a/demo/test-fpga-region.yaml +++ b/demo/test-fpga-orchestrated.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Pod metadata: - name: test-fpga-region + name: test-fpga-orchestrated spec: containers: - name: test-container