Skip to content

Commit 082cde6

Browse files
author
Pavel Chupin
authored
[CI][1/3] Add Ubuntu 22 containers build (#7106)
It mostly copy-paste from Ubuntu 20 containers with one additional fix needed for ROCm. I couldn't make containers push work from PR pull_request workflow. Hope that it will work via scheduled workflow trigger. Also ignore sycl_containers workflow change in pre-commit. New containers when tested in PRs are not getting pushed so actual testing doesn't make sense. This is 1 of 3 patches expected: 1. Start building 22.04 basic containers in addition to 20.04 ones 2. Start running nightly on 22.04 containers in addition to 20.04 ones and push nightly containers 3. Finalize transition by updating documentation and removing 20.04 containers from all scripts This PR is for 1 only.
1 parent 7d0451c commit 082cde6

File tree

5 files changed

+207
-0
lines changed

5 files changed

+207
-0
lines changed

.github/workflows/sycl_containers.yaml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,118 @@ jobs:
135135
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.fpgaemu.github_tag}}
136136
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.oclcpu.github_tag}}
137137
138+
base_image_ubuntu2204:
139+
if: github.repository == 'intel/llvm'
140+
name: Base Ubuntu 22.04 Docker image
141+
runs-on: ubuntu-latest
142+
steps:
143+
- name: Checkout
144+
uses: actions/checkout@v3
145+
with:
146+
fetch-depth: 2
147+
- name: Build and Push Container
148+
uses: ./devops/actions/build_container
149+
with:
150+
push: ${{ github.event_name != 'pull_request' }}
151+
file: ubuntu2204_base
152+
username: ${{ github.repository_owner }}
153+
password: ${{ secrets.GITHUB_TOKEN }}
154+
tags: |
155+
ghcr.io/${{ github.repository }}/ubuntu2204_base:${{ github.sha }}
156+
ghcr.io/${{ github.repository }}/ubuntu2204_base:latest
157+
build_image_ubuntu2204:
158+
if: github.repository == 'intel/llvm'
159+
name: Build Ubuntu Docker image
160+
runs-on: ubuntu-latest
161+
steps:
162+
- name: Checkout
163+
uses: actions/checkout@v3
164+
with:
165+
fetch-depth: 2
166+
- name: Build and Push Container
167+
uses: ./devops/actions/build_container
168+
with:
169+
push: ${{ github.event_name != 'pull_request' }}
170+
file: ubuntu2204_build
171+
username: ${{ github.repository_owner }}
172+
password: ${{ secrets.GITHUB_TOKEN }}
173+
tags: |
174+
ghcr.io/${{ github.repository }}/ubuntu2204_build:${{ github.sha }}
175+
ghcr.io/${{ github.repository }}/ubuntu2204_build:latest
176+
177+
# This job produces a Docker container with the latest versions of Intel
178+
# drivers, that can be found on GitHub.
179+
drivers_image_ubuntu2204:
180+
if: github.repository == 'intel/llvm'
181+
name: Intel Drivers Ubuntu 22.04 Docker image
182+
runs-on: ubuntu-latest
183+
needs: base_image_ubuntu2204
184+
steps:
185+
- name: Checkout
186+
uses: actions/checkout@v3
187+
with:
188+
fetch-depth: 2
189+
- name: Get dependencies configuration
190+
id: deps
191+
run: |
192+
DEPS=`cat devops/dependencies.json`
193+
DEPS="${DEPS//'%'/'%25'}"
194+
DEPS="${DEPS//$'\n'/'%0A'}"
195+
DEPS="${DEPS//$'\r'/'%0D'}"
196+
echo $DEPS
197+
echo "::set-output name=deps::$DEPS"
198+
- name: Build and Push Container
199+
uses: ./devops/actions/build_container
200+
with:
201+
push: ${{ github.event_name != 'pull_request' }}
202+
file: ubuntu2204_intel_drivers
203+
username: ${{ github.repository_owner }}
204+
password: ${{ secrets.GITHUB_TOKEN }}
205+
tags: |
206+
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest-${{ github.sha }}
207+
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest
208+
build-args: |
209+
compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux.compute_runtime.github_tag}}
210+
igc_tag=${{fromJson(steps.deps.outputs.deps).linux.igc.github_tag}}
211+
tbb_tag=${{fromJson(steps.deps.outputs.deps).linux.tbb.github_tag}}
212+
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux.fpgaemu.github_tag}}
213+
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux.oclcpu.github_tag}}
214+
215+
# This job produces a Docker container with the latest versions of Intel
216+
# drivers, that can be found on GitHub.
217+
drivers_image_ubuntu2204_unstable:
218+
if: github.repository == 'intel/llvm'
219+
name: Intel Drivers (unstable) Ubuntu 22.04 Docker image
220+
runs-on: ubuntu-latest
221+
needs: base_image_ubuntu2204
222+
steps:
223+
- name: Checkout
224+
uses: actions/checkout@v3
225+
with:
226+
fetch-depth: 2
227+
- name: Get dependencies configuration
228+
id: deps
229+
run: |
230+
DEPS=`cat devops/dependencies.json`
231+
DEPS="${DEPS//'%'/'%25'}"
232+
DEPS="${DEPS//$'\n'/'%0A'}"
233+
DEPS="${DEPS//$'\r'/'%0D'}"
234+
echo $DEPS
235+
echo "::set-output name=deps::$DEPS"
236+
- name: Build and Push Container
237+
uses: ./devops/actions/build_container
238+
with:
239+
push: ${{ github.event_name != 'pull_request' }}
240+
file: ubuntu2204_intel_drivers
241+
username: ${{ github.repository_owner }}
242+
password: ${{ secrets.GITHUB_TOKEN }}
243+
tags: |
244+
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable-${{ github.sha }}
245+
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable
246+
build-args: |
247+
compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.compute_runtime.github_tag}}
248+
igc_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.igc.github_tag}}
249+
tbb_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.tbb.github_tag}}
250+
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.fpgaemu.github_tag}}
251+
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.oclcpu.github_tag}}
252+

.github/workflows/sycl_precommit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- '.github/ISSUE_TEMPLATE/**'
1010
- '.github/CODEOWNERS'
1111
- '.github/workflows/sycl_update_gpu_driver.yml'
12+
- '.github/workflows/sycl_containers.yaml'
1213
- '.github/workflows/sycl_windows_build_and_test.yml'
1314
- '.github/workflows/sycl_macos_build_and_test.yml'
1415
- 'devops/containers/**'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM ubuntu:22.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
USER root
6+
7+
# Install SYCL prerequisites
8+
COPY scripts/install_build_tools.sh /install.sh
9+
RUN /install.sh
10+
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 group so that it can access GPU
17+
RUN usermod -aG video sycl
18+
# Allow sycl user to run as sudo
19+
RUN echo "sycl ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
20+
21+
COPY actions/cached_checkout /actions/cached_checkout
22+
COPY actions/cleanup /actions/cleanup
23+
COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh
24+
COPY scripts/install_drivers.sh /opt/install_drivers.sh
25+
26+
ENTRYPOINT ["/docker_entrypoint.sh"]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM nvidia/cuda:11.7.0-devel-ubuntu22.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
USER root
6+
7+
# Install Nvidia keys
8+
# https://forums.developer.nvidia.com/t/notice-cuda-linux-repository-key-rotation/212772
9+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
10+
11+
# Install SYCL prerequisites
12+
COPY scripts/install_build_tools.sh /install.sh
13+
RUN /install.sh
14+
15+
# Install AMD ROCm
16+
RUN printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600\n' | tee /etc/apt/preferences.d/rocm-pin-600
17+
RUN apt install -yqq libnuma-dev wget gnupg2 && \
18+
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \
19+
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list && \
20+
apt update && \
21+
apt install -yqq rocm-dev && \
22+
apt-get clean && \
23+
rm -rf /var/lib/apt/lists/*
24+
25+
# By default Ubuntu sets an arbitrary UID value, that is different from host
26+
# system. When CI passes default UID value of 1001, some of LLVM tools fail to
27+
# discover user home directory and fail a few LIT tests. Fixes UID and GID to
28+
# 1001, that is used as default by GitHub Actions.
29+
RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
30+
# Add sycl user to video group so that it can access GPU
31+
RUN usermod -aG video sycl
32+
33+
COPY actions/cached_checkout /actions/cached_checkout
34+
COPY actions/cleanup /actions/cleanup
35+
COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh
36+
37+
ENTRYPOINT ["/docker_entrypoint.sh"]
38+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ARG base_tag=latest
2+
ARG base_image=ghcr.io/intel/llvm/ubuntu2204_base
3+
4+
FROM $base_image:$base_tag
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
8+
ARG compute_runtime_tag=latest
9+
ARG igc_tag=latest
10+
ARG cm_tag=latest
11+
ARG tbb_tag=latest
12+
ARG fpgaemu_tag=latest
13+
ARG cpu_tag=latest
14+
15+
RUN apt update && apt install -yqq wget
16+
17+
COPY scripts/get_release.py /
18+
COPY scripts/install_drivers.sh /
19+
20+
RUN mkdir /runtimes
21+
ENV INSTALL_LOCATION=/runtimes
22+
RUN /install_drivers.sh --all
23+
24+
COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh
25+
26+
ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"]
27+

0 commit comments

Comments
 (0)