Commit Graph

1618 Commits

Author SHA1 Message Date
Aanand Prasad f03dec766d Rename max workers env var and fix docs
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-15 16:43:43 +01:00
Aanand Prasad 35aef1aee0 Merge pull request #1687 from mnowster/1651-parallelise-stopping-containers
1651 parallelise stopping containers
2015-07-15 16:29:54 +01:00
Aanand Prasad 6c7c63ce34 Merge pull request #1693 from ekristen/remove_tty_wrap
Do not wrap table cells
2015-07-15 16:27:27 +01:00
Aanand Prasad e675d67774 Test against Docker 1.6.2 and 1.7.1
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-15 14:37:44 +01:00
Ben Firshman 200b408843 Link to waffle board from CONTRIBUTING.md
Closes #1067

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-07-15 11:56:46 +01:00
Mazz Mosley 03d34336a8 Document DEFAULT_MAX_WORKERS
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-15 11:56:06 +01:00
Aanand Prasad 847f839cab Merge pull request #1559 from aanand/update-swarm-docs
Update Swarm docs
2015-07-15 11:43:10 +01:00
Mazz Mosley a68ca199a2 Execute container commands in parallel
Commands able to use this parallelisation are `stop`, `kill` and `rm`.

We're using a backported function from python 3, to allow us to make
the most of a pool of threads without having to write the low level
code for managing this ourselves.

A default value for number of threads is a low enough number so it
shouldn't cause performance problems but if someone knows the
capability of their system and wants to increase it, they can via
an environment variable DEFAULT_MAX_WORKERS

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-15 11:02:50 +01:00
Ben Firshman aab6df6ba4 Add test coverage support
Prints out results on console and puts HTML report in `coverage-html`.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-07-15 10:09:37 +01:00
Erik Kristensen 7937611366 change 80 to 0
Signed-off-by: Erik Kristensen <erik@erikkristensen.com>
2015-07-14 12:31:00 -06:00
Erik Kristensen b7edb3ca9d do not wrap table cells
Signed-off-by: Erik Kristensen <erik@erikkristensen.com>
2015-07-14 12:30:42 -06:00
Aanand Prasad 1e71eebc74 Merge pull request #1688 from aanand/use-docker-py-1.3.0
Use docker-py 1.3.0
2015-07-14 16:55:44 +01:00
Aanand Prasad fdc34a187e Use docker-py 1.3.0
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-14 16:17:12 +01:00
Mazz Mosley 2db0a377e2 Minor test refactor
Rather than creating a docker client within each test, create one
at setup and make it accessible to the whole class.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-13 14:11:12 +01:00
Aanand Prasad 81707ef1ad Merge pull request #1643 from aanand/warn-about-legacy-one-off-containers
Show an error on 'run' when there are legacy one-off containers
2015-07-08 14:48:03 +01:00
Aanand Prasad a8ad13734e Merge pull request #1666 from mnowster/docs-for-extends-file-default-behaviour
Docs for `file` default behaviour
2015-07-07 17:12:29 +01:00
Aanand Prasad 8b033d3946 Merge pull request #1665 from mnowster/1648-support-log-opt
1648 support log opt
2015-07-07 17:08:04 +01:00
Mazz Mosley ef8ae07145 Docs for `file` default behaviour
Change in behaviour, `file` key is optional and if not set the
default is to look within the same file as `extends` is defined.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-07 17:01:09 +01:00
Mazz Mosley 6f31e8ebe9 Add support for log_opt
When specifying a log_driver you want to specify some options for
the logger as per the docker run --log-opt option. The logger
options are key value pairs.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-07 16:26:43 +01:00
Aanand Prasad 2bc10db545 Merge pull request #1658 from aanand/fix-smart-recreate-nonexistent-image
Fix smart recreate when 'image' is changed to something nonexistent
2015-07-07 16:12:44 +01:00
Aanand Prasad 531265bc84 Fix smart recreate when 'image' is changed to something nonexistent
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-07 16:01:44 +01:00
Mazz Mosley c1223bfd3a Keep config keys in alphabetised order
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-07 12:02:05 +01:00
Aanand Prasad e9da790f76 Merge pull request #1660 from mnowster/754-add-option-memswap-limit
Add in memswap_limit run option
2015-07-07 10:09:49 +01:00
Mazz Mosley fc26982132 Add in memswap_limit run option
By allowing the memswap_limit option to be defined we also need to
check that mem_limit is set, you can't have swap without a limit.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-06 17:08:57 +01:00
Aanand Prasad e98caf5cf9 Show an error on 'run' when there are legacy one-off containers
Also warn the user about the one-off containers in the standard error
message about legacy containers.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-06 14:45:17 +01:00
Daniel Nephin 20218394b9 Merge pull request #1649 from albers/doc-completion-zsh
Mention zsh command completion in general install section
2015-07-06 06:41:09 -07:00
Aanand Prasad fc8f564558 Merge pull request #1632 from mnowster/extends_file_default_behaviour
Extends file default behaviour and fixes circular reference bug
2015-07-06 13:28:54 +01:00
Aanand Prasad 0fa5808389 Merge pull request #1623 from mnowster/documentation-fixes
Documentation fixes
2015-07-06 13:25:56 +01:00
Harald Albers 2fc7cd6e03 Mention zsh command completion in general install section
Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-05 19:18:24 +02:00
Aanand Prasad d90202399a Merge pull request #1645 from dnephin/fix_up_race
Fix race condition in docker-compose up
2015-07-03 16:28:22 +01:00
Aanand Prasad f42fd6a3ad Merge pull request #1642 from aanand/fix-1573
Fix bug where duplicate container is leftover after 'up' fails
2015-07-03 16:25:53 +01:00
Aanand Prasad d85688892c Merge pull request #1644 from aanand/fix-rm-bug
Stop 'rm' and 'ps' listing services not defined in the current file
2015-07-03 16:22:48 +01:00
Daniel Nephin bd554a6fea Fix race condition in docker-compose up.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-07-03 10:29:46 -04:00
Mazz Mosley 317bbec98c Move make_service_dict out of config
This top level function is a test helper, so I've moved it into the
config_test file and updated accordingly.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 15:06:53 +01:00
Mazz Mosley 6e6dbdad95 working_dir is no longer optional
When building test data using make_service_dict, we need to include
working_dir as it is core to some of the functionality of
ServiceLoader.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 14:56:18 +01:00
Aanand Prasad 0b887b841f Stop 'rm' and 'ps' listing services not defined in the current file
If you have an alternate YAML file with different services defined,
containers for those services will be shown in `docker-compose ps` even
if you don't pass that file in.

Furthermore, `docker-compose rm` will claim that it's going to remove
them, but actually won't.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-03 14:34:27 +01:00
Mazz Mosley c6e03d739d Test self referencing 'file'
When specifying the 'file' key to a value of it's own name, test
that this works and does not cause a false positive circular reference
error.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 14:14:47 +01:00
Mazz Mosley 6a6e7934bd Refactor circular-reference check
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 14:05:35 +01:00
Mazz Mosley ba71e2a549 Use new load_from_filename
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 14:05:14 +01:00
Mazz Mosley c51d53afba Fix off by one error
In our circular reference check the stack was previously off by one,
by not including the current service name that was calling another.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 12:24:33 +01:00
Mazz Mosley bd7fcd1123 Use absolute paths
A circular reference bug occurs when there is a difference in the paths
of the file specified in the extends. So one time it is relative, second
time is absolute thus allowing a further circular reference to occur.

By using absolute paths we can be sure that the service filename check
is correct.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 12:21:12 +01:00
Mazz Mosley 254bc4908c Move extends validation into ServiceLoader class
This refactoring allows us to raise an error when there is no
'file' key specified in the .yml and no self.filename set. This
error was specific to the tests, as the tests are
the only place that constructs service dicts without sometimes
setting a filename.

Moving the function within the class as well as it is code that
is exclusively for the use of validating properties for the
ServiceLoader class.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 11:26:31 +01:00
Mazz Mosley 24c1d95869 Refactor extends validation tests
Split them out into individual validation tests so it is clearer
to see what is going on and to enable adding further validation
tests.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 11:26:31 +01:00
Mazz Mosley 5e2d43843c Reduce path manipulation
If we're using self.filename, then it's already a full path and we
don't need to splice off the filename.yml just so we can .join it
back together again.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 11:26:31 +01:00
Mazz Mosley 6e4a954dbd 'file' key can be omitted from extends
If the 'file' key is not set in the extends_options dict then we
look for the 'service' from within the same file.

Fixes this issue: https://github.com/docker/compose/issues/1237

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 11:26:30 +01:00
Mazz Mosley 31dedd8bdd Rename function process to validate
The process function contained purely validation checks, so re-named
the function to aid intent clarity.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 11:26:30 +01:00
Aanand Prasad 62b47224f0 Fix bug where duplicate container is leftover after 'up' fails
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-03 10:46:07 +01:00
Aanand Prasad db7e5124f3 Merge pull request #1488 from dnephin/config_from_stdin
Support reading config from stdin
2015-07-03 09:03:40 +01:00
Aanand Prasad a6b9982a1e Merge pull request #1633 from jeffk/parse_env_vars_in_all_volumes
Added env var parsing to volume container paths
2015-07-03 08:55:48 +01:00
Aanand Prasad 40b8c3c892 Merge pull request #1624 from mnowster/1519_relax_service_name_restrictions
1519 relax service name restrictions
2015-07-03 08:54:16 +01:00