From df65c0fb0c8524d010c8cc65fa388dd7131cc5e8 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Tue, 10 Dec 2024 08:58:08 -0800 Subject: [PATCH 1/5] [SYCL][Devops] Fix containers build We already have `sycl` user created by a base image, no need to repeat that. This is a follow-up to intel/llvm#16290 to address an issue which was not caught by pre-commit. --- devops/containers/ubuntu2204_preinstalled.Dockerfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/devops/containers/ubuntu2204_preinstalled.Dockerfile b/devops/containers/ubuntu2204_preinstalled.Dockerfile index 60fb91226398e..8d0d13a3ed190 100644 --- a/devops/containers/ubuntu2204_preinstalled.Dockerfile +++ b/devops/containers/ubuntu2204_preinstalled.Dockerfile @@ -10,15 +10,6 @@ ADD sycl_linux.tar.gz /opt/sycl/ ENV PATH /opt/sycl/bin:$PATH ENV LD_LIBRARY_PATH /opt/sycl/lib:$LD_LIBRARY_PATH -# 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/irc groups so that it can access GPU -RUN usermod -aG video sycl -RUN usermod -aG irc sycl - USER sycl ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"] From 55bce58af3643043056c9662146cd3d95bf61751 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Wed, 11 Dec 2024 08:03:48 -0800 Subject: [PATCH 2/5] Use sudo to install packages --- devops/containers/ubuntu2204_intel_drivers.Dockerfile | 2 +- devops/containers/ubuntu2404_intel_drivers.Dockerfile | 2 +- devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile index fa3745141b827..dbc7e822415b9 100644 --- a/devops/containers/ubuntu2204_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -7,7 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive ARG use_latest=true -RUN apt update && apt install -yqq wget +RUN sudo apt update && apt install -yqq wget COPY scripts/get_release.py / COPY scripts/install_drivers.sh / diff --git a/devops/containers/ubuntu2404_intel_drivers.Dockerfile b/devops/containers/ubuntu2404_intel_drivers.Dockerfile index a3f68a449ec54..c5c28aead1f02 100644 --- a/devops/containers/ubuntu2404_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers.Dockerfile @@ -7,7 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive ARG use_latest=true -RUN apt update && apt install -yqq wget +RUN sudo apt update && apt install -yqq wget COPY scripts/get_release.py / COPY scripts/install_drivers.sh / diff --git a/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile b/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile index bd73fdde26bec..ff68a713bb6d4 100644 --- a/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile @@ -5,7 +5,7 @@ FROM $base_image:$base_tag ENV DEBIAN_FRONTEND=noninteractive -RUN apt update && apt install -yqq libllvm14 +RUN sudo apt update && apt install -yqq libllvm14 COPY scripts/get_release.py / COPY scripts/install_drivers.sh / From 355412e036b607f4f3563aa9aee49342b4704b7a Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Wed, 11 Dec 2024 08:13:09 -0800 Subject: [PATCH 3/5] Properly deal with && --- devops/containers/ubuntu2204_intel_drivers.Dockerfile | 2 +- devops/containers/ubuntu2404_intel_drivers.Dockerfile | 2 +- devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile index dbc7e822415b9..068e67ae02c8c 100644 --- a/devops/containers/ubuntu2204_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -7,7 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive ARG use_latest=true -RUN sudo apt update && apt install -yqq wget +RUN sudo apt update && sudo apt install -yqq wget COPY scripts/get_release.py / COPY scripts/install_drivers.sh / diff --git a/devops/containers/ubuntu2404_intel_drivers.Dockerfile b/devops/containers/ubuntu2404_intel_drivers.Dockerfile index c5c28aead1f02..ca519c8c73074 100644 --- a/devops/containers/ubuntu2404_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers.Dockerfile @@ -7,7 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive ARG use_latest=true -RUN sudo apt update && apt install -yqq wget +RUN sudo apt update && sudo apt install -yqq wget COPY scripts/get_release.py / COPY scripts/install_drivers.sh / diff --git a/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile b/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile index ff68a713bb6d4..c7dddf467e95a 100644 --- a/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile @@ -5,7 +5,7 @@ FROM $base_image:$base_tag ENV DEBIAN_FRONTEND=noninteractive -RUN sudo apt update && apt install -yqq libllvm14 +RUN sudo apt update && sudo apt install -yqq libllvm14 COPY scripts/get_release.py / COPY scripts/install_drivers.sh / From e0a71fc729f2cb0378fcc275acf85f2230aeebaa Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Wed, 11 Dec 2024 08:17:46 -0800 Subject: [PATCH 4/5] More sudo to the god of sudo --- devops/containers/ubuntu2204_intel_drivers.Dockerfile | 4 ++-- devops/containers/ubuntu2404_intel_drivers.Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile index 068e67ae02c8c..859f3caf81ccd 100644 --- a/devops/containers/ubuntu2204_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -13,7 +13,7 @@ COPY scripts/get_release.py / COPY scripts/install_drivers.sh / COPY dependencies.json / -RUN mkdir /runtimes +RUN sudo mkdir /runtimes ENV INSTALL_LOCATION=/runtimes RUN --mount=type=secret,id=github_token \ if [ "$use_latest" = "true" ]; then \ @@ -21,7 +21,7 @@ RUN --mount=type=secret,id=github_token \ else \ install_driver_opt=" dependencies.json"; \ fi && \ - GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh $install_driver_opt --all + GITHUB_TOKEN=$(cat /run/secrets/github_token) sudo /install_drivers.sh $install_driver_opt --all COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh diff --git a/devops/containers/ubuntu2404_intel_drivers.Dockerfile b/devops/containers/ubuntu2404_intel_drivers.Dockerfile index ca519c8c73074..e4875c10cbdd3 100644 --- a/devops/containers/ubuntu2404_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers.Dockerfile @@ -13,7 +13,7 @@ COPY scripts/get_release.py / COPY scripts/install_drivers.sh / COPY dependencies.json / -RUN mkdir /runtimes +RUN sudo mkdir /runtimes ENV INSTALL_LOCATION=/runtimes RUN --mount=type=secret,id=github_token \ if [ "$use_latest" = "true" ]; then \ @@ -21,7 +21,7 @@ RUN --mount=type=secret,id=github_token \ else \ install_driver_opt=" dependencies.json"; \ fi && \ - GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh $install_driver_opt --all + GITHUB_TOKEN=$(cat /run/secrets/github_token) sudo /install_drivers.sh $install_driver_opt --all COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh From ff6507d97242b1dbcc64625d39ba5f3fa62eeef3 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Wed, 11 Dec 2024 08:39:11 -0800 Subject: [PATCH 5/5] Add sycl to sudoers for 2204 images --- devops/containers/ubuntu2204_build.Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devops/containers/ubuntu2204_build.Dockerfile b/devops/containers/ubuntu2204_build.Dockerfile index faeb86126574a..0cdc0bba443cd 100644 --- a/devops/containers/ubuntu2204_build.Dockerfile +++ b/devops/containers/ubuntu2204_build.Dockerfile @@ -39,6 +39,9 @@ RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash RUN usermod -aG video sycl RUN usermod -aG irc sycl +# Allow sycl user to run as sudo +RUN echo "sycl ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh USER sycl