Commit Graph

1032 Commits

Author SHA1 Message Date
Aanand Prasad d7db15ce94 Merge pull request #3364 from TomasTomecek/3355-detailed-error-messages
service: detailed error messages for create and start
2016-07-11 16:29:35 -04:00
Aanand Prasad 593d1aeb09 Fix bugs with entrypoint/command in docker-compose run
- When no command is passed but `--entrypoint` is, set Cmd to `[]`
- When command is a single empty string, set Cmd to `[""]`

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-07-11 16:15:13 -04:00
Jonathan Giannuzzi 83f35e132b Add support for creating internal networks
Signed-off-by: Jonathan Giannuzzi <jonathan@giannuzzi.be>
2016-07-11 11:34:01 +02:00
Tomas Tomecek fea970dff3 service: detailed error messages for create and start
Fixes: #3355

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2016-07-11 10:45:27 +02:00
Aanand Prasad 4207d43b85 Fix timeout value in error message
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-07-07 12:08:47 -07:00
Aanand Prasad 1e176b58c5 Merge pull request #3592 from stakodiak/fix-privilege-typo
Fix a typo in a test's name.
2016-07-06 15:22:05 -07:00
Aanand Prasad 554dc2496a Merge pull request #3590 from Knetic/oomscore
Added support for oom_score_adj
2016-07-06 11:45:09 -07:00
Aanand Prasad 949b88fff9 Fix alias tests on 1.11
The fix in 8e04582052 caused a regression
when testing against 1.11.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-07-06 09:56:25 -07:00
George Lester 6fe5d2b543 Implemented oom_score_adj
Signed-off-by: George Lester <glester491@gmail.com>
2016-07-05 23:43:32 -07:00
Aanand Prasad 50d5aab8ad Fix test: check container's Env array instead of the output of 'env'
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-06-30 17:00:30 -07:00
Joffrey F 5d244ef6d8 Unset env vars behavior in 'run' mirroring engine
Unset env vars passed to `run` via command line options take the
value of the system's var with the same name.

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-06-30 15:48:23 -07:00
Aanand Prasad 72d3d5d84b Merge pull request #3612 from dnephin/tests_for_bundle
Add some unit tests and an acceptance test for bundle
2016-06-28 14:47:29 -07:00
Daniel Nephin 5640bd42a8 Add an acceptance test for bundle.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-28 10:18:59 -04:00
Daniel Nephin 95207561bb Add some unit tests for new bundle and push commands.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-28 10:18:20 -04:00
Aanand Prasad 8e04582052 Fix tests to accommodate short-id container alias
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-06-27 16:21:19 -07:00
Jonathan Giannuzzi 3c77db709f Fix assertion that was always true
Signed-off-by: Jonathan Giannuzzi <jonathan@giannuzzi.be>
2016-06-20 14:48:45 +02:00
Joffrey F ee68a51e28 Skip TLS version test if TLSv1_2 is not available on platform
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-06-14 12:23:04 -07:00
Aanand Prasad 8f8c17bf66 Merge pull request #3549 from shin-/KalleDK-master
Add support for COMPOSE_TLS_VERSION config option
2016-06-14 10:57:12 -07:00
Aanand Prasad 21f20cbc9b Merge pull request #3449 from Andrey9kin/ready/3281
Fix #3281: Unexpected result when using build args with default values
2016-06-14 08:05:07 -07:00
alex 68d73183eb Fix a typo in a test's name. 2016-06-13 23:36:34 -04:00
Joffrey F 60f7e021ad Fix split_path_mapping behavior when mounting "/"
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-06-13 15:32:10 -07:00
Aanand Prasad e502417df2 Merge pull request #3475 from shin-/3429-networks-config-serialize
Output valid config in config command
2016-06-07 18:01:39 +02:00
Joffrey F ea640f3821 Remove external_name from serialized config output
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-06-03 12:10:09 -07:00
Joffrey F e7a8b2fed5 Update TLS version configuration code. Tests.
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-06-03 11:45:22 -07:00
Milind Shakya 11a2eab549 Replace assertEquals with assertEqual since the former is getting deprecated soon. Also, fix pep8 E309.
Signed-off-by: Milind Shakya <sh.milind@gmail.com>
2016-06-02 16:35:23 -07:00
Andrey Devyatkin a67ba5536d Fix #3281: Unexpected result when using build args with default values
Fix the issue when build arg is set to None instead of empty string. Usecase:

cat docker-compose.yml
  .... args:
  - http_proxy
  - https_proxy
  - no_proxy

If http_proxy, https_proxy, no_proxy environment variables are not defined then http_proxy,
https_proxy, no_proxy build args will be set to string None which breaks all downloads

With this change undefined build args will be set to empty string instead of string None

Signed-off-by: Andrey Devyatkin <andrey.a.devyatkin@gmail.com>
2016-05-28 11:39:41 +02:00
Andrey Devyatkin c148849f0e Fix #3281: Unexpected result when using build args with default values
Fix the issue when build arg is set to None instead of empty string. Usecase:

cat docker-compose.yml
.... args:
- http_proxy
- https_proxy
- no_proxy

If http_proxy, https_proxy, no_proxy environment variables are not defined then http_proxy,
https_proxy, no_proxy build args will be set to string None which breaks all downloads

With this change undefined build args will be set to empty string instead of string None

Signed-off-by: Andrey Devyatkin <andrey.a.devyatkin@gmail.com>
2016-05-27 20:16:52 +02:00
Denis Makogon 1298b9aa5d Issue-3503: Improve timestamp validation in tests
CLITestCase.test_events_human_readable fails due to
 wrong assumption that host where tests were launched
 will have the same date time as Docker daemon.

 This fix introduces internal method for validating
 timestamp in Docker logs

Signed-off-by: Denys Makogon <lildee1991@gmail.com>
2016-05-27 14:50:13 +03:00
Andrey Devyatkin e3e8a619cc Fix #3281: Unexpected result when using build args with default values
Fix the issue when build arg is set to None instead of empty string.
Usecase:

cat docker-compose.yml
....
args:
- http_proxy
- https_proxy
- no_proxy

If http_proxy, https_proxy, no_proxy environment variables are not defined
then http_proxy, https_proxy, no_proxy build args will be set to string None which breaks all downloads

With this change build args will not passed to docker engine if they are equal to string None

Signed-off-by: Andrey Devyatkin <andrey.a.devyatkin@gmail.com>
2016-05-27 07:48:13 +02:00
Joffrey F 842e372258 Eliminate duplicates when merging port mappings from config files
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-05-20 15:28:35 -07:00
Aanand Prasad 7763122ecb Merge pull request #3459 from shin-/2487-split-volume-path
Always use the Windows version of splitdrive when parsing volume mappings
2016-05-20 11:42:43 +01:00
Joffrey F 2b5b665d3a Add test for path mapping with Windows containers
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-05-19 14:53:37 -07:00
Joffrey F db0a6cf2bb Always use the Windows version of splitdrive when parsing volume mappings
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-05-17 16:33:59 -07:00
Joffrey F 844b7d463f Update rm command to always remove one-off containers.
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-05-16 14:59:33 -07:00
Joffrey F 310b3d9441 Properly handle APIError failures in Project.up
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-05-02 13:42:05 -07:00
Joffrey F 0b24883cef Support combination of shorthand flag and equal sign for host option
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-04-28 12:52:00 -07:00
Aanand Prasad 756ef14edc Fix format of 'restart' option in 'config' output
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-26 19:21:03 +01:00
Aanand Prasad 6064d200f9 Fix output of 'config' for v1 files
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-26 19:21:03 +01:00
Aanand Prasad 84a3e2fe79 Check full error message in test_up_with_net_is_invalid
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-26 19:21:03 +01:00
Aanand Prasad a4d3dd6197 Remove v2_only decorators on config tests
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-26 19:21:03 +01:00
Patrice FERLET ba10f1cd55 Fix the tests from jenkins
Acceptance tests didn't set "help" command to return "0" EXIT_CODE.

close #3354
related #3263

Signed-off-by: Patrice Ferlet <metal3d@gmail.com>
2016-04-20 13:23:37 +02:00
Aanand Prasad 984f839d33 Merge pull request #3263 from twitherspoon/3191_2_help_cli_feature
Added code to support no argument help command
2016-04-19 12:14:24 +01:00
Aanand Prasad 52fa010ac7 Merge pull request #3337 from dnephin/check_for_short_id_alias
Check for short id alias, and don't disconnect if it already exists
2016-04-19 12:12:43 +01:00
johnharris85 6d2805917c Account for aliased links
Fix failing tests
Signed-off-by: John Harris <john@johnharris.io>
2016-04-17 15:25:06 -04:00
johnharris85 377be5aa1f Adding tests
Signed-off-by: John Harris <john@johnharris.io>
2016-04-17 14:01:06 -04:00
Daniel Nephin 56c6e29819 Unit test for skipping network disconnect.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-04-15 16:28:59 -04:00
Danyal Prout 339ebc0483 Fixes #2096: Only show multiple port clash warning if multiple containers
are about to be started.

Signed-off-by: Danyal Prout <me@dany.al>
2016-04-12 20:58:21 +01:00
Tony Witherspoon ae46bf8907 Updated StringIO import to support io module
Signed-off-by: Tony Witherspoon <tony.witherspoon@gmail.com>
2016-04-12 12:29:59 -04:00
Tony Witherspoon 276738f733 Updated cli_test.py to validate against the updated help command conditions
Signed-off-by: Tony Witherspoon <tony.witherspoon@gmail.com>
2016-04-12 11:47:15 -04:00
Aanand Prasad 7781f62ddf Attempt to fix flaky logs test
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-12 12:07:13 +01:00
Aanand Prasad 15c5bc2e6c Rename a couple of functions in parallel.py
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-11 13:05:30 +01:00
Daniel Nephin 83df95d511 Remove extra ensure_image_exists() which causes duplicate builds.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-04-08 15:21:12 -04:00
Aanand Prasad ffab27c049 Test events coming out of parallel_execute_stream in error case
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 18:53:16 +01:00
Aanand Prasad 3720b50c3b Extract get_deps test helper
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 18:48:07 +01:00
Aanand Prasad 141b96bb31 Abort operations if their dependencies fail
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 17:51:09 +01:00
Tony Witherspoon f5b80640fe Merge branch '3191_2_help_cli_feature' of https://github.com/twitherspoon/compose into 3191_2_help_cli_feature 2016-04-07 12:46:27 -04:00
Tony Witherspoon 5d0aab4a8e updated cli_test.py to no longer expect raised SystemExit exceptions
Signed-off-by: Tony Witherspoon <tony.witherspoon@gmail.com>
2016-04-07 12:42:14 -04:00
Daniel Nephin b33d7b3dd8 Prevent unnecessary inspection of containers when created from an inspect.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-04-06 11:14:42 -04:00
Joffrey F d27b82207c Remove obsolete assert_hostname tests
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-30 10:58:15 -07:00
Joffrey F 7116aefe43 Fix assert_hostname logic in tls_config_from_options
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-28 17:39:20 -07:00
Joffrey F 12ad3ff301 Injecting os.environ in Environment instance happens outside of init method
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:28 -07:00
Joffrey F b99037b4a6 Add support for DOCKER_* variables in .env file
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:28 -07:00
Joffrey F 36f1b4589c Limit occurrences of creating an environment object.
.env file is always read from the project_dir

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:01 -07:00
Joffrey F f48da96e8b Test get_project_name from env file
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:01 -07:00
Joffrey F d55fc85fea Added default env file test.
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:01 -07:00
Joffrey F 1801f83bb8 Environment class cleanup
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:01 -07:00
Joffrey F fd020ed2cf Tests use updated get_config_paths_from_options signature
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:01 -07:00
Joffrey F 5831b869e8 Update tests for new environment handling
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:01 -07:00
Joffrey F c69d8a3bd2 Implement environment singleton to be accessed throughout the code
Load and parse environment file from working dir

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-24 10:57:01 -07:00
Daniel Nephin 732531b722 Disable a test that is failing against 1.11.0rc1.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-24 12:32:13 -04:00
Aanand Prasad c3eca82749 Merge pull request #3128 from dnephin/add_network_settings_to_config_hash
Include network settings as part of the service config hash.
2016-03-23 17:01:32 +00:00
Joffrey F 2cc87555cb tls_config_from_options unit tests
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-22 11:57:45 -07:00
Aanand Prasad aaa7b09369 Merge pull request #3181 from dnephin/fix_partial_change_test_failure
Fix flaky partial_change state test
2016-03-22 10:14:28 +00:00
Aanand Prasad a20b84e6d2 Merge pull request #3178 from aanand/2774-off-one-offs
Remove one-off containers in `rm` and `down`
2016-03-22 10:12:21 +00:00
Daniel Nephin 5c968f9e15 Fix flaky partial_change state test.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-21 19:07:50 -04:00
Daniel Nephin be1476f24b Only allow tmpfs on v2.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-21 14:41:28 -04:00
Aanand Prasad 2bf5e46857 Stop and remove still-running one-off containers in 'down'
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-03-21 18:08:07 +00:00
Aanand Prasad a2317dfac2 Remove one-off containers in 'docker-compose down'
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-03-21 16:15:49 +00:00
Joffrey F 5826a2147b Use enum to represent 3 possible states of the one_off filter
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-21 12:12:52 +00:00
Joffrey F 187ea4cd81 Add --all option to rm command - remove one-off containers
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-21 12:12:52 +00:00
Daniel Nephin dfac48f3f5 Make a new flaky test less flaky.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-18 18:20:03 -04:00
Daniel Nephin 089ec66522 Include network settings as part of the service config hash.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-18 18:20:03 -04:00
Philip Walls 85c7d3e5ce Add support for docker run --tmpfs flag.
Signed-off-by: Philip Walls <pawalls@rabidgeek.com>
2016-03-18 18:19:48 -04:00
Daniel Nephin 25cbc2aae9 Fix flaky network test.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-18 18:19:16 -04:00
Thomas Grainger 20bf05a6e3 Fix TypeError in Exception handling
Traceback (most recent call last):
  File "/tmp/tmp.02tgGaAGtW/docker-compose/bin/docker-compose", line 11, in <module>
    sys.exit(main())
  File "/tmp/tmp.02tgGaAGtW/docker-compose/lib/python3.4/site-packages/compose/cli/main.py", line 68, in main
    log_api_error(e)
  File "/tmp/tmp.02tgGaAGtW/docker-compose/lib/python3.4/site-packages/compose/cli/main.py", line 89, in log_api_error
    if 'client is newer than server' in e.explanation:
TypeError: 'str' does not support the buffer interface

Signed-off-by: Thomas Grainger <tagrain@gmail.com>
2016-03-17 15:13:01 +00:00
Aanand Prasad 371ea479f5 Merge pull request #3075 from dnephin/reactive_logs
Display logs for new containers started after the command is run
2016-03-16 21:03:25 +00:00
Aanand Prasad abddabfb0a Merge pull request #3135 from dnephin/fix_down_idempotency
Make down idempotent, continue to remove resources if one is missing
2016-03-16 20:26:18 +00:00
Joffrey F dd40331b44 Merge pull request #3102 from shin-/1477-a-modest-proposal
Add flag to up/down to remove orphaned containers
2016-03-16 10:58:15 -07:00
Joffrey F 20c29f7e47 Add flag to up/down to remove orphaned containers
Add --remove-orphans to CLI reference docs
Add --remove-orphans to bash completion file
Test orphan warning and remove_orphan option in up

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-15 16:11:49 -07:00
Simon van der Veldt 658803edf8 Add -w or --workdir to compose run to override workdir from commandline
Signed-off-by: Simon van der Veldt <simon.vanderveldt@gmail.com>
2016-03-15 15:28:32 -04:00
Daniel Nephin bf96edfe11 Reduce the args of some functions by including presenters as part of the thread_args.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-15 15:15:00 -04:00
Daniel Nephin e5529a89e1 Make down idempotent, continue to remove resources if one is missing.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-15 13:26:29 -04:00
Daniel Nephin e8a93821d4 Fix race condition where a container stopping and starting again would cause logs to miss logs.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-15 13:17:11 -04:00
Daniel Nephin 8d9adc0902 Fix flaky log test by using container status, instead of boolean state.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-15 13:17:10 -04:00
Daniel Nephin 48ed68eeaa Fix geneartors for python3.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-15 13:17:10 -04:00
Daniel Nephin 4312c93eae Add an acceptance test to show logs behaves properly for stopped containers.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-15 13:17:10 -04:00
Daniel Nephin 44c1747127 Add tests for reactive log printing.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-15 13:17:10 -04:00
Daniel Nephin 65797558f8 Refactor log printing to support containers that are started later.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-15 13:17:10 -04:00
Ilya Skriblovsky 5df774bd10 Fixed testing error handling by `up`
Signed-off-by: Ilya Skriblovsky <IlyaSkriblovsky@gmail.com>
2016-03-14 22:55:42 +03:00
Ilya Skriblovsky f933381a12 Dependency-ordered start/stop/up
Signed-off-by: Ilya Skriblovsky <IlyaSkriblovsky@gmail.com>
2016-03-14 22:55:42 +03:00
Aanand Prasad e5cd869c61 Merge pull request #3095 from dnephin/refactor_command_dispatch
Refactor command dispatch and fix api version mismatch error
2016-03-14 16:18:29 +00:00
Matt Daue ee136446a2 Fix #2804: Add ipv4 and ipv6 static addressing
- Added ipv4_network and ipv6_network to the networks section in the
  service section for each configured network
- Added feature documentation
- Added unit tests

Signed-off-by: Matt Daue <mattdaue@gmail.com>
2016-03-09 18:37:52 -05:00
Joffrey F 7033042656 Merge pull request #3039 from dbonev/3020-build-arguments-object-syntax
Allowing null for build args
2016-03-09 10:55:05 -08:00
Daniel Nephin 0a091055d2 Improve handling of connection errors and error messages.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-08 15:39:11 -05:00
Daniel Nephin 886328640f Convert some cli tests to pytest.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-08 14:42:51 -05:00
Daniel Nephin 9f9dcc098a Make TopLevelCommand use the project field.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-08 14:36:53 -05:00
Daniel Nephin 53bea8a720 Refactor command dispatch to improve unit testing and support better error messages.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-08 14:23:27 -05:00
Joffrey F d2b065e615 Don't raise ConfigurationError for volume driver mismatch
when driver is unspecified

Add testcase

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-07 18:07:41 -08:00
Dimitar Bonev 81b7fba33e Allowing null for build args
Signed-off-by: Dimitar Bonev <dimitar.bonev@gmail.com>
2016-03-05 15:57:06 +02:00
Aanand Prasad 9e242cdc75 Merge pull request #3032 from dnephin/multiple_files_from_env_var
Support multiple files in COMPOSE_FILE env var
2016-03-03 17:23:22 +00:00
Aanand Prasad 4ae71f41dd Merge pull request #2832 from aanand/refactor-cli-unit-tests
Refactor CLI initialization and unit tests
2016-03-02 16:10:44 -08:00
Daniel Nephin 53a3d14046 Support multiple files in COMPOSE_FILE env var.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-02 18:47:58 -05:00
Aanand Prasad 20caf02bf6 Create real Project objects in CLI unit tests
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-03-02 15:11:34 -08:00
Aanand Prasad 4644f2c0f9 Remove environment-overriding unit test for 'run'
There's already an acceptance test for it

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-03-02 15:11:32 -08:00
Aanand Prasad 575b48749d Remove unused global_options arg from dispatch()
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-03-02 15:09:48 -08:00
Aanand Prasad 2c75a8fdf5 Extract helper methods for building config objects from dicts
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-03-02 15:09:48 -08:00
Aanand Prasad f75408923e Merge pull request #3053 from dnephin/handle_booleans_in_mappings
Don't allow booleans for mapping types
2016-03-02 15:04:20 -08:00
Aanand Prasad 3f98c0716e Merge pull request #3052 from dnephin/merge_v1_logging
Fix merging of logging options in v1 config
2016-03-02 15:03:36 -08:00
Daniel Nephin e1b87d7be0 Update reference docs for the new flag.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-02 15:32:51 -05:00
Daniel Nephin b7fb3a6d9b Add --build flag for up and create
Also adds a warning when up builds an image without the --build flag
so that users know it wont happen on the next up.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-02 15:32:51 -05:00
Aanand Prasad 0b3561a7d5 Merge pull request #2720 from seguins/2227-improvements-logs
Add flags on logs
2016-03-01 17:41:31 -08:00
Stéphane Seguin 038da4eea3 Logs args of LogPrinter as a dictionary
Signed-off-by: Stéphane Seguin <stephseguin93@gmail.com>
2016-03-01 20:24:15 +01:00
Stéphane Seguin 9b36dc5c54 Add --tail flag as option on logs.
Closes #265
Signed-off-by: Stéphane Seguin <stephseguin93@gmail.com>
2016-03-01 20:23:46 +01:00
Stéphane Seguin d9b4286f91 Add -t, --timestamps flag as option on logs.
Signed-off-by: Stéphane Seguin <stephseguin93@gmail.com>
2016-03-01 20:23:46 +01:00
Stéphane Seguin 82632098a3 Add -f, --follow flag as option on logs.
Closes #2187
Signed-off-by: Stéphane Seguin <stephseguin93@gmail.com>
2016-03-01 20:23:43 +01:00
Daniel Nephin 18510b4024 Don't allow booleans for mapping types.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-01 11:57:35 -05:00
Daniel Nephin b726f508a6 Fix merging of logging options in v1 config.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-01 11:43:26 -05:00
Aanand Prasad 210856179d Merge pull request #3036 from JesusTinoco/master
Display in the log output the name of those containers created using …
2016-02-29 15:17:14 -08:00
Jesus 6bfb23baaa Display containers name when scale a container
Display in the log output the name of those containers created using the scale command and
change the test_scale_with_api_error test to support the containers name when scale

Signed-off-by: Jesus Rodriguez Tinoco <jesus.rodriguez.tinoco@gmail.com>
2016-02-29 20:19:03 +01:00
Tomas Tomecek d28c5dda92 implement exec
Resolves #593

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2016-02-29 10:50:09 +01:00
Aanand Prasad adb8de367e Merge pull request #2388 from dnephin/fix_long_lines
Wrap long lines
2016-02-25 16:52:33 -08:00
Aanand Prasad 42f4d814d7 Merge pull request #2880 from dnephin/merge_jsonschemas
Merge jsonschemas to a single schema file per version
2016-02-25 16:51:56 -08:00
Daniel Nephin dc3a5ce624 Refactor config validation to support constraints in the same jsonschema
Reworked the two schema validation functions to read from the same schema but
use different parts of it. Error handling is now split as well by the
schema that is being used to validate.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-24 16:20:17 -08:00
Daniel Nephin 43ecf8793a Address old TODO, and small refactor of container name logic in service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-24 16:19:38 -08:00
Daniel Nephin d451578152 Make environment variables without a value the same as docker-cli.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-23 11:14:59 -08:00
Daniel Nephin 4b04280db8 Revert "Change special case from '_', None to ()"
This reverts commit 677c50650c.

Revert "Modify service_test.py::ServiceTest::test_resolve_env to reflect new behavior"

This reverts commit 0019037712.

Revert "Mangle the tests. They pass for better or worse!"

This reverts commit 7ab9509ce6.

Revert "If an env var is passthrough but not defined on the host don't set it."

This reverts commit 6540efb3d3.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-23 11:13:57 -08:00
Daniel Nephin 1d67e6f0f0 Merge pull request #2995 from dnephin/fix_warning_about_bools
Fix warning about boolean values
2016-02-23 11:11:54 -08:00
Daniel Nephin ba799d2e86 Merge pull request #2996 from dnephin/fix_abort_on_container_exit
Fix abort on container exit
2016-02-23 10:52:12 -08:00
Richard Bann bf2bf21720 Add failing test for --abort-on-container-exit
Handle --abort-on-container-exit. Fixes #2940

Signed-off-by: Richard Bann <richardbann@gmail.com>
2016-02-22 16:39:40 -08:00
Daniel Nephin 0a06d827fa Fix warning about boolean values.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-22 14:56:01 -08:00
Daniel Nephin d5514965d5 Merge pull request #2975 from dnephin/fix_crash_on_none_in_config
Fix validation message when there are multiple nested oneOf validations.
2016-02-19 15:53:26 -05:00
Daniel Nephin 02535f0cf1 Fix validation message when there are multiple ested oneOf validations.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-19 14:22:55 -05:00
Daniel Nephin 0d218c34c7 Make config validation error messages more consistent.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-19 13:12:57 -05:00
Daniel Nephin 4b2a666231 Validate that each section of the config is a mapping before running interpolation.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-19 12:38:52 -05:00
Joffrey F 7152f7ea76 Handle mismatched network formats in config files
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-02-18 15:24:41 -08:00
Joffrey F 825a0941f0 Network aliases are now part of the network dictionary
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-02-18 15:23:47 -08:00
Joffrey F 4b99b32ffb Add v2_only decorator to network aliases test
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-02-18 15:23:47 -08:00
Joffrey F 633e349ab9 Test network_aliases feature
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-02-18 15:23:46 -08:00
Joffrey F d3a95c2892 Merge pull request #2938 from shin-/2927-buildargs-types
Constraint build argument types. Numbers are cast into strings.
2016-02-18 15:07:09 -08:00
Daniel Nephin 4f7530c480 Only set a container affinity if there are volumes to copy over.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-17 22:35:14 -05:00
Joffrey F 1952b52392 Constraint build argument types. Numbers are cast into strings
Numerical driver_opts are also valid and typecast into strings.
Additional config tests.

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-02-17 11:53:29 -08:00
Daniel Nephin 4a09da43ea Fix copying of volumes by using the name of the volume instead of the host path.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-17 13:34:14 -05:00
Daniel Nephin 74dc1b1411 Merge pull request #2893 from shin-/2833-run-dependencies
Bring up all dependencies when running a single service.
2016-02-12 16:33:01 -05:00
Joffrey F a8fda480e3 driver_opts can only be of type string
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-02-12 10:51:11 -08:00
Joffrey F 367fabdbfa Bring up all dependencies when running a single service.
Added test for running a depends_on service

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-02-12 09:46:10 -08:00
Daniel Nephin 532dffd688 Fix build section without context.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-11 14:12:02 -05:00
Daniel Nephin 740329a131 Shm_size requires docker 1.10.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-11 13:50:23 -05:00
Aanand Prasad 23ab2c7e44 Merge pull request #2878 from dnephin/merge_build_args
Merge build.args when merging services
2016-02-11 17:41:41 +00:00
Spencer Rinehart 5e6dc3521c Add support for shm_size. Fixes #2823.
shm_size controls the size of /dev/shm in the container and requires
Docker 1.10 or newer (API version 1.22).  This requires docker-py 1.8.0
(docker/docker-py#923).

Similar to fields like `mem_limit`, `shm_size` may be specified as
either an integer or a string (e.g., `64M`).

Updating docker-py to the master branch in order to get the unreleased
dependency on `shm_size` there in place.

Signed-off-by: Spencer Rinehart <anubis@overthemonkey.com>
2016-02-10 15:25:18 -06:00
Daniel Nephin 37564a73c3 Merge build.args when merging services.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-10 13:54:40 -05:00
Aanand Prasad 7b5bad6050 Merge pull request #2851 from cr7pt0gr4ph7/2839-fix-networks-merging
Fix merge behavior for 'networks' and 'network_mode'.
2016-02-10 17:51:01 +00:00
Daniel Nephin 6f06b3bd30 Merge pull request #2853 from dnephin/fix_short_id_alias
Use 12 characters for the short id
2016-02-09 14:56:24 -05:00
cr7pt0gr4ph7 582de19a5a Simplify unit tests in config/config_test.py by using class variables instead of methods for parametrizing tests.
Signed-off-by: cr7pt0gr4ph7 <cr7pt0gr4ph7@gmail.com>
2016-02-08 21:57:15 +01:00
Joffrey F fdf4a2e89e Merge pull request #2734 from jrabbit/empty-env-var-2359
Empty env var #2359
2016-02-08 11:17:54 -08:00
Daniel Nephin 421981e7d2 Use 12 characters for the short id to match docker and fix backwards compatibility.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-08 12:18:48 -05:00
Lukas Waslowski e929086c49 Separate MergePortsTest from MergeListsTest and add MergeNetworksTest.
Signed-off-by: Lukas Waslowski <cr7pt0gr4ph7@gmail.com>
2016-02-08 14:29:03 +01:00
Daniel Nephin 57fc85b457 Wrap long lines and restrict lines to 105 characters.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-04 19:05:39 -05:00
Aanand Prasad be236d8801 Update docker-py and dockerpty
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-02-04 19:16:01 +00:00
Daniel Nephin 89c5b800e6 Merge pull request #2782 from dbonev/2772-compose-project-name-empty
Falling back to default project name on empty COMPOSE_PROJECT_NAME
2016-02-02 20:37:38 -05:00
Daniel Nephin 4c4e94bc19 Merge pull request #2785 from dnephin/depends_on_with_extends
Fix list options when used with extends and multiple files
2016-02-02 13:36:46 -05:00
Daniel Nephin 3d3388d59b Extract volume init and removal from project.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-02 10:53:04 -05:00
Daniel Nephin e551988616 Include networks in the config_hash.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-02 10:52:03 -05:00
Daniel Nephin 0810eeba10 Don't initialize networks that aren't used by any services.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-02 10:52:03 -05:00
Daniel Nephin 8e838968fe Refactor project network initlization.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-02 10:51:31 -05:00
Daniel Nephin 3ec87adccc Update merge docs with depends_on, and correction about how links and volumes_from are merged.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-02 10:49:43 -05:00
Daniel Nephin bf6a5d3e49 Fix merging of lists with multiple files.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-02-02 10:48:18 -05:00
Aanand Prasad 1152c5b25b Tweak and test warning shown when version is a dict
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-02-02 13:58:34 +00:00
Aanand Prasad ef8db3650a Improve error messages for invalid versions
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-02-02 13:58:34 +00:00
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 4ac004059a Normalise/fix config field designators in validation messages
- Instead of "Service 'web' configuration key 'image'", just say
  "web.image"

- Fix the "Service 'services'" bug in the v2 file format

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-02-02 13:47:43 +00:00
Aanand Prasad d40bc6e4a0 Convert validation error tests to pytest style
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-02-02 13:47:43 +00:00
Dimitar Bonev 34ccb90d7e Falling back to default project name when COMPOSE_PROJECT_NAME is set to empty
Signed-off-by: Dimitar Bonev <dimitar.bonev@gmail.com>
2016-01-30 10:14:45 +02:00
Daniel Nephin b4868d0259 Fix race condition with up and setting signal handlers.
Also print stdout on wait_for_container().

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-29 13:04:04 -05:00
Daniel Nephin 883e45626f Merge pull request #2706 from dnephin/dont_copy_host_volumes
Don't copy host volumes on recreate
2016-01-28 15:02:53 -05:00
Aanand Prasad 650b0cec38 Remove ability to join bridge network + user-defined networks
Containers connected to the bridge network can't have aliases, so it's
simpler to rule that they can *either* be connected to the bridge
network (via `network_mode: bridge`) *or* be connected to user-defined
networks (via `networks` or the default network).

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-27 00:42:09 +00:00
Aanand Prasad ed1b204804 Rename 'net' to 'network mode' in various classes/methods
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-25 23:55:20 +00:00
Aanand Prasad a9c623fdf2 Test that net can be extended
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-25 23:55:20 +00:00
Aanand Prasad e566a4dc1c Implement network_mode in v2
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-25 23:24:55 +00:00
Aanand Prasad a267d8fe3c Merge pull request #2728 from shin-/2709_service_volumes
Match named volumes in service definitions with declared volumes
2016-01-25 23:24:09 +00:00
Joffrey F af6b18cad8 Merge pull request #2746 from aanand/alias-containers-by-short-id
Alias containers by short id
2016-01-25 13:55:30 -08:00
Aanand Prasad 313c584185 Alias containers by short id
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-25 16:14:21 +00:00
jrabbit 0019037712 Modify service_test.py::ServiceTest::test_resolve_env to reflect new behavior
Signed-off-by: jrabbit <jackjrabbit@gmail.com>
2016-01-24 15:25:06 -05:00
jrabbit 7ab9509ce6 Mangle the tests. They pass for better or worse!
Signed-off-by: jrabbit <jackjrabbit@gmail.com>
2016-01-23 16:19:17 -05:00
Joffrey F 139c7f7830 Move named volumes matching to config validation phase
Signed-off-by: Joffrey F <joffrey@docker.com>
2016-01-22 17:42:24 -08:00
Joffrey F 48377a354f is_named_volume also tests for home paths ~
Fix bug with VolumeSpec not being updated
Fix integration test

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-01-22 16:05:21 -08:00
Dimitar Bonev 3a72edb906 Network fields schema validation
Signed-off-by: Dimitar Bonev <dimitar.bonev@gmail.com>
2016-01-22 16:42:10 +02:00
Joffrey F 9e67eae311 Match named volumes in service definitions with declared volumes
Raise ConfigurationError for undeclared named volumes
Test new behavior

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-01-21 18:10:53 -08:00
Aanand Prasad da2b6329ae Add test for logs=False
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>

Conflicts:
	compose/cli/main.py
2016-01-21 19:20:50 +00:00
Aanand Prasad f3e55568d1 Fix interactive run with networking
Make sure we connect the container to all required networks *after*
starting the container and *before* hijacking the terminal.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-21 18:42:59 +00:00
Aanand Prasad a14906fd35 Fix 'run' behaviour with networks
- Test that one-off containers join all networks
- Don't set any aliases

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-21 17:28:55 +00:00