From ad4e216ac2ba407aa77490a4ad735fb69b025dc3 Mon Sep 17 00:00:00 2001 From: Igor Salnikov Date: Wed, 30 Mar 2022 19:56:01 +0300 Subject: [PATCH 1/2] Install GPU driver in opensource image --- docker/dockerfiles/Dockerfile_opensource_image.template | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/dockerfiles/Dockerfile_opensource_image.template b/docker/dockerfiles/Dockerfile_opensource_image.template index 0ce337f9..0dfbcaa2 100644 --- a/docker/dockerfiles/Dockerfile_opensource_image.template +++ b/docker/dockerfiles/Dockerfile_opensource_image.template @@ -83,6 +83,10 @@ RUN sed -Ei 's/# deb-src /deb-src /' /etc/apt/sources.list && \ apt clean && \ rm -rf /var/lib/apt/lists/* +RUN curl -L https://raw.githubusercontent.com/openvinotoolkit/openvino/master/scripts/install_dependencies/install_NEO_OCL_driver.sh -o /tmp/install_NEO_OCL_driver.sh && \ + chmod +x /tmp/install_NEO_OCL_driver.sh && \ + bash /tmp/install_NEO_OCL_driver.sh -y + # CREATE DIRECTORY FOR PUBLIC WORKBENCH ARTIFACTS RUN mkdir -m 777 -p ${WORKBENCH_PUBLIC_DIR} && chown -R ${USER_NAME} ${WORKBENCH_PUBLIC_DIR} From 0b9906d674d70182d20a366c06dab5c28a56268f Mon Sep 17 00:00:00 2001 From: Igor Salnikov Date: Fri, 1 Apr 2022 19:24:42 +0300 Subject: [PATCH 2/2] build client in image --- .../Dockerfile_opensource_image.template | 17 +++++++++++++---- docker/local/build_image.sh | 10 +++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/docker/dockerfiles/Dockerfile_opensource_image.template b/docker/dockerfiles/Dockerfile_opensource_image.template index 0dfbcaa2..beedcbdc 100644 --- a/docker/dockerfiles/Dockerfile_opensource_image.template +++ b/docker/dockerfiles/Dockerfile_opensource_image.template @@ -1,3 +1,10 @@ +FROM node:14-alpine AS client_builder +ENV CLIENT_FOLDER /root/client +COPY client ${CLIENT_FOLDER} +WORKDIR ${CLIENT_FOLDER} +RUN npm ci +RUN DL_PROFILER_BACKEND_STATIC_PATH=${CLIENT_FOLDER}/static/ npm run pack + FROM ubuntu:20.04 SHELL ["/bin/bash", "+x", "-c"] @@ -78,15 +85,14 @@ RUN apt update && \ RUN sed -Ei 's/# deb-src /deb-src /' /etc/apt/sources.list && \ apt update && \ apt install -y --no-install-recommends ${DEPENDENCIES} && \ + curl -L https://raw.githubusercontent.com/openvinotoolkit/openvino/master/scripts/install_dependencies/install_NEO_OCL_driver.sh -o /tmp/install_NEO_OCL_driver.sh && \ + chmod +x /tmp/install_NEO_OCL_driver.sh && \ + bash /tmp/install_NEO_OCL_driver.sh -y && \ apt source gettext-base && \ apt remove -y dpkg-dev && \ apt clean && \ rm -rf /var/lib/apt/lists/* -RUN curl -L https://raw.githubusercontent.com/openvinotoolkit/openvino/master/scripts/install_dependencies/install_NEO_OCL_driver.sh -o /tmp/install_NEO_OCL_driver.sh && \ - chmod +x /tmp/install_NEO_OCL_driver.sh && \ - bash /tmp/install_NEO_OCL_driver.sh -y - # CREATE DIRECTORY FOR PUBLIC WORKBENCH ARTIFACTS RUN mkdir -m 777 -p ${WORKBENCH_PUBLIC_DIR} && chown -R ${USER_NAME} ${WORKBENCH_PUBLIC_DIR} @@ -97,6 +103,9 @@ WORKDIR ${INTEL_OPENVINO_DIR}/tools RUN rm -rf ${OPENVINO_WORKBENCH_ROOT} ADD --chown=workbench workbench ${OPENVINO_WORKBENCH_ROOT}/ +WORKDIR ${OPENVINO_WORKBENCH_ROOT} +COPY --from=client_builder --chown=workbench /root/client/static ./static/ + RUN python3 -m pip install pip==19.3.1 # COPY JUPYTER USER SETTINGS diff --git a/docker/local/build_image.sh b/docker/local/build_image.sh index 61b91b9d..cb0cbb9a 100755 --- a/docker/local/build_image.sh +++ b/docker/local/build_image.sh @@ -28,24 +28,20 @@ done set -e +echo echo -e "${TERMINAL_COLOR_MESSAGE} The script must be run from the root folder of the Workbench ${TERMINAL_COLOR_CLEAR}" -echo -e "${TERMINAL_COLOR_MESSAGE} Also install 'NVM' from the repository 'https://github.com/nvm-sh/nvm' and install the client dependencies in the client folder with the following command: 'npm install'${TERMINAL_COLOR_CLEAR}" echo ROOT_FOLDER="${PWD}" pushd ${ROOT_FOLDER} - pushd client - source ${NVM_DIR}/nvm.sh && nvm use 14 - DL_PROFILER_BACKEND_STATIC_PATH=../static/ npm run pack - popd - if [ -d $TEMP_FOLDER ]; then rm -rf $TEMP_FOLDER fi mkdir $TEMP_FOLDER pushd $TEMP_FOLDER rsync -av --progress ${ROOT_FOLDER} ./ --exclude={'venv','venv_tf2','tests','client','.git','wb/data','.venv','.unified_venv'} + rsync -av --progress ${ROOT_FOLDER}/client ./ --exclude={'node_modules','.idea','.git','e2e'} VERSIONS_FILE="${ROOT_FOLDER}/automation/Jenkins/openvino_version.yml" @@ -90,4 +86,4 @@ pushd ${ROOT_FOLDER} popd echo "To run the image, execute the following command:" -echo "docker rm local_build || true && openvino-workbench --image ${IMAGE_NAME}:${IMAGE_TAG} --container-name local_build" +echo "docker rm local_build || true && openvino-workbench --image ${IMAGE_NAME}:${IMAGE_TAG} --container-name local_build --enable-gpu"