345 Commits

Author SHA1 Message Date
Daniel Nephin
2b75741e5a Fix cherry-pick errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-09-11 14:22:35 -04:00
Daniel Nephin
7ff8c2b224 Resolves #1804
Fix mutation of service.options when a label or environment variable is specified in the config.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-09-10 19:32:30 -04:00
Daniel Nephin
db31adc208 Extract link names into a function.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-09-10 19:32:30 -04:00
Daniel Nephin
805f6a7683 Refactor network_mode logic out of Service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-09-10 19:32:30 -04:00
Daniel Nephin
d92f323e6d Fixes #1757 - include all service properties in the config_dict()
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-09-10 19:32:30 -04:00
Daniel Nephin
6a23491fa9 Resolves #1856, fix regression in #1645. Includes some refactoring to make testing easier.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-09-10 19:32:30 -04:00
Mazz Mosley
294b9742be Handle all exceptions
If we get back an error that wasn't an APIError, it was causing the
thread to hang. This catch all, while I appreciate feels risky to
have a catch all, is better than not catching and silently failing,
with a never ending thread.

If something worse than an APIError has gone wrong, we want to stop
the incredible journey of what we're doing.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-09-10 19:32:30 -04:00
Aanand Prasad
d0792b49fa Merge pull request #1846 from aanand/fix-mem-limit-options
Fix mem_limit and memswap_limit regression
(cherry picked from commit 93cc7e375130ebaaa287bb5d7e04f59bd0d6d98e)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-08-11 16:00:20 +01:00
Mazz Mosley
5548aa5c79 Merge pull request #1833 from aanand/deprecate-relative-volumes-without-dot
Show a warning when a relative path is specified without "./"
(cherry picked from commit 52733f699681c3ee762917d2d837fa4bd8c4a9ba)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>

Conflicts:
	compose/config.py
	tests/unit/config_test.py
2015-08-11 12:57:42 +01:00
Ben Firshman
16440ff055 Merge pull request #1829 from vlajos/typofixes-vlajos-20150807
typofix - https://github.com/vlajos/misspell_fixer
(cherry picked from commit b7baa899e271fd13f17592be015b8bf066c17245)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-08-11 09:44:28 +01:00
Ben Firshman
74b4fb89bb Merge pull request #1835 from aanand/fix-crash-when-container-has-no-name
Ignore containers that don't have a name
(cherry picked from commit 4e12ce39b35ea49bfdcd6677b26a46eb593ec208)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-08-11 09:44:27 +01:00
Aanand Prasad
3d6946417d Merge pull request #1800 from aanand/volume-driver-support
Support volume_driver
(cherry picked from commit 41b9df763925dee4f5702dc48ce18a76cbca19f2)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-31 16:29:24 +01:00
Daniel Nephin
5c853c4a2c Merge pull request #1794 from aanand/add-test-for-trailing-slash-volume-copy
Add test for trailing slash volume copying bug
(cherry picked from commit ea7276031c237c8c1f8bc6131102b5a73c29826e)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-31 15:29:44 +01:00
Aanand Prasad
ad922cd7a1 Merge pull request #1787 from aanand/fix-duplicate-volume-bind
Fix "Duplicate volume mount" error when config has trailing slashes
(cherry picked from commit dc7bdd10d45093fff2d51ec20d67928a17f3a06f)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-31 15:29:44 +01:00
Aanand Prasad
49bafdc4cd Merge pull request #1777 from aanand/update-api-version
Update API version to 1.19
(cherry picked from commit 276e369c3167b4f5e189b33e8a55ff6fd7115142)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-31 15:29:44 +01:00
Mazz Mosley
65cc84140a Merge pull request #1736 from aanand/deprecate-allow-insecure-ssl
Deprecate --allow-insecure-ssl
2015-07-23 14:09:17 +01:00
Aanand Prasad
70c7d27c4e Merge pull request #1758 from mnowster/improve-scale-test-coverage
Improve scale test coverage
2015-07-23 11:07:48 +01:00
Aanand Prasad
04a773f1c8 Deprecate --allow-insecure-ssl
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-23 10:56:21 +01:00
Mazz Mosley
119901c19b Improve test coverage for scale
Also includes tiny amount of code cleanup, being explicit with imports.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-23 10:55:57 +01:00
Aanand Prasad
1739448402 Don't use custom name for one-off containers
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-22 15:39:56 +01:00
Aanand Prasad
233c509f71 Remove logging test
It doesn't do much other than cause the remainder of the test suite to
generate lots of junk output.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-21 15:56:37 +01:00
Mazz Mosley
cc0bfea8a1 Merge pull request #1711 from aanand/custom-names
Add container_name option for specifying a custom container name
2015-07-21 14:28:16 +01:00
Aanand Prasad
89f6caf871 Allow any volume mode to be specified
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-17 16:14:09 +01:00
Aanand Prasad
a3191ab90f Add container_name option
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-17 15:50:09 +01:00
Aanand Prasad
ced94a3504 Make smart recreate the default
Add --force-recreate flag to enable the old default behaviour of
recreating everything.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-17 11:28:02 +01:00
Mazz Mosley
c7dccccd1f Merge pull request #1704 from aanand/fix-timeout-type
Make sure up/restart/stop timeout is an int
2015-07-16 10:50:06 +01:00
Aanand Prasad
0c5c8d1f00 Handle case where /containers/json returns "Labels": null
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-15 17:13:33 +01:00
Aanand Prasad
ec8bf066ba Make sure up/restart/stop timeout is an int
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-15 16:56:39 +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
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
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
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
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
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
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
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
ba71e2a549 Use new load_from_filename
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 14:05:14 +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
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
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
Daniel Nephin
ae96fc0071 Support reading config from stdin.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-07-02 22:16:22 -04:00
Jeff Kramer
8709dc3c24 Added env var parsing to volume container paths
This commit adds environment variable parsing to the container side
of the volume mapping in configs. The common use case for this is
mounting SSH agent sockets in a container, using code like:

volumes:
    - $SSH_AUTH_SOCK:$SSH_AUTH_SOCK
environment:
    - SSH_AUTH_SOCK

Signed-off-by: Jeff Kramer <jeff.kramer@voxmedia.com>
2015-07-02 13:13:38 -05:00