Commit Graph

42 Commits

Author SHA1 Message Date
Aanand Prasad aeef61fcd8 Make 'version' a string
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-02-02 13:58:34 +00:00
Aanand Prasad 406b6b28f4 Tag v2-only tests
- Don't run them against Engine < 1.10
- Set the API version appropriately for the Engine version, so all tests
  use API version 1.22 against Engine 1.10

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-15 02:08:20 +00:00
Aanand Prasad a027a0079c Use networking for version 2 Compose files
- Remove --x-networking and --x-network-driver
- There's now no way to set a network driver - this will be added back
  with the 'networks' key

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-12 21:29:40 +00:00
Joffrey F ec5111f1c2 Volumes are now prefixed with the project name
When created through the compose file, volumes are prefixed
with the name of the project they belong to + underscore,
similarly to how containers are currently handled.

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-01-05 15:21:53 -08:00
Joffrey F b4be7b870f Add support for declaring named volumes in compose files
* Bump default API version to 1.21 (required for named volume management)
* Introduce new, versioned compose file format while maintaining support
  for current (legacy) format
* Test updates to reflect changes made to the internal API

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-01-05 15:09:39 -08:00
Daniel Nephin 4bf2f8c4f9 Fix lookup of linked containers for API version 1.20
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-05 15:09:39 -08:00
Daniel Nephin c64b7cbb10 Ignore errors from API about not being able to kill a container.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-05 15:09:39 -08:00
Daniel Nephin e67bc2569c Properly resolve environment from all sources.
Split env resolving into two phases. The first phase is to expand the paths
of env_files, which is done before merging extends. Once all files are merged
together, the final phase is to read the env_files and use them as the base
for environment variables.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-25 11:02:20 -05:00
Aanand Prasad cfb1b37da2 Merge pull request #2405 from dnephin/move_all_validation_to_config
Move all validation to config
2015-11-25 15:16:21 +00:00
Aanand Prasad 88e9c1ccd9 Merge pull request #2438 from dnephin/fix_flaky_pull_test
Fix `build --pull` test flakes
2015-11-24 16:44:53 +00:00
Daniel Nephin 533f33271a Move service sorting to config package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-23 13:33:00 -05:00
Daniel Nephin dac75b07dc Move volume parsing to config.types module
This removes the last of the old service.ConfigError

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-23 13:33:00 -05:00
Daniel Nephin 2351e11cc8 Make sure we always have the latest busybox image, so that build --pull tests don't flake.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-20 17:51:36 -05:00
Daniel Nephin 1e8f76767f Fix env_file and environment when used with extends.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-18 16:07:11 -05:00
Daniel Nephin 1f7faadc77 Remove name from config schema.
Refactors config validation of a service to use a ServiceConfig data object.
Instead of passing around a bunch of related scalars, we can use the
ServiceConfig object as a parameter to most of the service validation functions.

This allows for a fix to the config schema, where the name is a field in the
schema, but not actually in the configuration. My passing the name around as
part of the ServiceConfig object, we don't need to add it to the config options.
Fixes #2299

validate_against_service_schema() is moved from a conditional branch in
ServiceExtendsResolver() to happen as one of the last steps after all
configuration is merged. This schema only contains constraints which only need
to be true at the very end of merging.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-11 11:00:11 -05:00
Daniel Nephin a92d86308f Rename ServiceLoader to ServiceExtendsResolver
ServiceLoader has evolved to be not really all that related to "loading" a
service. It's responsibility is more to do with handling the `extends`
field, which is only part of loading.  The class and its primary method
(make_service_dict()) were renamed to better reflect their responsibility.

As part of that change process_container_options() was removed from
make_service_dict() and renamed to process_service().  It contains logic for
handling the non-extends options.

This change allows us to remove the hacks from testcase.py and only call
the functions we need to format a service dict correctly for integration tests.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-11 10:58:07 -05:00
Daniel Nephin 3474bb6cf5 Cleanup workaround in testcase.py
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-10 12:43:55 -05:00
Daniel Nephin f7100b2ef3 Change version check from engine version to api version.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-21 15:40:50 -04:00
Aanand Prasad d5f5eb1924 Enable use of Docker networking with the --x-networking flag
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-10-14 11:19:43 -04:00
Daniel Nephin c37a0c38a2 Fix a test case that assumes busybox image id.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-09-22 12:28:59 -04:00
Mazz Mosley d31d24d19f Work around some coupling of links, net & volume_from
This is minimal disruptive change I could make to ensure
the service integration tests worked, now we have some validation
happening.

There is some coupling/entanglement/assumption going on here.

Project when creating a service, using it's class method from_dicts
performs some transformations on links, net & volume_from, which
get passed on to Service when creating. Service itself, then performs
some transformation on those values. This worked fine in the tests before
because those options were merely passed on via make_service_dict.

This is no longer true with our validation in place. You can't pass to
ServiceLoader [(obj, 'string')] for links, the validation expects it to be
a list of strings. Which it would be when passed into Project.from_dicts
method.

I think the tests need some re-factoring but for now, manually deleting
keys out of the kwargs and then putting them back in for Service Creation
allows the tests to continue.

I am not super happy about this approach. Hopefully we can come back and
improve it.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-09-02 15:43:52 +01:00
Mazz Mosley 8a6061bfb9 __init__ takes service name and dict
Moving service name and dict out of the function make_service_dict
and into __init__. We always call make_service_dict with those so
let's put them in the initialiser. Slightly cleaner design intent.

The whole purpose of the ServiceLoader is to take a
service name&service dictionary then validate, process and return
service dictionaries ready to be created.

This is also another step towards cleaning the code up so we can
interpolate and validate an extended dictionary.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-09-02 15:42:38 +01:00
Mazz Mosley 1344533b24 filename is not optional
While it can be set to ultimately a value of None, when a
config file is read in from stdin, it is not optional.

We kinda make use of it's ability to be set to None in our
tests but functionally and design wise, it is required.

If filename is not set, extends does not work.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-09-02 15:42:38 +01:00
Daniel Nephin 235fe21fd0 Prevent flaky test by changing container names.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-08-31 14:57:06 -04:00
Daniel Nephin 59d4f304ee Run pre-commit on all files
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-08-24 17:04:50 -04:00
Aanand Prasad 92ef1f5702 Make compose.config a proper module
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-08-05 15:50:22 +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
Daniel Nephin 60351a8e07 Speed up integration test and make cleanup easier by using labels
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-06-14 16:45:28 -04:00
Daniel Nephin d827809ffb Use labels to filter containers.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-06-14 16:45:28 -04:00
Aanand Prasad b0cb31c186 Use 'top' instead of 'sleep' as a dummy command
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-21 16:24:29 +01:00
Daniel Nephin ed50a0a3a0 Resolves #1066, use labels to identify containers
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-05-18 10:47:26 -04:00
Aanand Prasad 4f366d8355 Make sure the build path we pass to docker-py is a binary string
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-04-30 11:57:46 +01:00
Daniel Nephin 3dd860f0ba Fix #923, support image with ids instead of names.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-04-29 10:13:18 -04:00
Aanand Prasad 528bed9ef6 Fix environment resolution
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-03-13 14:22:28 +00:00
Aanand Prasad 4ecf5e01ff Extract YAML loading and parsing into config module
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-03-13 14:21:58 +00:00
Aanand Prasad 2af7693e64 WIP: rename Fig to Compose
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-01-20 21:00:23 +00:00
Aanand Prasad b318585f3c TLS support, with same env vars as docker client
Thanks to @jkingyens for the bulk of the work.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2014-10-16 10:41:26 +01:00
Aanand Prasad 537d435a28 Fix race condition in cli_test.py
We weren't waiting for the build to finish, causing the rest of the test
to occasionally fail when looking for the image.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2014-09-26 11:42:16 -07:00
Daniel Nephin e0b0801e87 Do less work during integration testing.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2014-09-09 22:00:21 -04:00
Daniel Nephin 7fd37c89b9 Remove fig.packages replace with real deps.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2014-09-05 11:44:49 -07:00
d11wtq 3a342fb25d Use busybox in fixtures, instead of ubuntu
Signed-off-by: d11wtq <chris@w3style.co.uk>
2014-06-11 10:25:50 +00:00
Ben Firshman ca7151aeb1 Split tests into unit and integration 2014-04-25 22:58:21 +01:00