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:10
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
ENV DB_PASSWORD $db_password
ENV RABBITMQ_PASSWORD $rabbitmq_password
ENV INSTALLDIR /opt/intel/openvino
ENV OPENVINO_WORKBENCH_ROOT $INSTALLDIR/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"
ENV PUBLIC_KEY_OPENVINO_URL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
ENV OPENVINO_REPOSITORY https://apt.repos.intel.com/openvino/2019/
ENV OPENVINO_VERSION "-2019.3.344"
ENV OPENCL_VERSION 19.32.13826
ENV OPENCL_COMPILER_VERSION 1.0.10-2407
ENV OPENCL_DRIVERS_URI https://github.com/intel/compute-runtime/releases/download/${OPENCL_VERSION}
ENV PYTHON_VERSION 3.7
ENV PYTHON python${PYTHON_VERSION}
ENV DEPENDENCIES "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 \
libgtk-3-0 \
libpango1.0-dev \
libpng-dev \
libswscale-dev \
sudo \
unzip \
python3 \
python3-pip \
python3-setuptools \
python3-dev \
postgresql \
postgresql-contrib \
erlang-nox \
apt-transport-https \
rabbitmq-server \
autoconf \
automake \
libtool \
ocl-icd-libopencl1 \
libtinfo5 \
gnupg2"
RUN apt-get update && apt-get install -y --no-install-recommends ${DEPENDENCIES} && rm -rf /var/lib/apt/lists/*
WORKDIR /thirdparty
RUN sed -i '3ideb-src http://deb.debian.org/debian buster main' /etc/apt/sources.list && apt-get update && apt-get source ${DEPENDENCIES}
RUN curl -L ${PUBLIC_KEY_OPENVINO_URL} --output GPG-PUB-KEY-INTEL-OPENVINO && \
sudo apt-key add GPG-PUB-KEY-INTEL-OPENVINO && \
echo "deb ${OPENVINO_REPOSITORY} all main" > /etc/apt/sources.list.d/intel-openvino-2019.list
RUN apt-get update && apt-get install -y --no-install-recommends intel-openvino-dev-ubuntu18${OPENVINO_VERSION} && rm -rf /var/lib/apt/lists/*
WORKDIR /opt/gfx
RUN curl -L ${OPENCL_DRIVERS_URI}/intel-gmmlib_19.2.3_amd64.deb --output intel-gmmlib_amd64.deb && \
curl -L ${OPENCL_DRIVERS_URI}/intel-igc-core_${OPENCL_COMPILER_VERSION}_amd64.deb --output intel-igc-core_amd64.deb && \
curl -L ${OPENCL_DRIVERS_URI}/intel-igc-opencl_${OPENCL_COMPILER_VERSION}_amd64.deb --output intel-igc-opencl_amd64.deb && \
curl -L ${OPENCL_DRIVERS_URI}/intel-opencl_${OPENCL_VERSION}_amd64.deb --output intel-opencl_amd64.deb && \
curl -L ${OPENCL_DRIVERS_URI}/intel-ocloc_${OPENCL_VERSION}_amd64.deb --output intel-ocloc_amd64.deb && \
dpkg -i *.deb && \
ldconfig
# For VPU
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
# Add a user to groups "video" and "users" to use GPU and VPU
RUN gpasswd -a openvino video && gpasswd -a openvino users
# Build Inference Engine samples
RUN mkdir $INSTALLDIR/deployment_tools/inference_engine/samples/build && \
cd $INSTALLDIR/deployment_tools/inference_engine/samples/build && \
/bin/bash -c "source $INSTALLDIR/bin/setupvars.sh && cmake .. && make -j8 benchmark_app"
RUN mkdir -m 777 -p ${OPENVINO_WORKBENCH_DATA_PATH} && chown -R openvino ${OPENVINO_WORKBENCH_ROOT}
RUN ${PYTHON} -m pip install --no-cache-dir -r ${OPENVINO_WORKBENCH_ROOT}/requirements.txt && \
${PYTHON} -m pip install --no-cache-dir -r ${OPENVINO_WORKBENCH_ROOT}/model_analyzer/requirements.txt && \
${PYTHON} -m pip install --no-cache-dir -r ${INSTALLDIR}/python/python${PYTHON_VERSION}/requirements.txt && \
${PYTHON} -m pip install --no-cache-dir -r ${INSTALLDIR}/python/python${PYTHON_VERSION}/openvino/tools/calibration/requirements.txt && \
${PYTHON} -m pip install --no-cache-dir -r ${INSTALLDIR}/deployment_tools/model_optimizer/requirements.txt
WORKDIR ${INSTALLDIR}/deployment_tools/open_model_zoo/tools/accuracy_checker
RUN ${PYTHON} setup.py egg_info && ${PYTHON} -m pip install -r accuracy_checker.egg-info/requires.txt && ${PYTHON} setup.py install
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 \. ${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 same terminal, build the Docker container using the following command:

docker build -t workbench . \
--build-arg https_proxy=<https-proxy> \
--build-arg http_proxy=<http-proxy> \
--build-arg no_proxy=<no-proxy> \
--build-arg rabbitmq_password=openvino \
--build-arg db_password=openvino

The build command uses the following arguments:

Arguments Explanation
--build-arg https_proxy=<https-proxy>

--build-arg http_proxy=<http-proxy>

--build-arg no_proxy=<no-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.