Closed IvanRibakov closed 2 weeks ago
My understanding of the issue is that at the moment --no-deps
flag controls both:
In reality, it is useful to separate the 2 behaviours. For example, I'm using a docker compose with 3+ services to perform system tests. When debugging issues I want to be able to disable one of the services (using --no-deps
+ explicitly listing services I want to run) and substitute the disabled service with an already running container with debug tools set up. This was working fine until upgrading to 2.19.0.
Ideal solution - introduce new flags --no-deps-start
. If set, will ensure that configured dependencies will not be used to launch any services, only the services explicitly listed in the up
command arguments will be started. But the validation of conditions of any dependencies between services that are listed in the up
command arguments or are already running will still be performed.
@milas sorry to tag you directly, just wanted to ask what does the removal of the status/0-triage badge mean for the issue?
As you enabled --no-deps
depends_on support is just disabled, and obviously dependency between A and B is then ignored. Seems to me this reflects lack of separation between your services that would deserve more independent compose files being used to isolate subsets of your architecture.
Anyway, in the meantime you could rely on https://github.com/compose-spec/compose-spec/commit/78b22da5f5c8998fde4c7434f19f3f4d01cde648 to be supported in next release
and obviously dependency between A and B is then ignored.
Not so obvious since behaviour was different until compose version 2.18.0 or 2.19.0. And I did not find any mention of related changes in the changelog so the change in behaviour indeed caught me by surprise.
Seems to me this reflects lack of separation between your services that would deserve more independent compose files being used to isolate subsets of your architecture.
Service architecture is already pretty minimal:
depends_on
+ healthcheck
of the service A to ensure that system tests are executed only when service A is completely ready.The only further separation possible here is to manage 2 services completely independently but that negates all orchestration benefits obtained from using compose.
in the meantime you could rely on https://github.com/compose-spec/compose-spec/commit/78b22da5f5c8998fde4c7434f19f3f4d01cde648 to be supported in next release
required
: whenfalse
Compose only warns you when the dependency service isn't started or available.
I'm not sure that will help in my case since what I'm trying to do is essentially completely substitute service A with a standalone custom container (substitution is done at the network layer by starting standalone container on the same address as the service A would be running on). Or am I misunderstanding the behaviour of the new required
feature?
What about the point raised earlier about a more granular dependency control?
- starting of dependency services
- validating that dependency services satisfy configured conditions
Does that have any future at all?
Are there any plans to restore the old behaviour of the --no-deps
flag that allowed starting a subset of service and still respect their healthcheck-based dependencies?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as not stale anymore due to the recent activity.
This issue has been automatically marked as not stale anymore due to the recent activity.
Closing as "not planned". no-deps
disables dependency management, as name suggests. This behavior looks sane to us and predictable for users.
If you have a real-world example which require a distinct behavior, please create a follow-up issue
Description
Since upgrading to Docker Compose 2.19.0 from 2.17.0
--no-deps
flag behaviour seems to have changed.Given following 2 services:
Current behavior
Scenario 1: only service B is started
Then service B is started without launching service A:
Scenario 2: both service A and B are started explicitly
Then service B is started without waiting for service A:
Expected behavior
Scenario 1: only service B is started
Expecting current behaviour (no changes)
Scenario 2: both service A and B are started explicitly
Expecting service B to wait for service A to become healthy as defined in the
depends_on
configuration object. This was the behaviour in earlier versions of Docker Compose.Steps To Reproduce
docker compose up --no-deps --abort-on-container-exit service-b
docker compose up --no-deps --abort-on-container-exit service-a service-b
Compose Version
Anything else?
No response