Skip to content

Commit 41a8db7

Browse files
authored
chore: fix docker compose file (#114)
1 parent b5badb7 commit 41a8db7

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

.github/workflows/test.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,9 @@ jobs:
241241
: $((++i))
242242
done
243243
env:
244-
HOST_ADDR: ${{ steps.host_ip_addr.outputs.host_ip_addr }}
245244
MAX_ATTEMPTS: "10"
246245
- name: Print containers
247246
run: docker compose -f $DOCKER_COMPOSE_FILE ps
248-
env:
249-
HOST_ADDR: ${{ steps.host_ip_addr.outputs.host_ip_addr }}
250247
- name: Build cluster
251248
run: bundle exec rake "build_cluster[$HOST_ADDR]"
252249
env:
@@ -256,8 +253,6 @@ jobs:
256253
run: bundle exec rake test
257254
- name: Stop containers
258255
run: docker compose -f $DOCKER_COMPOSE_FILE down
259-
env:
260-
HOST_ADDR: ${{ steps.host_ip_addr.outputs.host_ip_addr }}
261256
benchmark:
262257
name: Benchmark
263258
timeout-minutes: 15

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ Please run Redis cluster with Docker.
188188
## If you use Docker server and your OS is Linux:
189189
$ docker compose up
190190
191-
## Else:
192-
$ host_addr="$(ip a | grep eth0 | grep inet | awk '{print $2}' | cut -d'/' -f1)"
193-
$ HOST_ADDR=$host_addr docker compose -f compose.nat.yaml up
194-
$ bundle exec rake "build_cluster[$host_addr]"
191+
## else:
192+
$ HOST_ADDR=192.168.xxx.xxx docker compose -f compose.nat.yaml up
193+
$ DEBUG=1 bundle exec rake 'build_cluster[192.168.xxx.xxx]'
194+
195+
### When the above rake task is not working:
196+
$ docker compose -f compose.nat.yaml exec node1 bash -c "yes yes | redis-cli --cluster create --cluster-replicas 1 $(seq 6379 6384 | xargs -I {} echo 192.168.xxx.xxx:{} | xargs echo)"
195197
```
196198

197199
Please run basic test cases.

compose.nat.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
# First things first, make sure the default-address-pools settings in /etc/docker/daemon.json
3-
# HOST_ADDR=192.168.11.9 docker compose -f docker-compose.nat.yaml up
4-
# HOST_ADDR=192.168.11.7 docker compose -f docker-compose.nat.yaml up
5-
# bundle exec rake 'build_cluster[192.168.11.9,192.168.11.7]'
3+
# HOST_ADDR=192.168.11.9 docker compose -f compose.nat.yaml up
4+
# HOST_ADDR=192.168.11.7 docker compose -f compose.nat.yaml up
5+
# DEBUG=1 bundle exec rake 'build_cluster[192.168.11.9,192.168.11.7]'
66
services:
77
node1: &node
88
image: "redis:${REDIS_VERSION:-7}"

0 commit comments

Comments
 (0)