-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Feature request: add scale parameter in yml #1661
Comments
@jmmills Can't you start your containers such as: "docker-compose scale worker=5" and that service would start with 5? |
@aanm Yes, but I think that functionality should be mirrored as a default in the service definition. Maybe I have a minimal set of workers that should always be running and I want that to be clearly declared as a default. |
@@aanm Do you expect that a If we were to do this going forward; I'd suggest something like:
Where |
We've gone back and forth on whether Now that we've got a rudimentary way to augment Compose files with |
I'd like to set |
@jamshid I've often wanted that, a definition that sets up an environment but doesn't run by default. I've been relegated to creating a base image (which a zero/no-op scale would also help with) in which I run my unit tests out of (via Something like this seems pretty useful for dev configurations
|
@prologic Why do that when the a "scale" parameter would solve both needs? |
@jmmills I'm just trying to find a solution to your use-case that doesn't involve breaking the current |
In my opinion scale (or number of copies) is part of the composition of a service, thus should be included in compose. |
Well I think we either have a |
👍 on having the capability of setting a default |
+1 |
Also, another use case: What if I want to scale the number of containers but don't want to background all of the services, or have to jump over to another terminal (or process) and set my scale numbers...
Doesn't work because up doesn't exit.
Becomes DWIM. |
I'm not sure that I really like this; all of a sudden
We're now abusing the "up" command really. "Scale" also takes on new meaning in that it now does two things:
|
Why would up bring up containers with a |
I could be wrong but reading your last comment it kind of implied that :) |
Let me elaborate:
Now, expected behavior: Edit: |
Okay :) Thanks; your example makes a bi more sense and a bit clearer as to the intention of I think |
I need create recipe indicate number of de intances (scale), for test, production, qa, etc. |
+1 for |
Yay! for |
+1 for |
+1 for |
|
+1 for scale=x. |
+1 |
1 similar comment
+1 |
Services in the new version of Docker does offer a 'replicas' feature.
…On Mon, Mar 20, 2017 at 3:28 PM, alwaysastudent ***@***.***> wrote:
I support @dnephin <https://github.com/dnephin> proposal on #2496
<#2496>
Please give us this basic feature.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1661 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AES98uWGEnbyCFyxNSSlv7QkXy5oBek1ks5rntNBgaJpZM4FS8ZQ>
.
|
@westlakem - that feature is for swarm. It is not for the regular service scaling. |
So many pros, few cons. What is the matter with this issue? |
There is a more recent proposal about completely removing the scale command in #2496 I really dont understand why or why there is no |
Implemented back in 1.13.0. Thank you everyone for your feedback and patience. |
@shin- Why is this considered closed? In managing large scale apps where EVERYTHING is automated & in version control, I now must modify my Ansible which executes Docker to define how many instances of a service will be running. Ansible should be setting up everything so Docker can run. Docker should be defining how many instances of a service the app needs. Now it's Docker's responsibility to know the inventory of services but Ansible's responsibility to call Docker so it knows how many containers to spin up? |
@greenscar Sorry, I'm not exactly sure what the problem is - are you unhappy about the way the feature has been implemented? If so, in what way can we make it better? |
Why is this not present in version 3? Extreamly confusing since "deploy.replicas" and "up" are not equivalente, you could say this feature is missing in v3. |
@cgarciae |
@shin- If I dont want to create a swarm and only use |
@cgarciae Why are you using a v3 file if you don't want to create a Swarm? |
I think everyone using docker expects the scale parameter to work for either docker 2 or 3 files. There is no reason for it not to and it could even set the default value for deploy.replicas as well. If deploy.replicas is set it therefore overrides scale in swarm. What is wrong with this picture apart from it being what everyone expects to happen (and of course if you don't like it no need to use it in your docker-compose.yml)? |
The missing scale parameter made a servie fail, since i forgot to scale it up like it was before since the last redeloy -.- why is this not a thing it would save service and maybe even lifes depending on what its running |
Just hit this issue as well. Seems there is no way to specify how many of a service to start from within the docker compose config? It is even more confusing that the docker compose documentation has a lot of documentation for things that don't work with docker-compose... |
Oh wait, so if i change my docker compose config to |
Ok, I see this issue of "version" not really meaning versions has already been brought up, #4693 |
I use v3.6 because i need some configs that does not exist in 2.2. For local development i use no swarm, but i want to set scale=0 to some containers in my docker-compose.overrides.yml. Because some of them are just for buildprocesses like the frontendbuild container. This container shares some volumes with other running containers, but should not started together with these other containers on docker-compose up. So the buildcontainer just runs with the run command. Yes i can set the --scale param on calling docker-compose up, but i think it is better to write it directly to the configuration. :) |
Thanks for the scale parameter. I was able to use it in a non-production In this case, only intended for somebody to try out Consul and Vault in a HA configuration and use Consul DNS. |
Which version of docker compose are you running on ? Since v3 this feature has been dropped (By drop, I mean, never implemented), so it's ignored. See https://docs.docker.com/compose/reference/scale/ |
I don’t ever use v3 format due to missing features. I tend to use the lowest 2.1 or 2.2 format depending on what features I’m using. Edit: not to say I avoid v3 format. Just that when I go to write a compose file it is usually missing what I want to use. |
Ok, I guessed you speak about docker compose with swarm stack, that's why. I never tried, but it's weird to talk about HA with docker compose without orchestrator and mutli node. Is it for "poc" or testing purpose ? Anyway, I never tried in this context |
In this case, the HA simply refers to a consul cluster and a vault cluster. It is meant to serve as a proof of concept available for experimentation and ease of bootstrap. The HA does not refer to docker HA or even multi-machine HA. It's only HA in that the person experimenting can kill one of the cluster containers and see that the consul and/or vault service is not affected. |
As a user of compose (formally fig), I would like to be able to specify the number of nodes started for any given definition (a.k.a scale) from inside the manifest (yaml configuration file), so that I can ship my cluster definition with my service orchestration.
E.g. syntax:
The text was updated successfully, but these errors were encountered: