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

Make v2 our primary target version of Docker Compose #1179

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

chadwhitacre
Copy link
Member

The big thing here is a fix for #1132. I did a grep for docker-compose and cleaned up the rest of the instances. The one question I had is in CI tests ... as I read it we still need docker-compose there so we can test v1, which we do still want to support for now.

@thenets
Copy link

thenets commented Nov 30, 2021

Unfortunately, I still have a problem with my version 😕

[luiz@fedora self-hosted]$ ./install.sh 
▶ Parsing command line ...

▶ Setting up error handling ...

▶ Checking minimum requirements ...
FAIL: Expected minimum docker-compose version to be 1.28.0 but found Docker Compose version v2.0.1```

@chadwhitacre
Copy link
Member Author

Hrm ... can you run with debugging turned on?

DEBUG=1 ./install.sh

@chadwhitacre
Copy link
Member Author

Might be a sed portability issue? I tested on macOS.

@thenets
Copy link

thenets commented Nov 30, 2021

Yep. This is the result.

▶ Checking minimum requirements ...
+++ dirname ./install.sh
++ source ./_min-requirements.sh
+++ MIN_DOCKER_VERSION=19.03.6
+++ MIN_COMPOSE_VERSION=1.28.0
+++ MIN_RAM_HARD=3800
+++ MIN_RAM_SOFT=7800
+++ MIN_CPU_HARD=2
+++ MIN_CPU_SOFT=4
+++ docker version --format '{{.Server.Version}}'
++ DOCKER_VERSION=20.10.10
+++ ver 20.10.10
+++ echo 20.10.10
+++ awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'
+++ ver 19.03.6
+++ echo 19.03.6
+++ awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'
++ [[ 20010010 -lt 19003006 ]]
++ docker compose version
+++ docker-compose version
+++ sed 's/^.* version:\{0,1\} v\{0,1\}\(.\{1,\}\),.*$/\1/'
+++ head -n1
++ COMPOSE_VERSION='Docker Compose version v2.0.1'
+++ ver Docker Compose version v2.0.1
+++ awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'
+++ echo Docker Compose version v2.0.1
+++ ver 1.28.0
+++ awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'
+++ echo 1.28.0
++ [[ 0000001 -lt 1028000 ]]
++ echo 'FAIL: Expected minimum docker-compose version to be 1.28.0 but found Docker Compose version v2.0.1'
FAIL: Expected minimum docker-compose version to be 1.28.0 but found Docker Compose version v2.0.1
++ exit 1
+ cleanup EXIT 1
+ [[ 0 -eq 1 ]]
+ DID_CLEAN_UP=1
+ [[ EXIT != \E\X\I\T ]]
+ [[ -z '' ]]
+ docker-compose --ansi never --env-file /home/luiz/projects/docker-sentry/self-hosted/.env stop -t 60

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AWESOME!

@chadwhitacre
Copy link
Member Author

So you want to use something like sed -r -n 's/^.*([0-9]+\.[0-9]+\.[0-9]+).*$/\1/p' to extract the version of some program in your Makefile and put it into a variable?

lol too close to home! 😅

sed -E ftw ...

$ echo 'Docker Compose version v2.0.0' | sed -E 's/^.* version:? v?([0-9.]+).*$/\1/'
2.0.0
$ ubuntu
root@4b55e1832404:/portal# echo 'Docker Compose version v2.0.0' | sed -E 's/^.* version:? v?([0-9.]+).*$/\1/'
2.0.0
root@4b55e1832404:/portal# 

@chadwhitacre
Copy link
Member Author

$ ./parse-version
1.5.0
     1.5.0

1.6.0
1.6.0

2.0.0
2.0.0

$ cat parse-version
#!/usr/bin/env sh

for dc in docker-compose-$1*; do
  ./$dc version | head -n1 |  sed -E 's/^.* version:? v?([0-9.]+),?.*$/\1/'
  ./$dc version | head -n1 | gsed -E 's/^.* version:? v?([0-9.]+),?.*$/\1/'
  echo
done
/Users/chadwhitacre/Desktop/dc
total 20
-rwxr-xr-x  1 chadwhitacre  staff  1087 Nov 30 11:47 docker-compose-1.5.0*
-rwxr-xr-x  1 chadwhitacre  staff  1325 Nov 30 11:47 docker-compose-1.6.0*
-rwxr-xr-x  1 chadwhitacre  staff    37 Nov 30 12:07 docker-compose-2*
-rwxr-xr-x  1 chadwhitacre  staff   146 Nov 30 11:47 download-docker-composes*
-rwxr-xr-x  1 chadwhitacre  staff   216 Nov 30 14:47 parse-version*
$

@chadwhitacre
Copy link
Member Author

How about with a31a964, @thenets?

@chadwhitacre
Copy link
Member Author

jk ba7f951 😬

@chadwhitacre
Copy link
Member Author

Hmm ... your review didn't clear the bit, @BYK. I guess I would need to give yinz write access.

@chadwhitacre chadwhitacre merged commit 4593233 into master Nov 30, 2021
@chadwhitacre chadwhitacre deleted the cwlw/moar-docker-compose-v2 branch November 30, 2021 21:55
@chadwhitacre
Copy link
Member Author

@thenets I went ahead with the merge on @BYK's review and my testing with GNU Sed. If this does not work for you please let us know! 🙇‍♂️

@chadwhitacre
Copy link
Member Author

With this PR I am closing the Support for Docker Compose v2 milestone. Anything coming in we will treat as a regression.

@chadwhitacre chadwhitacre changed the title Do more migrating to Docker Compose v2 Make v2 our primary target version of Docker Compose Nov 30, 2021
@chadwhitacre chadwhitacre mentioned this pull request Dec 15, 2021
3 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants