From 359c9c37605580cf96432dfb60e1fca25ab86dd6 Mon Sep 17 00:00:00 2001 From: david-cortes-intel Date: Wed, 25 Sep 2024 08:43:56 +0200 Subject: [PATCH] Update Docker file (#2899) * pull only from conda-forge, syntax and version updates * update syntax for env * try reverting back to conda * optimize placement of docker statement to avoid re-downloads * clear warning * undo accidental commit --- .ci/env/apt.sh | 14 ++++++-------- .ci/env/environment.yml | 1 - dev/docker/README.md | 15 ++++++++++----- dev/docker/onedal-dev.Dockerfile | 25 ++++++++++++------------- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.ci/env/apt.sh b/.ci/env/apt.sh index 4c370e8ee5e..146fddccd0c 100755 --- a/.ci/env/apt.sh +++ b/.ci/env/apt.sh @@ -23,17 +23,15 @@ function update { } function add_repo { - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main" - sudo apt-get update + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | \ + gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \ + | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt update } function install_dpcpp { - sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-2024.2 - sudo bash -c 'echo libintelocl.so > /etc/OpenCL/vendors/intel-cpu.icd' + sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-runtime-libs } function install_mkl { diff --git a/.ci/env/environment.yml b/.ci/env/environment.yml index 61655fe9e76..171bd54de52 100644 --- a/.ci/env/environment.yml +++ b/.ci/env/environment.yml @@ -1,6 +1,5 @@ name: ci-env channels: - conda-forge - - defaults dependencies: - impi-devel=2021.12.0 diff --git a/dev/docker/README.md b/dev/docker/README.md index df4ba32bd63..0b7438d20c0 100644 --- a/dev/docker/README.md +++ b/dev/docker/README.md @@ -16,13 +16,18 @@ *******************************************************************************/--> # Docker Development Environment + ## How To Use + There is a simple docker dev environment for the oneDAL development and build process. It includes dependencies for building all oneDAL components with ``make`` and ``bazel`` -Note: The docker setup assumes that it is executed from the oneDAL repo and copies repo files inside the container +Note: The docker setup assumes that it is executed from the oneDAL repo and copies repo files inside the container. In order to build the container locally from the root of the `oneDAL` repository, execute the following: +```shell +docker build -t onedal-dev -f dev/docker/onedal-dev.Dockerfile . +``` -For that, run: - ```sh - docker run -it onedal-dev /bin/bash - ``` +Then, in order to use the container interactively, run: +```shell +docker run -it onedal-dev /bin/bash +``` diff --git a/dev/docker/onedal-dev.Dockerfile b/dev/docker/onedal-dev.Dockerfile index fb6c02394cc..d4851e38d7a 100644 --- a/dev/docker/onedal-dev.Dockerfile +++ b/dev/docker/onedal-dev.Dockerfile @@ -17,23 +17,28 @@ FROM ubuntu:22.04@sha256:adbb90115a21969d2fe6fa7f9af4253e16d45f8d4c1e930182610c4731962658 ARG workdirectory="/sources/oneDAL" - -COPY . ${workdirectory} - WORKDIR ${workdirectory} #Env setup RUN apt-get update && \ - apt-get -y install sudo wget gnupg git make python3-setuptools doxygen + apt-get -y install sudo wget gnupg git make python3-setuptools doxygen software-properties-common # Install miniconda -ENV CONDA_DIR /opt/conda -RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ - /bin/bash ~/miniconda.sh -b -p /opt/conda +ENV CONDA_DIR=/opt/conda +RUN wget --quiet \ + "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ + bash Miniforge3* -b -p /opt/conda # Put conda in path to use conda activate ENV PATH=$CONDA_DIR/bin:$PATH +# Installing environment for bazel +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 && \ + chmod 755 bazelisk-linux-amd64 && \ + mv bazelisk-linux-amd64 /usr/bin/bazel + +COPY . ${workdirectory} + # Installing environment for base development dependencies RUN .ci/env/apt.sh dev-base @@ -43,11 +48,6 @@ RUN .ci/env/apt.sh dpcpp # Installing environment for clang-format RUN .ci/env/apt.sh clang-format -# Installing environment for bazel -RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 && \ - chmod 755 bazelisk-linux-amd64 && \ - mv bazelisk-linux-amd64 /usr/bin/bazel - # Installing openBLAS dependency RUN .ci/env/openblas.sh @@ -56,4 +56,3 @@ RUN ./dev/download_micromkl.sh # Installing oneTBB dependency RUN ./dev/download_tbb.sh -