-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add build with lammps and intel mpi on rocky (#29)
* add hpctoolkit build for rocky * add build with lammps and intel mpi on rocky this was suggested by google. it is not clear if this will work nicely with hpctoolkit, testing now Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
143 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM spack/rockylinux8:latest as builder | ||
|
||
# What we want to install and how we want to install it | ||
# is specified in a manifest file (spack.yaml) | ||
RUN mkdir /opt/spack-environment \ | ||
&& (echo spack: \ | ||
&& echo ' specs: [hpctoolkit +papi +mpi]' \ | ||
&& echo ' view: /opt/views/view' \ | ||
&& echo ' concretizer:' \ | ||
&& echo ' unify: true' \ | ||
&& echo ' packages:' \ | ||
&& echo ' all:' \ | ||
&& echo ' require: ["target=:x86_64"]' \ | ||
&& echo ' config:' \ | ||
&& echo ' install_tree: /opt/software') > /opt/spack-environment/spack.yaml | ||
|
||
# Install the software, remove unnecessary deps | ||
RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y | ||
|
||
# Strip all the binaries | ||
RUN find -L /opt/views/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 | ||
|
||
# Modifications to the environment that are necessary to run | ||
RUN cd /opt/spack-environment && \ | ||
spack env activate --sh -d . > activate.sh | ||
|
||
# Bare OS image to run the installed executables | ||
FROM rockylinux:8 | ||
|
||
COPY --from=builder /opt/spack-environment /opt/spack-environment | ||
COPY --from=builder /opt/software /opt/software | ||
|
||
# paths.view is a symlink, so copy the parent to avoid dereferencing and duplicating it | ||
COPY --from=builder /opt/views /opt/views | ||
|
||
RUN { \ | ||
echo '#!/bin/sh' \ | ||
&& echo '.' /opt/spack-environment/activate.sh \ | ||
&& echo 'exec "$@"'; \ | ||
} > /entrypoint.sh \ | ||
&& chmod a+x /entrypoint.sh \ | ||
&& ln -s /opt/views/view /opt/view | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
CMD [ "/bin/bash" ] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
ARG tag="8" | ||
FROM rockylinux:${tag} as builder | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Enable PowerTools for development packages | ||
RUN yum -y update \ | ||
&& dnf -y install 'dnf-command(config-manager)' \ | ||
&& yum config-manager --set-enabled powertools \ | ||
&& yum -y update \ | ||
&& yum -y install epel-release \ | ||
&& yum -y install \ | ||
wget \ | ||
fftw-devel \ | ||
fftw \ | ||
git \ | ||
curl \ | ||
bind-utils \ | ||
sudo \ | ||
jq \ | ||
which \ | ||
file \ | ||
unzip \ | ||
vim \ | ||
patch \ | ||
diffutils \ | ||
pkgconfig \ | ||
libtool \ | ||
autoconf \ | ||
automake \ | ||
gcc-gfortran \ | ||
gcc \ | ||
gcc-c++ \ | ||
make \ | ||
cmake \ | ||
bison \ | ||
flex \ | ||
python3-devel \ | ||
fftw3-devel fftw3 \ | ||
openssh-server \ | ||
openssh-clients \ | ||
&& yum clean all | ||
|
||
# Set default /usr/bin/python to python3 | ||
RUN alternatives --set python /usr/bin/python3 | ||
|
||
ENV LANG=C.UTF-8 | ||
RUN printf "LANG=C.UTF-8" > /etc/locale.conf | ||
|
||
RUN git clone https://github.com/GoogleCloudPlatform/hpc-tools && \ | ||
yum group install -y "Development tools" && \ | ||
cd hpc-tools/rocky_linux_8 && \ | ||
chmod +x google_install_intelmpi google_hpc_libfabric && \ | ||
# installs to /opt/intel | ||
./google_install_intelmpi --impi_2021 && \ | ||
# And install libfabric with net/psm3 | ||
./google_hpc_libfabric --net --psm3 | ||
|
||
|
||
# Modifications to the environment that are necessary to run | ||
RUN echo ". /opt/intel/mpi/latest/env/vars.sh" >> /etc/profile.d/z10_intel_environment.sh | ||
WORKDIR /opt/ | ||
|
||
# install laamps alongside spack | ||
RUN . /opt/intel/mpi/latest/env/vars.sh && \ | ||
git clone --depth 1 --branch stable_29Sep2021_update2 https://github.com/lammps/lammps.git /opt/lammps && \ | ||
cd /opt/lammps && \ | ||
mkdir build && \ | ||
cd build && \ | ||
. /etc/profile && \ | ||
cmake ../cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DPKG_REAXFF=yes -DBUILD_MPI=yes -DPKG_OPT=yes -DFFT=FFTW3 -DCMAKE_PREFIX_PATH=/opt/intel/mpi/2021.8.0 -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu && \ | ||
make && \ | ||
make install | ||
|
||
# sshd | ||
RUN ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N '' && \ | ||
ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N '' && \ | ||
ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key -N ''; | ||
|
||
WORKDIR /opt/lammps/examples/reaxff/HNS | ||
|
||
# Hack for ssh for now... | ||
RUN echo " LogLevel ERROR" >> /etc/ssh/ssh_config && \ | ||
echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \ | ||
echo " UserKnownHostsFile=/dev/null" >> /etc/ssh/ssh_config && \ | ||
cd /root && \ | ||
mkdir -p /run/sshd && \ | ||
ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa && chmod og+rX . && \ | ||
cd .ssh && cat id_rsa.pub > authorized_keys && chmod 644 authorized_keys | ||
|
||
EXPOSE 22 |