diff --git a/.github/workflows/sycl_containers.yaml b/.github/workflows/sycl_containers.yaml index 9f5824ea99055..11f33c2d4a2ef 100644 --- a/.github/workflows/sycl_containers.yaml +++ b/.github/workflows/sycl_containers.yaml @@ -135,3 +135,118 @@ jobs: fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.fpgaemu.github_tag}} cpu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.oclcpu.github_tag}} + base_image_ubuntu2204: + if: github.repository == 'intel/llvm' + name: Base Ubuntu 22.04 Docker image + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Build and Push Container + uses: ./devops/actions/build_container + with: + push: ${{ github.event_name != 'pull_request' }} + file: ubuntu2204_base + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + tags: | + ghcr.io/${{ github.repository }}/ubuntu2204_base:${{ github.sha }} + ghcr.io/${{ github.repository }}/ubuntu2204_base:latest + build_image_ubuntu2204: + if: github.repository == 'intel/llvm' + name: Build Ubuntu Docker image + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Build and Push Container + uses: ./devops/actions/build_container + with: + push: ${{ github.event_name != 'pull_request' }} + file: ubuntu2204_build + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + tags: | + ghcr.io/${{ github.repository }}/ubuntu2204_build:${{ github.sha }} + ghcr.io/${{ github.repository }}/ubuntu2204_build:latest + + # This job produces a Docker container with the latest versions of Intel + # drivers, that can be found on GitHub. + drivers_image_ubuntu2204: + if: github.repository == 'intel/llvm' + name: Intel Drivers Ubuntu 22.04 Docker image + runs-on: ubuntu-latest + needs: base_image_ubuntu2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Get dependencies configuration + id: deps + run: | + DEPS=`cat devops/dependencies.json` + DEPS="${DEPS//'%'/'%25'}" + DEPS="${DEPS//$'\n'/'%0A'}" + DEPS="${DEPS//$'\r'/'%0D'}" + echo $DEPS + echo "::set-output name=deps::$DEPS" + - name: Build and Push Container + uses: ./devops/actions/build_container + with: + push: ${{ github.event_name != 'pull_request' }} + file: ubuntu2204_intel_drivers + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + tags: | + ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest-${{ github.sha }} + ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest + build-args: | + compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux.compute_runtime.github_tag}} + igc_tag=${{fromJson(steps.deps.outputs.deps).linux.igc.github_tag}} + tbb_tag=${{fromJson(steps.deps.outputs.deps).linux.tbb.github_tag}} + fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux.fpgaemu.github_tag}} + cpu_tag=${{fromJson(steps.deps.outputs.deps).linux.oclcpu.github_tag}} + + # This job produces a Docker container with the latest versions of Intel + # drivers, that can be found on GitHub. + drivers_image_ubuntu2204_unstable: + if: github.repository == 'intel/llvm' + name: Intel Drivers (unstable) Ubuntu 22.04 Docker image + runs-on: ubuntu-latest + needs: base_image_ubuntu2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Get dependencies configuration + id: deps + run: | + DEPS=`cat devops/dependencies.json` + DEPS="${DEPS//'%'/'%25'}" + DEPS="${DEPS//$'\n'/'%0A'}" + DEPS="${DEPS//$'\r'/'%0D'}" + echo $DEPS + echo "::set-output name=deps::$DEPS" + - name: Build and Push Container + uses: ./devops/actions/build_container + with: + push: ${{ github.event_name != 'pull_request' }} + file: ubuntu2204_intel_drivers + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + tags: | + ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable-${{ github.sha }} + ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable + build-args: | + compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.compute_runtime.github_tag}} + igc_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.igc.github_tag}} + tbb_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.tbb.github_tag}} + fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.fpgaemu.github_tag}} + cpu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.oclcpu.github_tag}} + diff --git a/.github/workflows/sycl_precommit.yml b/.github/workflows/sycl_precommit.yml index 33c70a28ca127..60c68d6bf4700 100644 --- a/.github/workflows/sycl_precommit.yml +++ b/.github/workflows/sycl_precommit.yml @@ -9,6 +9,7 @@ on: - '.github/ISSUE_TEMPLATE/**' - '.github/CODEOWNERS' - '.github/workflows/sycl_update_gpu_driver.yml' + - '.github/workflows/sycl_containers.yaml' - '.github/workflows/sycl_windows_build_and_test.yml' - '.github/workflows/sycl_macos_build_and_test.yml' - 'devops/containers/**' diff --git a/devops/containers/ubuntu2204_base.Dockerfile b/devops/containers/ubuntu2204_base.Dockerfile new file mode 100644 index 0000000000000..c00167e047716 --- /dev/null +++ b/devops/containers/ubuntu2204_base.Dockerfile @@ -0,0 +1,26 @@ +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +USER root + +# Install SYCL prerequisites +COPY scripts/install_build_tools.sh /install.sh +RUN /install.sh + +# By default Ubuntu sets an arbitrary UID value, that is different from host +# system. When CI passes default UID value of 1001, some of LLVM tools fail to +# discover user home directory and fail a few LIT tests. Fixes UID and GID to +# 1001, that is used as default by GitHub Actions. +RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash +# Add sycl user to video group so that it can access GPU +RUN usermod -aG video sycl +# Allow sycl user to run as sudo +RUN echo "sycl ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +COPY actions/cached_checkout /actions/cached_checkout +COPY actions/cleanup /actions/cleanup +COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh +COPY scripts/install_drivers.sh /opt/install_drivers.sh + +ENTRYPOINT ["/docker_entrypoint.sh"] diff --git a/devops/containers/ubuntu2204_build.Dockerfile b/devops/containers/ubuntu2204_build.Dockerfile new file mode 100644 index 0000000000000..7a25714278ce9 --- /dev/null +++ b/devops/containers/ubuntu2204_build.Dockerfile @@ -0,0 +1,38 @@ +FROM nvidia/cuda:11.7.0-devel-ubuntu22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +USER root + +# Install Nvidia keys +# https://forums.developer.nvidia.com/t/notice-cuda-linux-repository-key-rotation/212772 +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub + +# Install SYCL prerequisites +COPY scripts/install_build_tools.sh /install.sh +RUN /install.sh + +# Install AMD ROCm +RUN printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600\n' | tee /etc/apt/preferences.d/rocm-pin-600 +RUN apt install -yqq libnuma-dev wget gnupg2 && \ + wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \ + echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list && \ + apt update && \ + apt install -yqq rocm-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# By default Ubuntu sets an arbitrary UID value, that is different from host +# system. When CI passes default UID value of 1001, some of LLVM tools fail to +# discover user home directory and fail a few LIT tests. Fixes UID and GID to +# 1001, that is used as default by GitHub Actions. +RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash +# Add sycl user to video group so that it can access GPU +RUN usermod -aG video sycl + +COPY actions/cached_checkout /actions/cached_checkout +COPY actions/cleanup /actions/cleanup +COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh + +ENTRYPOINT ["/docker_entrypoint.sh"] + diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile new file mode 100644 index 0000000000000..2319b6d04a9d6 --- /dev/null +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -0,0 +1,27 @@ +ARG base_tag=latest +ARG base_image=ghcr.io/intel/llvm/ubuntu2204_base + +FROM $base_image:$base_tag + +ENV DEBIAN_FRONTEND=noninteractive + +ARG compute_runtime_tag=latest +ARG igc_tag=latest +ARG cm_tag=latest +ARG tbb_tag=latest +ARG fpgaemu_tag=latest +ARG cpu_tag=latest + +RUN apt update && apt install -yqq wget + +COPY scripts/get_release.py / +COPY scripts/install_drivers.sh / + +RUN mkdir /runtimes +ENV INSTALL_LOCATION=/runtimes +RUN /install_drivers.sh --all + +COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh + +ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"] +