mirror of
https://github.com/docker/compose.git
synced 2025-07-06 13:24:25 +02:00
commit
24e9f66d79
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
__version__ = '1.9.0-rc1'
|
__version__ = '1.9.0-rc2'
|
||||||
|
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
|||||||
import contextlib
|
import contextlib
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
|
from distutils.spawn import find_executable
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
from docker.errors import APIError
|
from docker.errors import APIError
|
||||||
@ -13,7 +14,6 @@ from requests.exceptions import SSLError
|
|||||||
from requests.packages.urllib3.exceptions import ReadTimeoutError
|
from requests.packages.urllib3.exceptions import ReadTimeoutError
|
||||||
|
|
||||||
from ..const import API_VERSION_TO_ENGINE_VERSION
|
from ..const import API_VERSION_TO_ENGINE_VERSION
|
||||||
from .utils import call_silently
|
|
||||||
from .utils import is_docker_for_mac_installed
|
from .utils import is_docker_for_mac_installed
|
||||||
from .utils import is_mac
|
from .utils import is_mac
|
||||||
from .utils import is_ubuntu
|
from .utils import is_ubuntu
|
||||||
@ -90,11 +90,11 @@ def exit_with_error(msg):
|
|||||||
|
|
||||||
|
|
||||||
def get_conn_error_message(url):
|
def get_conn_error_message(url):
|
||||||
if call_silently(['which', 'docker']) != 0:
|
if find_executable('docker') is None:
|
||||||
return docker_not_found_msg("Couldn't connect to Docker daemon.")
|
return docker_not_found_msg("Couldn't connect to Docker daemon.")
|
||||||
if is_docker_for_mac_installed():
|
if is_docker_for_mac_installed():
|
||||||
return conn_error_docker_for_mac
|
return conn_error_docker_for_mac
|
||||||
if call_silently(['which', 'docker-machine']) == 0:
|
if find_executable('docker-machine') is not None:
|
||||||
return conn_error_docker_machine
|
return conn_error_docker_machine
|
||||||
return conn_error_generic.format(url=url)
|
return conn_error_generic.format(url=url)
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import pipes
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from distutils.spawn import find_executable
|
||||||
from inspect import getdoc
|
from inspect import getdoc
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
|
|
||||||
@ -1063,9 +1064,8 @@ def exit_if(condition, message, exit_code):
|
|||||||
|
|
||||||
|
|
||||||
def call_docker(args):
|
def call_docker(args):
|
||||||
try:
|
executable_path = find_executable('docker')
|
||||||
executable_path = subprocess.check_output(["which", "docker"]).strip()
|
if not executable_path:
|
||||||
except subprocess.CalledProcessError:
|
|
||||||
raise UserError(errors.docker_not_found_msg("Couldn't find `docker` binary."))
|
raise UserError(errors.docker_not_found_msg("Couldn't find `docker` binary."))
|
||||||
|
|
||||||
args = [executable_path] + args
|
args = [executable_path] + args
|
||||||
|
@ -140,6 +140,7 @@
|
|||||||
"mac_address": {"type": "string"},
|
"mac_address": {"type": "string"},
|
||||||
"mem_limit": {"type": ["number", "string"]},
|
"mem_limit": {"type": ["number", "string"]},
|
||||||
"memswap_limit": {"type": ["number", "string"]},
|
"memswap_limit": {"type": ["number", "string"]},
|
||||||
|
"mem_swappiness": {"type": "integer"},
|
||||||
"network_mode": {"type": "string"},
|
"network_mode": {"type": "string"},
|
||||||
|
|
||||||
"networks": {
|
"networks": {
|
||||||
@ -168,6 +169,14 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000},
|
||||||
|
"group_add": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": ["string", "number"]
|
||||||
|
},
|
||||||
|
"uniqueItems": true
|
||||||
|
},
|
||||||
"pid": {"type": ["string", "null"]},
|
"pid": {"type": ["string", "null"]},
|
||||||
|
|
||||||
"ports": {
|
"ports": {
|
||||||
@ -248,6 +257,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"internal": {"type": "boolean"},
|
||||||
"enable_ipv6": {"type": "boolean"},
|
"enable_ipv6": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/list_or_dict"}
|
||||||
},
|
},
|
||||||
|
@ -538,6 +538,10 @@ def get_volumes_from(project, service_dict):
|
|||||||
def warn_for_swarm_mode(client):
|
def warn_for_swarm_mode(client):
|
||||||
info = client.info()
|
info = client.info()
|
||||||
if info.get('Swarm', {}).get('LocalNodeState') == 'active':
|
if info.get('Swarm', {}).get('LocalNodeState') == 'active':
|
||||||
|
if info.get('ServerVersion', '').startswith('ucp'):
|
||||||
|
# UCP does multi-node scheduling with traditional Compose files.
|
||||||
|
return
|
||||||
|
|
||||||
log.warn(
|
log.warn(
|
||||||
"The Docker Engine you're using is running in swarm mode.\n\n"
|
"The Docker Engine you're using is running in swarm mode.\n\n"
|
||||||
"Compose does not use swarm mode to deploy services to multiple nodes in a swarm. "
|
"Compose does not use swarm mode to deploy services to multiple nodes in a swarm. "
|
||||||
|
@ -27,6 +27,11 @@ exe = EXE(pyz,
|
|||||||
'compose/config/config_schema_v2.0.json',
|
'compose/config/config_schema_v2.0.json',
|
||||||
'DATA'
|
'DATA'
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
'compose/config/config_schema_v2.1.json',
|
||||||
|
'compose/config/config_schema_v2.1.json',
|
||||||
|
'DATA'
|
||||||
|
),
|
||||||
(
|
(
|
||||||
'compose/GITSHA',
|
'compose/GITSHA',
|
||||||
'compose/GITSHA',
|
'compose/GITSHA',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
PyYAML==3.11
|
PyYAML==3.11
|
||||||
backports.ssl-match-hostname==3.5.0.1; python_version < '3'
|
backports.ssl-match-hostname==3.5.0.1; python_version < '3'
|
||||||
cached-property==1.2.0
|
cached-property==1.2.0
|
||||||
docker-py==1.10.4
|
docker-py==1.10.5
|
||||||
dockerpty==0.4.1
|
dockerpty==0.4.1
|
||||||
docopt==0.6.1
|
docopt==0.6.1
|
||||||
enum34==1.0.4; python_version < '3.4'
|
enum34==1.0.4; python_version < '3.4'
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION="1.9.0-rc1"
|
VERSION="1.9.0-rc2"
|
||||||
IMAGE="docker/compose:$VERSION"
|
IMAGE="docker/compose:$VERSION"
|
||||||
|
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -34,7 +34,7 @@ install_requires = [
|
|||||||
'requests >= 2.6.1, != 2.11.0, < 2.12',
|
'requests >= 2.6.1, != 2.11.0, < 2.12',
|
||||||
'texttable >= 0.8.1, < 0.9',
|
'texttable >= 0.8.1, < 0.9',
|
||||||
'websocket-client >= 0.32.0, < 1.0',
|
'websocket-client >= 0.32.0, < 1.0',
|
||||||
'docker-py >= 1.10.4, < 2.0',
|
'docker-py >= 1.10.5, < 2.0',
|
||||||
'dockerpty >= 0.4.1, < 0.5',
|
'dockerpty >= 0.4.1, < 0.5',
|
||||||
'six >= 1.3.0, < 2',
|
'six >= 1.3.0, < 2',
|
||||||
'jsonschema >= 2.5.1, < 3',
|
'jsonschema >= 2.5.1, < 3',
|
||||||
|
@ -826,9 +826,9 @@ class ProjectTest(DockerClientTestCase):
|
|||||||
name='composetest',
|
name='composetest',
|
||||||
config_data=config_data
|
config_data=config_data
|
||||||
)
|
)
|
||||||
project.up()
|
project.up(detached=True)
|
||||||
|
|
||||||
service_container = project.get_service('web').containers()[0]
|
service_container = project.get_service('web').containers(stopped=True)[0]
|
||||||
ipam_config = service_container.inspect().get(
|
ipam_config = service_container.inspect().get(
|
||||||
'NetworkSettings', {}
|
'NetworkSettings', {}
|
||||||
).get(
|
).get(
|
||||||
@ -857,8 +857,8 @@ class ProjectTest(DockerClientTestCase):
|
|||||||
name='composetest',
|
name='composetest',
|
||||||
config_data=config_data
|
config_data=config_data
|
||||||
)
|
)
|
||||||
project.up()
|
project.up(detached=True)
|
||||||
service_container = project.get_service('web').containers()[0]
|
service_container = project.get_service('web').containers(stopped=True)[0]
|
||||||
assert service_container.inspect()['HostConfig']['Isolation'] == 'default'
|
assert service_container.inspect()['HostConfig']['Isolation'] == 'default'
|
||||||
|
|
||||||
@v2_1_only()
|
@v2_1_only()
|
||||||
|
@ -16,9 +16,9 @@ def mock_logging():
|
|||||||
yield mock_log
|
yield mock_log
|
||||||
|
|
||||||
|
|
||||||
def patch_call_silently(side_effect):
|
def patch_find_executable(side_effect):
|
||||||
return mock.patch(
|
return mock.patch(
|
||||||
'compose.cli.errors.call_silently',
|
'compose.cli.errors.find_executable',
|
||||||
autospec=True,
|
autospec=True,
|
||||||
side_effect=side_effect)
|
side_effect=side_effect)
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ class TestHandleConnectionErrors(object):
|
|||||||
|
|
||||||
def test_generic_connection_error(self, mock_logging):
|
def test_generic_connection_error(self, mock_logging):
|
||||||
with pytest.raises(errors.ConnectionError):
|
with pytest.raises(errors.ConnectionError):
|
||||||
with patch_call_silently([0, 1]):
|
with patch_find_executable(['/bin/docker', None]):
|
||||||
with handle_connection_errors(mock.Mock()):
|
with handle_connection_errors(mock.Mock()):
|
||||||
raise ConnectionError()
|
raise ConnectionError()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user