From 60f8ce09f9b512536ce731a693446f6279ecd939 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Fri, 11 Jan 2019 17:43:47 +0100 Subject: [PATCH 01/27] "Bump 1.24.0-rc1" Signed-off-by: Djordje Lukic --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ compose/__init__.py | 2 +- script/run/run.sh | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a7a2ffe9..e294a209a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,42 @@ Change log ========== +1.24.0 (2019-01-25) +------------------- + +### Features + +- Added support for connecting to the Docker Engine using the `ssh` protocol. + +- Added a `--all` flag to `docker-compose ps` to include stopped one-off containers + in the command's output. + +### Bugfixes + +- Fixed a bug where some valid credential helpers weren't properly handled by Compose + when attempting to pull images from private registries. + +- Fixed an issue where the output of `docker-compose start` before containers were created + was misleading + +- To match the Docker CLI behavior and to avoid confusing issues, Compose will no longer + accept whitespace in variable names sourced from environment files. + +- Compose will now report a configuration error if a service attempts to declare + duplicate mount points in the volumes section. + +- Fixed an issue with the containerized version of Compose that prevented users from + writing to stdin during interactive sessions started by `run` or `exec`. + +- One-off containers started by `run` no longer adopt the restart policy of the service, + and are instead set to never restart. + +- Fixed an issue that caused some container events to not appear in the output of + the `docker-compose events` command. + +- Missing images will no longer stop the execution of `docker-compose down` commands + (a warning will be displayed instead). + 1.23.2 (2018-11-28) ------------------- diff --git a/compose/__init__.py b/compose/__init__.py index 652e1fad9..bc5e6b116 100644 --- a/compose/__init__.py +++ b/compose/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from __future__ import unicode_literals -__version__ = '1.24.0dev' +__version__ = '1.24.0-rc1' diff --git a/script/run/run.sh b/script/run/run.sh index cc36e4751..df3f2298f 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -15,7 +15,7 @@ set -e -VERSION="1.23.2" +VERSION="1.24.0-rc1" IMAGE="docker/compose:$VERSION" From 200795173168aeb5aeccaa9184d972a7a28ad600 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Fri, 11 Jan 2019 17:57:05 +0100 Subject: [PATCH 02/27] "Bump 1.24.0-rc1" Signed-off-by: Djordje Lukic --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e294a209a..c5eb1bb4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ Change log - Fixed an issue where the output of `docker-compose start` before containers were created was misleading - + - To match the Docker CLI behavior and to avoid confusing issues, Compose will no longer accept whitespace in variable names sourced from environment files. @@ -31,7 +31,7 @@ Change log - One-off containers started by `run` no longer adopt the restart policy of the service, and are instead set to never restart. -- Fixed an issue that caused some container events to not appear in the output of +- Fixed an issue that caused some container events to not appear in the output of the `docker-compose events` command. - Missing images will no longer stop the execution of `docker-compose down` commands From 0f3d4ddaa7b8262f964f2c42d502e5a65d28cc64 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Fri, 11 Jan 2019 18:28:30 +0100 Subject: [PATCH 03/27] "Bump 1.24.0-rc1" Signed-off-by: Djordje Lukic --- script/release/release/repository.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/release/release/repository.py b/script/release/release/repository.py index 9a5d432c0..bb8f4fbeb 100644 --- a/script/release/release/repository.py +++ b/script/release/release/repository.py @@ -219,6 +219,8 @@ def get_contributors(pr_data): commits = pr_data.get_commits() authors = {} for commit in commits: + if not commit.author: + continue author = commit.author.login authors[author] = authors.get(author, 0) + 1 return [x[0] for x in sorted(list(authors.items()), key=lambda x: x[1])] From 3934617e379e5c75ba5fc6aa7e518c2108165167 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Tue, 15 Jan 2019 09:01:49 +0100 Subject: [PATCH 04/27] Add bash completion for `ps --all|-a` Signed-off-by: Harald Albers --- contrib/completion/bash/docker-compose | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker-compose b/contrib/completion/bash/docker-compose index 395888d34..5938ff9e2 100644 --- a/contrib/completion/bash/docker-compose +++ b/contrib/completion/bash/docker-compose @@ -361,7 +361,7 @@ _docker_compose_ps() { case "$cur" in -*) - COMPREPLY=( $( compgen -W "--help --quiet -q --services --filter" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--all -a --filter --help --quiet -q --services" -- "$cur" ) ) ;; *) __docker_compose_complete_services From 82a89aef1c15a5419097fde5039c837f2af8d9ae Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Wed, 16 Jan 2019 13:47:23 +0100 Subject: [PATCH 05/27] Support for credential_spec Signed-off-by: Djordje Lukic --- compose/cli/main.py | 4 ++-- compose/config/config.py | 23 ++++++++++++++++++++++- compose/config/validation.py | 12 ++++++++++++ contrib/completion/zsh/_docker-compose | 2 +- tests/unit/config/config_test.py | 6 +++++- 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/compose/cli/main.py b/compose/cli/main.py index 950e5055d..789601792 100644 --- a/compose/cli/main.py +++ b/compose/cli/main.py @@ -206,8 +206,8 @@ class TopLevelCommand(object): name specified in the client certificate --project-directory PATH Specify an alternate working directory (default: the path of the Compose file) - --compatibility If set, Compose will attempt to convert deploy - keys in v3 files to their non-Swarm equivalent + --compatibility If set, Compose will attempt to convert keys + in v3 files to their non-Swarm equivalent Commands: build Build or rebuild services diff --git a/compose/config/config.py b/compose/config/config.py index 3df211f73..e2ed29a47 100644 --- a/compose/config/config.py +++ b/compose/config/config.py @@ -51,6 +51,7 @@ from .validation import match_named_volumes from .validation import validate_against_config_schema from .validation import validate_config_section from .validation import validate_cpu +from .validation import validate_credential_spec from .validation import validate_depends_on from .validation import validate_extends_file_path from .validation import validate_healthcheck @@ -369,7 +370,6 @@ def check_swarm_only_config(service_dicts, compatibility=False): ) if not compatibility: check_swarm_only_key(service_dicts, 'deploy') - check_swarm_only_key(service_dicts, 'credential_spec') check_swarm_only_key(service_dicts, 'configs') @@ -706,6 +706,7 @@ def validate_service(service_config, service_names, config_file): validate_depends_on(service_config, service_names) validate_links(service_config, service_names) validate_healthcheck(service_config) + validate_credential_spec(service_config) if not service_dict.get('image') and has_uppercase(service_name): raise ConfigurationError( @@ -894,6 +895,7 @@ def finalize_service(service_config, service_names, version, environment, compat normalize_build(service_dict, service_config.working_dir, environment) if compatibility: + service_dict = translate_credential_spec_to_security_opt(service_dict) service_dict, ignored_keys = translate_deploy_keys_to_container_config( service_dict ) @@ -930,6 +932,25 @@ def convert_restart_policy(name): raise ConfigurationError('Invalid restart policy "{}"'.format(name)) +def convert_credential_spec_to_security_opt(credential_spec): + if 'file' in credential_spec: + return 'file://{file}'.format(file=credential_spec['file']) + return 'registry://{registry}'.format(registry=credential_spec['registry']) + + +def translate_credential_spec_to_security_opt(service_dict): + result = [] + + if 'credential_spec' in service_dict: + spec = convert_credential_spec_to_security_opt(service_dict['credential_spec']) + result.append('credentialspec={spec}'.format(spec=spec)) + + if result: + service_dict['security_opt'] = result + + return service_dict + + def translate_deploy_keys_to_container_config(service_dict): if 'credential_spec' in service_dict: del service_dict['credential_spec'] diff --git a/compose/config/validation.py b/compose/config/validation.py index 039569551..1cceb71f0 100644 --- a/compose/config/validation.py +++ b/compose/config/validation.py @@ -240,6 +240,18 @@ def validate_depends_on(service_config, service_names): ) +def validate_credential_spec(service_config): + credential_spec = service_config.config.get('credential_spec') + if not credential_spec: + return + + if 'registry' not in credential_spec and 'file' not in credential_spec: + raise ConfigurationError( + "Service '{s.name}' is missing 'credential_spec.file' or " + "credential_spec.registry'".format(s=service_config) + ) + + def get_unsupported_config_msg(path, error_key): msg = "Unsupported config option for {}: '{}'".format(path_string(path), error_key) if error_key in DOCKER_CONFIG_HINTS: diff --git a/contrib/completion/zsh/_docker-compose b/contrib/completion/zsh/_docker-compose index e55c91964..5fd418a69 100755 --- a/contrib/completion/zsh/_docker-compose +++ b/contrib/completion/zsh/_docker-compose @@ -339,7 +339,7 @@ _docker-compose() { '(- :)'{-h,--help}'[Get help]' \ '*'{-f,--file}"[${file_description}]:file:_files -g '*.yml'" \ '(-p --project-name)'{-p,--project-name}'[Specify an alternate project name (default: directory name)]:project name:' \ - "--compatibility[If set, Compose will attempt to convert deploy keys in v3 files to their non-Swarm equivalent]" \ + "--compatibility[If set, Compose will attempt to convert keys in v3 files to their non-Swarm equivalent]" \ '(- :)'{-v,--version}'[Print version and exit]' \ '--verbose[Show more output]' \ '--log-level=[Set log level]:level:(DEBUG INFO WARNING ERROR CRITICAL)' \ diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index 8baf8e4ee..c2e6b7b07 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -3593,6 +3593,9 @@ class InterpolationTest(unittest.TestCase): 'reservations': {'memory': '100M'}, }, }, + 'credential_spec': { + 'file': 'spec.json' + }, }, }, }) @@ -3610,7 +3613,8 @@ class InterpolationTest(unittest.TestCase): 'mem_limit': '300M', 'mem_reservation': '100M', 'cpus': 0.7, - 'name': 'foo' + 'name': 'foo', + 'security_opt': ['credentialspec=file://spec.json'], } @mock.patch.dict(os.environ) From 1f9b20d97bfb5af7cf64544c0e5d1613cc57ebdc Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Mon, 21 Jan 2019 19:13:45 +0100 Subject: [PATCH 06/27] Add `--parallel` to `docker build`'s options in `bash` and `zsh` completion Signed-off-by: Ulysses Souza --- contrib/completion/bash/docker-compose | 2 +- contrib/completion/zsh/_docker-compose | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker-compose b/contrib/completion/bash/docker-compose index 5938ff9e2..2add0c9cd 100644 --- a/contrib/completion/bash/docker-compose +++ b/contrib/completion/bash/docker-compose @@ -114,7 +114,7 @@ _docker_compose_build() { case "$cur" in -*) - COMPREPLY=( $( compgen -W "--build-arg --compress --force-rm --help --memory --no-cache --pull" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--build-arg --compress --force-rm --help --memory --no-cache --pull --parallel" -- "$cur" ) ) ;; *) __docker_compose_complete_services --filter source=build diff --git a/contrib/completion/zsh/_docker-compose b/contrib/completion/zsh/_docker-compose index 5fd418a69..d25256c14 100755 --- a/contrib/completion/zsh/_docker-compose +++ b/contrib/completion/zsh/_docker-compose @@ -117,6 +117,7 @@ __docker-compose_subcommand() { '--no-cache[Do not use cache when building the image.]' \ '--pull[Always attempt to pull a newer version of the image.]' \ '--compress[Compress the build context using gzip.]' \ + '--parallel[Build images in parallel.]' \ '*:services:__docker-compose_services_from_build' && ret=0 ;; (bundle) From 4585db124a9a51e3f58f2714c40e097c4eb568a9 Mon Sep 17 00:00:00 2001 From: Christopher Crone Date: Tue, 5 Feb 2019 10:40:03 +0100 Subject: [PATCH 07/27] macOS: Bump Python and OpenSSL Signed-off-by: Christopher Crone --- script/setup/osx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/setup/osx b/script/setup/osx index 08491b6e5..1b546816d 100755 --- a/script/setup/osx +++ b/script/setup/osx @@ -13,13 +13,13 @@ if ! [ ${DEPLOYMENT_TARGET} == "$(macos_version)" ]; then SDK_SHA1=dd228a335194e3392f1904ce49aff1b1da26ca62 fi -OPENSSL_VERSION=1.1.0h +OPENSSL_VERSION=1.1.0j OPENSSL_URL=https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -OPENSSL_SHA1=0fc39f6aa91b6e7f4d05018f7c5e991e1d2491fd +OPENSSL_SHA1=dcad1efbacd9a4ed67d4514470af12bbe2a1d60a -PYTHON_VERSION=3.6.6 +PYTHON_VERSION=3.6.8 PYTHON_URL=https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -PYTHON_SHA1=ae1fc9ddd29ad8c1d5f7b0d799ff0787efeb9652 +PYTHON_SHA1=09fcc4edaef0915b4dedbfb462f1cd15f82d3a6f # # Install prerequisites. From 28310b3ba4fe77d53b684dc6930f1e18f01e1564 Mon Sep 17 00:00:00 2001 From: Christopher Crone Date: Tue, 5 Feb 2019 10:50:25 +0100 Subject: [PATCH 08/27] requirements-dev: Fix version of mock to 2.0.0 Signed-off-by: Christopher Crone --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4d74f6d15..bfb941152 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ coverage==4.4.2 flake8==3.5.0 -mock>=1.0.1 +mock==2.0.0 pytest==3.6.3 pytest-cov==2.5.1 From 3fc5c6f563dea6526947a5b6d23126b612eaeb19 Mon Sep 17 00:00:00 2001 From: Christopher Crone Date: Tue, 5 Feb 2019 10:50:55 +0100 Subject: [PATCH 09/27] script.build.linux: Do not tail image build logs Signed-off-by: Christopher Crone --- script/build/linux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build/linux b/script/build/linux index 1a4cd4d9b..056940ad0 100755 --- a/script/build/linux +++ b/script/build/linux @@ -5,7 +5,7 @@ set -ex ./script/clean TAG="docker-compose" -docker build -t "$TAG" . | tail -n 200 +docker build -t "$TAG" . docker run \ --rm --entrypoint="script/build/linux-entrypoint" \ -v $(pwd)/dist:/code/dist \ From e0412a24884351e093764b91cc2689c682bc1562 Mon Sep 17 00:00:00 2001 From: Christopher Crone Date: Tue, 5 Feb 2019 10:51:26 +0100 Subject: [PATCH 10/27] Dockerfile: Force version of virtualenv to 16.2.0 Signed-off-by: Christopher Crone --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index a14be492e..c5e7c815a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,8 @@ ENV LANG en_US.UTF-8 RUN useradd -d /home/user -m -s /bin/bash user WORKDIR /code/ +# FIXME(chris-crone): virtualenv 16.3.0 breaks build, force 16.2.0 until fixed +RUN pip install virtualenv==16.2.0 RUN pip install tox==2.1.1 ADD requirements.txt /code/ @@ -25,6 +27,7 @@ ADD .pre-commit-config.yaml /code/ ADD setup.py /code/ ADD tox.ini /code/ ADD compose /code/compose/ +ADD README.md /code/ RUN tox --notest ADD . /code/ From 0dec6b5ff1fb078817aba1533896f61b5dcfae4d Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Wed, 30 Jan 2019 14:28:00 +0100 Subject: [PATCH 11/27] Fix Flake8 lint This removes extra indentation and replace the use of `is` by `==` when comparing strings Signed-off-by: Ulysses Souza --- compose/service.py | 80 +++++++++++++++--------------- tests/unit/cli/log_printer_test.py | 2 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/compose/service.py b/compose/service.py index 3c5e356a3..8c6702f1e 100644 --- a/compose/service.py +++ b/compose/service.py @@ -291,7 +291,7 @@ class Service(object): c for c in stopped_containers if self._containers_have_diverged([c]) ] for c in divergent_containers: - c.remove() + c.remove() all_containers = list(set(all_containers) - set(divergent_containers)) @@ -461,50 +461,50 @@ class Service(object): def _execute_convergence_recreate(self, containers, scale, timeout, detached, start, renew_anonymous_volumes): - if scale is not None and len(containers) > scale: - self._downscale(containers[scale:], timeout) - containers = containers[:scale] + if scale is not None and len(containers) > scale: + self._downscale(containers[scale:], timeout) + containers = containers[:scale] - def recreate(container): - return self.recreate_container( - container, timeout=timeout, attach_logs=not detached, - start_new_container=start, renew_anonymous_volumes=renew_anonymous_volumes - ) - containers, errors = parallel_execute( - containers, - recreate, - lambda c: c.name, - "Recreating", + def recreate(container): + return self.recreate_container( + container, timeout=timeout, attach_logs=not detached, + start_new_container=start, renew_anonymous_volumes=renew_anonymous_volumes ) + containers, errors = parallel_execute( + containers, + recreate, + lambda c: c.name, + "Recreating", + ) + for error in errors.values(): + raise OperationFailedError(error) + + if scale is not None and len(containers) < scale: + containers.extend(self._execute_convergence_create( + scale - len(containers), detached, start + )) + return containers + + def _execute_convergence_start(self, containers, scale, timeout, detached, start): + if scale is not None and len(containers) > scale: + self._downscale(containers[scale:], timeout) + containers = containers[:scale] + if start: + _, errors = parallel_execute( + containers, + lambda c: self.start_container_if_stopped(c, attach_logs=not detached, quiet=True), + lambda c: c.name, + "Starting", + ) + for error in errors.values(): raise OperationFailedError(error) - if scale is not None and len(containers) < scale: - containers.extend(self._execute_convergence_create( - scale - len(containers), detached, start - )) - return containers - - def _execute_convergence_start(self, containers, scale, timeout, detached, start): - if scale is not None and len(containers) > scale: - self._downscale(containers[scale:], timeout) - containers = containers[:scale] - if start: - _, errors = parallel_execute( - containers, - lambda c: self.start_container_if_stopped(c, attach_logs=not detached, quiet=True), - lambda c: c.name, - "Starting", - ) - - for error in errors.values(): - raise OperationFailedError(error) - - if scale is not None and len(containers) < scale: - containers.extend(self._execute_convergence_create( - scale - len(containers), detached, start - )) - return containers + if scale is not None and len(containers) < scale: + containers.extend(self._execute_convergence_create( + scale - len(containers), detached, start + )) + return containers def _downscale(self, containers, timeout=None): def stop_and_remove(container): diff --git a/tests/unit/cli/log_printer_test.py b/tests/unit/cli/log_printer_test.py index d0c4b56be..6db24e464 100644 --- a/tests/unit/cli/log_printer_test.py +++ b/tests/unit/cli/log_printer_test.py @@ -193,7 +193,7 @@ class TestConsumeQueue(object): queue.put(item) generator = consume_queue(queue, True) - assert next(generator) is 'foobar-1' + assert next(generator) == 'foobar-1' def test_item_is_none_when_timeout_is_hit(self): queue = Queue() From 0fdb9783cd3358a480ed508b5da6744a2d0dedb4 Mon Sep 17 00:00:00 2001 From: Christopher Crone Date: Tue, 5 Feb 2019 12:13:19 +0100 Subject: [PATCH 12/27] circleci: Fix virtualenv version to 16.2.0 Signed-off-by: Christopher Crone --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f4e90d6de..08f8c42c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: command: ./script/setup/osx - run: name: install tox - command: sudo pip install --upgrade tox==2.1.1 + command: sudo pip install --upgrade tox==2.1.1 virtualenv==16.2.0 - run: name: unit tests command: tox -e py27,py36,py37 -- tests/unit @@ -22,7 +22,7 @@ jobs: - checkout - run: name: upgrade python tools - command: sudo pip install --upgrade pip virtualenv + command: sudo pip install --upgrade pip virtualenv==16.2.0 - run: name: setup script command: DEPLOYMENT_TARGET=10.11 ./script/setup/osx From 3fae0119ca2d1a05c490fdbf286370e92ce4a349 Mon Sep 17 00:00:00 2001 From: Michael Irwin Date: Tue, 5 Mar 2019 10:17:09 -0500 Subject: [PATCH 13/27] Fix merging of compose files when network has None config Signed-off-by: Michael Irwin Resolves #6525 --- compose/config/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/config/config.py b/compose/config/config.py index e2ed29a47..f3142d80a 100644 --- a/compose/config/config.py +++ b/compose/config/config.py @@ -1193,7 +1193,7 @@ def merge_networks(base, override): base = {k: {} for k in base} if isinstance(base, list) else base override = {k: {} for k in override} if isinstance(override, list) else override for network_name in all_network_names: - md = MergeDict(base.get(network_name, {}), override.get(network_name, {})) + md = MergeDict(base.get(network_name) or {}, override.get(network_name) or {}) md.merge_field('aliases', merge_unique_items_lists, []) md.merge_field('link_local_ips', merge_unique_items_lists, []) md.merge_scalar('priority') From 360753ecc17e7af637b031c7d1785b343e326ea6 Mon Sep 17 00:00:00 2001 From: Michael Irwin Date: Tue, 5 Mar 2019 22:18:22 -0500 Subject: [PATCH 14/27] Added test case to verify fix for #6525 Signed-off-by: Michael Irwin --- tests/unit/config/config_test.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index c2e6b7b07..50d8e13a8 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -3932,6 +3932,24 @@ class MergeNetworksTest(unittest.TestCase, MergeListsTest): } } + def test_network_has_none_value(self): + service_dict = config.merge_service_dicts( + {self.config_name: { + 'default': None + }}, + {self.config_name: { + 'default': { + 'aliases': [] + } + }}, + DEFAULT_VERSION) + + assert service_dict[self.config_name] == { + 'default': { + 'aliases': [] + } + } + def test_all_properties(self): service_dict = config.merge_service_dicts( {self.config_name: { From 81b30c438014a7213734641777b0ec6c2ca60e2b Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Tue, 12 Mar 2019 10:35:09 -0400 Subject: [PATCH 15/27] Enable bootloader_ignore_signals in pyinstaller Fixes #3347 Signed-off-by: Ben Firshman --- docker-compose.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.spec b/docker-compose.spec index 70db5c29e..5ca1e4c24 100644 --- a/docker-compose.spec +++ b/docker-compose.spec @@ -98,4 +98,5 @@ exe = EXE(pyz, debug=False, strip=None, upx=True, - console=True) + console=True, + bootloader_ignore_signals=True) From 295dd9abda9c0e96d989dba7d69b13a62b7f3511 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Wed, 20 Mar 2019 18:03:41 +0100 Subject: [PATCH 16/27] Bump docker-py version to 3.7.1 This docker-py version includes ssh fixes Signed-off-by: Ulysses Souza --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9333ec60d..2487f92c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ cached-property==1.3.0 certifi==2017.4.17 chardet==3.0.4 colorama==0.4.0; sys_platform == 'win32' -docker==3.7.0 +docker==3.7.1 docker-pycreds==0.4.0 dockerpty==0.4.1 docopt==0.6.2 From 0e05ac6d2c7a1ee9fe77760f288cd85ab117074c Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Fri, 22 Mar 2019 10:32:59 +0100 Subject: [PATCH 17/27] Use os.system() instead of run_setup() Use `os.system()` instead of `run_setup()` because the last is not taking any effect Signed-off-by: Ulysses Souza --- script/release/release.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/release/release.py b/script/release/release.py index 63bf863df..9db1a49d9 100755 --- a/script/release/release.py +++ b/script/release/release.py @@ -7,7 +7,6 @@ import os import shutil import sys import time -from distutils.core import run_setup from jinja2 import Template from release.bintray import BintrayAPI @@ -276,7 +275,8 @@ def finalize(args): repository.checkout_branch(br_name) - run_setup(os.path.join(REPO_ROOT, 'setup.py'), script_args=['sdist', 'bdist_wheel']) + os.system('python {setup_script} sdist bdist_wheel'.format( + setup_script=os.path.join(REPO_ROOT, 'setup.py'))) merge_status = pr_data.merge() if not merge_status.merged and not args.finalize_resume: From 662761dbba74b52c8788854f00bfef6ca130bce9 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Fri, 22 Mar 2019 10:58:32 +0100 Subject: [PATCH 18/27] Fix typo on finalize Signed-off-by: Ulysses Souza --- script/release/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/release/README.md b/script/release/README.md index f7f911e53..a0ce5d2a8 100644 --- a/script/release/README.md +++ b/script/release/README.md @@ -129,7 +129,7 @@ assets public), proceed to the "Finalize a release" section of this guide. Once you're ready to make your release public, you may execute the following command from the root of the Compose repository: ``` -./script/release/release.sh -b finalize RELEAE_VERSION +./script/release/release.sh -b finalize RELEASE_VERSION ``` Note that this command will create and publish versioned assets to the public. From c54341758a29032712e51c45c11076d330a1de39 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Fri, 22 Mar 2019 11:00:23 +0100 Subject: [PATCH 19/27] Fix bintray docker-compose link Signed-off-by: Ulysses Souza --- script/release/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/release/README.md b/script/release/README.md index a0ce5d2a8..0c6f12cbe 100644 --- a/script/release/README.md +++ b/script/release/README.md @@ -40,7 +40,7 @@ This API token should be exposed to the release script through the ### A Bintray account and Bintray API key Your Bintray account will need to be an admin member of the -[docker-compose organization](https://github.com/settings/tokens). +[docker-compose organization](https://bintray.com/docker-compose). Additionally, you should generate a personal API key. To do so, click your username in the top-right hand corner and select "Edit profile" ; on the new page, select "API key" in the left-side menu. From 428942498b90567b76541851ed30cec382af75cf Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Fri, 22 Mar 2019 15:15:52 +0100 Subject: [PATCH 20/27] "Bump 1.24.0-rc3" Signed-off-by: Ulysses Souza --- CHANGELOG.md | 18 +++++++++++++++++- compose/__init__.py | 2 +- script/run/run.sh | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5eb1bb4d..440104fa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Change log ========== -1.24.0 (2019-01-25) +1.24.0 (2019-03-22) ------------------- ### Features @@ -11,6 +11,12 @@ Change log - Added a `--all` flag to `docker-compose ps` to include stopped one-off containers in the command's output. +- Add bash completion for `ps --all|-a` + +- Support for credential_spec + +- Add `--parallel` to `docker build`'s options in `bash` and `zsh` completion + ### Bugfixes - Fixed a bug where some valid credential helpers weren't properly handled by Compose @@ -37,6 +43,16 @@ Change log - Missing images will no longer stop the execution of `docker-compose down` commands (a warning will be displayed instead). +- Force `virtualenv` version for macOS CI + +- Fix merging of compose files when network has `None` config + +- Fix `CTRL+C` issues by enabling `bootloader_ignore_signals` in `pyinstaller` + +- Bump `docker-py` version to `3.7.1` to fix SSH issues + +- Fix release script and some typos on release documentation + 1.23.2 (2018-11-28) ------------------- diff --git a/compose/__init__.py b/compose/__init__.py index bc5e6b116..5fd7d326b 100644 --- a/compose/__init__.py +++ b/compose/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from __future__ import unicode_literals -__version__ = '1.24.0-rc1' +__version__ = '1.24.0-rc3' diff --git a/script/run/run.sh b/script/run/run.sh index df3f2298f..edc2e0c0e 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -15,7 +15,7 @@ set -e -VERSION="1.24.0-rc1" +VERSION="1.24.0-rc3" IMAGE="docker/compose:$VERSION" From 917c2701f25f15b0d39a4dd8f93254b75aa058dd Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Fri, 22 Mar 2019 17:10:41 +0100 Subject: [PATCH 21/27] Fix script for release file already present case This avoids a: "AttributeError: 'HTTPError' object has no attribute 'message'" Signed-off-by: Ulysses Souza --- script/release/release/pypi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/release/release/pypi.py b/script/release/release/pypi.py index a40e17544..dc0b0cb97 100644 --- a/script/release/release/pypi.py +++ b/script/release/release/pypi.py @@ -18,7 +18,7 @@ def pypi_upload(args): 'dist/docker-compose-{}*.tar.gz'.format(rel) ]) except HTTPError as e: - if e.response.status_code == 400 and 'File already exists' in e.message: + if e.response.status_code == 400 and 'File already exists' in str(e): if not args.finalize_resume: raise ScriptError( 'Package already uploaded on PyPi.' From eb2fdf81b468cd5f88360df23850341510b342e4 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Thu, 28 Mar 2019 17:45:03 +0100 Subject: [PATCH 22/27] Bump docker-py 3.7.2 Signed-off-by: Ulysses Souza --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2487f92c0..5e8ec2ed7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ cached-property==1.3.0 certifi==2017.4.17 chardet==3.0.4 colorama==0.4.0; sys_platform == 'win32' -docker==3.7.1 +docker==3.7.2 docker-pycreds==0.4.0 dockerpty==0.4.1 docopt==0.6.2 From 0aa590649c2cabdbf9527ae90438395eaf1e6b0b Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Thu, 28 Mar 2019 18:34:02 +0100 Subject: [PATCH 23/27] "Bump 1.24.0" Signed-off-by: Ulysses Souza --- CHANGELOG.md | 2 +- compose/__init__.py | 2 +- script/run/run.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 440104fa6..80f98be92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,7 +49,7 @@ Change log - Fix `CTRL+C` issues by enabling `bootloader_ignore_signals` in `pyinstaller` -- Bump `docker-py` version to `3.7.1` to fix SSH issues +- Bump `docker-py` version to `3.7.2` to fix SSH and proxy config issues - Fix release script and some typos on release documentation diff --git a/compose/__init__.py b/compose/__init__.py index 5fd7d326b..b66d2eb58 100644 --- a/compose/__init__.py +++ b/compose/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from __future__ import unicode_literals -__version__ = '1.24.0-rc3' +__version__ = '1.24.0' diff --git a/script/run/run.sh b/script/run/run.sh index edc2e0c0e..a8690cad1 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -15,7 +15,7 @@ set -e -VERSION="1.24.0-rc3" +VERSION="1.24.0" IMAGE="docker/compose:$VERSION" From 8552e8e2833f377103843bbc31df282cce299a77 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Thu, 23 May 2019 23:39:09 +0200 Subject: [PATCH 24/27] "Bump 1.25.0-rc1" Signed-off-by: Ulysses Souza --- CHANGELOG.md | 69 +++++++++++++++++++++++++++++++++++++++++++++ compose/__init__.py | 2 +- script/run/run.sh | 2 +- 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a3ad8bfd..0a512c353 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,75 @@ Change log ========== +1.25.0 (2019-05-22) +------------------- + +### Features + +- Add tag `docker-compose:latest` + +- Add `docker-compose:-alpine` image/tag + +- Add `docker-compose:-debian` image/tag + +- Bumped `docker-py` 4.0.1 + +- Supports `requests` up to 2.22.0 version + +- Drops empty tag on `build:cache_from` + +- `Dockerfile` now generates `libmusl` binaries for alpine + +- Only pull images that can't be built + +- Attribute `scale` can now accept `0` as a value + +- Added `--quiet` build flag + +- Added `--no-interpolate` to `docker-compose config` + +- Bump OpenSSL for macOS build (`1.1.0j` to `1.1.1a`) + +- Added `--no-rm` to `build` command + +- Added support for `credential_spec` + +- Resolve digests without pulling image + +- Upgrade `pyyaml` to `4.2b1` + +- Lowered severity to `warning` if `down` tries to remove nonexisting image + +- Use improved API fields for project events when possible + +- Update `setup.py` for modern `pypi/setuptools` and remove `pandoc` dependencies + +- Removed `Dockerfile.armhf` which is no longer needed + +### Bugfixes + +- Fixed `--remove-orphans` when used with `up --no-start` + +- Fixed `docker-compose ps --all` + +- Fixed `depends_on` dependency recreation behavior + +- Fixed bash completion for `build --memory` + +- Fixed misleading warning concerning env vars when performing an `exec` command + +- Fixed failure check in parallel_execute_watch + +- Fixed race condition after pulling image + +- Fixed error on duplicate mount points. + +- Fixed merge on networks section + +- Always connect Compose container to `stdin` + +- Fixed the presentation of failed services on 'docker-compose start' when containers are not available + 1.24.0 (2019-03-28) ------------------- diff --git a/compose/__init__.py b/compose/__init__.py index 0042896b6..55060583e 100644 --- a/compose/__init__.py +++ b/compose/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from __future__ import unicode_literals -__version__ = '1.25.0dev' +__version__ = '1.25.0-rc1' diff --git a/script/run/run.sh b/script/run/run.sh index f3456720f..58caf3612 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -15,7 +15,7 @@ set -e -VERSION="1.24.0" +VERSION="1.25.0-rc1" IMAGE="docker/compose:$VERSION" From 5e7521909d59ca69f77b60dc4173c9517facc2b9 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Fri, 14 Jun 2019 14:58:17 +0100 Subject: [PATCH 25/27] Add .fossa.yml file This commit adds a .fossa.yml file used by fossa.io It allows for fossa to scan the dependencies and figure out which oss licenses are in use. This can be added to CI at some point in the near future. Signed-off-by: Dave Tucker --- .fossa.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .fossa.yml diff --git a/.fossa.yml b/.fossa.yml new file mode 100644 index 000000000..b50761ef1 --- /dev/null +++ b/.fossa.yml @@ -0,0 +1,14 @@ +# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli) +# Visit https://fossa.io to learn more + +version: 2 +cli: + server: https://app.fossa.io + fetcher: custom + project: git@github.com:docker/compose +analyze: + modules: + - name: . + type: pip + target: . + path: . From a78e3b0c7c6f9d562f2bac5246e3fb2f2f34c21d Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Thu, 20 Jun 2019 14:12:28 +0200 Subject: [PATCH 26/27] Bump docker-py Signed-off-by: Djordje Lukic --- requirements.txt | 4 ++-- tests/acceptance/cli_test.py | 10 +++++----- tests/fixtures/environment-exec/docker-compose.yml | 2 +- tests/fixtures/links-composefile/docker-compose.yml | 6 +++--- tests/fixtures/simple-composefile/docker-compose.yml | 2 +- tests/fixtures/simple-dockerfile/Dockerfile | 2 +- tests/fixtures/v2-simple/docker-compose.yml | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/requirements.txt b/requirements.txt index 5e8ec2ed7..6007ee3ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ cached-property==1.3.0 certifi==2017.4.17 chardet==3.0.4 colorama==0.4.0; sys_platform == 'win32' -docker==3.7.2 +docker==3.7.3 docker-pycreds==0.4.0 dockerpty==0.4.1 docopt==0.6.2 @@ -21,4 +21,4 @@ requests==2.20.0 six==1.10.0 texttable==0.9.1 urllib3==1.21.1; python_version == '3.3' -websocket-client==0.32.0 +websocket-client==0.56.0 diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py index 5142f96eb..9ed257369 100644 --- a/tests/acceptance/cli_test.py +++ b/tests/acceptance/cli_test.py @@ -40,7 +40,7 @@ ProcessResult = namedtuple('ProcessResult', 'stdout stderr') BUILD_CACHE_TEXT = 'Using cache' -BUILD_PULL_TEXT = 'Status: Image is up to date for busybox:latest' +BUILD_PULL_TEXT = 'Status: Image is up to date for busybox:1.27.2' def start_process(base_dir, options): @@ -658,15 +658,15 @@ class CLITestCase(DockerClientTestCase): self.base_dir = 'tests/fixtures/links-composefile' result = self.dispatch(['pull', '--no-parallel', 'web']) assert sorted(result.stderr.split('\n'))[1:] == [ - 'Pulling web (busybox:latest)...', + 'Pulling web (busybox:1.27.2)...', ] def test_pull_with_include_deps(self): self.base_dir = 'tests/fixtures/links-composefile' result = self.dispatch(['pull', '--no-parallel', '--include-deps', 'web']) assert sorted(result.stderr.split('\n'))[1:] == [ - 'Pulling db (busybox:latest)...', - 'Pulling web (busybox:latest)...', + 'Pulling db (busybox:1.27.2)...', + 'Pulling web (busybox:1.27.2)...', ] def test_build_plain(self): @@ -2592,7 +2592,7 @@ class CLITestCase(DockerClientTestCase): container, = self.project.containers() expected_template = ' container {} {}' - expected_meta_info = ['image=busybox:latest', 'name=simple-composefile_simple_'] + expected_meta_info = ['image=busybox:1.27.2', 'name=simple-composefile_simple_'] assert expected_template.format('create', container.id) in lines[0] assert expected_template.format('start', container.id) in lines[1] diff --git a/tests/fixtures/environment-exec/docker-compose.yml b/tests/fixtures/environment-exec/docker-compose.yml index 813606eb8..e284ba8cb 100644 --- a/tests/fixtures/environment-exec/docker-compose.yml +++ b/tests/fixtures/environment-exec/docker-compose.yml @@ -2,7 +2,7 @@ version: "2.2" services: service: - image: busybox:latest + image: busybox:1.27.2 command: top environment: diff --git a/tests/fixtures/links-composefile/docker-compose.yml b/tests/fixtures/links-composefile/docker-compose.yml index 930fd4c7a..0a2f3d9ef 100644 --- a/tests/fixtures/links-composefile/docker-compose.yml +++ b/tests/fixtures/links-composefile/docker-compose.yml @@ -1,11 +1,11 @@ db: - image: busybox:latest + image: busybox:1.27.2 command: top web: - image: busybox:latest + image: busybox:1.27.2 command: top links: - db:db console: - image: busybox:latest + image: busybox:1.27.2 command: top diff --git a/tests/fixtures/simple-composefile/docker-compose.yml b/tests/fixtures/simple-composefile/docker-compose.yml index b25beaf4b..e86d3fc80 100644 --- a/tests/fixtures/simple-composefile/docker-compose.yml +++ b/tests/fixtures/simple-composefile/docker-compose.yml @@ -1,5 +1,5 @@ simple: - image: busybox:latest + image: busybox:1.27.2 command: top another: image: busybox:latest diff --git a/tests/fixtures/simple-dockerfile/Dockerfile b/tests/fixtures/simple-dockerfile/Dockerfile index dd864b838..098ff3eb1 100644 --- a/tests/fixtures/simple-dockerfile/Dockerfile +++ b/tests/fixtures/simple-dockerfile/Dockerfile @@ -1,3 +1,3 @@ -FROM busybox:latest +FROM busybox:1.27.2 LABEL com.docker.compose.test_image=true CMD echo "success" diff --git a/tests/fixtures/v2-simple/docker-compose.yml b/tests/fixtures/v2-simple/docker-compose.yml index c99ae02fc..ac754eeea 100644 --- a/tests/fixtures/v2-simple/docker-compose.yml +++ b/tests/fixtures/v2-simple/docker-compose.yml @@ -1,8 +1,8 @@ version: "2" services: simple: - image: busybox:latest + image: busybox:1.27.2 command: top another: - image: busybox:latest + image: busybox:1.27.2 command: top From 4667896b69e46991f5e93183fa70f1233f469414 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Mon, 24 Jun 2019 11:20:44 +0200 Subject: [PATCH 27/27] "Bump 1.24.1" Signed-off-by: Djordje Lukic --- CHANGELOG.md | 7 +++++++ compose/__init__.py | 2 +- script/run/run.sh | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80f98be92..8f777c6c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Change log ========== +1.24.1 (2019-06-24) +------------------- + +### Bugfixes + +- Fixed acceptance tests + 1.24.0 (2019-03-22) ------------------- diff --git a/compose/__init__.py b/compose/__init__.py index b66d2eb58..6a40e150f 100644 --- a/compose/__init__.py +++ b/compose/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from __future__ import unicode_literals -__version__ = '1.24.0' +__version__ = '1.24.1' diff --git a/script/run/run.sh b/script/run/run.sh index a8690cad1..4881adc38 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -15,7 +15,7 @@ set -e -VERSION="1.24.0" +VERSION="1.24.1" IMAGE="docker/compose:$VERSION"