File tree Expand file tree Collapse file tree 5 files changed +38
-47
lines changed Expand file tree Collapse file tree 5 files changed +38
-47
lines changed Original file line number Diff line number Diff line change @@ -8,21 +8,8 @@ USER root
88COPY scripts/install_build_tools.sh /install.sh
99RUN /install.sh
1010
11- # By default Ubuntu sets an arbitrary UID value, that is different from host
12- # system. When CI passes default UID value of 1001, some of LLVM tools fail to
13- # discover user home directory and fail a few LIT tests. Fixes UID and GID to
14- # 1001, that is used as default by GitHub Actions.
15- RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
16- # Add sycl user to video/irc groups so that it can access GPU
17- RUN usermod -aG video sycl
18- RUN usermod -aG irc sycl
19-
20- # group 109 is required for sycl user to access PVC card.
21- RUN groupadd -g 109 render
22- RUN usermod -aG render sycl
23-
24- # Allow sycl user to run as sudo
25- RUN echo "sycl ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
11+ COPY scripts/setup-sycl-user.sh /user-setup.sh
12+ RUN /user-setup.sh
2613
2714COPY actions/cached_checkout /actions/cached_checkout
2815COPY actions/cleanup /actions/cleanup
Original file line number Diff line number Diff line change @@ -30,14 +30,8 @@ RUN apt update && apt install -yqq rocm-dev && \
3030 apt-get clean && \
3131 rm -rf /var/lib/apt/lists/*
3232
33- # By default Ubuntu sets an arbitrary UID value, that is different from host
34- # system. When CI passes default UID value of 1001, some of LLVM tools fail to
35- # discover user home directory and fail a few LIT tests. Fixes UID and GID to
36- # 1001, that is used as default by GitHub Actions.
37- RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
38- # Add sycl user to video/irc groups so that it can access GPU
39- RUN usermod -aG video sycl
40- RUN usermod -aG irc sycl
33+ COPY scripts/setup-sycl-user.sh /user-setup.sh
34+ RUN /user-setup.sh
4135
4236COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh
4337
Original file line number Diff line number Diff line change @@ -3,22 +3,15 @@ ARG base_image=ghcr.io/intel/llvm/ubuntu2204_intel_drivers
33
44FROM $base_image:$base_tag
55
6+ USER ROOT
7+
68COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh
79RUN mkdir -p /opt/sycl
810ADD sycl_linux.tar.gz /opt/sycl/
911
1012ENV PATH /opt/sycl/bin:$PATH
1113ENV LD_LIBRARY_PATH /opt/sycl/lib:$LD_LIBRARY_PATH
1214
13- # By default Ubuntu sets an arbitrary UID value, that is different from host
14- # system. When CI passes default UID value of 1001, some of LLVM tools fail to
15- # discover user home directory and fail a few LIT tests. Fixes UID and GID to
16- # 1001, that is used as default by GitHub Actions.
17- RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
18- # Add sycl user to video/irc groups so that it can access GPU
19- RUN usermod -aG video sycl
20- RUN usermod -aG irc sycl
21-
2215USER sycl
2316
2417ENTRYPOINT ["/bin/bash" , "/drivers_entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -8,21 +8,8 @@ USER root
88COPY scripts/install_build_tools.sh /install.sh
99RUN /install.sh
1010
11- # By default Ubuntu sets an arbitrary UID value, that is different from host
12- # system. When CI passes default UID value of 1001, some of LLVM tools fail to
13- # discover user home directory and fail a few LIT tests. Fixes UID and GID to
14- # 1001, that is used as default by GitHub Actions.
15- RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
16- # Add sycl user to video/irc groups so that it can access GPU
17- RUN usermod -aG video sycl
18- RUN usermod -aG irc sycl
19-
20- # group 109 is required for sycl user to access PVC card.
21- RUN groupadd -g 109 render
22- RUN usermod -aG render sycl
23-
24- # Allow sycl user to run as sudo
25- RUN echo "sycl ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
11+ COPY scripts/create-sycl-user.sh /user-setup.sh
12+ RUN /user-setup.sh
2613
2714COPY actions/cached_checkout /actions/cached_checkout
2815COPY actions/cleanup /actions/cleanup
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # By default Ubuntu sets an arbitrary UID value, that is different from host
4+ # system. When CI passes default UID value of 1001, some of LLVM tools fail to
5+ # discover user home directory and fail a few LIT tests. Fixes UID and GID to
6+ # 1001, that is used as default by GitHub Actions.
7+ groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
8+ # Add sycl user to video/irc groups so that it can access GPU
9+ usermod -aG video sycl
10+ usermod -aG irc sycl
11+
12+ # group 109 is required for sycl user to access PVC card.
13+ groupadd -g 109 render
14+ usermod -aG render sycl
15+
16+ if [[ -f /run/secrets/sycl_passwd ]]; then
17+ # When running in our CI environment, we restrict access to root.
18+
19+ # Set password for sycl user
20+ cat /run/secrets/sycl_passwd | passwd -s sycl
21+
22+ # Allow sycl user to run as sudo, but only with password
23+ echo " sycl ALL=(root) PASSWD:ALL" >> /etc/sudoers
24+ else
25+ # Otherwise, we allow password-less root to simplify building other
26+ # containers on top.
27+
28+ # Allow sycl user to run as sudo passwrod-less
29+ echo " sycl ALL=(root) NOPASSWD:ALL" >> /etc/sudoers
30+ fi
You can’t perform that action at this time.
0 commit comments