WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
217 stars 176 forks source link

Update compose file to v3 and get rid of version obsolescense warning #4046

Open sarayourfriend opened 3 months ago

sarayourfriend commented 3 months ago

Current Situation

All Openverse docker compose commands emit the following warning:

WARN[0000] /.../openverse/docker-compose.yml: `version` is obsolete 

Suggested Improvement

Now that we've moved to Docker compose v2, we can update to the latest compose file format.

Refer to https://docs.docker.com/compose/compose-file/compose-versioning/ and https://docs.docker.com/compose/compose-file/ for information on changes between version 2 and the most recent compose file specification.

Benefit

Remove the warning and stop using EOL compose file format.

Additional context

Due to the complexity and far-reaching implications of this change (local development as well as CI), this issue is staff only.

Priority is medium due to the tediousness of the version is obsolete warning on every compose command in the monorepo.

dhruvkb commented 3 months ago

Not that it justifies not upgrading (we definitely should upgrade to v3), I should note that this warning does not appear as of Docker version 25.0.5, build 5dc9bcc and Docker Compose version v2.24.5.

sarayourfriend commented 3 months ago

I'm on Docker Compose version 2.26.1 and Docker version 26.0.0, build 2ae903e86c and see it every time I run our compose stack.

zackkrida commented 2 months ago

Interesting, I don't see it on Docker version 26.1.0, build 9714adc and compose version 2.24.6.

sarayourfriend commented 2 months ago

This is almost certainly dependent only on the compose plugin version, not Docker, and you're both running older versions than me or @krysal who both see this warning.

4200 already fixes it so we don't need to worry about whether it is or isn't present for some and not others. It is obsolete and unnecessary, so we can remove it.