intel-device-plugins-for-ku.../cmd/fpga_crihook
Ed Bartosh 9df1afdf43 fpga_crihook: check if intel annotation is set
Check if container annotation com.intel.fpga.mode is set to
"intel.com/fpga-region". This annotation is set by device plugin.
So, the check should help to filter out unwanted workflow that
device plugin is not aware of.
2018-07-16 16:12:59 +03:00
..
testdata fpga_crihook: check if intel annotation is set 2018-07-16 16:12:59 +03:00
main_test.go fpga_crihook: check if intel annotation is set 2018-07-16 16:12:59 +03:00
main.go fpga_crihook: check if intel annotation is set 2018-07-16 16:12:59 +03:00
README.md implement CRI prestart hook 2018-07-05 13:49:09 +03:00

Build and setup prestart CRI-O hook

Get source code

$ mkdir -p $GOPATH/src/github.com/intel/
$ cd $GOPATH/src/github.com/intel/
$ git clone https://github.com/intel/intel-device-plugins-for-kubernetes.git

Build CRI-O hook

$ cd $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes
$ make fpga_crihook

Install CRI-O hook

$ sudo cp cmd/fpga_crihook/fpga_crihook /usr/local/bin/

Configure CRI-O to run the hook

$ sudo cat << EOF > /etc/containers/oci/hooks.d/prestart.json
{
    "hook" : "/usr/local/bin/fpga_crihook",
    "stage" : [ "prestart" ],
    "annotation": [ "intel.com/fpga-region" ]
}
EOF

$ sudo systemctl restart crio