-
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.
* making bad life choices (single layer flux install) Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
188 additions
and
2 deletions.
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,182 @@ | ||
ARG tag=focal | ||
FROM ubuntu:${tag} | ||
|
||
# This will build a single layer for everything flux needs, and a second for | ||
# environment (PATH) but arguably we can add that later. | ||
# Don't try this at home! | ||
# docker build -f Dockerfile.mamba-layer -t rse-ops/flux-conda:mamba-layer . | ||
|
||
ENV PATH=/opt/conda/bin:$PATH LANG=C.UTF-8 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# This first section from src/test/docker/bionic/Dockerfile in flux-core | ||
# https://github.com/flux-framework/flux-core/blob/master/src/test/docker/bionic/Dockerfile | ||
RUN apt-get update && \ | ||
apt-get -qq install -y --no-install-recommends \ | ||
apt-utils && \ | ||
apt-get -qq install -y --no-install-recommends \ | ||
locales \ | ||
ca-certificates \ | ||
curl \ | ||
wget \ | ||
man \ | ||
git \ | ||
flex \ | ||
ssh \ | ||
sudo \ | ||
vim \ | ||
luarocks \ | ||
munge \ | ||
lcov \ | ||
ccache \ | ||
lua5.2 \ | ||
mpich \ | ||
valgrind \ | ||
jq && \ | ||
# Compilers, autotools | ||
apt-get update && \ | ||
apt-get -qq install -y --no-install-recommends \ | ||
build-essential \ | ||
pkg-config \ | ||
autotools-dev \ | ||
libtool \ | ||
libffi-dev \ | ||
autoconf \ | ||
automake \ | ||
make \ | ||
cmake \ | ||
clang-6.0 \ | ||
clang-tidy \ | ||
gcc-8 \ | ||
g++-8 && \ | ||
# Python - instead of a system python we install mamba | ||
/bin/bash -c "curl -L https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh > mambaforge.sh && \ | ||
bash mambaforge.sh -b -p /opt/conda && \ | ||
rm mambaforge.sh" && \ | ||
export PATH=/opt/conda/bin:$PATH && \ | ||
pip install --upgrade --ignore-installed \ | ||
"markupsafe==2.0.0" \ | ||
coverage cffi ply six pyyaml "jsonschema>=2.6,<4.0" \ | ||
sphinx sphinx-rtd-theme sphinxcontrib-spelling && \ | ||
# Other deps | ||
apt-get -qq install -y --no-install-recommends \ | ||
libsodium-dev \ | ||
libzmq3-dev \ | ||
libczmq-dev \ | ||
libjansson-dev \ | ||
libmunge-dev \ | ||
libncursesw5-dev \ | ||
liblua5.2-dev \ | ||
liblz4-dev \ | ||
libsqlite3-dev \ | ||
uuid-dev \ | ||
libhwloc-dev \ | ||
libmpich-dev \ | ||
libs3-dev \ | ||
libevent-dev \ | ||
libarchive-dev \ | ||
libpam-dev && \ | ||
# Testing utils and libs | ||
apt-get -qq install -y --no-install-recommends \ | ||
faketime \ | ||
libfaketime \ | ||
pylint \ | ||
cppcheck \ | ||
enchant \ | ||
aspell \ | ||
aspell-en && \ | ||
locale-gen en_US.UTF-8 && \ | ||
# NOTE: luaposix installed by rocks due to Ubuntu bug: #1752082 https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082 | ||
luarocks install luaposix && \ | ||
# Install caliper by hand for now | ||
mkdir -p /opt/caliper && \ | ||
cd /opt/caliper && \ | ||
wget -O - https://github.com/LLNL/Caliper/archive/v1.7.0.tar.gz | tar xvz --strip-components 1 && \ | ||
mkdir build && \ | ||
cd build && \ | ||
CC=gcc CXX=g++ cmake .. -DCMAKE_INSTALL_PREFIX=/usr && \ | ||
make -j 4 && \ | ||
make install && \ | ||
cd ../.. && \ | ||
rm -rf caliper && \ | ||
mkdir -p /opt/prrte && cd /opt/prrte && \ | ||
# Install openpmix, prrte | ||
git clone https://github.com/openpmix/openpmix.git && \ | ||
git clone https://github.com/openpmix/prrte.git && \ | ||
ls -l && \ | ||
set -x && \ | ||
cd openpmix && \ | ||
git checkout fefaed568f33bf86f28afb6e45237f1ec5e4de93 && \ | ||
./autogen.pl && \ | ||
PYTHON=/opt/conda/bin/python ./configure --prefix=/usr --disable-static && make -j 4 install && \ | ||
ldconfig && \ | ||
cd .. && \ | ||
cd prrte && \ | ||
git checkout 477894f4720d822b15cab56eee7665107832921c && \ | ||
./autogen.pl && \ | ||
PYTHON=/opt/conda/bin/python ./configure --prefix=/usr && make -j 4 install && \ | ||
cd ../.. && \ | ||
rm -rf prrte && \ | ||
# Manually create the fluxuser | ||
useradd -u 1000 -d /home/fluxuser -m fluxuser && \ | ||
printf "fluxuser ALL= NOPASSWD: ALL\\n" >> /etc/sudoers && \ | ||
export FLUX_SECURITY_VERSION=0.8.0 && \ | ||
cd /opt && \ | ||
CCACHE_DISABLE=1 && \ | ||
V=$FLUX_SECURITY_VERSION && \ | ||
PKG=flux-security-$V && \ | ||
URL=https://github.com/flux-framework/flux-security/releases/download && \ | ||
wget ${URL}/v${V}/${PKG}.tar.gz && \ | ||
tar xvfz ${PKG}.tar.gz && \ | ||
cd ${PKG} && \ | ||
PYTHON=/opt/conda/bin/python ./configure --prefix=/usr --sysconfdir=/etc || cat config.log && \ | ||
make -j 4 && \ | ||
make install && \ | ||
cd .. && \ | ||
rm -rf flux-security-* && \ | ||
# Add configured user to image with sudo access: | ||
set -x && \ | ||
# Setup MUNGE directories & key | ||
mkdir -p /var/run/munge && \ | ||
dd if=/dev/urandom bs=1 count=1024 > /etc/munge/munge.key && \ | ||
chown -R munge /etc/munge/munge.key /var/run/munge && \ | ||
chmod 600 /etc/munge/munge.key && \ | ||
# Build flux core | ||
# This I added and copied how to build with caliper / flux security enabled | ||
# https://github.com/flux-framework/flux-core/blob/master/src/test/docker/docker-run-checks.sh#L185-L191 | ||
git clone --depth 1 -b disable-sign-id-check https://github.com/researchapps/flux-core && \ | ||
cd flux-core && \ | ||
./autogen.sh && \ | ||
PYTHON=/opt/conda/bin/python PYTHON_PREFIX=PYTHON_EXEC_PREFIX=/opt/conda/lib/python3.8/site-packages ./configure --prefix=/usr --sysconfdir=/etc \ | ||
--with-systemdsystemunitdir=/etc/systemd/system \ | ||
--localstatedir=/var \ | ||
--with-flux-security \ | ||
--enable-caliper && \ | ||
make clean && \ | ||
make && \ | ||
make install && \ | ||
|
||
# This is from the same src/test/docker/bionic/Dockerfile but in flux-sched | ||
# Flux-sched deps | ||
apt-get -qq install -y --no-install-recommends \ | ||
libboost-graph-dev \ | ||
libboost-system-dev \ | ||
libboost-filesystem-dev \ | ||
libboost-regex-dev \ | ||
libyaml-cpp-dev \ | ||
libedit-dev && \ | ||
export LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH && \ | ||
# Build Flux Sched | ||
# https://github.com/flux-framework/flux-sched/blob/master/src/test/docker/docker-run-checks.sh#L152-L158 | ||
git clone --depth 1 https://github.com/flux-framework/flux-sched && \ | ||
cd flux-sched && \ | ||
./autogen.sh && \ | ||
PYTHON=/opt/conda/bin/python ./configure --prefix=/usr --sysconfdir=/etc \ | ||
--with-systemdsystemunitdir=/etc/systemd/system \ | ||
--localstatedir=/var \ | ||
--with-flux-security \ | ||
--enable-caliper && \ | ||
make && \ | ||
sudo make install && \ | ||
ldconfig && \ | ||
rm -rf /var/lib/apt/lists/* |