Commit Graph

302 Commits

Author SHA1 Message Date
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 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
Mazz Mosley f33f673b49 Allow _.- chars in service names
As VALID_CHARS is shared with project names, these chars are also
now allowed within project names.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-01 17:57:50 +01:00
Mazz Mosley 8cf84ea552 Fix missing image names
These tests were indeed raising a config error, but not for the reason
intended/tested for. I've added in the image name so the config error
raise is correctly testing the Service name.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-01 17:57:50 +01:00
Aanand Prasad c8751980f9 Merge pull request #1578 from aanand/fix-migrate-help
Fix 'docker-compose help migrate-to-labels'
2015-06-21 17:25:52 -07:00
Aanand Prasad 4f83a18912 Merge pull request #1570 from aanand/fix-build-pull
Explicitly set pull=False when building
2015-06-21 17:25:46 -07:00
Aanand Prasad 93372dd665 Fix 'docker-compose help migrate-to-labels'
- Fix "No such command" error

- Add text from migration section of install docs

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-19 15:43:53 -07:00
Aanand Prasad c22cc02df5 Don't set network mode when none is specified
Setting a value overrides the new default network option.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-19 15:22:13 -07:00
Aanand Prasad bef0926c58 Explicitly set pull=False when building
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-18 17:43:16 -07:00
Aanand Prasad 77c939b256 Merge pull request #1142 from calou/master
Added support of option mac-address
2015-06-17 14:39:00 -07:00
Sébastien Gruchet b76ac6e633 Added support to option mac-address
Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>

Updated doc

Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>

Fixed LINT errors

Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>

Changed mac-address entry order in config keys

Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>

Changed attributes order in docs/yml.md

Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>
2015-06-17 21:28:17 +02:00
Aanand Prasad bc14c473c9 Merge pull request #1521 from dano/validate-service-names
Validate that service names passed to Project.containers aren't bogus.
2015-06-16 10:45:49 -07:00
Aanand Prasad 5b2a0cc73d Merge pull request #1406 from vdemeester/667-compose-port-scale
Fixing docker-compose port with scale (#667)
2015-06-15 10:58:44 -07:00
Daniel Nephin 06db577105 Move converge() to a test module, and use a short timeout for tests.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-06-14 17:18:27 -04:00
Travis Thieman c24d5380e6 Extend up -t to pass timeout to stop running containers
Signed-off-by: Travis Thieman <travis.thieman@gmail.com>
2015-06-14 16:45:28 -04: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 08bc4b830b Fix volume binds de-duplication
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-12 16:57:22 -04:00
Vincent Demeester a5fd91c705 Fixing docker-compose port with scale (#667)
Fixes #667 and Closes #735 (taking over it)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-06-10 23:26:33 +02:00
Aanand Prasad 4fd5d58076 Test against Docker 1.7.0 RC2
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-10 14:19:36 -04:00
Aanand Prasad ff151c8ea0 Test that data volumes now survive a crash when recreating
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-09 13:06:09 -04:00
Dan O'Reilly c59c9dd951 Add integration test for service name verification
Add a test to make sure NoSuchService is raised if
a bogus service name is given to 'docker-compose logs'.

Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-06-08 17:04:42 -04:00
Aanand Prasad db2d02dc0b Remove Service.start_or_create_containers()
It's only used in a single test method.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-08 10:59:03 -04:00
Aanand Prasad 7d2a89427c Merge pull request #1466 from noironetworks/changing-scale-to-warning
Modified scale awareness from exception to warning
2015-06-04 16:21:01 +01:00
Ben Firshman ec437313a7 Change kill SIGINT test to use SIGSTOP
I think the original intention of the original test was the check that
different signals work, I think. This does this -- it sends a signal
that doesn't cause the container to stop.

Closes #759. Replaces #1467.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-05-29 11:13:37 +01:00
André Martins ae63d35660 Modified scale awareness from exception to warning
Signed-off-by: André Martins <martins@noironetworks.com>
2015-05-26 23:59:45 +01:00
Todd Whiteman b9c502531d Possible division by zero error when pulling an image - fixes #1463
Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>
2015-05-26 15:34:34 -07:00
Aanand Prasad 1344099e29 Merge pull request #1444 from aanand/migrate-in-dependency-order
Migrate containers in dependency order
2015-05-26 17:30:14 +01:00
Aanand Prasad 7da8e6be3b Migrate containers in dependency order
This fixes a bug where migration would fail with an error if a
downstream container was migrated before its upstream dependencies, due
to `check_for_legacy_containers()` being implicitly called when we fetch
`links`, `volumes_from` or `net` dependencies.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-26 16:03:06 +01:00
Aanand Prasad 4795fd874f Fix regression in `docker-compose up`
When an upstream dependency (e.g. a db) has a container but a downstream
service (e.g. a web app) doesn't, a web container is not created on
`docker-compose up`.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-26 16:01:05 +01:00
Aanand Prasad 0b4d9401ee Bail out immediately if there are legacy containers
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-26 11:53:51 +01:00
Aanand Prasad 051f56a1e6 Fix bugs with one-off legacy containers
- One-off containers were included in the warning log messages, which can
  make for unreadable output when there are lots (as there often are).

- Compose was attempting to recreate one-off containers as normal
  containers when migrating.

Fixed by implementing the exact naming logic from before we used labels.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-21 18:21:49 +01:00
Aanand Prasad b5ce23885b Split out fetching of legacy names so we can test it
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-21 18:21:49 +01:00
Aanand Prasad 0fdb8bf814 Refactor migration logic
- Rename `migration` module to `legacy` to make its legacy-ness explicit

- Move `check_for_legacy_containers` into `legacy` module

- Fix migration test so it can be run in isolation

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-21 18:21:09 +01: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 022f81711e Fixes #1434, Project.containers with service_names.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-05-20 20:47:34 -04:00
lsowen ea7ee301c0 Add security_opt as a docker-compose.yml option
Signed-off-by: Logan Owen <lsowen@s1network.com>
2015-05-19 13:47:41 -04:00
Aanand Prasad ef4eb66723 Implement smart recreate behind an experimental CLI flag
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-18 18:39:18 +01:00
Daniel Nephin 62059d55e6 Add migration warning and option to migrate to labels.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-05-18 10:55:12 -04: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
Daniel Nephin 28d2aff8b8 Fix teardown for integration tests.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-05-18 10:44:44 -04:00
Daniel Nephin 417d9c2d51 Use individual volumes for recreate instead of volumes_from
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-05-11 13:01:43 -04:00
delbert@umn.edu df87bd91c8 Added devices configuration option
Signed-off-by: Dan Elbert <dan.elbert@gmail.com>
2015-05-11 10:50:58 -05:00
Daniel Nephin 6829efd4d3 Resolves #874, Rename instead of use an intermediate.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-05-07 21:53:41 -04:00
Daniel Nephin 0f2f9db6d8 Merge pull request #1388 from vdemeester/1303-log-driver-support
Add support for log-driver as a docker-compose.yml option
2015-05-07 12:00:42 -04:00