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

Container for (spack-manager) CPU Build of Exawind #573

Open
wants to merge 17 commits into
base: main
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
13 changes: 13 additions & 0 deletions configs/containercpu/compilers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
compilers:
- compiler:
spec: [email protected]
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: []
2 changes: 2 additions & 0 deletions configs/containercpu/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config:
build_jobs: 32
62 changes: 62 additions & 0 deletions configs/containercpu/packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
packages:
# Global settings
all:
compiler:
- [email protected]
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: [email protected]
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]
9 changes: 9 additions & 0 deletions env-templates/exawind_containercpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spack:
include:
- include.yaml
concretizer:
unify: false
reuse: false
view: false
specs:
- 'exawind+hypre~cuda'
92 changes: 92 additions & 0 deletions hpc_containers/exawind_container_cpu/Dockerfile-containercpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
MAINTAINER Philip Sakievich, Sandia National Laboratories <[email protected]>
MAINTAINER Jon Rood, NREL <[email protected]>

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"]
2 changes: 2 additions & 0 deletions scripts/create-exawind-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions spack-scripting/scripting/cmd/manager_cmds/find_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
),
}


Expand Down
Loading