Skip to content

Commit

Permalink
Merge pull request #3031 from grondo/fluxorama
Browse files Browse the repository at this point in the history
add fluxorama system instance docker image sources
  • Loading branch information
mergify[bot] committed Aug 8, 2020
2 parents 0bf0800 + aec1209 commit f198a29
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ after_success:
docker tag "$TAGNAME" ${t} && \
docker push ${t}
fi
# If this is centos8 build, then build fluxorama image
if echo "$TAGNAME" | grep -q "centos8"; then
FLUXORAMATAG="fluxrm/fluxorama${TRAVIS_TAG+:$TRAVIS_TAG}"
docker build -t ${FLUXORAMATAG} src/test/docker/fluxorama
docker push ${FLUXORAMATAG}
fi
fi
after_failure:
Expand Down
33 changes: 12 additions & 21 deletions src/test/docker/centos8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ LABEL maintainer="Mark Grondona <mgrondona@llnl.gov>"
RUN yum -y update \
&& dnf -y install 'dnf-command(config-manager)' \
&& yum config-manager --set-enabled PowerTools \
&& yum -y update

&& yum -y update \
# Enable EPEL
RUN yum -y install epel-release

&& yum -y install epel-release \
# Utilities
RUN yum -y install \
&& yum -y install \
wget \
man-db \
less \
git \
sudo \
munge \
Expand All @@ -27,30 +26,24 @@ RUN yum -y install \
file \
vim \
patch \
diffutils

diffutils \
# Compilers, autotools
RUN yum -y install \
pkgconfig \
libtool \
autoconf \
automake \
gcc \
gcc-c++ \
make \
cmake

cmake \
# Python
RUN yum -y install \
python36 \
python3-devel \
python3-cffi \
python3-six \
python3-yaml \
python3-jsonschema

python3-jsonschema \
# Development dependencies
RUN yum -y install \
libsodium-devel \
zeromq-devel \
czmq-devel \
Expand All @@ -63,20 +56,17 @@ RUN yum -y install \
mpich-devel \
lua-devel \
valgrind-devel \
libs3-devel

libs3-devel \
# Other deps
RUN yum -y install \
perl-Time-HiRes \
lua-posix \
libfaketime \
cppcheck \
enchant \
aspell \
aspell-en

# Clean up
RUN yum clean all
aspell-en \
glibc-langpack-en \
&& yum clean all

# Set default /usr/bin/python to python3
RUN alternatives --set python /usr/bin/python3
Expand All @@ -100,5 +90,6 @@ RUN mkdir caliper \
&& rm -rf caliper

ENV LANG=C.UTF-8
RUN printf "LANG=C.UTF-8" > /etc/locale.conf

COPY config.site /usr/share/config.site
14 changes: 9 additions & 5 deletions src/test/docker/docker-run-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,18 @@ export chain_lint

if [[ "$INSTALL_ONLY" == "t" ]]; then
docker run --rm \
--workdir=/usr/src \
--workdir=/usr/src \
--volume=$TOP:/usr/src \
travis-builder:${IMAGE} \
sh -c "./autogen.sh &&
./configure --prefix=/usr &&
travis-builder:${IMAGE} \
sh -c "./autogen.sh &&
./configure --prefix=/usr --sysconfdir=/etc \
--with-systemdsystemunitdir=/etc/systemd/system \
--localstatedir=/var \
--with-flux-security \
--enable-caliper &&
make clean &&
make -j${JOBS}" \
|| (docker rm tmp.$$; die "docker run of 'make install' failed")
|| (docker rm tmp.$$; die "docker run of 'make install' failed")
else
docker run --rm \
--workdir=/usr/src \
Expand Down
92 changes: 92 additions & 0 deletions src/test/docker/fluxorama/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

FROM fluxrm/flux-core:centos8

# Default container user.
# "fluxuser" should match fluxrm/flux-core image
ARG USER=fluxuser
ARG UID=2100
ARG GID=2100

# UID for system "flux" user. Runs Flux instance
ARG FLUXUID=1000

ENV container docker

STOPSIGNAL SIGRTMIN+3

USER root

VOLUME [ "/sys/fs/cgroup" ]

# See: https://hub.docker.com/r/centos/systemd/dockerfile
RUN (cd /lib/systemd/system/sysinit.target.wants/; \
for i in *; \
do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; \
done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;


RUN dnf install -y psmisc tmux \
&& dnf clean all

#
# Install ttyd
RUN wget https://github.com/tsl0922/ttyd/releases/download/1.6.0/ttyd_linux.x86_64
RUN mv ttyd_linux.x86_64 /usr/bin/ttyd && chmod 755 /usr/bin/ttyd

#
# Register ttyd service
RUN user=fluxuser && uid=$(id -u $user) && gid=$(id -g fluxuser) \
&& printf "#!/bin/sh\n" >/bin/ttyd.sh \
&& printf "rm -f /var/run/nologin\n" >>/bin/ttyd.sh \
&& printf "/usr/bin/ttyd -o -p 7681 /bin/login $user\n" >>/bin/ttyd.sh \
&& printf "systemctl halt --no-block\n" >>/bin/ttyd.sh \
&& chmod 755 /bin/ttyd.sh \
&& printf "[Unit]\n" >/etc/systemd/system/ttyd.service \
&& printf "Description=ttyd service\n\n" >>/etc/systemd/system/ttyd.service \
&& printf "[Service]\n" >>/etc/systemd/system/ttyd.service \
&& printf "Type=simple\n" >>/etc/systemd/system/ttyd.service \
&& printf "ExecStart=/bin/ttyd.sh\n" >>/etc/systemd/system/ttyd.service \
&& printf "User=root\nGroup=root\n" >>/etc/systemd/system/ttyd.service \
&& printf "[Install]\nWantedBy=multi-user.target\n" >>/etc/systemd/system/ttyd.service

#
# Add flux user
#
RUN groupadd -g $FLUXUID flux \
&& useradd -g flux -u $FLUXUID -d /home/flux -m flux

# N.B.: "fluxuser" already exists in fluxrm/flux-core image

#
# Add users besides fluxuser for mult-user testing
RUN for i in $(seq 1 5); do \
user="user${i}"; \
uid=$((${UID} + 100 + $i)); \
printf "Adding ${user}\n"; \
groupadd -g $uid $user; \
useradd -g $user -u $uid -d /home/$user -m $user; \
done

# Copy in configuration
COPY imp.toml /etc/flux/imp/conf.d/imp.toml
COPY job-exec.toml /etc/flux/system/conf.d/exec.toml
COPY access.toml /etc/flux/system/conf.d/access.toml

RUN chmod 4755 /usr/libexec/flux/flux-imp \
&& systemctl enable flux.service \
&& systemctl enable munge.service \
&& systemctl enable ttyd.service

COPY f.txt /etc/motd
COPY entrypoint.sh /usr/local/sbin

WORKDIR /home/$USER
EXPOSE 7681
CMD [ "init" ]
3 changes: 3 additions & 0 deletions src/test/docker/fluxorama/access.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[access]
allow-guest-user = true
allow-root-owner = true
11 changes: 11 additions & 0 deletions src/test/docker/fluxorama/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# Set default password for fluxuser
if test -z "$FLUXUSER_PASSWORD"; then
printf >&2 "ERROR: No password set for fluxuser\n"
printf >&2 "Please set via the FLUXUSER_PASSWORD environment variable\n"
printf >&2 "e.g. FLUXUSER_PASSWORD=xxzzy docker run -e FLUXUSER_PASSWORD ..\n"
exit 1
fi
printf >&2 "Setting requested password for fluxuser..\n"
echo fluxuser:${FLUXUSER_PASSWORD} | chpasswd
exec "$@"

0 comments on commit f198a29

Please sign in to comment.