Skip to content

Commit e560dfe

Browse files
authored
[CI] Add new container with more build utils (#5083)
New container comes pre-installed with CUDA (current version is 11.4.2) and ROCm 4.5, as well as other SYCL dependencies. This is to support other configurations in GitHub Actions environment.
1 parent 21b1530 commit e560dfe

File tree

4 files changed

+67
-9
lines changed

4 files changed

+67
-9
lines changed

.github/workflows/sycl_containers.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ jobs:
3535
ghcr.io/${{ github.repository }}/ubuntu2004_base:latest
3636
context: ${{ github.workspace }}/devops
3737
file: ${{ github.workspace }}/devops/containers/ubuntu2004_base.Dockerfile
38+
build_image_ubuntu2004:
39+
if: github.repository == 'intel/llvm'
40+
name: Build Ubuntu Docker image
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
with:
46+
fetch-depth: 2
47+
- name: Login to GitHub Container Registry
48+
uses: docker/login-action@v1
49+
with:
50+
registry: ghcr.io
51+
username: ${{ github.repository_owner }}
52+
password: ${{ secrets.GITHUB_TOKEN }}
53+
- name: Build and Push Container
54+
uses: docker/build-push-action@v2
55+
with:
56+
push: true
57+
tags: |
58+
ghcr.io/${{ github.repository }}/ubuntu2004_build:${{ github.sha }}
59+
ghcr.io/${{ github.repository }}/ubuntu2004_build:latest
60+
context: ${{ github.workspace }}/devops
61+
file: ${{ github.workspace }}/devops/containers/ubuntu2004_build.Dockerfile
3862
# This job produces a Docker container with the latest versions of Intel
3963
# drivers, that can be found on GitHub.
4064
drivers_image_ubuntu2004:

devops/containers/ubuntu2004_base.Dockerfile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@ ENV DEBIAN_FRONTEND=noninteractive
44

55
USER root
66

7-
RUN apt update && apt install -yqq \
8-
build-essential \
9-
cmake \
10-
ninja-build \
11-
ccache \
12-
git \
13-
python3 \
14-
python3-distutils \
15-
python-is-python3
7+
# Install SYCL prerequisites
8+
COPY scripts/install_build_tools.sh /install.sh
9+
RUN /install.sh
1610

1711
# By default Ubuntu sets an arbitrary UID value, that is different from host
1812
# system. When CI passes default UID value of 1001, some of LLVM tools fail to
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM nvidia/cuda:11.4.2-devel-ubuntu20.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+
# Install AMD ROCm
12+
RUN apt install -yqq libnuma-dev wget gnupg2 && \
13+
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \
14+
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list && \
15+
apt update && \
16+
apt install -yqq rocm-dev && \
17+
apt-get clean && \
18+
rm -rf /var/lib/apt/lists/*
19+
20+
# By default Ubuntu sets an arbitrary UID value, that is different from host
21+
# system. When CI passes default UID value of 1001, some of LLVM tools fail to
22+
# discover user home directory and fail a few LIT tests. Fixes UID and GID to
23+
# 1001, that is used as default by GitHub Actions.
24+
RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
25+
26+
COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh
27+
28+
ENTRYPOINT ["/docker_entrypoint.sh"]
29+

devops/scripts/install_build_tools.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
apt update && apt install -yqq \
4+
build-essential \
5+
cmake \
6+
ninja-build \
7+
ccache \
8+
git \
9+
python3 \
10+
python3-distutils \
11+
python-is-python3

0 commit comments

Comments
 (0)