Skip to content

Commit

Permalink
Change the testing infra to test against docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ofekshenawa committed Dec 15, 2024
1 parent 8be51b7 commit be8234d
Show file tree
Hide file tree
Showing 57 changed files with 5,410 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- "7.4.1"
- "7.2.6"
- "6.2.16"
- "8.0-M01"
go_version:
- "1.19.x"
- "1.20.x"
Expand Down
140 changes: 140 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---

services:

redis:
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:8.0-M01}
container_name: redis-standalone
environment:
- TLS_ENABLED=yes
- REDIS_CLUSTER=no
- PORT=6379
- TLS_PORT=6666
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
ports:
- 6379:6379
- 9123:6379 # Sentinel port
- 6666:6666 # TLS port
volumes:
- "./dockers/standalone:/redis/work"
profiles:
- standalone
- sentinel
- replica
- all-stack
- all

replica:
image: ${REDIS_IMAGE:-redis:8.0-M01}
container_name: redis-replica
depends_on:
- redis
command: redis-server --replicaof redis 6379 --protected-mode no --save ""
ports:
- 6380:6379
profiles:
- replica
- all-stack
- all

cluster:
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:8.0-M01}
container_name: redis-cluster
environment:
- REDIS_CLUSTER=yes
- NODES=6
- REPLICAS=1
- TLS_ENABLED=yes
- PORT=16379
- TLS_PORT=27379
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ""}
ports:
- "16379-16381:16379-16381"
volumes:
- "./dockers/cluster:/redis/work"
profiles:
- cluster
- all-stack
- all

sentinel:
image: ${REDIS_IMAGE:-redis:8.0-M01}
container_name: redis-sentinel1
depends_on:
- redis
entrypoint: "redis-sentinel /redis.conf --port 9123"
ports:
- 9126:9126
volumes:
- "./dockers/sentinel.conf:/redis.conf"
profiles:
- sentinel
- all-stack
- all

sentinel2:
image: ${REDIS_IMAGE:-redis:8.0-M01}
container_name: redis-sentinel2
depends_on:
- redis
entrypoint: "redis-sentinel /redis.conf --port 9124"
ports:
- 9127:9127
volumes:
- "./dockers/sentinel.conf:/redis.conf"
profiles:
- sentinel
- all-stack
- all

sentinel3:
image: ${REDIS_IMAGE:-redis:8.0-M01}
container_name: redis-sentinel3
depends_on:
- redis
entrypoint: "redis-sentinel /redis.conf --port 26381"
ports:
- 9128:9128
volumes:
- "./dockers/sentinel.conf:/redis.conf"
profiles:
- sentinel
- all-stack
- all

sentinel-slave1:
image: ${REDIS_IMAGE:-redis:8.0-M01}
container_name: redis-sentinel1-slave
depends_on:
- redis
command: redis-server --slaveof redis 9123 --protected-mode no --save ""
ports:
- 9124:9123
profiles:
- sentinel
- all-stack
- all

sentinel-slave2:
image: ${REDIS_IMAGE:-redis:8.0-M01}
container_name: redis-sentinel2-slave
depends_on:
- redis
command: redis-server --slaveof redis 9123 --protected-mode no --save ""
ports:
- 9125:9123
profiles:
- sentinel
- all-stack
- all

redis-stack:
image: ${REDIS_STACK_IMAGE:-redis/redis-stack-server:edge}
container_name: redis-stack
ports:
- 6349:6379
environment:
- "REDIS_ARGS=${REDIS_STACK_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ''}"
profiles:
- standalone
- all-stack
1 change: 1 addition & 0 deletions dockers/cluster/cluster-nodes.info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-0 node-1 node-2 node-3 node-4 node-5
7 changes: 7 additions & 0 deletions dockers/cluster/node-0/nodes.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
16151e686272aa1dd2d15d4af407b6be45c9eca1 127.0.0.1:16384@26384,,tls-port=27384,shard-id=78410864729d91b91858e4f921bcd314095cfcc6 slave 3a1250b30cc37fca6db12b82fdefcbf615dec08f 1734269951169 1734269951128 1 connected
a0970bd542e1e5b7512bfc61deac5244e4478c58 127.0.0.1:16382@26382,,tls-port=27382,shard-id=8ee145d9d4fab776f3f51de69974dc0377adb434 slave 17003be25313b117da88e1dfefdb9ddb6bf68c90 0 1734269951203 2 connected
3a1250b30cc37fca6db12b82fdefcbf615dec08f 127.0.0.1:16379@26379,,tls-port=27379,shard-id=78410864729d91b91858e4f921bcd314095cfcc6 myself,master - 0 0 1 connected 0-5460
0287949c6e8aa2fb3f26d81820cc54b82bfd551f 127.0.0.1:16383@26383,,tls-port=27383,shard-id=4554bc07be3de979d00342a6de84369994bb059c slave 4759591cd1762d973a5691128c97200deb57762f 1734269951169 1734269951128 3 connected
4759591cd1762d973a5691128c97200deb57762f 127.0.0.1:16381@26381,,tls-port=27381,shard-id=4554bc07be3de979d00342a6de84369994bb059c master - 0 1734269951169 3 connected 10923-16383
17003be25313b117da88e1dfefdb9ddb6bf68c90 127.0.0.1:16380@26380,,tls-port=27380,shard-id=8ee145d9d4fab776f3f51de69974dc0377adb434 master - 0 1734269951169 2 connected 5461-10922
vars currentEpoch 6 lastVoteEpoch 0
12 changes: 12 additions & 0 deletions dockers/cluster/node-0/redis.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

port 16379

tls-port 27379

include /redis/work/tls/redis-tls.conf

cluster-enabled yes

cluster-config-file nodes.conf

protected-mode no
Loading

0 comments on commit be8234d

Please sign in to comment.