apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

test: Discuss how to face the docker compose update

Open Chever-John opened this issue 2 years ago • 5 comments

Issue description

When I was preparing to build the development environment on my new host, I was surprised to find a simple ci build problem after running the make-e2e-test-local command.

This is easy to fix, the official command seems to have been updated from docker-compose to docker compose.

I can install an older version of Docker Compose, or just modify the makefile to fix it. But for future compatibility. I suggest to think about rewriting part of the logic on this side?

So do we need to have a discussion about this situation?

Environment

  • your apisix-ingress-controller version (output of apisix-ingress-controller version --long):
  • your Kubernetes cluster version (output of kubectl version):
  • if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a):

Minimal test code / Steps to reproduce

  1. run the command make e2e-test-local;

Actual result

./test/e2e/testdata/wolf-rbac/cmd.sh: line 33: docker-compose: command not found
./test/e2e/testdata/wolf-rbac/cmd.sh: line 36: docker-compose: command not found
curl: (7) Failed connect to 127.0.0.1:12180; Connection refused
curl: (7) Failed connect to 127.0.0.1:12180; Connection refused
curl: (7) Failed connect to 127.0.0.1:12180; Connection refused
make: *** [e2e-wolf-rbac] Error 7

Error log

none

Expected result

Success!

Chever-John avatar Aug 01 '22 07:08 Chever-John

You have not installed docker-compose. Or you can try to fix it

AlinsRan avatar Aug 01 '22 09:08 AlinsRan

First, I have installed Docker Compose!

@AlinsRan Maybe I didn't express myself clearly. What I meant was that the latest version of docker compose executes the command docker compose instead of docker-compose. So do we have to improve the makefile to accommodate this change. Or does anyone have a better suggestion?

Chever-John avatar Aug 01 '22 10:08 Chever-John

First, I have installed Docker Compose!

@AlinsRan Maybe I didn't express myself clearly. What I meant was that the latest version of docker compose executes the command docker compose instead of docker-compose. So do we have to improve the makefile to accommodate this change. Or does anyone have a better suggestion?

Hello, @Chever-John.

I went through the Docker documentation and noticed the following passage

Run docker compose up and the Docker compose command starts and runs your entire app. You can alternatively run docker-compose up using Compose standalone(docker-compose binary).

I think the problem here is that the new version of docker integrates the compose command and you are trying to use the new way, but docker also supports the old version of docker-compose. considering the compatibility with the old version, I think it is better to keep the current approach.

Feel free to point out if I'm wrong in my description.

zaunist avatar Aug 02 '22 08:08 zaunist

Here you can simply add a conditional judgment. Determine if there is a docker-compose command on the machine. Or check if any compose plugin has been installed.

I think what is needed here is compatibility, not replacement.

tao12345666333 avatar Aug 02 '22 09:08 tao12345666333

@zaunist Thanks for your document which is very important.

@tao12345666333 Agree!

Chever-John avatar Aug 02 '22 14:08 Chever-John

We could use the following code to check if the docker compose exist.

if command -v "docker compose" > /dev/null 2>&1; then
    alias docker-compose='docker compose'
fi

Copyright by openai :-)

Update: It does not work.

Chever-John avatar Apr 21 '23 14:04 Chever-John

@AlinsRan Issue to be closed since PRs merged?

leowmjw avatar Jul 27 '23 09:07 leowmjw

Yeah. My negligence. PR #1808 has been merged, I will close this issues.

AlinsRan avatar Jul 27 '23 10:07 AlinsRan