From 2e7493a8899d75a991fa2386d3eedcfbca690580 Mon Sep 17 00:00:00 2001 From: Guillaume Lours Date: Fri, 18 Oct 2019 17:54:18 +0200 Subject: [PATCH 1/9] Set no-colors to true if CLICOLOR env variable is set to 0 Signed-off-by: Guillaume Lours --- compose/cli/main.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/compose/cli/main.py b/compose/cli/main.py index 9e01b5396..fde4fd035 100644 --- a/compose/cli/main.py +++ b/compose/cli/main.py @@ -6,6 +6,7 @@ import contextlib import functools import json import logging +import os import pipes import re import subprocess @@ -102,9 +103,9 @@ def dispatch(): options, handler, command_options = dispatcher.parse(sys.argv[1:]) setup_console_handler(console_handler, options.get('--verbose'), - options.get('--no-ansi'), + set_no_color_if_clicolor(options.get('--no-ansi')), options.get("--log-level")) - setup_parallel_logger(options.get('--no-ansi')) + setup_parallel_logger(set_no_color_if_clicolor(options.get('--no-ansi'))) if options.get('--no-ansi'): command_options['--no-color'] = True return functools.partial(perform_command, options, handler, command_options) @@ -666,7 +667,7 @@ class TopLevelCommand(object): log_printer_from_project( self.project, containers, - options['--no-color'], + set_no_color_if_clicolor(options['--no-color']), log_args, event_stream=self.project.events(service_names=options['SERVICE'])).run() @@ -1124,7 +1125,7 @@ class TopLevelCommand(object): log_printer = log_printer_from_project( self.project, attached_containers, - options['--no-color'], + set_no_color_if_clicolor(options['--no-color']), {'follow': True}, cascade_stop, event_stream=self.project.events(service_names=service_names)) @@ -1602,3 +1603,7 @@ def warn_for_swarm_mode(client): "To deploy your application across the swarm, " "use `docker stack deploy`.\n" ) + + +def set_no_color_if_clicolor(no_color_flag): + return no_color_flag or os.environ.get('CLICOLOR') == "0" From a3a23bf94934d5d01a997ba14e34d794d157e3ec Mon Sep 17 00:00:00 2001 From: Sebastien Mamessier Date: Fri, 25 Oct 2019 13:55:45 +0200 Subject: [PATCH 2/9] Fixed error when using startswith on non-ascii string Signed-off-by: Sebastien Mamessier --- compose/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/service.py b/compose/service.py index ae4e7665c..f487db7d1 100644 --- a/compose/service.py +++ b/compose/service.py @@ -1806,7 +1806,7 @@ class _CLIBuilder(object): line = p.stdout.readline() if not line: break - if line.startswith(magic_word): + if line.startswith(str(magic_word)): appear = True yield json.dumps({"stream": line}) From 802fa202286fb9bf0fab18b0f558b13009367fc5 Mon Sep 17 00:00:00 2001 From: Anthony Lai Date: Sun, 3 Nov 2019 22:54:44 +0000 Subject: [PATCH 3/9] Make container service color deterministic, remove red from chosen colors Signed-off-by: Anthony Lai --- compose/cli/colors.py | 4 ++-- compose/cli/log_printer.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/compose/cli/colors.py b/compose/cli/colors.py index cb30e3615..ea45198e0 100644 --- a/compose/cli/colors.py +++ b/compose/cli/colors.py @@ -41,9 +41,9 @@ for (name, code) in get_pairs(): def rainbow(): - cs = ['cyan', 'yellow', 'green', 'magenta', 'red', 'blue', + cs = ['cyan', 'yellow', 'green', 'magenta', 'blue', 'intense_cyan', 'intense_yellow', 'intense_green', - 'intense_magenta', 'intense_red', 'intense_blue'] + 'intense_magenta', 'intense_blue'] for c in cs: yield globals()[c] diff --git a/compose/cli/log_printer.py b/compose/cli/log_printer.py index 6940a74c8..a4b70a672 100644 --- a/compose/cli/log_printer.py +++ b/compose/cli/log_printer.py @@ -134,7 +134,10 @@ def build_thread(container, presenter, queue, log_args): def build_thread_map(initial_containers, presenters, thread_args): return { container.id: build_thread(container, next(presenters), *thread_args) - for container in initial_containers + # Container order is unspecified, so they are sorted by name in order to make + # container:presenter (log color) assignment deterministic when given a list of containers + # with the same names. + for container in sorted(initial_containers, key=lambda c: c.name) } From e546533cfe21ab380c0ec4cefbd1e9d0cd3ec4e6 Mon Sep 17 00:00:00 2001 From: Zuhayr Elahi Date: Wed, 6 Nov 2019 17:10:48 -0800 Subject: [PATCH 4/9] Fixed broken README link for common use cases Signed-off-by: Zuhayr Elahi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c9b87daba..fd643f174 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ see [the list of features](https://github.com/docker/docker.github.io/blob/maste Compose is great for development, testing, and staging environments, as well as CI workflows. You can learn more about each case in -[Common Use Cases](https://github.com/docker/docker.github.io/blob/master/compose/overview.md#common-use-cases). +[Common Use Cases](https://github.com/docker/docker.github.io/blob/master/compose/index.md#common-use-cases). Using Compose is basically a three-step process. From 2919bebea46574f95e566f57dfd6746c6e1661b9 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Mon, 18 Nov 2019 15:43:50 +0100 Subject: [PATCH 5/9] Fix non ascii chars error. Python2 only Signed-off-by: Ulysses Souza --- compose/service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compose/service.py b/compose/service.py index f487db7d1..d329be979 100644 --- a/compose/service.py +++ b/compose/service.py @@ -1806,7 +1806,10 @@ class _CLIBuilder(object): line = p.stdout.readline() if not line: break - if line.startswith(str(magic_word)): + # Fix non ascii chars on Python2. To remove when #6890 is complete. + if six.PY2: + magic_word = str(magic_word) + if line.startswith(magic_word): appear = True yield json.dumps({"stream": line}) From a0592ce58504615c8c773ff6270066f18e7de60f Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Mon, 18 Nov 2019 19:14:13 +0100 Subject: [PATCH 6/9] "Bump 1.25.0" Signed-off-by: Ulysses Souza --- CHANGELOG.md | 104 ++++++++++++++++++++++++++++++++++++++++++++ compose/__init__.py | 2 +- script/run/run.sh | 2 +- 3 files changed, 106 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a3ad8bfd..4436ed74d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,110 @@ Change log ========== +1.25.0 (2019-11-18) +------------------- + +### Features + +- Set no-colors to true if CLICOLOR env variable is set to 0 + +- Add working dir, config files and env file in service labels + +- Add dependencies for ARM build + +- Add BuildKit support, use `DOCKER_BUILDKIT=1` and `COMPOSE_DOCKER_CLI_BUILD=1` + +- Bump paramiko to 2.6.0 + +- Add working dir, config files and env file in service labels + +- Add tag `docker-compose:latest` + +- Add `docker-compose:-alpine` image/tag + +- Add `docker-compose:-debian` image/tag + +- Bumped `docker-py` 4.1.0 + +- 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.1c`) + +- 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 + +- Make container service color deterministic, remove red from chosen colors + +- Fix non ascii chars error. Python2 only + +- Format image size as decimal to be align with Docker CLI + +- Use Python Posix support to get tty size + +- Fix same file 'extends' optimization + +- Use python POSIX support to get tty size + +- Format image size as decimal to be align with Docker CLI + +- Fixed stdin_open + +- 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.1 (2019-06-24) +------------------- + +### Bugfixes + +- Fixed acceptance tests + 1.24.0 (2019-03-28) ------------------- diff --git a/compose/__init__.py b/compose/__init__.py index 0042896b6..d35e818c7 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' diff --git a/script/run/run.sh b/script/run/run.sh index f3456720f..ffeec59a2 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" IMAGE="docker/compose:$VERSION" From d072601197effc2271b599a9aafe3a9cc5366729 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Mon, 18 Nov 2019 19:29:40 +0100 Subject: [PATCH 7/9] "Bump 1.25.0" Signed-off-by: Ulysses Souza --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4436ed74d..ca9cc3424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Change log ### Features -- Set no-colors to true if CLICOLOR env variable is set to 0 +- Set no-colors to true if CLICOLOR env variable is set to 0 - Add working dir, config files and env file in service labels From 0a186604be76457def87f9b571ca53eb37c0ffa7 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Mon, 18 Nov 2019 19:35:34 +0100 Subject: [PATCH 8/9] "Bump 1.25.0" Signed-off-by: Ulysses Souza --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca9cc3424..d1a6fae32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,9 +64,9 @@ Change log - Fix non ascii chars error. Python2 only -- Format image size as decimal to be align with Docker CLI +- Format image size as decimal to be align with Docker CLI -- Use Python Posix support to get tty size +- Use Python Posix support to get tty size - Fix same file 'extends' optimization @@ -90,7 +90,7 @@ Change log - Fixed race condition after pulling image -- Fixed error on duplicate mount points. +- Fixed error on duplicate mount points - Fixed merge on networks section From b42d4197ce3865c31e27ed134ea1fb081b839c0c Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Mon, 18 Nov 2019 22:46:12 +0100 Subject: [PATCH 9/9] Add latest tag question on resume and start to tag on build Signed-off-by: Ulysses Souza --- script/release/release.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/release/release.py b/script/release/release.py index a9c05eb78..82bc9a0a6 100755 --- a/script/release/release.py +++ b/script/release/release.py @@ -204,7 +204,8 @@ def resume(args): gh_release = create_release_draft(repository, args.release, pr_data, files) delete_assets(gh_release) upload_assets(gh_release, files) - img_manager = ImageManager(args.release) + tag_as_latest = is_tag_latest(args.release) + img_manager = ImageManager(args.release, tag_as_latest) img_manager.build_images(repository) except ScriptError as e: print(e) @@ -244,7 +245,8 @@ def start(args): files = downloader.download_all(args.release) gh_release = create_release_draft(repository, args.release, pr_data, files) upload_assets(gh_release, files) - img_manager = ImageManager(args.release) + tag_as_latest = is_tag_latest(args.release) + img_manager = ImageManager(args.release, tag_as_latest) img_manager.build_images(repository) except ScriptError as e: print(e)