Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use docker compose v2 without alias #33

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ start_sentinel_env: base_image redis/src/redis-server cmd/rdsync/rdsync recreate
rm -rf ./tests/images/redis/redis-server && cp redis/src/redis-server ./tests/images/redis/redis-server
rm -rf ./tests/images/redis/redis-senticache && cp redis/src/redis-senticache ./tests/images/redis/redis-senticache
rm -rf ./tests/images/redis/redis-cli && cp redis/src/redis-cli ./tests/images/redis/redis-cli
docker-compose -p $(PROJECT) -f ./tests/images/jepsen-compose.yaml up -d --force-recreate --build
docker compose -p $(PROJECT) -f ./tests/images/jepsen-compose.yaml up -d --force-recreate --build
timeout 600 docker exec rdsync_zoo1_1 setup_zk.sh
timeout 600 docker exec rdsync_redis1_1 setup_sentinel.sh
timeout 600 docker exec rdsync_redis2_1 setup_sentinel.sh redis1
Expand All @@ -62,7 +62,7 @@ start_cluster_env: base_image redis/src/redis-server cmd/rdsync/rdsync recreate_
rm -rf ./tests/images/redis/redis-server && cp redis/src/redis-server ./tests/images/redis/redis-server
rm -rf ./tests/images/redis/redis-senticache && cp redis/src/redis-senticache ./tests/images/redis/redis-senticache
rm -rf ./tests/images/redis/redis-cli && cp redis/src/redis-cli ./tests/images/redis/redis-cli
docker-compose -p $(PROJECT) -f ./tests/images/jepsen-compose.yaml up -d --force-recreate --build
docker compose -p $(PROJECT) -f ./tests/images/jepsen-compose.yaml up -d --force-recreate --build
timeout 600 docker exec rdsync_zoo1_1 setup_zk.sh
timeout 600 docker exec rdsync_redis1_1 setup_cluster.sh
timeout 600 docker exec rdsync_redis2_1 setup_cluster.sh redis1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ It uses a patched redis version to make a cluster or sentinel-like setup less pr

## Try it out

* You will need a linux vm with gnu make, docker, docker-compose and go >1.22 installed.
* You will need a linux vm with gnu make, docker, docker compose and go >1.22 installed.
* Use `make start_sentinel_env` to start an environment with senticache
* Or `make start_cluster_env` to start an environment with single shard of clustered setup
* Run `make clean` to drop containers and network
6 changes: 3 additions & 3 deletions tests/testutil/docker_composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ func NewDockerComposer(project, config string) (*DockerComposer, error) {
}

func (dc *DockerComposer) runCompose(args []string, env []string) error {
args2 := []string{}
args2 := []string{"compose"}
args2 = append(args2, "-f", dc.config, "-p", dc.projectName)
args2 = append(args2, args...)
cmd := exec.Command("docker-compose", args2...)
cmd := exec.Command("docker", args2...)
cmd.Env = append(os.Environ(), env...)
out, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("failed to run 'docker-compose %s': %s\n%s", strings.Join(args2, " "), err, out)
return fmt.Errorf("failed to run 'docker compose %s': %s\n%s", strings.Join(args2, " "), err, out)
}
return nil
}
Expand Down
Loading