Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I6245a207ec65df0ef11a798b4cffe3157abccb73
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: Spyros Trigazis <spyridon.trigazis@cern.ch>
python docker version in u-c is bumped to 3.1.1 in [1].
Till 2.7.0 if MINIMUM_DOCKER_API_VERSION it just reported
warning but since 3.0.0 it reports Error, see [2]. This
patch bumps the expected version to 1.21 which is same
docker version used in magnum and supported by current
python docker.
[1] https://review.openstack.org/#/c/551428/
[2] df8422d079
Change-Id: Id93c5f70504c7d686dbd1b3d9bdfc1ef657d9287
Since we use docker >= 12.1 we can move to docker python SDK 2.x.x.
Docker 2.x.x is backwards compatible with older docker versions
using the APIClient instead of the DockerClient [1].
[1] https://docker-py.readthedocs.io/en/stable/api.html
Change-Id: I9e50a877de6e0a8c3ba56c2d7ebbbe336972a146
Close-Bug: #1696862
Following on from removing the k8s specific APIs in
I1f6f04a35dfbb39f217487fea104ded035b75569 the objects associated with
these APIs need removal.
Remove the container object, drop the db table and remove references to
the container object. The docker_conductor has also been removed as this
was used for managing containers using Magnum objects.
Change-Id: I288fa7a9717519b1ae8195820975676d99b4d6d2
Partially-Implements: blueprint delete-container-endpoint
Co-Authored-By: Spyros Trigazis <strigazi@gmail.com>
Docker client api has this decorator utils.check_resource for
pause/unpause action when we pass a container dict as the parameter
of `action` method.
Also cleanup logs method
Change-Id: I64983c5b07bcda049d9a5df054238703ef345055
This patch aimed to reduce db call count when we invode k8sAPI.
For those user using bay name to do pod/rc/service operations, we
can saving a db call.
Change-Id: I1488d0526e1d444cb681b408f8a13ce25b4aee6f
mem_limit and memswap_limit are moved to host_config in docker client
api for API version >= 1.19
427e3a6023
Closes-Bug: #1557895
Change-Id: I34e5e49ae650219f986a2b0032df65672c319ec6
This patch removes Hardcoded docker client settings and move them to configure
setting. Changes default value of DEFAULT_DOCKER_TIMEOUT from 10 to 60.
DEFAULT_DOCKER_TIMEOUT = 10 is too short, it brings troubles in some bad
networking environment (or bad performance swarm master), and this won't work
on gate.
The docker-py client's default value: DEFAULT_TIMEOUT_SECONDS = 60,
Suggest we set DEFAULT_DOCKER_TIMEOUT = 60, as long as our rpc time_out.
There is a circle reference between magnum/common/docker_utils.py and
magnum/conductor/handlers/common/docker_client.py, so I merge them.
Co-Authored-By: Eli Qiao <liyong.qiao@intel.com>
Change-Id: I6046376cbf5eec6b0102956fd4e4f38b958dd80c
Closes-Bug: #1519714
api_address is a API address instead of master node's IP address.
This patch fix it by adding a new OutputMapping, it will help to handle
the mapping from master address to api_address.
Also test cases added.
Closes-Bug: #1514311
Change-Id: I47baf92dd466150adbd75746d0cb804d108f7d5f
Some tests used incorrect order assertEqual(observed, expected).
The correct order expected by testtools is
assertEqual(expected, observed).
This patch fix the issue in the module magnum/tests/unit/common/.
Change-Id: Ib92006145171d265b836e0fc9951583414d83952
Partial-Bug: #1259292
This method is for obtaining a docker client that is used to
communicate with a swarm bay. Pulling it out of docker conductor
allows it to be reused later.
Change-Id: I495835595ee049103f97ee8b5bfe9eb74fe9ad45
Partial-Bug: #1503460