Skip to content

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Aug 29, 2023


testing: update docker-py to 7.0.0b1

docker/docker-py@6.1.3...7.0.0b1

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah
Copy link
Member Author

Looks like there's 2 tests that still need fixing in docker-py;

_________________ TestNetworks.test_connect_with_ipv6_address __________________
docker/api/client.py:265: in _raise_for_status
    response.raise_for_status()
/usr/local/lib/python3.7/site-packages/requests/models.py:1021: in raise_for_status
    raise HTTPError(http_error_msg, response=self)
E   requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.44/networks/create

The above exception was the direct cause of the following exception:
tests/integration/api_network_test.py:391: in test_connect_with_ipv6_address
    gateway="2001:389::ffff"
tests/integration/api_network_test.py:16: in create_network
    net_id = self.client.create_network(net_name, *args, **kwargs)['Id']
docker/api/network.py:153: in create_network
    return self._result(res, json=True)
docker/api/client.py:271: in _result
    self._raise_for_status(response)
docker/api/client.py:267: in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
docker/errors.py:39: in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
E   docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.44/networks/create: Bad Request ("invalid network config:
E   invalid subnet 2001:389::/64: IPv6 has not been enabled for this network")
__________________ TestNetworks.test_create_with_ipv6_address __________________
docker/api/client.py:265: in _raise_for_status
    response.raise_for_status()
/usr/local/lib/python3.7/site-packages/requests/models.py:1021: in raise_for_status
    raise HTTPError(http_error_msg, response=self)
E   requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.44/networks/create

The above exception was the direct cause of the following exception:
tests/integration/api_network_test.py:236: in test_create_with_ipv6_address
    pool_configs=[IPAMPool(subnet="2001:389::/64")],
tests/integration/api_network_test.py:16: in create_network
    net_id = self.client.create_network(net_name, *args, **kwargs)['Id']
docker/api/network.py:153: in create_network
    return self._result(res, json=True)
docker/api/client.py:271: in _result
    self._raise_for_status(response)
docker/api/client.py:267: in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
docker/errors.py:39: in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
E   docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.44/networks/create: Bad Request ("invalid network config:
E   invalid subnet 2001:389::/64: IPv6 has not been enabled for this network")

@akerouanton
Copy link
Member

It looks like the daemon was not erroring out on that prior to #45759 (ie. it was silently ignoring IPv6 subnets if EnableIPv6 was not true). For both tests, the IP address set during create/connect would previously end up in EndpointSettings but the corresponding interface wouldn't get this address assigned as EnableIPv6 isn't set.

I think we should remove this check and instead automatically turn EnableIPv6 to true if there's an IPv6 subnet set.

akerouanton added a commit to akerouanton/docker that referenced this pull request Sep 11, 2023
Fix moby#46368.

PR moby#45759 added a validation step to `NetworkCreate` to ensure
no IPv6 subnet could be set on a network if its `EnableIPv6` parameter
is false.

Before that, the daemon was accepting such request but was doing nothing
with the IPv6 subnet.

This validation step is now deleted, and we automatically set
`EnableIPv6` if an IPv6 subnet was specified.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Sep 11, 2023
Fix moby#46368.

PR moby#45759 added a validation step to `NetworkCreate` to ensure
no IPv6 subnet could be set on a network if its `EnableIPv6` parameter
is false.

Before that, the daemon was accepting such request but was doing nothing
with the IPv6 subnet.

This validation step is now deleted, and we automatically set
`EnableIPv6` if an IPv6 subnet was specified.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
@thaJeztah thaJeztah force-pushed the docker_py_latest branch 2 times, most recently from ad08241 to 3905155 Compare September 12, 2023 09:07
docker/docker-py@6.1.3...7.0.0b1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This reverts commit 19d860f.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah changed the title testing: update docker-py to latest (main branch) testing: update docker-py to 7.0.0b1 Nov 21, 2023
@thaJeztah
Copy link
Member Author

nice! looks like it's happy;

=============================== warnings summary ===============================
tests/integration/client_test.py::CancellableEventsTest::test_cancel_events
  /src/docker/utils/utils.py:398: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    delta = dt - datetime.utcfromtimestamp(0)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
------- generated xml file: /src/bundles/test-docker-py/junit-report.xml -------
=========================== short test summary info ============================
XFAIL tests/integration/api_container_test.py::CreateContainerTest::test_create_with_cpu_rt_options - CONFIG_RT_GROUP_SCHED isn't enabled
XFAIL tests/integration/api_container_test.py::CreateContainerTest::test_create_with_storage_opt - Not supported on most drivers
XFAIL tests/integration/api_container_test.py::ContainerTopTest::test_top - Output of docker top depends on host distro, and is not formalized.
XFAIL tests/integration/api_container_test.py::ContainerTopTest::test_top_with_psargs - Output of docker top depends on host distro, and is not formalized.
XFAIL tests/integration/api_swarm_test.py::SwarmTest::test_init_swarm_data_path_addr - Can fail if eth0 has multiple IP addresses
XFAIL tests/integration/api_swarm_test.py::SwarmTest::test_init_swarm_with_log_driver - This doesn't seem to be taken into account by the engine
SKIPPED [1] tests/integration/api_image_test.py:289: Doesn't work inside a container - FIXME
SKIPPED [1] tests/integration/api_swarm_test.py:30: Test stalls the engine on 1.12.0
= 395 passed, 2 skipped, 2 deselected, 6 xfailed, 3 xpassed, 1 warning in 298.96s (0:04:58) =

@thaJeztah thaJeztah added this to the 25.0.0 milestone Nov 21, 2023
@thaJeztah thaJeztah marked this pull request as ready for review November 21, 2023 23:07
@thaJeztah thaJeztah requested a review from tianon as a code owner November 21, 2023 23:07
@thaJeztah
Copy link
Member Author

/cc @milas @akerouanton PTAL 👍

@AkihiroSuda AkihiroSuda merged commit b93a532 into moby:master Nov 22, 2023
@thaJeztah thaJeztah deleted the docker_py_latest branch November 22, 2023 07:39
@milas
Copy link
Contributor

milas commented Nov 27, 2023

Thanks for getting this merged ❤️

FYI I tagged a 7.0.0b2 today but it's bit-for-bit identical, the PyPI publishing was just broken before so I needed to fix the GHA CI pipeline.

I'll circle back once 7.0.0 final is tagged to bump the version off the beta.

@thaJeztah
Copy link
Member Author

Thanks; saw the b2 arrive, and that they were identical, so I didn't hurry yet to update it (as we're using the tag from GitHub), but can update once we have 7.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants