Uh oh!
There was an error while loading. Please reload this page.
implementation of initial_scale service option (issue #116) - #630
implementation of initial_scale service option (issue #116)#630ekroymann wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
I think this validation should happen much easier. For one, it's duplicated in two places right now, which is not good.
This feels more like configuration validate code, which right now is done in the constructor for Service. You'll have to change can_be_scaled() slightly to accept the options as a param (instead of using self.options), but that should be fine (you could even move the function off the class if you wanted to, since self wouldn't be used any more).
I also noticed there's a bug in can_be_scaled() that will return True if the external interface is specified but no external port (it should really return False in that case) , but I guess that can be fixed later if you wanted to leave it for now.
ekroymann
commented
Nov 15, 2014
I refactored the PR to match the suggestions of dnephin. I also added some unit tests for the feature. Along the way, I noticed, that a different test case was patching the Container class globally, which can get (and does, in this case) in the way of other test cases using Container. |
dnephin
commented
Dec 3, 2014
LGTM, but please do squash the commits into a single one. |
bfirsh
commented
Dec 9, 2014
@EmilTH Cool! Thanks! Needs rebasing though, I'm afraid. :( |
ekroymann
commented
Dec 9, 2014
@bfirsh OK, rebased onto docker/fig master. |
aanand
commented
Dec 29, 2014
Looks like it needs another rebase, sorry. It could also do with some documentation in |
ekroymann
commented
Jan 4, 2015
I did the rebase and also added the documentation. Don't know, why the tests fail, but this seems to be a problem with the build setup. |
dnephin
commented
Jan 4, 2015
I reran the build, it ran this time. There is just one error from |
Signed-off-by: Emil Kroymann <emil.kroymann@gmail.com>
ekroymann
commented
Jan 5, 2015
I fixed the flake8 inconsistency and also made sure all tests pass. 2015-01-04 19:45 GMT+01:00 Daniel Nephin notifications@github.com:
|
aanand
commented
Jan 8, 2015
Just an update: I think this PR is good, but I'm holding off on an LGTM because I've been thinking about configuration a lot and I'm worried about introducing stuff into service definition that isn't focused on application structure. I do think that it should be possible to define an initial scale for each service in a version-controlled configuration file, so that your first For context, there are a handful of other concerns relating to the structure and content of
Scaling directives fit in this category too, where there seems to be a boundary between an abstract, portable app definition and concrete, host-specific configuration. We're going to need to make a decision about where the latter should live but I still want to be cautious about what we allow in (Of course, since we already allow you to specify volume host paths etc, it's likely that there'll be breaking changes whatever we decide, so maybe it doesn't matter.) |
eduherraiz
commented
Jan 10, 2015
+1 to this PR. I think an app could be need a scale factor > 1 for a container at initial configuration. Not for service definition, needed to the app structure. |
NoumanSaleem
commented
Jun 10, 2015
Any update on this? |
rysiekpl
commented
Jun 16, 2015
Ping? |
ekroymann
commented
Jun 16, 2015
Sorry, I got side tracked and did not have time to look into @aanand's proposal or resolve conflicts with master branch. If desired, I can put some work into this. |
rysiekpl
commented
Jun 16, 2015
Well, I just tested it and Still, does sound like a useful feature nonetheless. |
dnephin
commented
Oct 29, 2015
Thanks for the contribution! As @aanand mentioned here this is something we're considering, but it doesn't hit into the Compose file. We're discussing a new file or directory for this type of configuration here: #745 (comment) And there is a issue tracking this feature in #1661 |
Implementation of the initial_scale service option discussed in option (issue #116). Initial scale is applied whenever the containers for a service are newly created, ie. on "fig up" or "fig up --no-recreate".
Signed-off-by: Emil Kroymann emil.kroymann@gmail.com