Skip to content

Commit

Permalink
fixup! fixup! ci: added rocm gha build
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Jun 27, 2024
1 parent 7a5d1dc commit 43dd72c
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 13 deletions.
2 changes: 2 additions & 0 deletions scripts/ci/cmake/ci-ubuntu20.04-rocm-serial.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ADIOS2_USE_SZ:BOOL=ON
ADIOS2_USE_ZeroMQ:STRING=ON
ADIOS2_USE_ZFP:BOOL=ON
ADIOS2_USE_Kokkos:BOOL=ON
ADIOS2_USE_Sodium:BOOL=OFF
ADIOS2_USE_Catalyst:BOOL=OFF
Python_ROOT_DIR:PATH=${PY_ROOT}
Python_FIND_STRATEGY:STRING=LOCATION
Expand Down
21 changes: 12 additions & 9 deletions scripts/ci/images/Dockerfile.ci-spack-ubuntu20.04-base
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,39 @@
ARG BASE_IMAGE=ecpe4s/ubuntu20.04-runner-amd64-gcc-11.4:2023.08.01
FROM $BASE_IMAGE

ARG E4S_VERSION=23.08
ARG E4S_VERSION=24.05
ARG ENABLED_ENVS="serial,ompi,mpich"
ARG EXTERNAL_PACKAGES
ARG EXTRA_VARIANTS
ARG EXTRA_PACKAGES


# Clone and patch spack
WORKDIR /
RUN if ! [ -d /spack ]; then \
git clone --depth 1 --single-branch --branch e4s-${E4S_VERSION} https://github.com/spack/spack; \
else \
git fetch --all && git checkout -t origin/e4s-${E4S_VERSION}; \
fi

COPY 0001-mpich-support-ch3-sock.patch /spack
COPY packages.yaml /etc/spack/packages.yaml

WORKDIR /spack
# TODO: Patch only needed until we merge https://github.com/spack/spack/pull/40964
#COPY 0001-mpich-support-ch3-sock.patch /spack
RUN if [ ${E4S_VERSION%.*} -le 23 ]; then git apply 0001-mpich-support-ch3-sock.patch; fi

# Install base specs
WORKDIR /spack
RUN . /spack/share/spack/setup-env.sh && \
spack external find ${EXTERNAL_PACKAGES} && \
spack mirror add E4S "https://cache.e4s.io/${E4S_VERSION}" && \
export ADIOS_SPEC_NO_MPI="adios2~mpi${EXTRA_VARIANTS}" && \
export ADIOS_SPEC_OPENMPI="adios2+mpi${EXTRA_VARIANTS}^openmpi" && \
export ADIOS_SPEC_MPICH="adios2+mpi${EXTRA_VARIANTS}^mpich" && \
export ADIOS_SPEC_OPENMPI="adios2+mpi${EXTRA_VARIANTS} ^openmpi" && \
export ADIOS_SPEC_MPICH="adios2+mpi${EXTRA_VARIANTS} ^mpich" && \
spack config add "config:checksum:false" && \
spack config add "config:build_jobs:$(nproc)" && \
spack config add "concretizer:unify:true" && \
if echo "$ENABLED_ENVS" | grep -q serial; then \
spack env create adios2-ci-serial && \
spack -e adios2-ci-serial add ${EXTRA_PACKAGES} && \
spack -e adios2-ci-serial add ${ADIOS_SPEC_NO_MPI} && \
spack -e adios2-ci-serial concretize && \
spack -e adios2-ci-serial install \
Expand All @@ -40,7 +45,6 @@ RUN . /spack/share/spack/setup-env.sh && \
fi && \
if echo "$ENABLED_ENVS" | grep -q ompi ; then \
spack env create adios2-ci-ompi && \
spack -e adios2-ci-ompi add ${EXTRA_PACKAGES} && \
spack -e adios2-ci-ompi add ${ADIOS_SPEC_OPENMPI} && \
spack -e adios2-ci-ompi concretize && \
spack -e adios2-ci-ompi install \
Expand All @@ -51,7 +55,6 @@ RUN . /spack/share/spack/setup-env.sh && \
fi && \
if echo "$ENABLED_ENVS" | grep -q mpich; then \
spack env create adios2-ci-mpich && \
spack -e adios2-ci-mpich add ${EXTRA_PACKAGES} && \
spack -e adios2-ci-mpich add ${ADIOS_SPEC_MPICH} && \
spack -e adios2-ci-mpich concretize && \
spack -e adios2-ci-mpich install \
Expand Down
23 changes: 23 additions & 0 deletions scripts/ci/images/Dockerfile.ci-spack-ubuntu22.04-rocm-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG BASE_IMAGE=rocm/dev-ubuntu-22.04
FROM $BASE_IMAGE

# Base dependencies for building VTK-m projects
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
ccache \
cmake \
curl \
g++ \
gfortran-11 \
git \
git-lfs \
git-lfs \
libcurl4-gnutls-dev \
make \
mpich \
ninja-build \
pkg-config \
rocthrust-dev \
\
&& \
apt clean
16 changes: 13 additions & 3 deletions scripts/ci/images/build-rocm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ set -ex
docker build \
--progress=plain \
--rm \
--build-arg BASE_IMAGE="ecpe4s/ubuntu20.04:24.02" \
--build-arg BASE_IMAGE="rocm/dev-ubuntu-22.04" \
-f ./Dockerfile.ci-spack-ubuntu22.04-rocm-base \
-t ghcr.io/ornladios/adios2:ci-spack-ubuntu20.04-rocm-base \
.

# Build the base image
docker build \
--progress=plain \
--rm \
--build-arg BASE_IMAGE="ghcr.io/ornladios/adios2:ci-spack-ubuntu20.04-rocm-base" \
--build-arg ENABLED_ENVS="serial" \
--build-arg E4S_VERSION="24.02" \
--build-arg EXTRA_PACKAGES="hip@6 kokkos@4.2" \
--build-arg EXTERNAL_PACKAGES="hip rocprim" \
--build-arg E4S_VERSION="24.05" \
--build-arg EXTRA_VARIANTS="+kokkos+rocm amdgpu_target=gfx906 ^hip@6" \
-f ./Dockerfile.ci-spack-ubuntu20.04-base \
-t ghcr.io/ornladios/adios2:ci-spack-ubuntu20.04-rocm \
.
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/images/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ packages:
all:
target: [haswell]
adios2:
require: '+blosc+bzip2+zfp+sz+png+sst+dataman+ssc+hdf5+python+fortran'
require: '+blosc2+bzip2+zfp+sz+png+sst+dataman+hdf5+python+fortran'
mpich:
require: 'device=ch3:sock'
openmpi:
Expand Down
2 changes: 2 additions & 0 deletions scripts/ci/setup-run/ci-ubuntu20.04-rocm.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

export CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:/opt/rocm/"

update-alternatives --set gcc "$(update-alternatives --list gcc | grep gcc-11)"
update-alternatives --set g++ "$(update-alternatives --list g++ | grep g++-11)"
update-alternatives --set gfortran "$(update-alternatives --list gfortran | grep gfortran-11)"
Expand Down

0 comments on commit 43dd72c

Please sign in to comment.