Skip to content

Commit

Permalink
tune docker compose, Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
nurturenature committed Apr 14, 2023
1 parent 7c64b5d commit bfabb5e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 26 deletions.
4 changes: 0 additions & 4 deletions docker/bin/up
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@ INFO "Running \`docker compose build\`"
# shellcheck disable=SC2086
docker compose --compatibility -p jepsen -f docker-compose.yml ${COMPOSE} ${DEV} build

# We need a fresh share volume each time we start, so we have a correct set of
# DB hosts. Why does Docker make sharing state SO hard
docker run --rm -v jepsen_jepsen-shared:/data/ debian:buster rm /data/nodes || true

INFO "Running \`docker compose up\`"
if [ "${RUN_AS_DAEMON}" -eq 1 ]; then
# shellcheck disable=SC2086
Expand Down
19 changes: 4 additions & 15 deletions docker/control/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye
FROM jgoerzen/debian-base-standard:bullseye

ENV container=docker
STOPSIGNAL SIGRTMIN+3
Expand All @@ -8,20 +8,9 @@ ENV LEIN_ROOT true
#
# Jepsen dependencies
#
RUN apt-get -y -q update && \
apt-get install -qy openjdk-17-jdk-headless \
libjna-java \
vim \
emacs \
git \
htop \
screen \
pssh \
curl \
wget \
gnuplot \
graphviz \
dos2unix
RUN apt-get -qy update && \
apt-get -qy install \
curl dos2unix emacs git gnuplot graphviz htop iputils-ping libjna-java openjdk-17-jdk-headless pssh screen vim wget

RUN wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein && \
mv lein /usr/bin && \
Expand Down
13 changes: 7 additions & 6 deletions docker/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ ENV container=docker
STOPSIGNAL SIGRTMIN+3

# Basic system stuff
RUN apt-get update
RUN apt-get install -y apt-transport-https
RUN apt-get -qy update && \
apt-get -qy install \
apt-transport-https

# Install packages
RUN apt-get -qy update && \
apt-get -qy install \
dos2unix \
openssh-server \
pwgen
dos2unix openssh-server pwgen

# When run, boot-debian-base will call this script, which does final
# per-db-node setup stuff.
Expand All @@ -28,7 +27,9 @@ RUN sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh
ENV DEBBASE_SSH enabled

# Install Jepsen deps
RUN apt-get install -qy build-essential bzip2 curl dnsutils faketime iproute2 iptables iputils-ping libzip4 logrotate man man-db net-tools ntpdate psmisc python rsyslog sudo tar unzip vim wget ca-certificates
RUN apt-get -qy update && \
apt-get -qy install \
build-essential bzip2 ca-certificates curl dirmngr dnsutils faketime iproute2 iptables iputils-ping libzip4 logrotate man man-db netcat net-tools ntpdate psmisc python rsyslog sudo tar tcpdump unzip vim wget

EXPOSE 22
CMD ["/usr/local/bin/boot-debian-base"]
3 changes: 2 additions & 1 deletion docker/template/depends.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- n%%N%%
n%%N%%:
condition: service_healthy
18 changes: 18 additions & 0 deletions docker/template/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ x-node:
- ALL
ports:
- ${JEPSEN_PORT:-22}
stop_signal: SIGRTMIN+3
healthcheck:
test: [ 'CMD-SHELL', 'systemctl status sshd | grep "Active: active (running)"' ]
interval: 1s
timeout: 1s
retries: 3
start_period: 3s
depends_on:
setup:
condition: service_completed_successfully

volumes:
jepsen-shared:
Expand All @@ -30,6 +40,13 @@ networks:
jepsen:

services:
setup:
image: jgoerzen/debian-base-standard:bullseye
container_name: jepsen-setup
hostname: setup
volumes:
- "jepsen-shared:/var/jepsen/shared"
entrypoint: [ 'rm', '-rf', '/var/jepsen/shared/nodes' ]
control:
container_name: jepsen-control
hostname: control
Expand All @@ -44,4 +61,5 @@ services:
- jepsen
volumes:
- "jepsen-shared:/var/jepsen/shared"
stop_signal: SIGRTMIN+3
%%DBS%%

0 comments on commit bfabb5e

Please sign in to comment.