Install DL Workbench from Dockerfile

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

Build Docker Image and Run DL Workbench

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

FROM debian:10 as OPENVINO_BUILD
ENV INSTALLDIR /opt/intel/openvino
ENV OPENVINO_PACKAGE_URL https://download.01.org/opencv/2019/openvinotoolkit/R3/l_openvino_toolkit_dev_ubuntu18_p_2019.3.376.tgz
ENV BUILD_DEPENDENCIES "\
build-essential \
cmake \
sudo \
"
ENV INSTALATION_DEPENDENCIES "\
cpio \
libpng-dev \
curl \
unzip \
lsb-release \
ca-certificates \
autoconf \
automake \
libtool \
gnupg2\
"
RUN apt-get update && \
apt-get install -y --no-install-recommends ${BUILD_DEPENDENCIES} ${INSTALATION_DEPENDENCIES} && \
rm -rf /var/lib/apt/lists/*
# For VPU
RUN cd /opt/ && \
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
RUN curl -L ${OPENVINO_PACKAGE_URL} --output /tmp/openvino_package.tgz && \
mkdir -p ${INSTALLDIR} && \
tar -xvf /tmp/openvino_package.tgz -C ${INSTALLDIR} && \
mv ${INSTALLDIR}/l_openvino_toolkit_dev_ubuntu18_p_20*/* ${INSTALLDIR}/
# 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"
FROM debian:10
RUN useradd -ms /bin/bash openvino && chown openvino -R /home/openvino
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 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 "libcairo2-dev \
libpango1.0-dev \
libglib2.0-dev \
libgtk-3-0 \
libswscale-dev \
libavcodec-dev \
libavformat-dev \
libgstreamer1.0-0 \
gstreamer1.0-plugins-base \
libusb-1.0-0-dev \
libdrm-dev\
ocl-icd-libopencl1 \
dpkg-dev \
lsb-release \
libtinfo5 \
curl \
python3 \
python3-pip \
python3-setuptools \
python3-dev \
postgresql \
postgresql-contrib \
apt-transport-https \
rabbitmq-server \
sudo \
unzip \
"
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}
# GET BINARIES FROM OPENVINO BUILD
COPY --from=OPENVINO_BUILD /opt /opt
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
# MAKE INSTALL FOR LIBUSB
WORKDIR /opt/libusb-1.0.22/libusb
RUN /bin/mkdir -p '/usr/local/lib' && \
/bin/bash ../libtool --mode=install /usr/bin/install -c libusb-1.0.la '/usr/local/lib' && \
/bin/mkdir -p '/usr/local/include/libusb-1.0' && \
/usr/bin/install -c -m 644 libusb.h '/usr/local/include/libusb-1.0' && \
/bin/mkdir -p '/usr/local/lib/pkgconfig' && \
cd /opt/libusb-1.0.22/ && \
/usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig' && \
ldconfig
# Add a user to groups "video" and "users" to use GPU and VPU
RUN gpasswd -a openvino video && gpasswd -a openvino users
RUN mkdir -m 777 -p ${OPENVINO_WORKBENCH_DATA_PATH} && chown -R openvino ${OPENVINO_WORKBENCH_ROOT}
WORKDIR ${INSTALLDIR}/deployment_tools/open_model_zoo/tools/accuracy_checker
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 && \
${PYTHON} -m pip install --no-cache-dir -r ${INSTALLDIR}/deployment_tools/open_model_zoo/tools/downloader/requirements.in && \
${PYTHON} -m pip install --no-cache-dir -r ${INSTALLDIR}/deployment_tools/open_model_zoo/tools/downloader/requirements-pytorch.in && \
${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"]

Open a terminal in the folder with Dockerfile. Build the Docker container by running 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).

Open a terminal in the folder with Dockerfile and 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

The command above the Docker container named workbench with the following arguments:

Argument Explanation
-p 127.0.0.1:5665:5665 Maps Docker container port 5665 to host port 5665 to get access to the 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 the 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 the 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 is executed, open the link http://127.0.0.1:5665 in your browser. The DL Workbench Get Started page appears:

Get_Started_Page.png

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