Install DL Workbench from Dockerfile

You can build a Docker image that contains the OpenVINO™ package including DL Workbench.

Build Docker Image and Run DL Workbench

Create a file named Dockerfile with the script provided below. Save it to an empty folder on your machine.

FROM debian:9
RUN useradd -ms /bin/bash openvino && chown openvino -R /home/openvino
ARG http_proxy
ARG https_proxy
ARG no_proxy
ARG db_password
ARG rabbitmq_password
ARG DOWNLOAD_LINK
ENV DB_PASSWORD $db_password
ENV RABBITMQ_PASSWORD $rabbitmq_password
ENV INSTALL_DIR /opt/intel/openvino
ENV TEMP_DIR /tmp/openvino_installer
ENV OPENVINO_WORKBENCH_ROOT $INSTALL_DIR/deployment_tools/tools/workbench
ENV OPENVINO_WORKBENCH_DATA_PATH $OPENVINO_WORKBENCH_ROOT/app/data
ENV PYTHONPATH ${OPENVINO_WORKBENCH_ROOT}:${OPENVINO_WORKBENCH_ROOT}/app/main/console_tool_wrapper/winograd_tool/winograd_cli_tool
ENV NVM_DIR "/home/openvino/.nvm"
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
cpio \
curl \
gstreamer1.0-plugins-base \
libavcodec-dev \
libavformat-dev \
libcairo2-dev \
libdrm-dev \
libglib2.0-dev \
lsb-release \
libgstreamer1.0-0 \
libgtk2.0-dev \
libpango1.0-dev \
libpng-dev \
libswscale-dev \
rpm2cpio \
sudo \
unzip \
wget \
python3 \
python3-pip \
python3-setuptools \
python3-dev \
postgresql \
postgresql-contrib \
erlang-nox \
apt-transport-https \
rabbitmq-server \
autoconf \
automake \
libtool \
ocl-icd-libopencl1 && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p $TEMP_DIR/l_openvino_toolkit
WORKDIR $TEMP_DIR
RUN curl $DOWNLOAD_LINK --output l_openvino_toolkit.tgz
RUN tar xf l_openvino_toolkit.tgz -C l_openvino_toolkit
COPY install_RPMS.sh install_RPMS.sh
RUN ./install_RPMS.sh $TEMP_DIR/l_openvino_toolkit/l_openvino_toolkit*
RUN sed -i 's/<INSTALLDIR>/\/opt\/intel\/openvino/g' /opt/intel/openvino/bin/setupvars.sh
RUN mkdir /opt/gfx && cp $INSTALL_DIR/install_dependencies/*.deb /opt/gfx/
RUN cd /opt/gfx && \
dpkg -i *.deb && \
ldconfig && \
rm -rf /opt/gfx
RUN cd /tmp/ && \
curl -L https://github.com/libusb/libusb/archive/v1.0.22.zip --output v1.0.22.zip && \
unzip v1.0.22.zip && cd libusb-1.0.22 && \
./bootstrap.sh && \
./configure --disable-udev --enable-shared && \
make -j4 && \
make install && \
ldconfig && \
rm -rf /tmp/*
RUN gpasswd -a openvino video && gpasswd -a openvino users
RUN mkdir $INSTALL_DIR/deployment_tools/inference_engine/samples/build && \
cd $INSTALL_DIR/deployment_tools/inference_engine/samples/build && \
/bin/bash -c "source $INSTALL_DIR/bin/setupvars.sh && cmake .. && make -j8 benchmark_app"
RUN mkdir -m 777 -p ${OPENVINO_WORKBENCH_DATA_PATH} && \
chown -R openvino ${OPENVINO_WORKBENCH_ROOT}
RUN pip3 install --no-cache-dir -r ${OPENVINO_WORKBENCH_ROOT}/requirements.txt && \
pip3 install --no-cache-dir -r ${OPENVINO_WORKBENCH_ROOT}/model_analyzer/requirements.txt && \
pip3 install --no-cache-dir -r ${INSTALL_DIR}/python/python$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')/requirements.txt && \
pip3 install --no-cache-dir -r ${INSTALL_DIR}/python/python$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')/openvino/tools/calibration/requirements.txt && \
pip3 install --no-cache-dir -r ${INSTALL_DIR}/deployment_tools/model_optimizer/requirements.txt
WORKDIR ${INSTALL_DIR}/python/python3.5/openvino/tools/accuracy_checker
RUN python3 setup.py egg_info && pip3 install -r accuracy_checker.egg-info/requires.txt
RUN echo "openvino ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
WORKDIR ${OPENVINO_WORKBENCH_ROOT}/proxy
RUN [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
nvm install v10 && \
nvm use v10 && \
npm install
USER postgres
RUN service postgresql start && \
psql --command "CREATE USER openvino WITH SUPERUSER PASSWORD '${DB_PASSWORD}';" && \
createdb -O openvino workbench
USER openvino
WORKDIR ${OPENVINO_WORKBENCH_ROOT}
ENTRYPOINT ["bash", "/opt/intel/openvino/deployment_tools/tools/workbench/entrypoint.package.sh"]

In the folder with Dockerfile, create an empty file named install_RPMS.sh. Save the following script to it.

#!/bin/bash
help_message=$"usage install_RPMS.sh \${PATH_TO_UNPACKED_OPENVINO_PACKAGE}
required parameters:
\${PATH_TO_UNPACKED_OPENVINO_PACKAGE} - path to unpacked OpenVINO package for Ubuntu 16
"
if [ $# -eq 0 ]
then
echo "$help_message"
exit -1
fi
path_to_package=$1
set -ex
declare -a rpms_to_install
rpms_to_install=("intel-openvino-ie-rt-20*_64.rpm" \
"intel-openvino-ie-rt-core-ubuntu-xenial-*64.rpm" \
"intel-openvino-omz-*64.rpm" \
"intel-openvino-ie-bin-python-tools-ubuntu-xenial-*64.rpm" \
"intel-openvino-ie-rt-cpu-ubuntu-xenial-*64.rpm" \
"intel-openvino-ie-rt-gpu-ubuntu-xenial-*64.rpm" \
"intel-openvino-ie-rt-hddl-ubuntu-xenial-*64.rpm" \
"intel-openvino-ie-rt-vpu-ubuntu-xenial-*64.rpm" \
"intel-openvino-ie-sdk-ubuntu-xenial-*64.rpm" \
"intel-openvino-gfx-driver-*64.rpm" \
"intel-openvino-setupvars-*64.rpm" \
"intel-openvino-model-optimizer-*64.rpm" \
"intel-openvino-dl-workbench-*64.rpm" \
"intel-openvino-docs-*64.rpm" \
"intel-openvino-ie-samples-*64.rpm" \
"intel-openvino-opencv-lib-ubuntu-xenial-*64.rpm" \
"intel-openvino-opencv-generic-*64.rpm" )
path_to_rpms=$path_to_package/rpm
cd /
for rpm in ${rpms_to_install[@]}; do
rpm2cpio $path_to_rpms/${rpm} | sudo cpio -idvm
done
cd -
ln -s /opt/intel/openvino* /opt/intel/openvino

Open a terminal in the folder with Dockerfile and install_RPMS.sh. Give the script execute permission by running the following command:

sudo chmod +x install_RPMS.sh

In the same terminal, build the Docker container using the following command:

docker build -t workbench . \
--build-arg DOWNLOAD_LINK=<http://registrationcenter-download.intel.com/...> \
--build-arg https_proxy=<https-proxy> \
--build-arg http_proxy=<http-proxy> \
--build-arg rabbitmq_password=openvino \
--build-arg db_password=openvino

NOTE: Please replace the placeholder link to the latest version of Intel® Distribution of OpenVINO™ toolkit package in the DOWNLOAD_LINK argument. You can copy the link from the Intel® Distribution of OpenVINO™ toolkit download page after registration. Right click on the Offline Installer button on the download page for Linux* in your browser and press  Copy link address .

The build command uses the following arguments:

Arguments Explanation
--build-arg https_proxy=<https-proxy>
and
--build-arg http_proxy=<http-proxy>
Optional. If you are behind a corporate proxy, set environment variables.
--build-arg rabbitmq_password=openvino
and
--build-arg db_password=openvino
You can keep the default passwords or create new ones (use numbers and Latin letters only).

When the build is complete, run the Docker container using this command:

docker run -p 127.0.0.1:5665:5665 \
--name workbench \
--privileged \
-v /dev/bus/usb:/dev/bus/usb \
-v /dev/dri:/dev/dri \
-e PROXY_HOST_ADDRESS=0.0.0.0 \
-e PORT=5665 \
-e http_proxy=<http-proxy> \
-e https_proxy=<https-proxy> \
-it workbench

This command runs the Docker container named workbench with the following arguments:

Argument Explanation
-p 127.0.0.1:5665:5665 Maps the Docker container port 5665 to the host port 5665 to get access to DL Workbench from a web browser.
--priveleged Enables full container capabilities.
-v /dev/bus/usb:/dev/bus/usb Mounts directory /dev/bus/usb to the Docker container and enables the container to use a GPU device in DL Workbench.
-v /dev/dri:/dev/dri Mounts directory /dev/dri to the Docker container and enables the container to use a GPU device in DL Workbench.
-e https_proxy=<https-proxy>
and
-e http_proxy=<http-proxy>
Optional. If you are behind a corporate proxy, set environment variables.
-it Enables interactive processes in the DL Workbench terminal. Set to the Docker image name workbench.

Once the command executes, open the link https://127.0.0.1:5665 in your browser, and the DL Workbench Get Started page appears:

Get_Started_Page.png

You have successfully installed OpenVINO™ DL Workbench. Now you can go to Work with Models and Sample Datasets.