diff --git a/configs/containercpu/compilers.yaml b/configs/containercpu/compilers.yaml new file mode 100644 index 00000000..10686fe8 --- /dev/null +++ b/configs/containercpu/compilers.yaml @@ -0,0 +1,13 @@ +compilers: +- compiler: + spec: gcc@11.4.0 + paths: + cc: /usr/bin/gcc + cxx: /usr/bin/g++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + flags: {} + operating_system: ubuntu22.04 + target: any + modules: [] + extra_rpaths: [] diff --git a/configs/containercpu/config.yaml b/configs/containercpu/config.yaml new file mode 100644 index 00000000..874ad986 --- /dev/null +++ b/configs/containercpu/config.yaml @@ -0,0 +1,2 @@ +config: + build_jobs: 32 diff --git a/configs/containercpu/packages.yaml b/configs/containercpu/packages.yaml new file mode 100644 index 00000000..c1d18861 --- /dev/null +++ b/configs/containercpu/packages.yaml @@ -0,0 +1,62 @@ +packages: +# Global settings + all: + compiler: + - gcc@11.4.0 + providers: + mpi: [mpich] + blas: [netlib-lapack] + lapack: [netlib-lapack] + variants: build_type=Release + mpi: + require: mpich +# Use Ubuntu libncurses-dev, b/c Spack version failes + ncurses: + externals: + - spec: ncurses@6.3 + prefix: /usr +# Package preferences to be built by Spack for correct Exawind +# Nota bene: use libtool from Spack for correct linking + ascent: + variants: ~fortran~openmp + amr-wind: + variants: +tiny_profile + conduit: + variants: ~fortran~hdf5_compat + boost: + version: [1.78.0] + variants: cxxstd=17 + cmake: + version: [3.26.3] + variants: build_type=Release + hdf5: + version: [1.10.7] + variants: +cxx+hl + libtool: + version: [2.4.7] + masa: + variants: ~fortran~python + netcdf-c: + require: '@4.7.4' + variants: +parallel-netcdf maxdims=65536 maxvars=524288 + openfast: + version: [master] + variants: +cxx + parallel-netcdf: + version: [1.12.2] + variants: ~fortran + perl: + require: '@5.34.1' + tioga: + version: [develop] + trilinos: + require: + - any_of: ["@13.4.0", "@develop"] + hypre: + require: '@develop' + variants: ~fortran + hypre2: + require: '@develop' + variants: ~fortran + yaml-cpp: + version: [0.6.3] diff --git a/env-templates/exawind_containercpu.yaml b/env-templates/exawind_containercpu.yaml new file mode 100644 index 00000000..01fd9c68 --- /dev/null +++ b/env-templates/exawind_containercpu.yaml @@ -0,0 +1,9 @@ +spack: + include: + - include.yaml + concretizer: + unify: false + reuse: false + view: false + specs: + - 'exawind+hypre~cuda' diff --git a/hpc_containers/exawind_container_cpu/Dockerfile-containercpu b/hpc_containers/exawind_container_cpu/Dockerfile-containercpu new file mode 100644 index 00000000..c0066ec9 --- /dev/null +++ b/hpc_containers/exawind_container_cpu/Dockerfile-containercpu @@ -0,0 +1,92 @@ +MAINTAINER Philip Sakievich, Sandia National Laboratories <psakiev@sandia.gov> +MAINTAINER Jon Rood, NREL <Jon.Rood@nrel.gov> + +ARG REGISTRY=docker.io/library +ARG IMAGE=ubuntu +ARG TAG=jammy + +FROM ${REGISTRY}/${IMAGE}:${TAG} + +# Make bash the default $SHELL +SHELL ["/bin/bash", "-c"] + +# Install Spack Prereqs: https://spack.readthedocs.io/en/latest/getting_started.html#system-prerequisites + +RUN apt-get update -yqq && \ + apt-get upgrade -yqq + +RUN apt-get install -yqq \ + ca-certificates \ + autoconf \ + automake \ + bzip2 \ + clangd \ + coreutils \ + curl \ + emacs-nox \ + file \ + flex \ + gcc \ + gcc-multilib \ + gcc-doc \ + g++ \ + gfortran \ + gfortran-multilib \ + gfortran-doc \ + git \ + git-doc \ + git-man \ + gnupg2 \ + libffi-dev \ + libfmt-dev \ + libgmp-dev \ + libjpeg-dev \ + libmpc-dev \ + libncurses-dev \ + libx11-dev \ + lsb-release \ + m4 \ + make \ + nano \ + openssl \ + patch \ + python3 \ + python3-distutils \ + python3-venv \ + unzip \ + vim \ + wget \ + wget2 \ + xz-utils \ + zip \ + zlib1g-dev + +RUN apt clean -yqq + +## Exawind CPU snapshot +WORKDIR /exawind-entry +##RUN git clone --recursive https://github.com/sandialabs/spack-manager + +## Pre-merge fork +RUN git clone --recursive https://github.com/ajpowelsnl/spack-manager +# +WORKDIR /exawind-entry/spack-manager +## Pre-merge branch from ajpowelsnl/spack-manager fork +RUN git checkout perlmutter/new_configs + +## Needed by "create-exawind-snapshot.sh" +ENV SPACK_MANAGER=/exawind-entry/spack-manager +ENV SPACK_MANAGER_MACHINE=containercpu +ENV CONTAINER_BUILD=cpu + +# Snapshot for CPU Exawind will be generated upon running container +RUN echo "export SPACK_MANAGER=$SPACK_MANAGER" >> /etc/bash.bashrc && \ + echo "source $SPACK_MANAGER/start.sh && spack-start" >> /etc/bash.bashrc && \ + echo "spack external find" >> /etc/bash.bashrc && \ + echo "$SPACK_MANAGER/scripts/create-exawind-snapshot.sh" >> /etc/bash.bashrc && \ + echo "spack clean -a" >> /etc/bash.bashrc && \ + echo "spack env activate -d snapshots/exawind/containercpu/$(date +%Y-%m-%d)" >> /etc/bash.bashrc && \ + echo "spack load exawind" >> /etc/bash.bashrc + + +CMD ["/usr/bin/bash"] diff --git a/scripts/create-exawind-snapshot.sh b/scripts/create-exawind-snapshot.sh index 2dcef826..d93069c9 100755 --- a/scripts/create-exawind-snapshot.sh +++ b/scripts/create-exawind-snapshot.sh @@ -55,6 +55,8 @@ elif [[ "${SPACK_MANAGER_MACHINE}" == "perlmutter" ]]; then elif [[ "${SPACK_MANAGER_MACHINE}" == "snl-hpc" ]]; then # TODO we should probably launch the install through slurm and exit on this one cmd "nice -n19 spack manager snapshot -s exawind+hypre+openfast amr-wind+hypre+openfast" +elif [[ "${SPACK_MANAGER_MACHINE}" == "containercpu" ]]; then + cmd "nice -n19 spack manager snapshot -m -s exawind%gcc+hypre~cuda" else cmd "nice -n19 spack manager snapshot -s exawind+hypre+openfast" fi diff --git a/spack-scripting/scripting/cmd/manager_cmds/find_machine.py b/spack-scripting/scripting/cmd/manager_cmds/find_machine.py index 34cc495e..fa3bc805 100644 --- a/spack-scripting/scripting/cmd/manager_cmds/find_machine.py +++ b/spack-scripting/scripting/cmd/manager_cmds/find_machine.py @@ -99,6 +99,9 @@ def is_e4s(): ), # General "darwin": MachineData(lambda: sys.platform == "darwin", "darwin.nodomain.gov"), + "containercpu": MachineData( + lambda: os.environ["CONTAINER_BUILD"] == "cpu", "containcpu.nodomain.gov" + ), }