From 3565b587baefda3be1ee727a75c2c78476b4642f Mon Sep 17 00:00:00 2001 From: Nick Sarnie Date: Fri, 13 Dec 2024 01:56:37 +0900 Subject: [PATCH] Revert "[SYCL][Devops] Fix `DockerFile` linting issues discovered by trivy" (#16346) Reverts intel/llvm#16290 Discussed with Alexey offline, reverting for now until we can address some more issues. CI failures expected, it's not actually using the changes in this PR. --- devops/containers/ubuntu2204_base.Dockerfile | 2 -- devops/containers/ubuntu2204_build.Dockerfile | 7 +++---- devops/containers/ubuntu2204_intel_drivers.Dockerfile | 2 -- devops/containers/ubuntu2204_preinstalled.Dockerfile | 11 ----------- devops/containers/ubuntu2404_base.Dockerfile | 2 -- devops/containers/ubuntu2404_intel_drivers.Dockerfile | 2 -- .../ubuntu2404_intel_drivers_igc_dev.Dockerfile | 2 -- devops/scripts/docker_entrypoint.sh | 3 ++- 8 files changed, 5 insertions(+), 26 deletions(-) diff --git a/devops/containers/ubuntu2204_base.Dockerfile b/devops/containers/ubuntu2204_base.Dockerfile index 4adf21f8871ff..07bb343cae93c 100644 --- a/devops/containers/ubuntu2204_base.Dockerfile +++ b/devops/containers/ubuntu2204_base.Dockerfile @@ -29,6 +29,4 @@ COPY actions/cleanup /actions/cleanup COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh COPY scripts/install_drivers.sh /opt/install_drivers.sh -USER sycl - ENTRYPOINT ["/docker_entrypoint.sh"] diff --git a/devops/containers/ubuntu2204_build.Dockerfile b/devops/containers/ubuntu2204_build.Dockerfile index faeb86126574a..313b455dbc25b 100644 --- a/devops/containers/ubuntu2204_build.Dockerfile +++ b/devops/containers/ubuntu2204_build.Dockerfile @@ -24,9 +24,10 @@ gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null && \ # Add rocm repo echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.1.1 jammy main" \ | tee --append /etc/apt/sources.list.d/rocm.list && \ -printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 +printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 && \ +apt update # Install the kernel driver -RUN apt update && apt install -yqq rocm-dev && \ +RUN apt install -yqq rocm-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -41,7 +42,5 @@ RUN usermod -aG irc sycl COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh -USER sycl - ENTRYPOINT ["/docker_entrypoint.sh"] diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile index fa3745141b827..fb018f195a48f 100644 --- a/devops/containers/ubuntu2204_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -25,7 +25,5 @@ RUN --mount=type=secret,id=github_token \ COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh -USER sycl - ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"] diff --git a/devops/containers/ubuntu2204_preinstalled.Dockerfile b/devops/containers/ubuntu2204_preinstalled.Dockerfile index 60fb91226398e..4d39cca4d6baa 100644 --- a/devops/containers/ubuntu2204_preinstalled.Dockerfile +++ b/devops/containers/ubuntu2204_preinstalled.Dockerfile @@ -10,16 +10,5 @@ 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"] diff --git a/devops/containers/ubuntu2404_base.Dockerfile b/devops/containers/ubuntu2404_base.Dockerfile index f8c96e8b1b7bb..c30e562c630e8 100644 --- a/devops/containers/ubuntu2404_base.Dockerfile +++ b/devops/containers/ubuntu2404_base.Dockerfile @@ -29,6 +29,4 @@ COPY actions/cleanup /actions/cleanup COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh COPY scripts/install_drivers.sh /opt/install_drivers.sh -USER sycl - ENTRYPOINT ["/docker_entrypoint.sh"] diff --git a/devops/containers/ubuntu2404_intel_drivers.Dockerfile b/devops/containers/ubuntu2404_intel_drivers.Dockerfile index a3f68a449ec54..b45e4a8adbb51 100644 --- a/devops/containers/ubuntu2404_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers.Dockerfile @@ -25,7 +25,5 @@ RUN --mount=type=secret,id=github_token \ COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh -USER sycl - ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"] diff --git a/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile b/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile index bd73fdde26bec..fd40361a379f5 100644 --- a/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile @@ -20,7 +20,5 @@ RUN --mount=type=secret,id=github_token \ COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh -USER sycl - ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"] diff --git a/devops/scripts/docker_entrypoint.sh b/devops/scripts/docker_entrypoint.sh index 6b323d17b084d..f0e89244d013f 100755 --- a/devops/scripts/docker_entrypoint.sh +++ b/devops/scripts/docker_entrypoint.sh @@ -1,7 +1,8 @@ #!/bin/bash if [ -d "$GITHUB_WORKSPACE" ]; then - sudo chown -R sycl:sycl $GITHUB_WORKSPACE + chown -R sycl:sycl $GITHUB_WORKSPACE + su sycl fi exec "$@"