Skip to content

Commit

Permalink
add build with lammps and intel mpi on rocky (#29)
Browse files Browse the repository at this point in the history
* 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
vsoch committed Sep 23, 2023
1 parent e9e24e1 commit 2d71559
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/docker-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ jobs:
["ovis-hpc", "ghcr.io/converged-computing/metric-ovis-hpc:latest"],
["kripke", "ghcr.io/converged-computing/metric-kripke:latest"],
["hpctoolkit-viewer", "ghcr.io/converged-computing/metric-hpctoolkit-viewer:latest"],
["hpctoolkit-containerize", "ghcr.io/converged-computing/metric-hpctoolkit-view:latest"],
["hpctoolkit-view", "ghcr.io/converged-computing/metric-hpctoolkit-view:ubuntu"],
["hpctoolkit-view-rocky", "ghcr.io/converged-computing/metric-hpctoolkit-view:rocky"],
["hpctoolkit-spack", "ghcr.io/converged-computing/metric-hpctoolkit-spack:latest"],
["hpctoolkit", "ghcr.io/converged-computing/metric-hpctoolkit:latest"],
["bdas", "ghcr.io/converged-computing/metric-bdas:latest"],
["laghos", "ghcr.io/converged-computing/metric-laghos:latest"],
["nekbone", "ghcr.io/converged-computing/metric-nekbone:latest"],
["lammps-intel-mpi-rocky", "ghcr.io/converged-computing/metric-lammps-intel-mpi:rocky"],
["lammps", "ghcr.io/converged-computing/metric-lammps:latest"],
["perf-kit-benchmarker", "ghcr.io/converged-computing/metric-perf-kit-benchmarker:latest"]]

Expand Down
49 changes: 49 additions & 0 deletions hpctoolkit-view-rocky/Dockerfile
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.
91 changes: 91 additions & 0 deletions lammps-intel-mpi-rocky/Dockerfile
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

0 comments on commit 2d71559

Please sign in to comment.