summaryrefslogtreecommitdiff
path: root/packaging/docker/catlfish-merge
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2015-04-13 14:19:38 +0200
committerLinus Nordberg <linus@nordberg.se>2015-04-13 17:11:07 +0200
commitcf6e64bf94677092ef94a6f4ed7c1391dcd43f23 (patch)
tree903d5a399ce3c4a98fe0a61e51a024c9f4616dda /packaging/docker/catlfish-merge
parent2e7ae73196da22dcf9b4817fc38861774ff61b84 (diff)
Run all types of nodes from the same docker image.
Diffstat (limited to 'packaging/docker/catlfish-merge')
-rw-r--r--packaging/docker/catlfish-merge/Dockerfile41
-rwxr-xr-xpackaging/docker/catlfish-merge/merge.sh27
-rw-r--r--packaging/docker/catlfish-merge/supervisord.conf6
3 files changed, 0 insertions, 74 deletions
diff --git a/packaging/docker/catlfish-merge/Dockerfile b/packaging/docker/catlfish-merge/Dockerfile
deleted file mode 100644
index 9a82d5f..0000000
--- a/packaging/docker/catlfish-merge/Dockerfile
+++ /dev/null
@@ -1,41 +0,0 @@
-# Docker file for catlfish merge.
-#
-# NOTE: The directory on the host system that's mounted at
-# /var/local/db/catlfish-merge in the container has to be writable by
-# a host user with uid 147.
-#
-# $ docker run \
-# -v /etc/catlfish:/usr/local/etc/catlfish:ro \
-# -v /var/local/db/catlfish-merge:/var/local/db/catlfish-merge \
-# catlfish-merge
-
-FROM erlang
-RUN apt-get update
-RUN echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections
-RUN apt-get -y -q install git python-ecdsa python-yaml
-
-WORKDIR /usr/local/src
-RUN git clone https://git.nordu.net/catlfish.git
-
-# Config dir and database dir are mounted from host using `-v' to
-# 'docker run'.
-VOLUME /usr/local/etc/catlfish
-VOLUME /var/local/db/catlfish-merge
-
-# Copy merge.sh.
-RUN mkdir -p /usr/local/catlfish/bin
-ADD merge.sh /usr/local/catlfish/bin/
-
-# Create a catlfish user.
-RUN groupadd --gid 147 catlfish
-RUN useradd --uid 147 --gid 147 catlfish
-
-# We run from /var/run/catlfish.
-RUN mkdir -p /var/run/catlfish/supervisord_log
-RUN chown -R catlfish:catlfish /var/run/catlfish
-WORKDIR /var/run/catlfish
-
-# Run supervisord.
-ADD supervisord.conf /etc/supervisor/
-USER catlfish
-CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
diff --git a/packaging/docker/catlfish-merge/merge.sh b/packaging/docker/catlfish-merge/merge.sh
deleted file mode 100755
index b3658cd..0000000
--- a/packaging/docker/catlfish-merge/merge.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-# Default intervals
-# - 5m before first merge
-# - 20m between subsequent merges
-S1=300; [ -n "$1" ] && S1=$1
-S2=1200; [ -n "$2" ] && S2=$2
-
-DBDIR="$3"
-
-[ -d $DBDIR ] || mkdir $DBDIR
-[ -d $DBDIR/chains ] || mkdir $DBDIR/chains
-[ -e $DBDIR/logorder ] || touch $DBDIR/logorder
-
-date
-echo "merge: waiting $(expr $S1 / 60)m$(expr $S1 % 60)s before merging for the first time"
-sleep $S1
-
-while true; do
- echo "$0: merging"
- date
- python /usr/local/src/catlfish/tools/merge.py \
- --config /usr/local/etc/catlfish/system.cfg \
- --localconfig /usr/local/etc/catlfish/merge.cfg
- echo "merge: waiting $(expr $S2 / 60)m$(expr $S2 % 60)s before merging again"
- sleep $S2
-done
diff --git a/packaging/docker/catlfish-merge/supervisord.conf b/packaging/docker/catlfish-merge/supervisord.conf
deleted file mode 100644
index deaf308..0000000
--- a/packaging/docker/catlfish-merge/supervisord.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-[supervisord]
-nodaemon=true
-
-[program:catlfish-merge]
-childlogdir=/var/run/catlfish
-command=/usr/local/catlfish/bin/merge.sh 300 1200 /var/local/db/catlfish-merge