Skip to content
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

[Ubuntu22] add new images #1

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 14 additions & 2 deletions .github/workflows/build_publish_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build and publish containers
on:
push:
branches: [ "main" ]
pull_request:

env:
# Use docker.io for Docker Hub if empty
Expand All @@ -23,12 +24,13 @@ jobs:
id-token: write

strategy:
fail-fast: false
matrix:
include:
- imagename: ci-ubuntu20
imagepath: ubuntu20
- imagename: ci-ubuntu-latest
imagepath: ubuntu_latest
- imagename: ci-ubuntu20
imagepath: ubuntu20
- imagename: ci-ubuntu20cuda11
imagepath: ubuntu20cuda11
- imagename: ci-ubuntu20rocm543
Expand All @@ -37,6 +39,16 @@ jobs:
imagepath: ubuntu20dpcpp_cuda11
- imagename: ci-ubuntu20rocm543dpcpp
imagepath: ubuntu20dpcpp_rocm5.4.3
- imagename: ci-ubuntu22
imagepath: ubuntu22
- imagename: ci-ubuntu22cuda11
imagepath: ubuntu22cuda11
- imagename: ci-ubuntu22rocm543
imagepath: ubuntu22rocm5.4.3
- imagename: ci-ubuntu22cuda11dpcpp
imagepath: ubuntu22dpcpp_cuda11
- imagename: ci-ubuntu22rocm543dpcpp
imagepath: ubuntu22dpcpp_rocm5.4.3

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Shamrock-code Docker images

This repository host the Docker images used by the shamrock for CI purposes.
This repository host the Docker images used by the shamrock for CI purposes.
7 changes: 7 additions & 0 deletions images/ubuntu20/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,12 @@ RUN echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
#
RUN git config --global --add safe.directory '*'

# Sometime some apt repo fail on first attempt
# https://stackoverflow.com/questions/72644496/docker-container-connection-timeout-while-installing-packages
RUN echo '\
Acquire::Retries "20";\
Acquire::https::Timeout "60";\
Acquire::http::Timeout "60";\
' > /etc/apt/apt.conf.d/99custom

WORKDIR /home/docker
5 changes: 3 additions & 2 deletions images/ubuntu20dpcpp_cuda11/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ RUN clinfo
###################################
WORKDIR /home/docker/compilers_gits

# 2024-WW14 is used instead of a more recent one because of incompatibility with cuda 11
RUN git clone https://github.com/intel/llvm -b 2024-WW14

WORKDIR /home/docker/compilers_gits/llvm
Expand All @@ -46,8 +47,8 @@ RUN CUDA_LIB_PATH=/opt/cuda/lib64/stubs \

WORKDIR /home/docker/compilers_gits/llvm/build

RUN ninja all tools/libdevice/libsycldevice
RUN ninja install
RUN ninja -k0 all lib/all tools/libdevice/libsycldevice
RUN ninja -k0 install

WORKDIR /home/docker

Expand Down
6 changes: 3 additions & 3 deletions images/ubuntu20dpcpp_rocm5.4.3/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN clinfo
###################################
WORKDIR /home/docker/compilers_gits

RUN git clone https://github.com/intel/llvm -b 2024-WW14
RUN git clone https://github.com/intel/llvm -b nightly-2024-10-27

WORKDIR /home/docker/compilers_gits/llvm

Expand All @@ -45,8 +45,8 @@ RUN python3 buildbot/configure.py \

WORKDIR /home/docker/compilers_gits/llvm/build

RUN ninja all tools/libdevice/libsycldevice
RUN ninja install
RUN ninja -k0 all lib/all tools/libdevice/libsycldevice
RUN ninja -k0 install

WORKDIR /home/docker

Expand Down
55 changes: 55 additions & 0 deletions images/ubuntu22/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# syntax=docker/dockerfile:1
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive

RUN useradd -m docker

RUN apt update -y && apt upgrade -y && apt install -y \
sudo \
curl\
wget\
lsb-release\
software-properties-common\
gnupg\
build-essential \
git \
python3 \
python3-venv \
python3-dev \
python3-pip \
cmake \
ninja-build \
libboost-all-dev \
doxygen \
graphviz \
texlive-full \
latexmk

RUN echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

# USER docker

# Fix for the issue
# Error: fatal: detected dubious ownership in repository at '/__w/Shamrock/Shamrock/external/NVTX'
# To add an exception for this directory, call:
# git config --global --add safe.directory /__w/Shamrock/Shamrock/external/NVTX
# Unable to find current revision in submodule path 'external/NVTX'
# Error: The process '/usr/bin/git' failed with exit code 1
#
# see : https://github.com/wmde/git-filter-repo-docker-action/pull/2/files
# T314987: Git require the .git folder to be owned by the same user
#
# So we disable the check as detailled here
#https://stackoverflow.com/questions/71849415/i-cannot-add-the-parent-directory-to-safe-directory-in-git
#
RUN git config --global --add safe.directory '*'

# Sometime some apt repo fail on first attempt
# https://stackoverflow.com/questions/72644496/docker-container-connection-timeout-while-installing-packages
RUN echo '\
Acquire::Retries "20";\
Acquire::https::Timeout "60";\
Acquire::http::Timeout "60";\
' > /etc/apt/apt.conf.d/99custom

WORKDIR /home/docker
4 changes: 4 additions & 0 deletions images/ubuntu22cuda11/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include ../ubuntu22/Dockerfile.in

COPY install_cuda.sh /opt/src/scripts/install_cuda.sh
RUN sh /opt/src/scripts/install_cuda.sh
5 changes: 5 additions & 0 deletions images/ubuntu22cuda11/install_cuda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdir -p /opt/cuda
wget --progress=bar:force -O cuda.sh http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run
sudo sh ./cuda.sh --override --silent --toolkit --no-man-page --no-drm --no-opengl-libs --installpath=/opt/cuda || true
echo "CUDA Version 11.0.2" | sudo tee /opt/cuda/version.txt
rm cuda.sh
55 changes: 55 additions & 0 deletions images/ubuntu22dpcpp_cuda11/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include ../ubuntu22cuda11/Dockerfile.in

RUN mkdir compilers_gits
RUN mkdir compilers

###################################
## DPC++ (requirement)
###################################
#update cmake
RUN sudo apt-get update
RUN sudo apt-get install -y ca-certificates gpg wget
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
RUN sudo apt-get update
RUN sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg
RUN sudo apt-get install -y kitware-archive-keyring
RUN sudo apt-get update
RUN sudo apt-get install -y cmake


#esimd requirement
RUN sudo apt install -y libva-dev libffi-dev libtool

#OpenCL requirement
RUN sudo apt install -y clinfo intel-opencl-icd opencl-headers

#check clinfo
RUN clinfo

###################################
## DPC++
###################################
WORKDIR /home/docker/compilers_gits

# 2024-WW14 is used instead of a more recent one because of incompatibility with cuda 11
RUN git clone https://github.com/intel/llvm -b 2024-WW14

WORKDIR /home/docker/compilers_gits/llvm

# configure dpcpp
RUN CUDA_LIB_PATH=/opt/cuda/lib64/stubs \
python3 buildbot/configure.py \
--llvm-external-projects compiler-rt \
--cuda \
--cmake-opt="-DCMAKE_INSTALL_PREFIX=/home/docker/compilers/DPCPP" \
--cmake-opt="-DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda"

WORKDIR /home/docker/compilers_gits/llvm/build

RUN ninja -k0 all lib/all tools/libdevice/libsycldevice
RUN ninja -k0 install

WORKDIR /home/docker

RUN rm -rf compilers_gits
5 changes: 5 additions & 0 deletions images/ubuntu22dpcpp_cuda11/install_cuda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdir -p /opt/cuda
wget --progress=bar:force -O cuda.sh http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run
sudo sh ./cuda.sh --override --silent --toolkit --no-man-page --no-drm --no-opengl-libs --installpath=/opt/cuda || true
echo "CUDA Version 11.0.2" | sudo tee /opt/cuda/version.txt
rm cuda.sh
53 changes: 53 additions & 0 deletions images/ubuntu22dpcpp_rocm5.4.3/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include ../ubuntu22rocm5.4.3/Dockerfile.in

RUN mkdir compilers_gits
RUN mkdir compilers

###################################
## DPC++ (requirement)
###################################
#update cmake
RUN sudo apt-get update
RUN sudo apt-get install -y ca-certificates gpg wget
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
RUN sudo apt-get update
RUN sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg
RUN sudo apt-get install -y kitware-archive-keyring
RUN sudo apt-get update
RUN sudo apt-get install -y cmake


#esimd requirement
RUN sudo apt install -y libva-dev libffi-dev libtool

#OpenCL requirement
RUN sudo apt install -y clinfo intel-opencl-icd opencl-headers

#check clinfo
RUN clinfo

###################################
## DPC++
###################################
WORKDIR /home/docker/compilers_gits

RUN git clone https://github.com/intel/llvm -b nightly-2024-10-27

WORKDIR /home/docker/compilers_gits/llvm

# configure dpcpp
RUN python3 buildbot/configure.py \
--llvm-external-projects compiler-rt \
--hip \
--cmake-opt="-DCMAKE_INSTALL_PREFIX=/home/docker/compilers/DPCPP" \
--cmake-opt="-DSYCL_BUILD_PI_HIP_ROCM_DIR=/opt/rocm"

WORKDIR /home/docker/compilers_gits/llvm/build

RUN ninja -k0 all lib/all tools/libdevice/libsycldevice
RUN ninja -k0 install

WORKDIR /home/docker

RUN rm -rf compilers_gits
6 changes: 6 additions & 0 deletions images/ubuntu22dpcpp_rocm5.4.3/install_rocm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo apt install -y libnuma-dev cmake unzip
wget --progress=bar:force -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.4.3 focal main" | sudo tee /etc/apt/sources.list.d/rocm.list
printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
sudo apt update -y
sudo apt install -y rocm-dev
4 changes: 4 additions & 0 deletions images/ubuntu22rocm5.4.3/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include ../ubuntu22/Dockerfile.in

COPY install_rocm.sh /opt/src/scripts/install_rocm.sh
RUN sh /opt/src/scripts/install_rocm.sh
6 changes: 6 additions & 0 deletions images/ubuntu22rocm5.4.3/install_rocm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo apt install -y libnuma-dev cmake unzip
wget --progress=bar:force -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.4.3 focal main" | sudo tee /etc/apt/sources.list.d/rocm.list
printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
sudo apt update -y
sudo apt install -y rocm-dev
7 changes: 7 additions & 0 deletions images/ubuntu_latest/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,12 @@ RUN echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
#
RUN git config --global --add safe.directory '*'

# Sometime some apt repo fail on first attempt
# https://stackoverflow.com/questions/72644496/docker-container-connection-timeout-while-installing-packages
RUN echo '\
Acquire::Retries "20";\
Acquire::https::Timeout "60";\
Acquire::http::Timeout "60";\
' > /etc/apt/apt.conf.d/99custom

WORKDIR /home/docker
Loading