Docker test image add cluster respawn (#111)
* First draft of test dockerfile build * Test dockerfile, build works, container runs and cluster tests go through * Removed fifo for output * renaming dockerfile * Adding functionality for test 12 Added scripts and entrypoint mods to the testing docker image to allow for random shut down and startup (both SIGSTOP and SIGINT) of the ipfs-cluster-service. * test docker image ready for tests 12 and 13 * Added cluster daemon respawn to docker image
This commit is contained in:
parent
39276a1e7b
commit
1d81a1fedc
|
@ -28,6 +28,7 @@ RUN apk add --no-cache --virtual cluster-deps make musl-dev go git \
|
||||||
&& cp docker/random-stopper.sh /usr/local/bin/random-stopper.sh \
|
&& cp docker/random-stopper.sh /usr/local/bin/random-stopper.sh \
|
||||||
&& cp docker/random-killer.sh /usr/local/bin/random-killer.sh \
|
&& cp docker/random-killer.sh /usr/local/bin/random-killer.sh \
|
||||||
&& cp docker/wait-killer-stopper.sh /usr/local/bin/wait-killer-stopper.sh \
|
&& cp docker/wait-killer-stopper.sh /usr/local/bin/wait-killer-stopper.sh \
|
||||||
|
&& cp docker/cluster-restart.sh /usr/local/bin/cluster-restart.sh \
|
||||||
&& chmod +x /usr/local/bin/start-daemons.sh \
|
&& chmod +x /usr/local/bin/start-daemons.sh \
|
||||||
&& apk del --purge cluster-deps \
|
&& apk del --purge cluster-deps \
|
||||||
&& cd / && rm -rf /go/src /go/bin/gx /go/bin/gx-go
|
&& cd / && rm -rf /go/src /go/bin/gx /go/bin/gx-go
|
||||||
|
|
|
@ -45,12 +45,16 @@ else
|
||||||
sed -i 's/127\.0\.0\.1\/tcp\/9094/0.0.0.0\/tcp\/9094/' "$IPFS_CLUSTER_PATH/service.json"
|
sed -i 's/127\.0\.0\.1\/tcp\/9094/0.0.0.0\/tcp\/9094/' "$IPFS_CLUSTER_PATH/service.json"
|
||||||
sed -i 's/127\.0\.0\.1\/tcp\/9095/0.0.0.0\/tcp\/9095/' "$IPFS_CLUSTER_PATH/service.json"
|
sed -i 's/127\.0\.0\.1\/tcp\/9095/0.0.0.0\/tcp\/9095/' "$IPFS_CLUSTER_PATH/service.json"
|
||||||
fi
|
fi
|
||||||
ipfs-cluster-service $@ &
|
ipfs-cluster-service --debug $@ &
|
||||||
|
# Testing scripts that spawn background processes are spawned and stopped here
|
||||||
/usr/local/bin/random-stopper.sh &
|
/usr/local/bin/random-stopper.sh &
|
||||||
kill -STOP $!
|
kill -STOP $!
|
||||||
echo $! > /data/ipfs-cluster/random-stopper-pid
|
echo $! > /data/ipfs-cluster/random-stopper-pid
|
||||||
/usr/local/bin/random-killer.sh &
|
/usr/local/bin/random-killer.sh &
|
||||||
kill -STOP $!
|
kill -STOP $!
|
||||||
echo $! > /data/ipfs-cluster/random-killer-pid
|
echo $! > /data/ipfs-cluster/random-killer-pid
|
||||||
|
/usr/local/bin/cluster-restart.sh &
|
||||||
|
kill -STOP $!
|
||||||
|
echo $! > /data/ipfs-cluster/cluster-restart-pid
|
||||||
echo "Daemons launched"
|
echo "Daemons launched"
|
||||||
exec tail -f /dev/null
|
exec tail -f /dev/null
|
||||||
|
|
Loading…
Reference in New Issue
Block a user