Skip to content

Commit

Permalink
Restore latest image with ubuntu noble, PDI and HIP are disabled (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau authored May 25, 2024
1 parent b6bcf68 commit 05a7c85
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 36 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ jobs:
strategy:
fail-fast: false
matrix:
image: ['latest']
image: ['oldest', 'latest']
backend: ['cpu', 'cuda', 'hip']
exclude:
- image: 'latest' # no ppa yet for hip in noble image
backend: 'hip'
needs: id_repo
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -82,15 +85,20 @@ jobs:
strategy:
fail-fast: false
matrix:
image: ['latest']
image: ['oldest', 'latest']
backend: ['cpu-gcc', 'cpu-clang', 'cuda', 'hip']
cxx_version: ['17', '20', '23']
cmake_build_type: ['Debug', 'Release']
exclude:
- image: 'latest' # nvcc only supports C++-17
- image: 'oldest' # nvcc 11 only supports C++-17
backend: 'cuda'
cxx_version: '20'
- image: 'latest' # nvcc only supports C++-17
- image: 'oldest' # nvcc 11 only supports C++-17
backend: 'cuda'
cxx_version: '23'
- image: 'latest' # no ppa yet for hip in noble image
backend: 'hip'
- image: 'latest' # nvcc 12 only supports C++-20
backend: 'cuda'
cxx_version: '23'
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -143,6 +151,11 @@ jobs:
fi
;;
esac
case "${{matrix.image}}" in
'latest')
EXTRA_CMAKE_FLAGS="-DDDC_BUILD_PDI_WRAPPER=OFF ${EXTRA_CMAKE_FLAGS}"
;;
esac
cmake \
-DDDC_BUILD_BENCHMARKS=ON \
-DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} \
Expand Down Expand Up @@ -193,12 +206,12 @@ jobs:
if: needs.id_repo.outputs.in_base_repo == 'false'
uses: actions/download-artifact@v3
with:
name: latest_cpu-artifact
name: oldest_cpu-artifact
- name: Load image artifact into docker
if: needs.id_repo.outputs.in_base_repo == 'false'
run: |
docker load < latest_cpu.tar
rm latest_cpu.tar
docker load < oldest_cpu.tar
rm oldest_cpu.tar
- name: Test
id: test
run: |
Expand Down Expand Up @@ -227,7 +240,7 @@ jobs:
docker run \
--cidfile='docker.cid' \
-v ${PWD}:/src:ro \
ghcr.io/cexa-project/ddc/latest_cpu:${GITHUB_SHA:0:7} \
ghcr.io/cexa-project/ddc/oldest_cpu:${GITHUB_SHA:0:7} \
bash /src/run.sh
if docker cp "$(cat docker.cid)":/data/tests.xml /home/runner/work/ddc/ddc/tests.xml
then echo "with_report=true" >> "$GITHUB_OUTPUT"
Expand All @@ -252,12 +265,12 @@ jobs:
- name: Collect image artifact
if: needs.id_repo.outputs.in_base_repo == 'false'
uses: actions/download-artifact@v3
with: { name: 'latest_cpu-artifact' }
with: { name: 'oldest_cpu-artifact' }
- name: Load image artifact into docker
if: needs.id_repo.outputs.in_base_repo == 'false'
run: |
docker load < latest_cpu-artifact.tar
rm latest_cpu-artifact.tar
docker load < oldest_cpu-artifact.tar
rm oldest_cpu-artifact.tar
- name: clang-tidy
run: |
cat<<-'EOF' > run.sh
Expand All @@ -278,5 +291,5 @@ jobs:
find /src/benchmarks /src/examples /src/tests -name '*.cpp' -exec clang-tidy-14 -p build -header-filter="(/src/include/ddc/.*|/src/tests/.*)" '{}' '+'
EOF
docker run \
-v ${PWD}:/src:ro ghcr.io/cexa-project/ddc/latest_cpu:${GITHUB_SHA:0:7} \
-v ${PWD}:/src:ro ghcr.io/cexa-project/ddc/oldest_cpu:${GITHUB_SHA:0:7} \
bash /src/run.sh
48 changes: 24 additions & 24 deletions docker/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: MIT

FROM ubuntu:jammy
FROM ubuntu:noble

LABEL "org.opencontainers.image.source"="https://github.com/Maison-de-la-Simulation/ddc"

Expand All @@ -26,23 +26,23 @@ RUN chmod +x /bin/bash_run \
gpg \
wget \
&& mkdir --parents --mode=0755 /etc/apt/keyrings \
&& if [ "xhip" = "x${BACKEND}" ] \
; then echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/5.7.3/ubuntu jammy main" > /etc/apt/sources.list.d/amdgpu.list \
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.7.3 jammy main" > /etc/apt/sources.list.d/rocm.list \
&& wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor --output /etc/apt/keyrings/rocm.gpg \
&& echo -e "Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600" > /etc/apt/preferences.d/rocm-pin-600 \
; fi \
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/pdidev-archive-keyring.gpg] https://raw.githubusercontent.com/pdidev/repo/ubuntu jammy main" > /etc/apt/sources.list.d/pdi.list \
&& wget -q -O /etc/apt/keyrings/pdidev-archive-keyring.gpg https://raw.githubusercontent.com/pdidev/repo/ubuntu/pdidev-archive-keyring.gpg \
# && if [ "xhip" = "x${BACKEND}" ] \
# ; then echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/5.7.3/ubuntu noble main" > /etc/apt/sources.list.d/amdgpu.list \
# && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.7.3 noble main" > /etc/apt/sources.list.d/rocm.list \
# && wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor --output /etc/apt/keyrings/rocm.gpg \
# && echo -e "Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600" > /etc/apt/preferences.d/rocm-pin-600 \
# ; fi \
# && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/pdidev-archive-keyring.gpg] https://raw.githubusercontent.com/pdidev/repo/ubuntu noble main" > /etc/apt/sources.list.d/pdi.list \
# && wget -q -O /etc/apt/keyrings/pdidev-archive-keyring.gpg https://raw.githubusercontent.com/pdidev/repo/ubuntu/pdidev-archive-keyring.gpg \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
libfftw3-dev \
libhwloc-dev \
libpdi-dev \
pdidev-archive-keyring \
# libpdi-dev \
# pdidev-archive-keyring \
pkg-config \
&& case "${BACKEND}" in \
"cpu") \
Expand All @@ -54,21 +54,21 @@ RUN chmod +x /bin/bash_run \
;; "cuda") \
apt-get install -y --no-install-recommends \
nvidia-cuda-toolkit \
gcc-10 \
g++-10 \
;; "hip") \
apt-get install -y --no-install-recommends \
rocm-hip-sdk \
gcc-12 \
g++-12 \
# ;; "hip") \
# apt-get install -y --no-install-recommends \
# rocm-hip-sdk \
;; esac \
&& git clone -b v1.7.0 https://github.com/ginkgo-project/ginkgo.git \
&& cd ginkgo \
&& case "${BACKEND}" in \
"cpu") \
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_BUILD_OMP=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
;; "cuda") \
cmake -S . -B build -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_CUDA_HOST_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_CUDA_ARCHITECTURES=70 -DGINKGO_BUILD_CUDA=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
;; "hip") \
cmake -S . -B build -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_HIP_ARCHITECTURES=gfx90a -DGINKGO_BUILD_HIP=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
cmake -S . -B build -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_CUDA_HOST_COMPILER=g++-12 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_CUDA_ARCHITECTURES=70 -DGINKGO_BUILD_CUDA=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
# ;; "hip") \
# cmake -S . -B build -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_HIP_ARCHITECTURES=gfx90a -DGINKGO_BUILD_HIP=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
;; esac \
&& cmake --build build \
&& cmake --install build \
Expand All @@ -85,12 +85,12 @@ RUN chmod +x /bin/bash_run \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -d /data -m -U ci \
&& if [ "xcuda" = "x${BACKEND}" ] \
; then echo 'CUDA_GCC=gcc-10' > /etc/profile.d/ddc-cuda.sh \
; echo 'CUDA_GXX=g++-10' >> /etc/profile.d/ddc-cuda.sh \
; fi \
&& if [ "xhip" = "x${BACKEND}" ] \
; then echo 'export LD_LIBRARY_PATH="/opt/rocm/lib"' > /etc/profile.d/10-rocm.sh \
; then echo 'CUDA_GCC=gcc-12' > /etc/profile.d/ddc-cuda.sh \
; echo 'CUDA_GXX=g++-12' >> /etc/profile.d/ddc-cuda.sh \
; fi
# && if [ "xhip" = "x${BACKEND}" ] \
# ; then echo 'export LD_LIBRARY_PATH="/opt/rocm/lib"' > /etc/profile.d/10-rocm.sh \
# ; fi

USER ci:ci
WORKDIR /data
Expand Down
101 changes: 101 additions & 0 deletions docker/oldest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Copyright (C) The DDC development team, see COPYRIGHT.md file
#
# SPDX-License-Identifier: MIT

FROM ubuntu:jammy

LABEL "org.opencontainers.image.source"="https://github.com/Maison-de-la-Simulation/ddc"

ARG BACKEND

COPY bash_run /bin/
ENV BASH_ENV=/etc/profile
SHELL ["/bin/bash", "-c"]


RUN chmod +x /bin/bash_run \
&& export DEBIAN_FRONTEND=noninteractive \
&& echo tzdata tzdata/Areas string Etc | debconf-set-selections \
&& echo tzdata tzdata/Zones/Etc string UTC | debconf-set-selections \
&& apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
apt-utils \
ca-certificates \
gpg \
wget \
&& mkdir --parents --mode=0755 /etc/apt/keyrings \
&& if [ "xhip" = "x${BACKEND}" ] \
; then echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/5.7.3/ubuntu jammy main" > /etc/apt/sources.list.d/amdgpu.list \
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.7.3 jammy main" > /etc/apt/sources.list.d/rocm.list \
&& wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor --output /etc/apt/keyrings/rocm.gpg \
&& echo -e "Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600" > /etc/apt/preferences.d/rocm-pin-600 \
; fi \
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/pdidev-archive-keyring.gpg] https://raw.githubusercontent.com/pdidev/repo/ubuntu jammy main" > /etc/apt/sources.list.d/pdi.list \
&& wget -q -O /etc/apt/keyrings/pdidev-archive-keyring.gpg https://raw.githubusercontent.com/pdidev/repo/ubuntu/pdidev-archive-keyring.gpg \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
libfftw3-dev \
libhwloc-dev \
libpdi-dev \
pdidev-archive-keyring \
pkg-config \
&& case "${BACKEND}" in \
"cpu") \
apt-get install -y --no-install-recommends \
clang \
clang-tidy-14 \
clang-format-14 \
llvm-14-tools \
;; "cuda") \
apt-get install -y --no-install-recommends \
nvidia-cuda-toolkit \
gcc-10 \
g++-10 \
;; "hip") \
apt-get install -y --no-install-recommends \
rocm-hip-sdk \
;; esac \
&& git clone -b v1.7.0 https://github.com/ginkgo-project/ginkgo.git \
&& cd ginkgo \
&& case "${BACKEND}" in \
"cpu") \
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_BUILD_OMP=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
;; "cuda") \
cmake -S . -B build -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_CUDA_HOST_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_CUDA_ARCHITECTURES=70 -DGINKGO_BUILD_CUDA=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
;; "hip") \
cmake -S . -B build -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_HIP_ARCHITECTURES=gfx90a -DGINKGO_BUILD_HIP=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
;; esac \
&& cmake --build build \
&& cmake --install build \
&& cd .. \
&& rm -rf ginkgo \
&& apt-get purge -y \
apt-transport-https \
apt-utils \
ca-certificates \
wget \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -d /data -m -U ci \
&& if [ "xcuda" = "x${BACKEND}" ] \
; then echo 'CUDA_GCC=gcc-10' > /etc/profile.d/ddc-cuda.sh \
; echo 'CUDA_GXX=g++-10' >> /etc/profile.d/ddc-cuda.sh \
; fi \
&& if [ "xhip" = "x${BACKEND}" ] \
; then echo 'export LD_LIBRARY_PATH="/opt/rocm/lib"' > /etc/profile.d/10-rocm.sh \
; fi

USER ci:ci
WORKDIR /data

ENTRYPOINT ["/bin/bash_run"]
CMD ["/bin/bash", "-li"]


8 changes: 8 additions & 0 deletions docker/oldest/bash_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Copyright (C) The DDC development team, see COPYRIGHT.md file
#
# SPDX-License-Identifier: MIT

. /etc/profile

exec "$@"

0 comments on commit 05a7c85

Please sign in to comment.