From 21168015c2611bac4bd944cf2f989ed26aa0094c Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 22 Sep 2023 19:04:52 -0600 Subject: [PATCH 1/4] 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 --- .github/workflows/docker-builds.yaml | 1 + lammps-intel-mpi-rocky/Dockerfile | 85 ++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 lammps-intel-mpi-rocky/Dockerfile diff --git a/.github/workflows/docker-builds.yaml b/.github/workflows/docker-builds.yaml index 62d0628..e066b31 100644 --- a/.github/workflows/docker-builds.yaml +++ b/.github/workflows/docker-builds.yaml @@ -33,6 +33,7 @@ jobs: ["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"]] diff --git a/lammps-intel-mpi-rocky/Dockerfile b/lammps-intel-mpi-rocky/Dockerfile new file mode 100644 index 0000000..217c845 --- /dev/null +++ b/lammps-intel-mpi-rocky/Dockerfile @@ -0,0 +1,85 @@ +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 + +# 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 +WORKDIR /opt/lammps/examples/reaxff/HNS From d95f78c32459c026aef7ca4f1d1e30f53a5fd31d Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 22 Sep 2023 19:16:53 -0600 Subject: [PATCH 2/4] add hpctoolkit build for rocky Signed-off-by: vsoch --- .github/workflows/docker-builds.yaml | 3 +- hpctoolkit-view-rocky/Dockerfile | 49 +++++++++++++++++++ .../Dockerfile | 0 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 hpctoolkit-view-rocky/Dockerfile rename {hpctoolkit-containerize => hpctoolkit-view}/Dockerfile (100%) diff --git a/.github/workflows/docker-builds.yaml b/.github/workflows/docker-builds.yaml index e066b31..15cc1ba 100644 --- a/.github/workflows/docker-builds.yaml +++ b/.github/workflows/docker-builds.yaml @@ -27,7 +27,8 @@ 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"], diff --git a/hpctoolkit-view-rocky/Dockerfile b/hpctoolkit-view-rocky/Dockerfile new file mode 100644 index 0000000..6eafcec --- /dev/null +++ b/hpctoolkit-view-rocky/Dockerfile @@ -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" ] diff --git a/hpctoolkit-containerize/Dockerfile b/hpctoolkit-view/Dockerfile similarity index 100% rename from hpctoolkit-containerize/Dockerfile rename to hpctoolkit-view/Dockerfile From 6f6db10b227f433d269193b46ee8db350de89692 Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 22 Sep 2023 21:47:25 -0600 Subject: [PATCH 3/4] working I think Signed-off-by: vsoch --- lammps-intel-mpi-rocky/Dockerfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lammps-intel-mpi-rocky/Dockerfile b/lammps-intel-mpi-rocky/Dockerfile index 217c845..d810f4e 100644 --- a/lammps-intel-mpi-rocky/Dockerfile +++ b/lammps-intel-mpi-rocky/Dockerfile @@ -71,15 +71,18 @@ RUN . /opt/intel/mpi/latest/env/vars.sh && \ 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 sed -i 's/^\(UsePAM yes\)/# \1/' /etc/ssh/sshd_config; \ + 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 + echo " UserKnownHostsFile=/dev/null" >> /etc/ssh/ssh_config EXPOSE 22 -WORKDIR /opt/lammps/examples/reaxff/HNS From 8d8a4b4bc0eb3b105a7eb0df2f16c0039f82dde9 Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 22 Sep 2023 22:09:45 -0600 Subject: [PATCH 4/4] needs to be passwordless Signed-off-by: vsoch --- lammps-intel-mpi-rocky/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lammps-intel-mpi-rocky/Dockerfile b/lammps-intel-mpi-rocky/Dockerfile index d810f4e..c5b3cea 100644 --- a/lammps-intel-mpi-rocky/Dockerfile +++ b/lammps-intel-mpi-rocky/Dockerfile @@ -73,16 +73,19 @@ RUN . /opt/intel/mpi/latest/env/vars.sh && \ make install # sshd -RUN sed -i 's/^\(UsePAM yes\)/# \1/' /etc/ssh/sshd_config; \ - ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N '' && \ +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 + 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