When docker-py is newer than docker daemon following
APIError may be raised:
client is newer than server (client API version: 1.24, server API version: 1.22)
So it's better to pass api_version='auto' to docker client,
so client will discover suitable version if not specified.
Change-Id: Ib747ed91b315ca762936a6efa6b71a29b2d2ae1e
Signed-off-by: Pavel Glushchak <pglushchak@virtuozzo.com>
Currently, when stoping/restarting container, Kolla uses default timeout value
between SIGTERM and SIGKILL provided by docker which is 10 sec. But some
services require more than it to finish graceful shutdown progress.
This patchset adds graceful_timeout to kolla_docker to override the default
one.
Partial Implements: bp signaling-to-container
Change-Id: Ica0b48a53c650cc23dfa1955027d2cf936a5932f
At the moment, the process to determine if an image has
changed or not relies on the Docker API which depending
on the Docker release server can return different results.
This patch addresses this issue by grabbing the SHA256
of the image before pulling (defaulting to None if it does
not exist) and then comparing it after the pull is complete
which should always be successful at determining if the
image did change or not.
The test for unknown status images is removed because this
is not a possible scenario as we do not rely on status
anymore except for failures (which are still tested).
Change-Id: Ia60a7f34420b02f50597dddb96a4c36ff3996612
Closes-Bug: #1668059
docker-py 2.0.0 is released with renaming docker.Client to
docker.APIClient. and with a new python package name "docker" rather
than "docker-py".
This patch support docker and docker-py packages.
Change-Id: Ib4400a4d2ce803191ee6215c5b28f0052970332c
Closes-Bug: #1668346
A empty docker volume item will cause start_container to fail.
This bug is not triggered in current kolla deployment scripts, but
only if you pass a empty volume item to kolla_docker module.
E.g. Using a if expression in items of volumes list while calling
start_container. Like the one in start.yml of iscsi and cinder.
Change-Id: I389246fb9650ab5304463e943459ecb68706167f
There is inconsistent use of either `/usr/bin/python` or
`/usr/bin/env python`. This makes for unexpected results when a
user might be using a virtualenv.
Change-Id: Ibb030f920a8869f9113ade70b66a921cc815060d
bypass_checks is disabled by Ib2e19794bbe804470a880253d5870254041358c8 .
But we use pid_mode: "{{ service.pid_mode | default('') }}" pattern in
the yaml file. whereas pid_mode only support "host" value, this patch
add '' as a choice of these two parameters.
Change-Id: Ib83ed5e437ca868f0e42ce740ad1125d2fa48ff4
Recreate and start a new container when container parameter is changed
in COPY_ALWAYS strategy.
Change-Id: I1e45c0dc34a93a18b664109823d6fd5b88c331a2
Closes-Bug: #1659799
docker engine 1.10 and docker engine 1.12 have different response for
list containers. Use status=running filter instead. It is provided by
all docker version.
Closes-Bug: #1658015
Change-Id: I54df4b08f215322d97d604ebd84e04255a359ef6
When using stream=True with docker-py it returns byte arrays rather than
strings.
Change-Id: I8eb6707ba2b122cf779135173abafe874b7223d2
Closes-Bug: #1643740
The parameter "required=True" is mistyped as "requried=True"
in ansible/library/kolla_docker.py and tests/test_kolla_docker.py
Closes bug: 1640423
Change-Id: I64c333275b9eb3eff5b1c0fa5d550f478e68020d
Current implementation has docker_restart_policy "always" and
docker_restart_policy_retry:"10" which should be mutually exclusive.
"unless-stopped" will restart the containers on any exit state
but not start on daemon startup if container was put to stopped state before.
Closes-Bug: #1621187
Change-Id: I4d881cd123a55625121b7a9047385e9b54e2e129
After docker 1.12, the RepoTags will be None rather than [] in the
image list API. This PS will handle the both case.
Change-Id: Ie2da44b44229c2f190550755b50876f607f9cc0c
Closes-Bug: #1608358
Replace dict.iteritems() with dict.items(). The Python 3 dict
type has no iteritems() method, the old iteritems() method was
renamed to items().
TrivialFix.
Change-Id: I2137e72554fd16d2c70e50306e4f57d27e35bcd3
The traceback is logged also and will be helpful when the
library failed. We can get which line is failed from the log.
TrivialFix
Change-Id: Ia417232007e2f34c83d2e7cad6ed08dee49ce836
Ansible 2.1.0 has lots of change and the plugin is not compatible
between 2.0.0 and 2.1.0. This change fix the gap.
* fix the signature change for _make_tmp_path in ansible 2.1.0
* fix the common_options in the kolla_docker.py
Change-Id: I05f5f05581c8bd625cd868fa0db549d0c60a7043
Closes-Bug: #1586018
This patch adds ability to specify required capabilities and security
mode for a specific docker container.
Change-Id: Ib8c15a8e354178bedd31ebb31a64618431f0e135
Closes-Bug: #1572648
When image id is the same, the container won't re-create with the
latest image tag.
Change-Id: I402ad275c388006248cb559851b01b0b963cf170
Closes-Bug: #1569723
As suggested it was created the variable KOLLA_SERVICE_NAME to identify
the container service name through PS1 shell variable.
This method it was previously discussed in IRC.
https://goo.gl/k7AdEg
The other option it was usage hostname param in kolla_docker, but
currently docker does not support it due this issue:
https://github.com/docker/compose/issues/2460
The final result is like this:
$ docker exec -it heka /bin/bash
(heka)[heka@kolla-control /]$
$ docker exec -it mariadb /bin/bash
(mariadb)[mysql@kolla-control /]$
More details can be accessed through this link
http://paste.openstack.org/show/493689/
Closes-Bug: #1557454
Change-Id: I6aab8d640a8ebb17baa9d6d4f1edd6e331674713
This change will enable to lvm commands running in a container
communicate with udev process running on a host.
Partially-Implements: blueprint iscsi-lvm2-docker
Change-Id: If780710bb81adaee44ce0d291e22ce91ec6436aa