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 up --scale, scale in config file #4742

Merged
merged 4 commits into from
Apr 27, 2017

Conversation

shin-
Copy link

@shin- shin- commented Apr 18, 2017

Implements #2496

This is a slight variant of Daniel's proposal in #2496. It adds a --scale flag instead of overloading the functionality of the services list, which works around the issue described in #1661 (comment)

The --scale option will be available for all versions of the Compose file, but the scale config option will only be added in file format 2.2. As a result, docker-compose scale with a 2.2 config file will be prohibited.

deploy.replicas might be considered as synonym to scale in the v3 format, but would be an independent addition (i.e. not in this PR).

…rmat

docker-compose scale modified to reuse code between up and scale

Signed-off-by: Joffrey F <[email protected]>
@shin- shin- force-pushed the 2496-new_scale branch 3 times, most recently from d3cef10 to b325579 Compare April 20, 2017 21:15
@shin- shin- changed the title [WIP] docker-compose up --scale, scale in config file docker-compose up --scale, scale in config file Apr 21, 2017
raise UserError(
'The scale command is incompatible with the v2.2 format. '
'Use the up command with the --scale flag instead.'
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we relax this restriction and only error if the config file contains scale: fields in the config?

I think that will remove the need to store config_version on the project as well.

@@ -875,7 +874,7 @@ def up(self, options):
If you want to force Compose to stop and recreate all containers, use the
`--force-recreate` flag.

Usage: up [options] [SERVICE...]
Usage: up [options] [--scale SERVICE=NUM...] [SERVICE...]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would just be part of options like the other options?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have to declare it separately because it's repeatable. Same goes for build for example:
Usage: build [options] [--build-arg key=val...] [SERVICE...]

or run:
Usage: run [options] [-v VOLUME...] [-p PORT...] [-e KEY=VAL...] SERVICE [COMMAND] [ARGS...]

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, cool, I didn't know that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants