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

update base container, use gh200 container builder, remove clang #1036

Open
wants to merge 8 commits into
base: develop
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
63 changes: 27 additions & 36 deletions ci/baseimage.cuda.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:22.04 as builder
FROM ubuntu:24.04 as builder

ARG CUDA_ARCH=60
ARG CUDA_ARCH=90

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -10,24 +10,24 @@ ENV PATH="/spack/bin:${PATH}"

ENV MPICH_VERSION=3.4.3

ENV CMAKE_VERSION=3.26.3
ENV CMAKE_VERSION=3.31.2

RUN apt-get -y update

RUN apt-get install -y apt-utils

# install basic tools
RUN apt-get install -y --no-install-recommends gcc g++ gfortran clang libomp-14-dev git make unzip file \
RUN apt-get install -y --no-install-recommends gcc g++ gfortran git make unzip file \
vim wget pkg-config python3-pip python3-dev cython3 python3-pythran curl tcl m4 cpio automake meson \
xz-utils patch patchelf apt-transport-https ca-certificates gnupg software-properties-common perl tar bzip2 \
liblzma-dev libbz2-dev

# install CMake
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz -O cmake.tar.gz && \
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-aarch64.tar.gz -O cmake.tar.gz && \
tar zxvf cmake.tar.gz --strip-components=1 -C /usr

# get latest version of spack
RUN git clone -b v0.21.2 https://github.com/spack/spack.git
RUN git clone -b releases/v0.23 https://github.com/spack/spack.git

# add local repo to spack
COPY ./spack /opt/spack
Expand All @@ -39,26 +39,24 @@ RUN spack config add config:install_tree:root:/opt/local
RUN spack config add packages:all:variants:cuda_arch=${CUDA_ARCH}

# find all external packages
RUN spack external find --all
RUN spack external find --all --exclude=openssl

# find compilers
RUN spack compiler find

# install yq (utility to manipulate the yaml files)
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_386 && chmod a+x /usr/local/bin/yq
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 && chmod a+x /usr/local/bin/yq

# change the fortran compilers: for gcc the gfortran is already properly set and the change has no effect; add it for clang
RUN yq -i '.compilers[0].compiler.paths.f77 = "/usr/bin/gfortran"' /root/.spack/linux/compilers.yaml && \
yq -i '.compilers[0].compiler.paths.fc = "/usr/bin/gfortran"' /root/.spack/linux/compilers.yaml && \
yq -i '.compilers[1].compiler.paths.f77 = "/usr/bin/gfortran"' /root/.spack/linux/compilers.yaml && \
yq -i '.compilers[1].compiler.paths.fc = "/usr/bin/gfortran"' /root/.spack/linux/compilers.yaml

# # change the fortran compilers: for gcc the gfortran is already properly set and the change has no effect; add it for clang
# RUN yq -i '.compilers[0].compiler.paths.f77 = "/usr/bin/gfortran"' /root/.spack/linux/compilers.yaml && \
# yq -i '.compilers[0].compiler.paths.fc = "/usr/bin/gfortran"' /root/.spack/linux/compilers.yaml && \
# yq -i '.compilers[1].compiler.paths.f77 = "/usr/bin/gfortran"' /root/.spack/linux/compilers.yaml && \
# yq -i '.compilers[1].compiler.paths.fc = "/usr/bin/gfortran"' /root/.spack/linux/compilers.yaml

# install MPICH
RUN spack install mpich@${MPICH_VERSION} %gcc

# install openmpi
RUN spack install openmpi %gcc

# install libvdwxc
RUN spack install libvdwxc %gcc +mpi ^mpich@${MPICH_VERSION}

Expand All @@ -67,28 +65,21 @@ RUN spack install openblas %gcc +fortran

RUN spack install magma %gcc +cuda +fortran ^openblas

RUN spack install nlcglib@master %gcc +cuda

# for the MPI hook
RUN echo $(spack find --format='{prefix.lib}' mpich) > /etc/ld.so.conf.d/mpich.conf
RUN ldconfig

# create environments for several configurations and install dependencies
RUN spack env create -d /sirius-env-clang && \
spack -e /sirius-env-clang add "sirius@develop %clang build_type=RelWithDebInfo ~cuda ~fortran +tests +pugixml ^openblas%gcc ^libxc%gcc ^mpich%gcc " && \
spack -e /sirius-env-clang develop -p /sirius-src sirius@develop && \
spack -e /sirius-env-clang install --only=dependencies --fail-fast
# # create environments for several configurations and install dependencies
# RUN spack env create -d /sirius-env-clang && \
# spack -e /sirius-env-clang add "sirius@develop %clang build_type=RelWithDebInfo ~cuda ~fortran +tests +pugixml ^openblas%gcc ^libxc%gcc ^mpich%gcc " && \
# spack -e /sirius-env-clang develop -p /sirius-src sirius@develop && \
# spack -e /sirius-env-clang install --only=dependencies --fail-fast

RUN spack env create -d /sirius-env-cuda && \
spack -e /sirius-env-cuda add "sirius@develop %gcc build_type=RelWithDebInfo +scalapack +tests +pugixml +apps +cuda +magma +python ^netlib-scalapack ^mpich ^openblas threads=openmp" && \
spack -e /sirius-env-cuda develop -p /sirius-src sirius@develop && \
spack -e /sirius-env-cuda install --only=dependencies --fail-fast

RUN spack env create -d /sirius-env-cuda-mkl-mpich && \
spack -e /sirius-env-cuda-mkl-mpich add "sirius@develop %gcc build_type=RelWithDebInfo +tests +pugixml +apps +cuda +scalapack +magma ^mpich ^intel-oneapi-mkl+cluster" && \
spack -e /sirius-env-cuda-mkl-mpich develop -p /sirius-src sirius@develop && \
spack -e /sirius-env-cuda-mkl-mpich install --only=dependencies --fail-fast

RUN spack env create -d /sirius-env-elpa && \
spack -e /sirius-env-elpa add "sirius@develop %gcc build_type=RelWithDebInfo +tests +pugixml +apps +cuda +scalapack +elpa ^netlib-scalapack ^mpich ^openblas ^elpa+cuda" && \
spack -e /sirius-env-elpa develop -p /sirius-src sirius@develop && \
Expand All @@ -104,15 +95,15 @@ RUN spack env create -d /sirius-env-nlcg && \
spack -e /sirius-env-nlcg develop -p /sirius-src sirius@develop && \
spack -e /sirius-env-nlcg install --only=dependencies --fail-fast

RUN spack env create -d /sirius-env-openmpi && \
spack -e /sirius-env-openmpi add "sirius@develop %gcc +tests +pugixml +apps +scalapack +fortran build_type=RelWithDebInfo ^netlib-scalapack ^openblas ^openmpi" && \
spack -e /sirius-env-openmpi develop -p /sirius-src sirius@develop && \
spack -e /sirius-env-openmpi install --only=dependencies --fail-fast
# RUN spack env create -d /sirius-env-openmpi && \
# spack -e /sirius-env-openmpi add "sirius@develop %gcc +tests +pugixml +apps +scalapack +fortran build_type=RelWithDebInfo ^netlib-scalapack ^openblas ^openmpi" && \
# spack -e /sirius-env-openmpi develop -p /sirius-src sirius@develop && \
# spack -e /sirius-env-openmpi install --only=dependencies --fail-fast

RUN spack env create -d /sirius-env-cuda-sequential && \
spack -e /sirius-env-cuda-sequential add "sirius@develop %gcc +cuda +tests +pugixml +apps +fortran build_type=RelWithDebInfo ^openblas ^openmpi" && \
spack -e /sirius-env-cuda-sequential develop -p /sirius-src sirius@develop && \
spack -e /sirius-env-cuda-sequential install --only=dependencies --fail-fast
# RUN spack env create -d /sirius-env-cuda-sequential && \
# spack -e /sirius-env-cuda-sequential add "sirius@develop %gcc +cuda +tests +pugixml +apps +fortran build_type=RelWithDebInfo ^openblas ^openmpi" && \
# spack -e /sirius-env-cuda-sequential develop -p /sirius-src sirius@develop && \
# spack -e /sirius-env-cuda-sequential install --only=dependencies --fail-fast

RUN spack env create -d /sirius-env-vdwxc-cuda && \
spack -e /sirius-env-vdwxc-cuda add "sirius@develop %gcc build_type=RelWithDebInfo +fortran +tests +pugixml +apps +vdwxc +cuda +nlcglib ^openblas ^mpich +cuda" && \
Expand Down
58 changes: 18 additions & 40 deletions ci/cscs-daint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ stages:
- test

build base cuda image:
extends: .container-builder-dynamic-name
extends: [.dynamic-image-name, .container-builder-cscs-gh200]
stage: baseimage
timeout: 10h
variables:
SLURM_TIMELIMIT: 600
DOCKERFILE: ci/baseimage.cuda.Dockerfile
WATCH_FILECHANGES: ci/baseimage.cuda.Dockerfile
PERSIST_IMAGE_NAME: $CSCS_REGISTRY_PATH/base/sirius-ci
DOCKER_BUILD_ARGS: '["CUDA_ARCH=60"]'
DOCKER_BUILD_ARGS: '["CUDA_ARCH=90"]'

build base rocm image:
extends: .container-builder-dynamic-name
Expand All @@ -27,18 +28,8 @@ build base rocm image:
PERSIST_IMAGE_NAME: $CSCS_REGISTRY_PATH/base/sirius-ci
DOCKER_BUILD_ARGS: '["ROCM_ARCH=gfx90a"]'

build cuda image mkl:
extends: .container-builder
needs: ["build base cuda image"]
stage: build
variables:
DOCKERFILE: ci/build.Dockerfile
PERSIST_IMAGE_NAME: discard
ENVPATH: "/sirius-env-cuda-mkl-mpich"
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

build cuda image:
extends: .container-builder
extends: [.dynamic-image-name, .container-builder-cscs-gh200]
needs: ["build base cuda image"]
stage: build
variables:
Expand All @@ -59,7 +50,7 @@ build rocm image:
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

build elpa cuda image:
extends: .container-builder
extends: .container-builder-cscs-gh200
needs: ["build base cuda image"]
stage: build
variables:
Expand All @@ -69,7 +60,7 @@ build elpa cuda image:
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

build sequential eigen-solver cuda image:
extends: .container-builder
extends: .container-builder-cscs-gh200
needs: ["build base cuda image"]
stage: build
variables:
Expand All @@ -79,7 +70,7 @@ build sequential eigen-solver cuda image:
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

build fp32 cuda image:
extends: .container-builder
extends: .container-builder-cscs-gh200
needs: ["build base cuda image"]
stage: build
variables:
Expand All @@ -89,7 +80,7 @@ build fp32 cuda image:
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

build vdwxc cuda image:
extends: .container-builder
extends: .container-builder-cscs-gh200
needs: ["build base cuda image"]
stage: build
variables:
Expand All @@ -100,7 +91,7 @@ build vdwxc cuda image:
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

build nlcg image:
extends: .container-builder
extends: .container-builder-cscs-gh200
needs: ["build base cuda image"]
stage: build
variables:
Expand All @@ -109,26 +100,15 @@ build nlcg image:
ENVPATH: "/sirius-env-nlcg"
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

build clang image:
extends: .container-builder
needs: ["build base cuda image"]
stage: build
variables:
DOCKERFILE: ci/build.Dockerfile
PERSIST_IMAGE_NAME: discard
# reuse openblas, libxc and spfft from gcc build
ENVPATH: "/sirius-env-clang"
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

build openmpi image:
extends: .container-builder
needs: ["build base cuda image"]
stage: build
variables:
DOCKERFILE: ci/build.Dockerfile
PERSIST_IMAGE_NAME: discard
ENVPATH: "/sirius-env-openmpi"
DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'
# build openmpi image:
# extends: .container-builder
# needs: ["build base cuda image"]
# stage: build
# variables:
# DOCKERFILE: ci/build.Dockerfile
# PERSIST_IMAGE_NAME: discard
# ENVPATH: "/sirius-env-openmpi"
# DOCKER_BUILD_ARGS: '["BASE_IMAGE=${BASE_IMAGE}", "ENVPATH=$ENVPATH"]'

.run_tests:
extends: .container-runner-daint-gpu
Expand All @@ -154,8 +134,6 @@ build openmpi image:
SLURM_UNBUFFEREDIO: ''
SLURM_WAIT: 0



gpu serial:
extends: .run_tests
variables:
Expand Down
2 changes: 1 addition & 1 deletion ci/github-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:22.04 as builder

ARG CUDA_ARCH=60
ARG CUDA_ARCH=90

ENV DEBIAN_FRONTEND=noninteractive \
PATH="$PATH:/spack/bin"
Expand Down
Loading