run_locally.sh: refactor to run any number of nodes, defaults to two#1420
run_locally.sh: refactor to run any number of nodes, defaults to two#1420mickmis wants to merge 1 commit intointeruss:mainfrom
Conversation
3422e55 to
b64b54c
Compare
BenjaminPelletier
left a comment
There was a problem hiding this comment.
It looks like there's a problem for later versions of docker:
pelletierb@pelletierb:~/IdeaProjects/OpenSource/monitoring$ ./build/dev/run_locally.sh up -d
service "rid_bootstrapper" can't be used with `extends` as it declare `depends_on`
pelletierb@pelletierb:~/IdeaProjects/OpenSource/monitoring$ make start-locally
build/dev/run_locally.sh up -d
service "rid_bootstrapper" can't be used with `extends` as it declare `depends_on`
make: *** [Makefile:60: start-locally] Error 15
pelletierb@pelletierb:~/IdeaProjects/OpenSource/monitoring$ docker --version
Docker version 29.4.0, build 9d7ad9f
Asking Gemini, it says:
It looks like you’ve run into a regression or a strict enforcement change in the Docker Compose spec that was reintroduced in very recent versions (late 2025/early 2026).
The error service "rid_bootstrapper" can't be used with extends as it declare depends_on happens because, according to the formal Compose specification, a service is not allowed to be a "base" for extension if it defines its own dependencies.
Why this is happening now
Historically, there has been a "tug-of-war" in Docker Compose development regarding this rule:
Docker Compose v1: Strictly forbade extending a service that had depends_on.
Early Docker Compose v2: Relaxed this rule (often accidentally), allowing users to extend services with dependencies, though it often led to "ghost" dependencies or broken startup orders.
Docker 29.x (Your version): This version has moved to a more rigid validation of the Compose Spec. It throws a hard error to prevent the ambiguity that occurs when you extend a service but don't necessarily have its dependencies (like a database or network) defined in your local file.
The reason your CI (v28.0.4) isn't failing is simply that it hasn't received the update that turned this "best practice" warning into a "hard block" error.
The standard way to handle this is to create a "template" service that has everything except the depends_on field, then have both your bootstrapper and your other services extend that.
Before (Invalid in v29):
services:
rid_bootstrapper:
image: my-image
depends_on:
- db # <--- This "poisons" the service for extension
environment:
- FOO=bar
another_service:
extends: rid_bootstrapper # <--- Error!After (Recommended):
services:
rid_base:
image: my-image
environment:
- FOO=bar
rid_bootstrapper:
extends: rid_base
depends_on:
- db
another_service:
extends: rid_base # Works perfectly!
The latest specs read differently to me:
Also, note that Docker Compose has its own release cycle. Locally I have: And the CI has: Do you have maybe locally an in-between version that does not support it? |
|
Just a thought, would it make sense to have it parameterized somehow? I would keep the default as light, with only one instances of databases, to keep them in the single, quick case and have limited resources usage, and use the case with N database only for load tests. |
I think you are right. I wanted to do that initially but could not find a not-too-complex way of doing so. However on a second thought I think there is. I will update this PR accordingly. |
eaf35c8 to
4cd7dec
Compare
|
When I check out this branch and run If I take down all my containers on the main branch and then try to start them up from this branch: My docker versions are: Even if it takes somewhat more effort to implement in a way that can be used by more versions of docker, I think that's worthwhile as we want to minimize friction to spin up users. docker is intended to remove the friction of setting up an environment just right, and we lose some of that benefit if a user has to fiddle with getting just the right version of docker before things will work. There are also many corporate restrictions around what versions of what software can be run -- upgrading docker is not necessarily an easy task for all users. |
This extends the existing
run_locally.shdeployment to run with a chosen number of nodes instead of a unique one. By default it runs two nodes, which is the case in the CI after this change.Notable changes:
crdband renamedwith-yugabyteintoybdbout of consistencycrdb-initwhich is now required with multiple nodes