1486 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
28f8b8549d
Remove local check for log-driver read support
Starting with Docker 20.10, the docker daemon has support for
"dual logging", which allows reading back logs, irregardless of
the logging-driver that is configured (except for "none" as logging
driver).

This patch removes the local check, which used a hard-coded list of
logging drivers that are expected to support reading logs.

When using an older version of Docker, the API should return an
error that reading logs is not supported, so no local check should
be needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-28 16:55:36 +01:00
Mike Seplowitz
4fa72a066a
Improve control over ANSI output (#6858)
* Move global console_handler into function scope

Signed-off-by: Mike Seplowitz <mseplowitz@bloomberg.net>

* Improve control over ANSI output

- Disabled parallel logger ANSI output if not attached to a tty.
  The console handler and progress stream already checked whether the
  output stream is a tty, but ParallelStreamWriter did not.

- Added --ansi=(never|always|auto) option to allow clearer control over
  ANSI output. Since --no-ansi is the same as --ansi=never, --no-ansi is
  now deprecated.

Signed-off-by: Mike Seplowitz <mseplowitz@bloomberg.net>
2021-01-19 18:17:55 +01:00
Anca Iordache
b9249168bd
Merge pull request #7926 from maaarghk/no_build_cache_from_duplicate_check
Remove duplicate values check for build.cache_from
2021-01-11 18:33:16 +01:00
Anca Iordache
e36ac32120
Merge pull request #7978 from thaJeztah/default_to_cli_build
Make COMPOSE_DOCKER_CLI_BUILD=1 the default
2021-01-11 18:29:42 +01:00
Ulysses Souza
369eb3220a Add metrics
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-04 15:16:51 -03:00
Sebastiaan van Stijn
affb0d504d
Make COMPOSE_DOCKER_CLI_BUILD=1 the default
This changes compose to use "native" build through the CLI
by default. With this, docker-compose can take advantage of
BuildKit (which is now enabled by default on Docker Desktop
2.5 and up).

Users that want to use the python client for building can
opt-out of this feature by setting COMPOSE_DOCKER_CLI_BUILD=0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-12-08 12:26:41 +01:00
Ulysses Souza
e0edc908b5 Fix project_dir to take first file in account
The order of precedence is:
- '--project-directory' option
- first file directory in '--file' option
- current directory

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-12-02 16:59:47 -03:00
Anca Iordache
f1059d75ed
Merge pull request #7866 from luca-nardelli/improve-mandatory-variables-issues
Report which variable fails interpolation when they are mandatory
2020-12-02 20:06:25 +01:00
Roman Anasal
2d2a8a0469 Implement service profiles
Implement profiles as introduced in compose-spec/compose-spec#110
fixes #7919
closes #1896
closes #6742
closes #7539

Signed-off-by: Roman Anasal <roman.anasal@bdsu.de>
2020-12-02 01:08:11 +01:00
Mark Gallagher
3ebfa4b089 Remove duplicate values check for build.cache_from
The `docker` command accepts duplicate values, so there is no benefit to
performing this check.

Fixes #7342.

Signed-off-by: Mark Gallagher <mark@fts.scot>
2020-11-13 01:56:37 +00:00
Anca Iordache
f965401569
Merge pull request #7435 from rohitkg98/7416-add-disable-log-prefix-flag
Added option to disable log prefix via cli
2020-11-12 09:34:20 +01:00
Ulysses Souza
675c9674e1 Add Makefile including spec download target
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-10-27 13:50:17 +01:00
Kaushal Rohit
cddaa77fea Added option to disable log prefix via cli
Signed-off-by: Kaushal Rohit <rohit.kg98@gmail.com>
2020-10-18 19:52:16 +05:30
Luca Nardelli
d51249acf4 Report which variable fails interpolation when they are mandatory
Add default value before raising UnsetRequiredSubstitution

Signed-off-by: Luca Nardelli <luca.nardelli@protonmail.com>
2020-10-15 09:55:04 +02:00
Ulysses Souza
ce59a4c223 Fix port rendering
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-09-24 14:49:26 +02:00
aiordache
5340a6d760 Add test for scale with stopped containers
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-09-16 15:59:43 +02:00
aiordache
a85d2bc64c update test for start trigger
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-09-16 15:59:43 +02:00
aiordache
fa720787d6 update depends_on tests
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-09-14 18:01:35 +02:00
Kevin Clark
d811500fa0 Added merge for max_replicas_per_node
Signed-off-by: Kevin Clark <kclark@edustaff.org>
2020-09-11 08:01:24 -04:00
Ulysses Souza
fde1c681a7 Preserve the version when specified in the file
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-09-10 13:10:33 +02:00
Ulysses Souza
3b17b3c2c0 Fix stderr on returncode is different of 0
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-08-31 22:20:26 +02:00
Erfan Gholamian
76963e44ad Added integration test for build error when building with docker cli
Signed-off-by: Erfan Gholamian <egholamian2@gmail.com>
2020-08-21 20:52:56 +02:00
Ulysses Souza
dff3ce28f4 Fix flake8
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-08-21 19:25:24 +02:00
Ulysses Souza
c447ff8c2c Update API version for docker client
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-08-21 18:11:27 +02:00
Ulysses Souza
5bbd670166 Update tests to use the version on docker client
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-08-21 16:42:00 +02:00
Anca Iordache
25d773c924
Merge pull request #7676 from aiordache/fix_deploy_parsing
Update schema and fix scale parsing
2020-08-18 14:34:25 +02:00
aiordache
2b4d409ac3 Update schema and fix memory limit parsing
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-08-17 20:08:06 +02:00
Ryosuke TOKUAMI
35f1334cbd Use docker cli on run when the envvar passed.
Make docker-compose run pass the the cli option
to project.up to build images using docker cli
considering COMPOSE_DOCKER_CLI_BUILD environment
variable.

Signed-off-by: Ryosuke TOKUAMI <mail@pokutuna.com>
2020-08-12 15:42:37 +02:00
alexrecuenco
4d3d9f64b9 Removed Python2 support
Closes: #6890

Some remarks,

- `# coding ... utf-8` statements are not needed
- isdigit on strings instead of a try-catch.
- Default opening mode is read, so we can do `open()` without the `'r'` everywhere
- Removed inheritinng from `object` class, it isn't necessary in python3.
- `super(ClassName, self)` can now be replaced with `super()`
- Use of itertools and `chain` on a couple places dealing with sets.
- Used the operator module instead of lambdas when warranted
    `itemgetter(0)` instead of `lambda x: x[0]`
    `attrgetter('name')` instead of `lambda x: x.name`
- `sorted` returns a list, so no need to use `list(sorted(...))`
- Removed `dict()` using dictionary comprehensions whenever possible
- Attempted to remove python3.2 support

Signed-off-by: alexrecuenco <alejandrogonzalezrecuenco@gmail.com>
2020-08-11 17:45:13 +07:00
Anca Iordache
79d6e122fd
Merge pull request #7651 from aiordache/cleanup_version_only
Cleanup after v2-v3 schema merge
2020-08-10 11:26:20 +02:00
Vitor Anjos
de1afd977d Fix typo
Signed-off-by: Vitor Anjos <vitorbartier@hotmail.com>
2020-08-10 10:32:45 +02:00
Vitor Anjos
17b41b27a8 Ignore build context path validation when it is not necessary
Signed-off-by: Vitor Anjos <vitorbartier@hotmail.com>
2020-08-10 10:32:45 +02:00
aiordache
7322dee672 Cleanup v*_only test decorators
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-08-10 10:30:41 +02:00
Eric Hripko
a8511e0884 Remove the now unneeded version qualifier
Signed-off-by: Eric Hripko <ehripko@bloomberg.net>
2020-08-07 14:46:17 +01:00
Eric Hripko
efb5601323 Implement service mode for ipc
Signed-off-by: Eric Hripko <ehripko@bloomberg.net>
2020-08-07 14:43:46 +01:00
Anca Iordache
d4f55a721d
Merge pull request #7457 from EricHripko/run-healthy
[Compose Spec] Make 'run' behave in the same way as 'up'
2020-08-07 10:31:22 +02:00
Eric Hripko
06462cd604 Make run behave in the same way as up
Signed-off-by: Eric Hripko <ehripko@bloomberg.net>
2020-08-06 23:11:39 +01:00
Anca Iordache
debcdde27d
Merge pull request #7543 from jarulsamy/7540-flag_nullifier
Add `--` as a separator of flags and arguments.
2020-08-04 14:28:14 +02:00
Anca Iordache
a2095a2a0c
Merge pull request #7510 from hartwork/issue-7501-stop-using-deprecated-assertequal
tests: Stop using deprecated assertEquals (fixes #7501)
2020-08-03 15:29:39 +02:00
aiordache
cb56036a6e rename schema to compose_spec
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-07-09 15:52:46 +02:00
aiordache
c06b30548d cleanup compatibility and tests
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-07-08 19:07:38 +02:00
aiordache
b78c1ec193 Merge 2.x and 3.x schemas
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-07-08 12:31:39 +02:00
Joshua Arulsamy
d0f9fa84ad Add tests for -- seperator of flags and args.
Signed-off-by: Joshua Arulsamy <joshua.gf.arul@gmail.com>
2020-06-17 23:14:39 -06:00
Ulysses Souza
854c14a5bc
Merge pull request #7031 from venthur/remove_python2
Removed Python2 support
2020-06-10 17:03:19 +02:00
Sebastian Pipping
59d03b1d5e tests: Stop using deprecated assertEquals (fixes #7501)
Signed-off-by: Sebastian Pipping <sebastian@pipping.org>
2020-06-09 19:59:36 +02:00
Ulysses Souza
7b84b66b0b Expect failure of test_create_container_with_blkio_config
On Linux kernel >= 5.3.x at least the daemon prints 2 warnings:
"Your kernel does not support cgroup blkio weight"
"Your kernel does not support cgroup blkio weight_device"

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-06-08 16:41:59 +02:00
Bastian Venthur
c5d2d3c30e re-added accidentally removed contextlib import
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
2020-06-03 18:23:19 +02:00
Bastian Venthur
8ce743c8c1 Fixed new things that came after the PR
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
2020-06-03 18:08:23 +02:00
Bastian Venthur
6351ad8a95 Import unittest.mock directly.
We don't need to support Python2 anymore.

Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
2020-06-03 17:43:56 +02:00
Bastian Venthur
c44746d92d Removed now useless check for version_info >= 2.7
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
2020-06-03 17:43:56 +02:00