Skip to content

Commit

Permalink
cleanup old spack dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
RMeli authored and oschuett committed Dec 20, 2023
1 parent fdb0e7a commit afdde75
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 305 deletions.
70 changes: 0 additions & 70 deletions tools/docker/Dockerfile.gcc_spack

This file was deleted.

70 changes: 0 additions & 70 deletions tools/docker/Dockerfile.gcc_spack_cuda

This file was deleted.

70 changes: 0 additions & 70 deletions tools/docker/Dockerfile.gcc_spack_rocm

This file was deleted.

95 changes: 0 additions & 95 deletions tools/docker/generate_dockerfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,30 +118,6 @@ def main() -> None:
with OutputFile(f"Dockerfile.test_{name}", args.check) as f:
f.write(test_without_build(name))

with OutputFile(f"Dockerfile.gcc_spack", args.check) as f:
f.write(
spack_toolchain(
distro="ubuntu:22.04",
spec="cp2k@master%gcc build_system=cmake +enable_regtests+cosma+mpi+openmp+sirius+elpa+libxc+libint+plumed+pexsi+spglib ^openblas+fortran ^cosma+scalapack+shared ^dbcsr+mpi+shared",
)
)

with OutputFile(f"Dockerfile.gcc_spack_cuda", args.check) as f:
f.write(
spack_toolchain(
distro="nvidia/cuda:12.2.0-devel-ubuntu22.04",
spec="cp2k@master%gcc build_system=cmake +libxc+libint+sirius+elpa+plumed+pexsi+spglib+cosma+mpi+openmp+cuda cuda_arch=60 smm=libxsmm ^openblas+fortran ^cosma+scalapack+shared+cuda ^dbcsr+cuda~shared cuda_arch=60 ^sirius+cuda",
)
)

with OutputFile(f"Dockerfile.gcc_spack_rocm", args.check) as f:
f.write(
spack_toolchain(
distro="rocm/dev-ubuntu-22.04:5.6.1-complete",
spec="cp2k@master%gcc build_system=cmake +sirius +elpa +libxc +libint smm=libxsmm +spglib +cosma +rocm amdgpu_target=gfx90a +pexsi +plumed +openmp ^openblas+fortran ^dbcsr+mpi+rocm~shared+openmp amdgpu_target=gfx906 ^cosma+shared~tests~apps+rocm",
)
)


# ======================================================================================
def regtest(
Expand Down Expand Up @@ -818,77 +794,6 @@ def spack_env_toolchain() -> str:
"""


# ======================================================================================
def spack_toolchain(distro: str, spec: str) -> str:
return rf"""
FROM {distro} as builder
ENV DEBIAN_FRONTEND noninteractive
# only the the two next lines are ubuntu specific
RUN apt-get update -qq
RUN apt-get install -qq --no-install-recommends autoconf autogen automake autotools-dev bzip2 ca-certificates g++ gcc gfortran git less libtool libtool-bin make nano patch pkg-config python3 unzip wget xxd zlib1g-dev cmake gnupg m4 xz-utils libssl-dev libssh-dev openmpi-common libopenmpi-dev
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
ENV FORCE_UNSAFE_CONFIGURE 1
ENV PATH="/spack/bin:${{PATH}}"
ENV MPICH_VERSION=4.0.3
# get latest version of spack
RUN git clone https://github.com/spack/spack.git
# set the location of packages built by spack
RUN spack config add config:install_tree:root:/opt/spack
# find all external packages but exclude python
RUN spack external find --all --exclude python
# find compilers
RUN spack compiler find
# tweaking the arguments
RUN yq -i '.compilers[0].compiler.flags.fflags = "-fallow-argument-mismatch"' /root/.spack/linux/compilers.yaml
#RUN spack config add packages:all:target:x86_64
# set amdgpu_target for all packages
# RUN spack config add packages:all:variants:amdgpu_target=gfx90a
# install few dependencies to help with docker caching
RUN spack install cmake@3.27.3
RUN spack install openblas+fortran
RUN spack install libxsmm
RUN spack install libxc
RUN spack install gsl
RUN spack install py-fypp
RUN spack install spglib
RUN spack install libvori
ENV SPEC_OPENBLAS="{spec}"
# instal all dependencies
RUN mkdir /cp2k-src
COPY . /cp2k-src
RUN spack repo add /cp2k-src/tools/spack
RUN spack env create --with-view /opt/cp2k cp2k-env
RUN spack install --only=dependencies --fail-fast $SPEC_OPENBLAS ^openmpi
# copy source files of the pull request into container
RUN spack --color always -e cp2k-env dev-build -q --source-path /cp2k-src $SPEC_OPENBLAS ^openmpi
# Build CP2K with CMake and run regression tests.
ARG TESTOPTS=""
RUN /bin/bash -o pipefail -c " \
TESTOPTS='${{TESTOPTS}}' \
/cp2k-src/tools/docker/scripts/test_regtest_spack.sh |& tee report.log && \
rm -rf regtesting"
# Output the report if the image is old and was therefore pulled from the build cache.
CMD cat $(find ./report.log -mmin +10) | sed '/^Summary:/ s/$/ (cached)/'
ENTRYPOINT []
"""


# ======================================================================================
class OutputFile:
def __init__(self, filename: str, check: bool) -> None:
Expand Down

0 comments on commit afdde75

Please sign in to comment.