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

[Docker Compose] V1 End of Life Policy #257

Closed
stephanierifai opened this issue Sep 9, 2021 · 62 comments
Closed

[Docker Compose] V1 End of Life Policy #257

stephanierifai opened this issue Sep 9, 2021 · 62 comments
Assignees
Labels
cli Improvements to the Docker CLI community_new New idea raised by a community contributor compose Improvements to Docker Compose

Comments

@stephanierifai
Copy link
Contributor

stephanierifai commented Sep 9, 2021

Tell us about your request
End maintenance of Docker Compose v1

Which service(s) is this request for?
Dev-tools

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
The goal of compose v2 was to align on Go for most of our development. In order to focus our time towards new features and enhancements, we need to make v2 the default and phase out v1.

Are you currently working around the issue?
N/A

Additional context
On April 26, 2022, we announced the GA of Docker Compose V2. We want you to have ample time to transition to Compose V2. We won’t sunset Docker Compose V1 immediately, and developers can still revert to V1. Given the numerous successful transitions to Compose V2 so far, we’ve created the following proposed timeline for Docker Compose V1's end of life (EOL):

October 2022 - 6 Months Post GA

  • Support of critical bug fixes and severe security issues will end on Compose v1
  • Users can alias docker-compose to docker compose
  • Users can opt-out of V2 via the Docker Desktop UI or through the docker-compose disable-v2 command

April 2023 - 1 Year Post GA

  • Users can alias docker-compose to docker compose
  • Users can no longer opt-out of V2 via the Docker Desktop UI or through the docker-compose disable-v2 command in new versions

Note: We have no plans of removing any aliasing of docker-compose to docker compose, we want to make it as easy as possible to switch and not break any of your code.

We’ll monitor feedback here alongside V2’s usage and make adjustments accordingly.

@stephanierifai stephanierifai added community_new New idea raised by a community contributor cli Improvements to the Docker CLI compose Improvements to Docker Compose labels Sep 9, 2021
@stephanierifai stephanierifai changed the title Compose V1 End of Life Policy [Docker Compose] V1 End of Life Policy Sep 9, 2021
@ndeloof
Copy link

ndeloof commented Sep 10, 2021

proposed notice on project's github: docker/compose#8589

@rfay
Copy link

rfay commented Sep 10, 2021

My first response is that this is way too fast, especially since docker-compose v2 is not even yet available for Linux, nor even thought through how it will be available. I think stopping all but security fixes is one thing, but security and basic maintenance probably needs to be a year after v2 becomes available on Linux. And that, of course, depends on how it's made available.

@ndeloof
Copy link

ndeloof commented Sep 11, 2021

not even yet available for Linux

Not yet "as a system package" (work in progress), but definitively available. This is just a question of running a curl command and many already did.

@rfay
Copy link

rfay commented Sep 11, 2021

Just saying... as a highly motivated user (I need it for ddev tests on Linux) I've been following all the issues on docker-compose v2. And even I haven't yet discovered how you do it, with or without packaging. I was delighted to see https://github.com/docker/compose-switch come out... but it still has no instructions in the readme. When there's a standard, documented way to use and maintain/upgrade docker-compose v2 on Linux (not docker compose) then it has arrived and the start time for docker-compose on Linux will have arrived.

I do think there's some crosstalk about the availability of the compose plugin for docker, which is mostly do-able on some platforms. But it's not a drop-in replacement or switch for docker-compose. Way too many tools in the linux ecosystem are dependent on docker-compose to hope that docker compose will replace them, even when it becomes easier to obtain.

@ndeloof
Copy link

ndeloof commented Sep 11, 2021

There's no "docker-compose v2 on Linux". Compose V2 is docker compose.
We indeed provide a command line compatibility tool, but that's not expected to be the default usage long terms.

About Linux availability, we indeed don't yet offer those components as system packages. Doesn't mean Linux users can't install Compose v2 and compose-switch. We miss documentation for sure, but this is just a question of days to get this available.

@rfay
Copy link

rfay commented Sep 11, 2021

I think there may just be a whole bunch of bundled things going on here, and it's going to be important to sort them all out.

  1. For some reason, there will not be a docker-compose v2. I don't think users will understand that choice, but if that's what's going on it needs to be stated more clearly.
  2. In that case, this isn't about "v1 end of life policy", it's about "docker-compose end of life" So the world needs to know "docker-compose is to be no more"..

There are loads of implications here:

  1. The compose plugin needs to be bundled with the docker client everywhere on Linux. For starters, that means the Docker repo packages.
  2. The compose plugin needs to make it into the OS-level distributions as soon as possible. It's already missed Debian 11, but could make it into Ubunto 22.04.

I should note that "running curl commands" is not a generally accepted practice for managed Linux machines, so it will be important to get these tools packaged fully as soon as possible.

I think I won't be the only one confused by the decision to do away with docker-compose. It's an old friend with a thousand uses and continuing it as a wrapper on compose v2 would be so terribly easy.

@stephanierifai
Copy link
Contributor Author

stephanierifai commented Sep 15, 2021

Based on feedback we have decided to focus our efforts on making the experience better for Linux users, this is has been edited above.

For history, the previous proposal was:

🔏 As of September 28th, 2021 new features and bug fixes will only be considered in the V2 codebase. Users will be defaulted into Docker Compose V2 and it will be considered GA. Users can still opt out through the UI and the cli. Docker Compose V1 will only be maintained regarding security issues.
🔐 On December 28th, 2021 Docker Compose V1 will be marked as deprecated.
🔒 By March 28th, 2022 no new contribution will be accepted to the V1 branch, even for security fixes.

@BigMorty
Copy link

For how long will users be able to switch back to using docker-compose (v1)?

@jamshid
Copy link

jamshid commented Sep 17, 2021

Very glad a docker-compose alias will be provided on Linux, we can't rewrite all scripts to use docker compose immediately especially when that requires a not-yet-released docker-ce package on Linux.

Would be nice if docker-compose were automatically installed by yum/apt-get install docker-ce-cli but probably not a big deal, afaik docker-compose was always a separate curl download or pip install.

A little nervous about the push to V2 when there's still some open issues like docker/compose#8505 preventing me from using it fully but hopefully all resolved soon. Also, docker compose up seems to be restarting services unnecessarily (more than V1 docker-compose) but I need to repro and file an issue.

@jpic
Copy link

jpic commented Nov 11, 2021

Thank you very much for the new release!
It would have been great to keep the convert command or to document that it's been dropped in the transitioning documentation. docker/compose#8914
Too bad for the "feature" I relied on! But the new spinner is nice, I thought compose was using an external library for that but it turns out it's actually implemented in compose codebase

@stephanierifai
Copy link
Contributor Author

Hi @jpic ! Thanks for your feedback :)

Do you mind sharing what version you are on 🤔 It should be available in V2 https://docs.docker.com/engine/reference/commandline/compose_convert/, but happy to look into it further.

cc @ulyssessouza

@jpic
Copy link

jpic commented Nov 19, 2021

Hi @stephanierifai,

The new convert command as implemented in v2 serves a completely different purpose, which is now to "output information duplicated from docker inspect for debugging" (according to this comment), in v1 it used to "output a usable stack configuration", which you could use to spawn new stacks.

The documentation states:

it merges the Compose files set by -f flags, resolves variables in Compose file, and expands short-notation into fully defined Compose model

While it does that, it previously did it so that you could reuse the output to spawn a new stack, and it's not possible anymore with the new output, as documented in issue docker/compose#8914. It also used to generate a more readable format, which it doesn't anymore because it now "expands short-notation into fully defined Compose model", I'm not sure if that's a feature anymore or rather a side effect caused by the current implementation in v2.

The other problem concerning the migration, is that it's not clear whether we should reimplement this feature from v1 on our own, or if compose is going to fix it in further versions ... A clear statement would help a lot!

@ndeloof
Copy link

ndeloof commented Nov 19, 2021

That's both a side effect (go being a typed language, compose config output actually reflect the structs, so the "expand short notation") and a feature: compose config helps diagnose configuration issues as it dump the actual model being applied.
Due to the first reason, there's no simple way to implement config command in a comparable way it was done by compose-V1 (i.e. just merge yaml files)

Also, compose config output, despite being verbose, is fully usable stack configuration

@jpic
Copy link

jpic commented Nov 19, 2021

Also, compose config output, despite being verbose, is fully usable stack configuration

I'm sorry, does it still output hardcoded full network names with the project name prefix ?

@ndeloof
Copy link

ndeloof commented Nov 19, 2021

It indeed resolves resource names as they will be created, so you can't use to run a distinct stack. The output is a fully usable configuration, but not a configuration you can tweak for another project

@jpic
Copy link

jpic commented Nov 19, 2021

If my compose defines a network "foo", then running convert should output it as "foo", not as "directoryname_foo", that's actually modifying the data I'm feeding into convert, it's not the same feature. It should not be named convert. Call that "inspect" if you want, and then decide if you're going to port the convert feature from v1 to v2 or drop it.

@ndeloof
Copy link

ndeloof commented Nov 19, 2021

the command name as documented by the command line is config. convert name comes from earlier work on ECS integration, and has been kept for compatibility.

Whatever the command name is, replicating compose-v1 config command is just not possible with the compose-go library design.

@jpic
Copy link

jpic commented Nov 19, 2021

To allow smooth migration from docker-compose, this subcommand declares alias docker compose config

It is a mistake to use the same name for a commands that is not compatible, even more "for compatibility". That causes more migration problems than if the alias just wasn't there at all! It's confusing...

Implementing config in go is possible with a library (mergo) that one of your libraries is using, you could also use a template! Or even do a pass on the data prior to outputting so that the network and volume names you feed into it don't change... Anyway, it'll have to be more than a one liner that is basically the current implementation, but we already have 3 solutions right there.

If you're committing to dropping the feature it's fine, just document it, that's what I'm saying, and we'll maintain it in the python version, because in the mean time it's not clear how we should deal with this.

@ndeloof
Copy link

ndeloof commented Nov 19, 2021

mergo used in compose-go merges go structs after the individual yaml files have been parsed.
compose V1 used python dictionaries and merged them by key, before applying validation.
So we never will fully reproduce compose V1 config command.

About resources prefix, if this is the only blocker, I guess we could look into being able to not append those in compose-go, so that docker compose config --to-be-defined-flag would render the "reusable output" you expect

@thediveo
Copy link

Can't you first merge at the YAML generic model level ("dict" or map level), instead of the unmarshalled Go struct level? Wouldn't that keep merging compatibility with v1 behavior?

@jpic
Copy link

jpic commented Nov 26, 2021 via email

@ndeloof
Copy link

ndeloof commented Nov 26, 2021

@jpic resource prefix incompatibility has been fixed
expanding volumes is important for diagnostic, and doesn't prevent the output to be reused by other compose-related tooling

Could we please stop focussing on tiny implementation details for a specific sub-command that is just a topic for an issue, while we are discussing here the global strategy for Compose V1 End of Life?

@jpic
Copy link

jpic commented Nov 26, 2021

Nice! Thank you for fixing the prefix! Volume expansion is absolutely pointless in the example I've given because the content of the bloat lines is exactly the same for every volume, plus there's a new default tmp volume that your config is adding, it will stay as-is even when the upstream default changes, but I understand it's not easy to spot in the bloat.

I'm just backing my suggestion with concrete examples but I'm actually talking about the strategy for v1 EOL: I think documentation should state that the config command has been dropped and that a new similar command may be used instead so at least users don't naively believe that a port of the command is in progress. If it's not going to be the same it should not have the same name because it's confusing.

It's a common practice to document the BC breaks when releasing new versions, I think compose should also be doing that, like any other software... Because it helps transitioning.

@ndeloof
Copy link

ndeloof commented Nov 26, 2021

none of the commands are strictly identical to the v1 one. Event compose version has a distinct output and some might get their script broken by this. This is what a "major version bump" implies, should we add warnings everywhere?

@markus-ksg
Copy link

In that case there is not even a way to have a .env file that
a) contains a $ in a value, and
b) is compatible with both V1 and V2

This is not 100% correct. I commented a workaround here docker/compose#8763 (comment) this will allow you to use $ but it won't be evaluated.

Nope, the behavior with single quotes around the value in docker compose V1 is platform-dependent:

  • on Linux, single or double quotes are passed verbatim into the value of the environment variable (i.e. including the quotes)
  • on Windows, single or double quotes are removed from the value of the environment variable (i.e. no quotes in the variable)

If anything changes with respect to quotes or other escape character processing when reading .env files in compose V2, then this needs to be announced loudly (and correctly) in the migration docs.

https://github.com/compose-spec/compose-spec/blob/master/spec.md sounds like the behavior of compose V2 matches V1 on Linux. That would be great!

@fuzzybair
Copy link

I just noticed the April 2023 date on

Users can no longer opt-out of V2 via the Docker Desktop UI or through the docker-compose disable-v2 command in new versions

I think this needs pushed out a while because compose V2 as released does not work for building large compose projects @ndeloof just put in a fix docker/compose#9091 that if I am reading correctly is tagged for 2.15.0 and according to the documentation https://docs.docker.com/compose/install/ for windows we need to wait for Docker Desktop to incorporate the change. Given what seems to be a monthly release cycle, we may be able to get it by late Jan. and time to get it into our build environments it is likely mid Feb. leaving only a month and a half to actually verify the fix works before there is no way to disable V2 on windows. (Linux simlink's don't generally work well in windows). Also the default buildkit builder in Docker desktop is not configurable moby/buildkit#2906 making the issues with parallel builds worse. Our system setup is to install docker and disable compose v2 and given the number of issues you find on the web/github related to parallel builds where the solution provided is not possible in windows (due to the above issues).

I propose extending the date out 3-6 months and possibly adding a notice inside the Desktop GUI that V1 will be removed in an upcoming release. To encourage those of us with large systems to give compose V2 another try, as we have been burned for a while. like the comment here docker/compose#9091 (comment) from @WolfspiritM

...
I made a buildx issue 2 years ago: docker/buildx#359
There is no flag to specify how many parallel jobs are run...there is no flag to specify memory and cpu...
Are we the only ones using docker-compose with more then just a simple TODO App?

@draco2003
Copy link

Due to MAC + VPN + DNS issues in Go prior to 1.20 our user base is required to use docker-compose v1 in order to use the Python dns resolution paths instead of the Go based ones. Removing the ability to opt out of v2 should be gated by getting a release of Docker Desktop that is built with Go 1.20 or later.

Go 1.20 was released Feb 1

@ndeloof
Copy link

ndeloof commented Feb 11, 2023

@draco2003 latest Docker Compose v2.16.0 release is built with Go 1.20, see changelog

@draco2003
Copy link

I can confirm v2.16.0 resolves the MAC + DNS + VPN issue! 🍾
Looking forward to seeing it come with Docker Desktop and resolve a ton of our support issues!

@itepifanio
Copy link

@stephanierifai I believe that we can close this issue

@ndeloof
Copy link

ndeloof commented Apr 24, 2024

@hyu please close this issue as completed

@hyu
Copy link

hyu commented Apr 24, 2024

This issue is now closed, as Docker Compose v1 has been deprecated as of July 2023. More details in our docs page, "Migrate to Compose V2".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Improvements to the Docker CLI community_new New idea raised by a community contributor compose Improvements to Docker Compose
Projects
Status: Shipped! Enjoy!
Development

No branches or pull requests