Unverified Commit a5017f6a authored by Eric J. Smith's avatar Eric J. Smith Committed by GitHub

Adding support for using docker to run redis test instances (#1389)

Adds support for running all Redis instances and configurations used in the tests inside of docker containers that work on all platforms. Just run `docker-compose up` inside of the `tests/RedisConfigs` folder.
parent afc4ec1f
#!/bin/sh
if [ "$#" -ne 0 ]; then
exec "$@"
else
mkdir -p /var/log/supervisor
supervisord -c /etc/supervisord.conf
sleep 3
tail -f /var/log/supervisor/*.log
fi
\ No newline at end of file
[supervisord]
nodaemon=false
[program:master-6379]
command=/usr/local/bin/redis-server /data/Basic/master-6379.conf
directory=/data/Basic
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:slave-6380]
command=/usr/local/bin/redis-server /data/Basic/slave-6380.conf
directory=/data/Basic
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:secure-6381]
command=/usr/local/bin/redis-server /data/Basic/secure-6381.conf
directory=/data/Basic
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:master-6382]
command=/usr/local/bin/redis-server /data/Failover/master-6382.conf
directory=/data/Failover
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:slave-6383]
command=/usr/local/bin/redis-server /data/Failover/slave-6383.conf
directory=/data/Failover
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:cluster-7000]
command=/usr/local/bin/redis-server /data/Cluster/cluster-7000.conf
directory=/data/Cluster
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:cluster-7001]
command=/usr/local/bin/redis-server /data/Cluster/cluster-7001.conf
directory=/data/Cluster
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:cluster-7002]
command=/usr/local/bin/redis-server /data/Cluster/cluster-7002.conf
directory=/data/Cluster
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:cluster-7003]
command=/usr/local/bin/redis-server /data/Cluster/cluster-7003.conf
directory=/data/Cluster
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:cluster-7004]
command=/usr/local/bin/redis-server /data/Cluster/cluster-7004.conf
directory=/data/Cluster
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:cluster-7005]
command=/usr/local/bin/redis-server /data/Cluster/cluster-7005.conf
directory=/data/Cluster
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:redis-7010]
command=/usr/local/bin/redis-server /data/Sentinel/redis-7010.conf
directory=/data/Sentinel
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:redis-7011]
command=/usr/local/bin/redis-server /data/Sentinel/redis-7011.conf
directory=/data/Sentinel
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:sentinel-26379]
command=/usr/local/bin/redis-server /data/Sentinel/sentinel-26379.conf --sentinel
directory=/data/Sentinel
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:sentinel-26380]
command=/usr/local/bin/redis-server /data/Sentinel/sentinel-26380.conf --sentinel
directory=/data/Sentinel
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
[program:sentinel-26381]
command=/usr/local/bin/redis-server /data/Sentinel/sentinel-26381.conf --sentinel
directory=/data/Sentinel
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
\ No newline at end of file
FROM redis:5
COPY Basic /data/Basic/
COPY Failover /data/Failover/
COPY Cluster /data/Cluster/
COPY Sentinel /data/Sentinel/
RUN chown -R redis:redis /data
COPY Docker/docker-entrypoint.sh /usr/local/bin/
RUN apt-get -y update && apt-get install -y git gcc make supervisor && apt-get clean
ADD Docker/supervisord.conf /etc/
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 6379 6380 6381 6382 6383 7000 7001 7002 7003 7004 7005 7010 7011 26379 26380 26381
port 26381
sentinel monitor mymaster 127.0.0.1 7011 2
sentinel down-after-milliseconds mymaster 1000
sentinel failover-timeout mymaster 2000
sentinel config-epoch mymaster 21
dir "../Temp/sentinel-26381"
version: '2.4'
services:
redis:
build:
context: .
image: stackexchange/redis-tests:latest
platform: linux
ports:
- 6379-6383:6379-6383
- 7000-7006:7000-7006
- 7010-7011:7010-7011
- 26379-26381:26379-26381
......@@ -38,9 +38,10 @@ pushd Sentinel > /dev/null
echo "${INDENT}Targets: 7010-7011"
redis-server redis-7010.conf &>/dev/null &
redis-server redis-7011.conf &>/dev/null &
echo "${INDENT}Monitors: 26379-26380"
echo "${INDENT}Monitors: 26379-26381"
redis-server sentinel-26379.conf --sentinel &>/dev/null &
redis-server sentinel-26380.conf --sentinel &>/dev/null &
redis-server sentinel-26381.conf --sentinel &>/dev/null &
popd > /dev/null
echo Servers started.
\ No newline at end of file
......@@ -4,7 +4,8 @@ pushd %~dp0\Sentinel
echo Targets: 7010-7011
@start "Redis (Sentinel-Target): 7010" /min ..\3.0.503\redis-server.exe redis-7010.conf
@start "Redis (Sentinel-Target): 7011" /min ..\3.0.503\redis-server.exe redis-7011.conf
echo Monitors: 26379-26380
echo Monitors: 26379-26381
@start "Redis (Sentinel): 26379" /min ..\3.0.503\redis-server.exe sentinel-26379.conf --sentinel
@start "Redis (Sentinel): 26380" /min ..\3.0.503\redis-server.exe sentinel-26380.conf --sentinel
@start "Redis (Sentinel): 26381" /min ..\3.0.503\redis-server.exe sentinel-26381.conf --sentinel
popd
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment