Skip to content

Commit

Permalink
[CI] Add new container with more build utils (#5083)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexbatashev authored Dec 5, 2021
1 parent 21b1530 commit e560dfe
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/sycl_containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@ jobs:
ghcr.io/${{ github.repository }}/ubuntu2004_base:latest
context: ${{ github.workspace }}/devops
file: ${{ github.workspace }}/devops/containers/ubuntu2004_base.Dockerfile
build_image_ubuntu2004:
if: github.repository == 'intel/llvm'
name: Build Ubuntu Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Container
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/${{ github.repository }}/ubuntu2004_build:${{ github.sha }}
ghcr.io/${{ github.repository }}/ubuntu2004_build:latest
context: ${{ github.workspace }}/devops
file: ${{ github.workspace }}/devops/containers/ubuntu2004_build.Dockerfile
# This job produces a Docker container with the latest versions of Intel
# drivers, that can be found on GitHub.
drivers_image_ubuntu2004:
Expand Down
12 changes: 3 additions & 9 deletions devops/containers/ubuntu2004_base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ ENV DEBIAN_FRONTEND=noninteractive

USER root

RUN apt update && apt install -yqq \
build-essential \
cmake \
ninja-build \
ccache \
git \
python3 \
python3-distutils \
python-is-python3
# Install SYCL prerequisites
COPY scripts/install_build_tools.sh /install.sh
RUN /install.sh

# 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
Expand Down
29 changes: 29 additions & 0 deletions devops/containers/ubuntu2004_build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM nvidia/cuda:11.4.2-devel-ubuntu20.04

ENV DEBIAN_FRONTEND=noninteractive

USER root

# Install SYCL prerequisites
COPY scripts/install_build_tools.sh /install.sh
RUN /install.sh

# Install AMD ROCm
RUN apt install -yqq libnuma-dev wget gnupg2 && \
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list && \
apt update && \
apt install -yqq rocm-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# 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

COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh

ENTRYPOINT ["/docker_entrypoint.sh"]

11 changes: 11 additions & 0 deletions devops/scripts/install_build_tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

apt update && apt install -yqq \
build-essential \
cmake \
ninja-build \
ccache \
git \
python3 \
python3-distutils \
python-is-python3

0 comments on commit e560dfe

Please sign in to comment.