Skip to content

Commit

Permalink
Use docker compose v2 without alias
Browse files Browse the repository at this point in the history
  • Loading branch information
secwall committed Apr 4, 2024
1 parent 548208b commit 66aabf2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit 66aabf2

Please sign in to comment.