Skip to content

[CI][1/3] Add Ubuntu 22 containers build #7106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions .github/workflows/sycl_containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,118 @@ jobs:
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.fpgaemu.github_tag}}
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.oclcpu.github_tag}}

base_image_ubuntu2204:
if: github.repository == 'intel/llvm'
name: Base Ubuntu 22.04 Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Build and Push Container
uses: ./devops/actions/build_container
with:
push: ${{ github.event_name != 'pull_request' }}
file: ubuntu2204_base
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
tags: |
ghcr.io/${{ github.repository }}/ubuntu2204_base:${{ github.sha }}
ghcr.io/${{ github.repository }}/ubuntu2204_base:latest
build_image_ubuntu2204:
if: github.repository == 'intel/llvm'
name: Build Ubuntu Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Build and Push Container
uses: ./devops/actions/build_container
with:
push: ${{ github.event_name != 'pull_request' }}
file: ubuntu2204_build
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
tags: |
ghcr.io/${{ github.repository }}/ubuntu2204_build:${{ github.sha }}
ghcr.io/${{ github.repository }}/ubuntu2204_build:latest

# This job produces a Docker container with the latest versions of Intel
# drivers, that can be found on GitHub.
drivers_image_ubuntu2204:
if: github.repository == 'intel/llvm'
name: Intel Drivers Ubuntu 22.04 Docker image
runs-on: ubuntu-latest
needs: base_image_ubuntu2204
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get dependencies configuration
id: deps
run: |
DEPS=`cat devops/dependencies.json`
DEPS="${DEPS//'%'/'%25'}"
DEPS="${DEPS//$'\n'/'%0A'}"
DEPS="${DEPS//$'\r'/'%0D'}"
echo $DEPS
echo "::set-output name=deps::$DEPS"
- name: Build and Push Container
uses: ./devops/actions/build_container
with:
push: ${{ github.event_name != 'pull_request' }}
file: ubuntu2204_intel_drivers
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
tags: |
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest-${{ github.sha }}
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest
build-args: |
compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux.compute_runtime.github_tag}}
igc_tag=${{fromJson(steps.deps.outputs.deps).linux.igc.github_tag}}
tbb_tag=${{fromJson(steps.deps.outputs.deps).linux.tbb.github_tag}}
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux.fpgaemu.github_tag}}
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux.oclcpu.github_tag}}

# This job produces a Docker container with the latest versions of Intel
# drivers, that can be found on GitHub.
drivers_image_ubuntu2204_unstable:
if: github.repository == 'intel/llvm'
name: Intel Drivers (unstable) Ubuntu 22.04 Docker image
runs-on: ubuntu-latest
needs: base_image_ubuntu2204
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get dependencies configuration
id: deps
run: |
DEPS=`cat devops/dependencies.json`
DEPS="${DEPS//'%'/'%25'}"
DEPS="${DEPS//$'\n'/'%0A'}"
DEPS="${DEPS//$'\r'/'%0D'}"
echo $DEPS
echo "::set-output name=deps::$DEPS"
- name: Build and Push Container
uses: ./devops/actions/build_container
with:
push: ${{ github.event_name != 'pull_request' }}
file: ubuntu2204_intel_drivers
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
tags: |
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable-${{ github.sha }}
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable
build-args: |
compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.compute_runtime.github_tag}}
igc_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.igc.github_tag}}
tbb_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.tbb.github_tag}}
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.fpgaemu.github_tag}}
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.oclcpu.github_tag}}

1 change: 1 addition & 0 deletions .github/workflows/sycl_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- '.github/ISSUE_TEMPLATE/**'
- '.github/CODEOWNERS'
- '.github/workflows/sycl_update_gpu_driver.yml'
- '.github/workflows/sycl_containers.yaml'
- '.github/workflows/sycl_windows_build_and_test.yml'
- '.github/workflows/sycl_macos_build_and_test.yml'
- 'devops/containers/**'
Expand Down
26 changes: 26 additions & 0 deletions devops/containers/ubuntu2204_base.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

USER root

# 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
# 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 group so that it can access GPU
RUN usermod -aG video sycl
# Allow sycl user to run as sudo
RUN echo "sycl ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

COPY actions/cached_checkout /actions/cached_checkout
COPY actions/cleanup /actions/cleanup
COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh
COPY scripts/install_drivers.sh /opt/install_drivers.sh

ENTRYPOINT ["/docker_entrypoint.sh"]
38 changes: 38 additions & 0 deletions devops/containers/ubuntu2204_build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM nvidia/cuda:11.7.0-devel-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive

USER root

# Install Nvidia keys
# https://forums.developer.nvidia.com/t/notice-cuda-linux-repository-key-rotation/212772
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub

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

# Install AMD ROCm
RUN printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600\n' | tee /etc/apt/preferences.d/rocm-pin-600
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
# Add sycl user to video group so that it can access GPU
RUN usermod -aG video sycl

COPY actions/cached_checkout /actions/cached_checkout
COPY actions/cleanup /actions/cleanup
COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh

ENTRYPOINT ["/docker_entrypoint.sh"]

27 changes: 27 additions & 0 deletions devops/containers/ubuntu2204_intel_drivers.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG base_tag=latest
ARG base_image=ghcr.io/intel/llvm/ubuntu2204_base

FROM $base_image:$base_tag

ENV DEBIAN_FRONTEND=noninteractive

ARG compute_runtime_tag=latest
ARG igc_tag=latest
ARG cm_tag=latest
ARG tbb_tag=latest
ARG fpgaemu_tag=latest
ARG cpu_tag=latest

RUN apt update && apt install -yqq wget

COPY scripts/get_release.py /
COPY scripts/install_drivers.sh /

RUN mkdir /runtimes
ENV INSTALL_LOCATION=/runtimes
RUN /install_drivers.sh --all

COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh

ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"]