Frequently Asked Question

Vision Point usage with Docker for early adopters
Last Updated 2 years ago

Please note that Docker support is currently under development and not yet officially supported. This is a preliminary article written for early adopters only. The following instructions can be changed without prior notice.

Prerequisites:
1. Host Machine with a supported Linux distribution. Please refer to the paragraph "SystemRequirements" of the Vision Point Software Installation Guide for more information
2. Standard Vision Point software package should be installed on the host machine

Prepare the Vision Point installation package for use in a Docker container:
1. Download Vision Point package for the system you are planning to use in the docker container, form here
2. Untar the package in a temporary location
3. Open the install.sh file in a text editor and change the following parameters:
a. keep_driver=1
b. KAYA_SERVICE_NOT_IMPLEMENTED=1
c. KAYA_TRAY_NOT_IMPLEMENTED=1
4. Delete the following code block:
==========================================================================
#echo -e "Hello\nworld"
echo "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Attention KAYA Iron IMX camera users!"
echo "Firmware upgrade of Iron IMX camera(s) to version 4.0 is required before installing this software!"
echo "The latest firmware can be found here: https://storage.kayainstruments.com/s/firmware-update"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"

echo "Choose option to proceede:"
echo "[c] - continue with the installation process"
echo "[e] - exit the installation process"

while [ true ] ; do
read -p 'How would you like to proceede:' varName
case "$varName" in
'c') break
;;
'e') exit 0
;;
*) continue
;;
esac
done
==========================================================================

5. Open the install_GenICam.sh file (under GenICam folder) in a text editor and remove all "sudo" before the commands
6. Open the install_GenTL.sh file (under GenTL folder) in a text editor and remove all "sudo" before the commands
7. Open the install_OpenCV.sh file (under OpenCV folder) in a text editor and remove all "sudo" before the commands
8. Download the KYFGLib.conf file from here


Below we describe 2 approaches to installing Vision Point in a Docker container:
1. Install VP inside a running container
2. Install VP during a container image build

Dockerfile
1. Chose the system image you want to use
2. Install "lsb-release"
If you want to install the Vision Point during the build you will also need to install and setup the
"tzdata" package and set up the TZ environment variable
For example:
==========================================================================
RUN apt install tzdata -y
ENV TZ="America/New_York"
==========================================================================
3. Add KAYA environment variables:
================================
ENV KAYA_VISION_POINT_LOGS=/var/log/KAYA_Instruments
ENV KAYA_VISION_POINT_DOCS=/opt/KAYA_Instruments/Doc
ENV KAYA_VISION_POINT_SAMPLE_DATA=/opt/KAYA_Instruments/Examples/Data
ENV KAYA_VISION_POINT_SAMPLE_API="/opt/KAYA_Instruments/Examples/Vision Point API"
ENV KAYA_VISION_POINT_LIB_PATH="/opt/KAYA_Instruments/lib"
ENV KAYA_VISION_POINT_INCLUDE_PATH="/opt/KAYA_Instruments/include"
================================
4. Copy the folder with the modified Vision Point installation to some location inside your container (for example /home/VP)
For example:
================================
COPY $Package_name /home/VP
================================
5. Copy the KYFGLib.conf file to the "/root/.config/KAYA Instruments/internal/" directory inside the container
6. If you want to install the Vision Point during the build you need to run sh install.sh command from the Vision Point installation folder.

Dockerfile Examples

1. Dockerfile for 1st approach, Installing VP inside a running container:
==========================================================================
FROM ubuntu:20.04
ENV Package_name=KAYA_Vision_Point_Setup_2022.1_SP_2_Ubuntu_20.04_x64__branches-sw_6_1_x_2022_1_build_6.1.2.8539_2022-06-08_13-28-10
RUN apt-get update &&apt install -y lsb-release
ENV KAYA_VISION_POINT_LOGS=/var/log/KAYA_Instruments
ENV KAYA_VISION_POINT_DOCS=/opt/KAYA_Instruments/Doc
ENV KAYA_VISION_POINT_SAMPLE_DATA=/opt/KAYA_Instruments/Examples/Data
ENV KAYA_VISION_POINT_SAMPLE_API="/opt/KAYA_Instruments/Examples/Vision Point API"
ENV KAYA_VISION_POINT_LIB_PATH="/opt/KAYA_Instruments/lib"
ENV KAYA_VISION_POINT_INCLUDE_PATH="/opt/KAYA_Instruments/include"
COPY $Package_name /home/VP/
COPY ["KYFGLib.conf", "/root/.config/KAYA Instruments/internal/"]
==========================================================================

2. Dockerfile for 2nd approach, Installing VP during a container image build:
==========================================================================
FROM ubuntu:20.04
ENV Package_name=KAYA_Vision_Point_Setup_2022.1_SP_2_Ubuntu_20.04_x64__branches-sw_6_1_x_2022_1_build_6.1.2.8539_2022-06-08_13-28-10
RUN apt-get update &&apt install -y lsb-release
RUN apt install tzdata -y
ENV TZ="America/New_York"
ENV KAYA_VISION_POINT_LOGS=/var/log/KAYA_Instruments
ENV KAYA_VISION_POINT_DOCS=/opt/KAYA_Instruments/Doc
ENV KAYA_VISION_POINT_SAMPLE_DATA=/opt/KAYA_Instruments/Examples/Data
ENV KAYA_VISION_POINT_SAMPLE_API="/opt/KAYA_Instruments/Examples/Vision Point API"
ENV KAYA_VISION_POINT_LIB_PATH="/opt/KAYA_Instruments/lib"
ENV KAYA_VISION_POINT_INCLUDE_PATH="/opt/KAYA_Instruments/include"
COPY $Package_name /home/VP/
COPY ["KYFGLib.conf", "/root/.config/KAYA Instruments/internal/"]
WORKDIR /home/VP
RUN sh install.sh
==========================================================================

Building the container

Perform the standard docker build command
Example:
================================
docker build -t kaya/kaya-sample.
================================

Run the container

1. For the 1st approach (installing VP inside a running container) you will need the internet access
For example, you can add it by using the "--network host" flag with the docker run command.
2. To have access to the KAYA PCI inside the container devices you have two options:
a. Add --privileged flag to the docker run command and start it with "sudo"
b. Add --device=/dev/predatorDevice{device number} flag to the docker run command (in case of several devices need to add several flags)

Example of the docker run command
1. With the privileged flag
================================
sudo docker run --network host -it --privileged kaya/kaya-sample
================================
b. With device flag
================================
docker run --network host -it --device=/dev/predatorDevice0 kaya/kaya-sample
================================

Vision Point installation inside the container
For the 1st approach (installing VP inside a running container) please follow the instructions below:
1. cd to the Vision Point installation folder (for example "cd /home/VP")
2. Run the "sh install.sh" command

Please Wait!

Please wait... it will take a second!