1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
# Copyright (c) 2020 Intel, Inc. All rights reserved.
# Copyright (c) 2020 IBM Corporation. All rights reserved.
#
# Base Build box for PRRTE
# Requires:
# - Basic compile tooling and runtime support
# - libevent - retrieve v2.1.11-stable from web
# - hwloc - retrieve v2.2.0 from web
# - curl
# - libjansson - retrieve v2.13.1 from web
# - PMIx - cloned from 'master' branch
# - PRRTE - cloned from 'master' branch
#
FROM centos:7
MAINTAINER Ralph Castain <ralph.h.castain@intel.com>
# ------------------------------------------------------------
# Install required packages
# ------------------------------------------------------------
RUN yum -y update && \
yum -y install epel-release && \
yum repolist && \
yum -y install \
systemd openssh-server openssh-clients \
gcc gdb strace \
binutils less wget which sudo \
perl perl-Data-Dumper numactl \
autoconf automake libtool flex bison \
iproute net-tools make git pandoc \
libnl3 gtk2 atk cairo tcl tcsh tk pciutils lsof ethtool bc file \
valgrind curl curl-devel && \
yum clean all
# ------------------------------------------------------------
# Define support libraries
# - hwloc
# - libevent
# - libjansson
# ------------------------------------------------------------
RUN mkdir -p /opt/hpc/local/build
RUN mkdir -p /opt/hpc/rndvz
ARG LIBEVENT_INSTALL_PATH=/opt/hpc/local/libevent
ENV LIBEVENT_INSTALL_PATH=$LIBEVENT_INSTALL_PATH
ARG HWLOC_INSTALL_PATH=/opt/hpc/local/hwloc
ENV HWLOC_INSTALL_PATH=$HWLOC_INSTALL_PATH
ARG LIBJANSSON_INSTALL_PATH=/opt/hpc/local/libjansson
ENV LIBJANSSON_INSTALL_PATH=$LIBJANSSON_INSTALL_PATH
RUN cd /opt/hpc/local/build && \
wget https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz && \
tar xf libevent-2.1.11-stable.tar.gz && \
cd libevent-2.1.11-stable && \
./configure --prefix=${LIBEVENT_INSTALL_PATH} > /dev/null && \
make > /dev/null && \
make install > /dev/null
RUN cd /opt/hpc/local/build && \
wget https://download.open-mpi.org/release/hwloc/v2.2/hwloc-2.2.0.tar.gz && \
tar xf hwloc-2.2.0.tar.gz && \
cd hwloc-2.2.0 && \
./configure --prefix=${HWLOC_INSTALL_PATH} > /dev/null && \
make > /dev/null && \
make install > /dev/null && \
cd .. && \
rm -rf /opt/hpc/local/src /opt/hpc/local/build/*
RUN cd /opt/hpc/local/build && \
wget https://digip.org/jansson/releases/jansson-2.13.1.tar.gz && \
tar xf jansson-2.13.1.tar.gz && \
cd jansson-2.13.1 && \
./configure --prefix=${LIBJANSSON_INSTALL_PATH} > /dev/null && \
make > /dev/null && \
make install > /dev/null && \
cd .. && \
rm -rf /opt/hpc/local/build/*
ENV LD_LIBRARY_PATH="$HWLOC_INSTALL_PATH/bin:$LIBEVENT_INSTALL_PATH/lib:$LIBJANSSON_INSTALL_PATH/lib:${LD_LIBRARY_PATH}"
# ------------------------------------------------------------
# PMIx Install
# ------------------------------------------------------------
ENV PMIX_ROOT=/opt/hpc/local/pmix
ENV LD_LIBRARY_PATH="$PMIX_ROOT/lib:${LD_LIBRARY_PATH}"
RUN cd /opt/hpc/local/build && \
git clone -q -b master https://github.com/openpmix/openpmix.git && \
cd openpmix && \
./autogen.pl > /dev/null && \
./configure --prefix=${PMIX_ROOT} \
--with-hwloc=${HWLOC_INSTALL_PATH} \
--with-libevent=${LIBEVENT_INSTALL_PATH} \
--with-curl \
--with-jansson=${LIBJANSSON_INSTALL_PATH} > /dev/null && \
make -j 10 > /dev/null && \
make -j 10 install > /dev/null && \
cd .. && rm -rf /opt/hpc/local/build/*
# ------------------------------------------------------------
# PRRTE Install
# ------------------------------------------------------------
ENV PRRTE_ROOT=/opt/hpc/local/prrte
ENV PATH="$PRRTE_ROOT/bin:${PATH}"
ENV LD_LIBRARY_PATH="$PRRTE_ROOT/lib:${LD_LIBRARY_PATH}"
RUN cd /opt/hpc/local/build && \
git clone -q -b master https://github.com/openpmix/prrte.git && \
cd prrte && \
./autogen.pl > /dev/null && \
./configure --prefix=${PRRTE_ROOT} \
--with-hwloc=${HWLOC_INSTALL_PATH} \
--with-libevent=${LIBEVENT_INSTALL_PATH} \
--with-pmix=${PMIX_ROOT} > /dev/null && \
make -j 10 > /dev/null && \
make -j 10 install > /dev/null && \
rm -rf /opt/hpc/local/build/*
# ------------------------------------------------------------
# Fixup the ssh login
# ------------------------------------------------------------
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N "" && \
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N "" && \
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" && \
echo " LogLevel ERROR" >> /etc/ssh/ssh_config && \
echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
echo " UserKnownHostsFile=/dev/null" >> /etc/ssh/ssh_config
# ------------------------------------------------------------
# Adjust default ulimit for core files
# ------------------------------------------------------------
RUN echo '* hard core -1' >> /etc/security/limits.conf && \
echo '* soft core -1' >> /etc/security/limits.conf && \
echo 'ulimit -c unlimited' >> /root/.bashrc
# ------------------------------------------------------------
# Create a user account
# ------------------------------------------------------------
RUN groupadd -r prteuser && useradd --no-log-init -r -m -b /home -g prteuser -G wheel prteuser
USER prteuser
RUN cd /home/prteuser && \
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa && chmod og+rX . && \
cd .ssh && cat id_rsa.pub > authorized_keys && chmod 644 authorized_keys && \
exit
# ------------------------------------------------------------
# Give the user passwordless sudo powers
# ------------------------------------------------------------
USER root
RUN echo "prteuser ALL = NOPASSWD: ALL" >> /etc/sudoers
# ------------------------------------------------------------
# Adjust the default environment
# ------------------------------------------------------------
USER root
ENV PRRTE_MCA_prrte_default_hostfile=/opt/hpc/etc/hostfile.txt
ENV PATH=$PATH:/opt/hpc/local/hwloc/bin
# Need to do this so that the 'prteuser' can have them too, not just root
RUN echo "export PMIX_ROOT=/opt/hpc/external/pmix" >> /etc/bashrc && \
echo "export PRRTE_ROOT=/opt/hpc/external/prrte" >> /etc/bashrc && \
echo "export PATH=\$PRRTE_ROOT/bin:\$PATH" >> /etc/bashrc && \
echo "export LD_LIBRARY_PATH=\$PMIX_ROOT/lib:\$LD_LIBRARY_PATH" >> /etc/bashrc && \
echo "export LD_LIBRARY_PATH=$HWLOC_INSTALL_PATH/lib:$LIBEVENT_INSTALL_PATH/lib:\$LD_LIBRARY_PATH" >> /etc/bashrc && \
echo "export LD_LIBRARY_PATH=\$LIBJANSSON_INSTALL_PATH/lib:\$LD_LIBRARY_PATH" >> /etc/bashrc && \
echo "export LD_LIBRARY_PATH=\$PRRTE_ROOT/lib:\$LD_LIBRARY_PATH" >> /etc/bashrc && \
echo "export PRRTE_MCA_prrte_default_hostfile=$PRRTE_MCA_prrte_default_hostfile" >> /etc/bashrc && \
echo "ulimit -c unlimited" >> /etc/bashrc && \
echo "alias pd=pushd" >> /etc/bashrc
# ------------------------------------------------------------
# Kick off the ssh daemon
# ------------------------------------------------------------
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
# ------------------------------------------------------------
# Tickle ptrace scope for Mac stacktrace
# ------------------------------------------------------------
CMD ["echo", "0", ">", "/proc/sys/kernel/yama/ptrace_scope"]
# ------------------------------------------------------------
# Kick off the PRRTE daemon
# ------------------------------------------------------------
USER prteuser
CMD ["prte"]
|