Skip to content
Snippets Groups Projects
Commit 17e807cb authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

spack centos stream

parent 67d42ce6
Branches
No related tags found
No related merge requests found
Bootstrap: docker
From: spack/centos-stream:v0.19.0
Stage: build
%post
# Create the manifest file for the installation in /opt/spack-environment
mkdir /opt/spack-environment && cd /opt/spack-environment
cat << EOF > spack.yaml
spack:
specs:
- openmpi@4.1.1+legacylaunchers+pmi fabrics=ucx schedulers=slurm target=skylake
- ucx@1.11.2+thread_multiple+pic+rc+dm+dc+ud+cma target=skylake
concretizer:
unify: when_possible
config:
install_tree: /opt/software
view: /opt/view
EOF
# Install all the required software
. /opt/spack/share/spack/setup-env.sh
spack env activate .
spack install --fail-fast
spack gc -y
spack env deactivate
spack env activate --sh -d . >> /opt/spack-environment/environment_modifications.sh
# Strip the binaries to reduce the size of the image
find -L /opt/view/* -type f -exec readlink -f '{}' \; | \
xargs file -i | \
grep 'charset=binary' | \
grep 'x-executable\|x-archive\|x-sharedlib' | \
awk -F: '{print $1}' | xargs strip -s
Bootstrap: docker
From: quay.io/centos/centos:stream
Stage: final
%files from build
/opt/spack-environment /opt
/opt/software /opt
/opt/view /opt
/opt/spack-environment/environment_modifications.sh /opt/spack-environment/environment_modifications.sh
%post
# Update, install and cleanup of system packages needed at run-time
yum update -y && yum install -y epel-release && yum update -y
yum install -y gcc gcc-gfortran
rm -rf /var/cache/yum && yum clean all
# Modify the environment without relying on sourcing shell specific files at startup
cat /opt/spack-environment/environment_modifications.sh >> $SINGULARITY_ENVIRONMENT
%labels
mpi openmpi@4.1.1
spack:
specs:
#- hdf5@1.10.7+mpi target=skylake
- openmpi@4.1.1 fabrics=ucx schedulers=slurm +legacylaunchers+thread_multiple+pmi target=skylake
- ucx@ +thread_multiple+pic+rc+dm+dc+ud+cma+mlx5-dv target=skylake
container:
images:
# os: "ubuntu:18.04"
os: "centos:8"
spack: 0.19.0
format: singularity
strip: true
os_packages:
final:
- gcc
- gcc-gfortran
labels:
mpi: "openmpi@4.1.1"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment