Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apiv2: test using docker-py integration tests #5386

Closed
gartnera opened this issue Mar 3, 2020 · 47 comments
Closed

apiv2: test using docker-py integration tests #5386

gartnera opened this issue Mar 3, 2020 · 47 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@gartnera
Copy link

gartnera commented Mar 3, 2020

/kind feature

Description

Consider using the docker-py integration tests to measure the progress on the apiv2 development effort. This is what the output of the tests look like with dockerd:

root@podman:~/docker-py/tests/integration# pytest
============================================================================== test session starts ===============================================================================
platform linux -- Python 3.6.9, pytest-4.3.1, py-1.8.1, pluggy-0.13.1
rootdir: /root/docker-py, inifile: pytest.ini
plugins: timeout-1.3.3, cov-2.6.1
collected 387 items

api_build_test.py .......s....s..........X                                                                                                                                 [  6%]
api_client_test.py .....                                                                                                                                                   [  7%]
api_config_test.py .....                                                                                                                                                   [  8%]
api_container_test.py ....xF..........x.........................................xx.....................                                                                    [ 29%]
api_exec_test.py .....................                                                                                                                                     [ 35%]
api_healthcheck_test.py ....                                                                                                                                               [ 36%]
api_image_test.py ...s........s.....                                                                                                                                       [ 40%]
api_network_test.py ...........................                                                                                                                            [ 47%]
api_plugin_test.py ...........                                                                                                                                             [ 50%]
api_secret_test.py .....                                                                                                                                                   [ 51%]
api_service_test.py ................s..........................................                                                                                            [ 67%]
api_swarm_test.py .ssss.Xs...x.......                                                                                                                                      [ 72%] 
api_volume_test.py .........                                                                                                                                               [ 74%]
client_test.py .....                                                                                                                                                       [ 75%]
context_api_test.py ..                                                                                                                                                     [ 76%] 
errors_test.py .                                                                                                                                                           [ 76%]
models_containers_test.py ...................F.................                                                                                                            [ 86%]
models_images_test.py ...............                                                                                                                                      [ 89%]
models_networks_test.py ....                                                                                                                                               [ 90%]
models_nodes_test.py .                                                                                                                                                     [ 91%]
models_resources_test.py .                                                                                                                                                 [ 91%]
models_services_test.py ..............X.                                                                                                                                   [ 95%]
models_swarm_test.py ..                                                                                                                                                    [ 96%]
models_volumes_test.py ..                                                                                                                                                  [ 96%]
regression_test.py ......                                                                                                                                                  [ 98%]
credentials/store_test.py EEEEEE                                                                                                                                           [ 99%]
credentials/utils_test.py .                                                                                                                                                [100%]

This is what the output of the tests look like with podman system service -t 0:

root@podman:~/docker-py/tests/integration# pytest
============================================================================== test session starts ===============================================================================
platform linux -- Python 3.6.9, pytest-4.3.1, py-1.8.1, pluggy-0.13.1
rootdir: /root/docker-py, inifile: pytest.ini
plugins: timeout-1.3.3, cov-2.6.1
collected 387 items

api_build_test.py F..FFFFFFFFFFFFFFFFFF..x                                                                                                                                 [  6%]
api_client_test.py .....                                                                                                                                                   [  7%]
api_config_test.py EEEEE                                                                                                                                                   [  8%]
api_container_test.py FFFFxxFEFFFFFFFFFFxxFFEFEFEFFFFFFFFFFEFEFEFEFFFFFFEFFFFFFFFEFFFFFFFEFFFxxxxFFFFFFEFEFEFEFEFEFFFFEFEFEFEFEFF                                          [ 29%]
api_exec_test.py FFFFFFFFEFFFFFFFFFFFFF                                                                                                                                    [ 35%]
api_healthcheck_test.py FEFEFEFE                                                                                                                                           [ 36%]
api_image_test.py FFFFFFFEFF...s..FEFF                                                                                                                                     [ 40%]
api_network_test.py FFFFFFFFFFFFF.FF.FFFFFEFFFFF                                                                                                                           [ 47%]
api_plugin_test.py FFFFFFFFFFF                                                                                                                                             [ 50%]
api_secret_test.py EEEEE                                                                                                                                                   [ 51%]
api_service_test.py EEEEEEEEEEEEEEEEsEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                                                                                            [ 67%]
api_swarm_test.py FssssFxsFFFxFFFFFFF                                                                                                                                      [ 72%]
api_volume_test.py F.F.FFF.F                                                                                                                                               [ 74%]
client_test.py ..F..                                                                                                                                                       [ 75%]
context_api_test.py ..                                                                                                                                                     [ 76%]
errors_test.py F                                                                                                                                                           [ 76%]
models_containers_test.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF                                                                                                            [ 86%]
models_images_test.py FFFFFFFFFFF.F.F                                                                                                                                      [ 89%]
models_networks_test.py FFFF                                                                                                                                               [ 90%]
models_nodes_test.py F                                                                                                                                                     [ 91%]
models_resources_test.py F                                                                                                                                                 [ 91%]
models_services_test.py EEEEEEEEEEEEEExE                                                                                                                                   [ 95%]
models_swarm_test.py FF                                                                                                                                                    [ 96%]
models_volumes_test.py FF                                                                                                                                                  [ 96%]
regression_test.py .F.FFFE                                                                                                                                                 [ 98%]
credentials/store_test.py EEEEEE                                                                                                                                           [ 99%]
credentials/utils_test.py .                                                                                                                                                [100%]

There's clearly a long way to go on development. This would also help potential users understand what is supported by podman apiv2 and perhaps even help scope future development efforts.

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 3, 2020
@baude
Copy link
Member

baude commented Mar 3, 2020

take a closer look at the tests ... they use swarm and a bunch of stuff we will never do.

@baude
Copy link
Member

baude commented Mar 3, 2020

they also dont support multiple registries and consider docker.io to be the one and only registries making their short name use difficult to deal with.

@gartnera
Copy link
Author

gartnera commented Mar 3, 2020

take a closer look at the tests ... they use swarm and a bunch of stuff we will never do.

Yep those aren't features I care about either. But it's a great way to demonstrate to potential adopters what works with apiv2 (in a very granular fashion). I'm not even necessarily saying run it with your normal CI pipelines, maybe just run it for every release.

they also dont support multiple registries and consider docker.io to be the one and only registries making their short name use difficult to deal with.

This doesn't seem to be particularly relevant to this issue (unless I'm misunderstanding).

If you want apiv2 to be compatible with the docker api there's unfortunately a lot of annoying ego (and industry capturing) decisions to deal with and overcome.

@baude
Copy link
Member

baude commented Mar 3, 2020

it matters because several of the tests fail because of it. again, so many of the tests use functions that we won't support I wonder how to make any of it applicable.

@github-actions
Copy link

github-actions bot commented Apr 3, 2020

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Apr 3, 2020

@gartnera Did you ever look any further into this? Even if we could get a subset of the tests to work, it would be a big step forward.

@gartnera
Copy link
Author

gartnera commented Apr 3, 2020

No I haven't done anything more. I reran the tests this morning against master, here's the results:

============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-4.3.1, py-1.8.1, pluggy-0.13.1
rootdir: /root/docker-py, inifile: pytest.ini
plugins: timeout-1.3.3, cov-2.6.1
timeout: 60.0s
timeout method: signal
timeout func_only: False
collected 387 items

api_build_test.py F...FFFF.FF.FF.FF.FFF..x                               [  6%]
api_client_test.py .....                                                 [  7%]
api_config_test.py EEEEE                                                 [  8%]
api_container_test.py ....xFF.FFF...F.xF...FFFFFFFFFFFFFF....F.FFFFF.FFF [ 21%]
..FF...Fxx.....FFEFFFFF.F.FFFFFF                                         [ 29%]
api_exec_test.py FFFFFFFFFFFFFFFFFFFFF                                   [ 35%]
api_healthcheck_test.py FFFF                                             [ 36%]
api_image_test.py ..FFFFFFF...s..FFF                                     [ 40%]
api_network_test.py FFFFFFFFFFFFF.FF.FFFFFFFFFF                          [ 47%]
api_plugin_test.py FFFFFFFFFFF                                           [ 50%]
api_secret_test.py EEEEE                                                 [ 51%]
api_service_test.py EEEEEEEEEEEEEEEEsEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 65%]
EEEEEEE                                                                  [ 67%]
api_swarm_test.py FssssFxsFFFxFFFFFFF                                    [ 72%]
api_volume_test.py F.F.FFF.F                                             [ 74%]
client_test.py ..F..                                                     [ 75%]
context_api_test.py ..                                                   [ 76%]
errors_test.py F                                                         [ 76%]
models_containers_test.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF          [ 86%]
models_images_test.py FFFF..FFFFF.F.F                                    [ 89%]
models_networks_test.py FFFF                                             [ 90%]
models_nodes_test.py F                                                   [ 91%]
models_resources_test.py .                                               [ 91%]
models_services_test.py EEEEEEEEEEEEEExE                                 [ 95%]
models_swarm_test.py FF                                                  [ 96%]
models_volumes_test.py FF                                                [ 96%]
regression_test.py F...FF                                                [ 98%]
credentials/store_test.py EEEEEE                                         [ 99%]
credentials/utils_test.py .                                              [100%]

Looks like there was decent improvement in api_build_test.py and api_container_test.py.

@rhatdan
Copy link
Member

rhatdan commented Apr 3, 2020

FYI @jwhonce @baude

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2020

@gartnera Have you continued to work on this?

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2020

@gartnera Would be nice to see how we have progressed.

@gartnera
Copy link
Author

gartnera commented Jun 9, 2020

Looks like most of the docker-py tests fail now with errors like:

API versions below 1.21 are no longer supported by this library

Worked around that by editing MINIMUM_DOCKER_API_VERSION in docker-py/docker/constants.py

Now I get these results:

============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-4.3.1, py-1.8.1, pluggy-0.13.1
rootdir: /root/docker-py, inifile: pytest.ini
plugins: timeout-1.3.3, cov-2.6.1
timeout: 60.0s
timeout method: signal
timeout func_only: False
collected 387 items

api_build_test.py F..FFFFFFFFFFFFFFFFFF..x                               [  6%]
api_client_test.py .....                                                 [  7%]
api_config_test.py EEEEE                                                 [  8%]
api_container_test.py ....xFF.FFF...F.xF...FFFFFFFFFFFFFF....F.FFFFF.F.. [ 21%]
..FF...Fxx.....FF........FFFFFF                                          [ 29%]
api_exec_test.py .FFFFFFFFFFFFFFFFFFFF                                   [ 35%]
api_healthcheck_test.py FFFF                                             [ 36%]
api_image_test.py ..FFFFF.F...s..FFF                                     [ 40%]
api_network_test.py FFFFFFFFFFFFF.FF.FFFFFFFFFF                          [ 47%]
api_plugin_test.py FFFFFFFFFFF                                           [ 50%]
api_secret_test.py EEEEE                                                 [ 51%]
api_service_test.py EEEEEEEEEEEEEEEEsEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 65%]
EEEEEEE                                                                  [ 67%]
api_swarm_test.py FssssFxsFFFxFFFFFFF                                    [ 72%]
api_volume_test.py F.F.FFF.F                                             [ 74%]
client_test.py ..F..                                                     [ 75%]
context_api_test.py ..                                                   [ 76%]
errors_test.py F                                                         [ 76%]
models_containers_test.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF          [ 86%]
models_images_test.py FFFF..FFFFF.F.F                                    [ 89%]
models_networks_test.py FFFF                                             [ 90%]
models_nodes_test.py F                                                   [ 91%]
models_resources_test.py .                                               [ 91%]
models_services_test.py EEEEEEEEEEEEEExE                                 [ 95%]
models_swarm_test.py FF                                                  [ 96%]
models_volumes_test.py FF                                                [ 96%]
regression_test.py ....FF                                                [ 98%]
credentials/store_test.py EEEEEE                                         [ 99%]
credentials/utils_test.py .                                              [100%]

There are six more passing tests (71 -> 77) since the last time I tested.

The most prominent errors looks like this:

During handling of the above exception, another exception occurred:
models_containers_test.py:324: in test_restart
    container = client.containers.run("alpine", "sleep 100", detach=True)
../../docker/models/containers.py:803: in run
    detach=detach, **kwargs)
../../docker/models/containers.py:861: in create
    resp = self.client.api.create_container(**create_kwargs)
../../docker/api/container.py:430: in create_container
    return self.create_container_from_config(config, name)
../../docker/api/container.py:441: in create_container_from_config
    return self._result(res, True)
../../docker/api/client.py:267: in _result
    self._raise_for_status(response)
../../docker/api/client.py:263: in _raise_for_status
    raise create_api_error_from_http_exception(e)
../../docker/errors.py:31: in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
E   docker.errors.APIError: 500 Server Error: Internal Server Error ("NewFromLocal(): unable to find a name and tag match for alpine in repotags: no such image")
___________________________ ContainerTest.test_start ___________________________
../../docker/api/client.py:261: in _raise_for_status
    response.raise_for_status()
/usr/lib/python3/dist-packages/requests/models.py:935: in raise_for_status
    raise HTTPError(http_error_msg, response=self)
E   requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.35/containers/create

This appears to be because podman doesn't pull images if they don't exist. To reproduce:

  • rm -rf /var/lib/containers
  • podman system service -t0
  • docker run -it --rm alpine /bin/sh
root@podman:~# docker run -it --rm alpine /bin/sh
docker: Error response from daemon: NewFromLocal(): unable to find a name and tag match for alpine in repotags: no such image.
See 'docker run --help'.
root@podman:~#

I also can't run containers if I don't explicitly set the command which I suspect is the cause of other test failures:

root@podman:~# docker run -it --rm alpine
unable to upgrade to tcp, received 409

Version info:

root@podman:~# docker version
Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.1
 Git commit:        2d0083d
 Built:             Fri Aug 16 14:20:06 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: linux/amd64/ubuntu-18.04
 Podman Engine:
  Version:          2.0.0-dev
  APIVersion:       1.0.0
  Arch:             amd64
  BuildTime:        2020-06-09T20:25:53Z
  Experimental:     true
  GitCommit:        fbe09d78e91c9ac5cadc8b00a67c7d7f89d64868-dirty
  GoVersion:        go1.13.4
  KernelVersion:    5.3.0-26-generic
  MinAPIVersion:    1.0.0
  Os:               linux
 Engine:
  Version:          2.0.0-dev
  API version:      1.0.0 (minimum version 1.0.0)
  Go version:       go1.13.4
  Git commit:       fbe09d78e91c9ac5cadc8b00a67c7d7f89d64868-dirty
  Built:            Tue Jun  9 20:25:53 2020
  OS/Arch:          linux/amd64
  Experimental:     true

@rhatdan
Copy link
Member

rhatdan commented Jun 10, 2020

@jwhonce Is our Docker version too old?

@jwhonce
Copy link
Member

jwhonce commented Jun 10, 2020

@rhatdan I'll research this how they are determining version. Via ping we report compatibility API v1.40.0 the latest.

@gartnera What value did you use for MINIMUM_DOCKER_API_VERSION ? TIA

@gartnera
Copy link
Author

MINIMUM_DOCKER_API_VERSION = '1.0'

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jul 13, 2020

@jwhonce @gartnera Is this still an issue?

@gartnera
Copy link
Author

You could close if if you'd like. I'll try and file some more specific issues. I reran the tests today, the output is below. Doesn't look like there's been much movement over the past month or two.

============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-4.3.1, py-1.8.1, pluggy-0.13.1
rootdir: /root/docker-py, inifile: pytest.ini
plugins: timeout-1.3.3, cov-2.6.1
timeout: 60.0s
timeout method: signal
timeout func_only: False
collected 387 items

api_build_test.py F..FFFFFFFFFFFFFFFFFF..x                               [  6%]
api_client_test.py .....                                                 [  7%]
api_config_test.py EEEEE                                                 [  8%]
api_container_test.py ....xFF.FFF...F.xF...FFFFFFFFFFFFFF....F.FFFFF.F.. [ 21%]
..FF....xx.....FF........FFFFFF                                          [ 29%]
api_exec_test.py .FFFFFFFFFFFFFFFFFFFF                                   [ 35%]
api_healthcheck_test.py FFFF                                             [ 36%]
api_image_test.py ..FFFFF.F...s..FFF                                     [ 40%]
api_network_test.py FFFFFFFFFFFFF.FF.FFFFFFFFFF                          [ 47%]
api_plugin_test.py FFFFFFFFFFF                                           [ 50%]
api_secret_test.py EEEEE                                                 [ 51%]
api_service_test.py EEEEEEEEEEEEEEEEsEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 65%]
EEEEEEE                                                                  [ 67%]
api_swarm_test.py FssssFxsFFFxFFFFFFF                                    [ 72%]
api_volume_test.py .F..FF...                                             [ 74%]
client_test.py ..F..                                                     [ 75%]
context_api_test.py ..                                                   [ 76%]
errors_test.py F                                                         [ 76%]
models_containers_test.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF          [ 86%]
models_images_test.py FFFF..FFFFF.F..                                    [ 89%]
models_networks_test.py FFFF                                             [ 90%]
models_nodes_test.py F                                                   [ 91%]
models_resources_test.py .                                               [ 91%]
models_services_test.py EEEEEEEEEEEEEExE                                 [ 95%]
models_swarm_test.py FF                                                  [ 96%]
models_volumes_test.py .F                                                [ 96%]
regression_test.py ....F.                                                [ 98%]
credentials/store_test.py EEEEEE                                         [ 99%]
credentials/utils_test.py .                                              [100%]

@rhatdan
Copy link
Member

rhatdan commented Jul 14, 2020

My understanding of the issues here is that a lot of docker-py tests rely on swarm and some network features, and rely on docker.io as the only registry. If docker-py wants to make their tests work with Podman or a subset, then we can do that. For now, we have been adding docker-py tests to podman but not the entire test suite.

If a community member wants to take this on it would be appreciated, but the core team has decided this is not a priority.

@rhatdan
Copy link
Member

rhatdan commented Sep 10, 2020

Still not a priority.

@riyad
Copy link
Contributor

riyad commented Sep 17, 2020

I have the same issue as in #5386 (comment)

Using Ansible's docker_container tasks (using the docker python package in the background) fail with the same error: fatal: [test]: FAILED! => {"changed": false, "msg": "Docker API version is 1.0.0. Minimum version required is 1.20."}

Intrigued by #5386 (comment) I tried to find out.

Running curl --unix-socket /run/podman/podman.sock http://localhost/version | jq on Fedora 32 with Podman 2.0.6:

{
  "Platform": {
    "Name": "linux/amd64/fedora-32"
  },
  "Components": [
    {
      "Name": "Podman Engine",
      "Version": "2.0.6",
      "Details": {
        "APIVersion": "1.0.0",
        "Arch": "amd64",
        "BuildTime": "2020-09-01T19:26:51Z",
        "Experimental": "true",
        "GitCommit": "",
        "GoVersion": "go1.14.6",
        "KernelVersion": "5.4.0-47-generic",
        "MinAPIVersion": "1.0.0",
        "Os": "linux"
      }
    }
  ],
  "Version": "2.0.6",
  "ApiVersion": "1.0.0",
  "MinAPIVersion": "1.0.0",
  "GitCommit": "",
  "GoVersion": "go1.14.6",
  "Os": "linux",
  "Arch": "amd64",
  "KernelVersion": "5.4.0-47-generic",
  "Experimental": true,
  "BuildTime": "2020-09-01T19:26:51Z"
}

It seems Podman actually reports it "only" supports ApiVersion: "1.0.0".
Maybe the reported version should be updated to match the actually supported API version.

@riyad
Copy link
Contributor

riyad commented Sep 17, 2020

I've separately reported this in #7682.

@rhatdan
Copy link
Member

rhatdan commented Sep 21, 2020

Well a fix for this has been merged, does this make this any better?

@rhatdan
Copy link
Member

rhatdan commented Nov 24, 2020

@gartnera Could you give us another run?

@riyad
Copy link
Contributor

riyad commented Nov 25, 2020

If it's of any help ... I just ran the integration tests myself. 🙂

Distro: Ubuntu 20.04
Podman: 2.1.1
docker-py: master

============================= test session starts ==============================
platform linux -- Python 3.8.5, pytest-4.3.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/riyad/src/docker-py, inifile: pytest.ini
plugins: cov-2.6.1, timeout-1.3.3
collected 389 items

tests/integration/api_build_test.py F..FFFFF.FF.FF.FFFFFF..x             [  6%]
tests/integration/api_client_test.py .....                               [  7%]
tests/integration/api_config_test.py EEEEE                               [  8%]
tests/integration/api_container_test.py ....xFF..FF...F.xF...FFFF..FFFFF [ 16%]
FFF....F.FFFFF.F..........xx.....FF........FFFFFF                        [ 29%]
tests/integration/api_exec_test.py F........FF......FFFF                 [ 34%]
tests/integration/api_healthcheck_test.py FFFF                           [ 35%]
tests/integration/api_image_test.py ...F.FF.F...s..FFF                   [ 40%]
tests/integration/api_network_test.py FFFFFFFFFFFFF.FF.FFFFFFFFFFF       [ 47%]
tests/integration/api_plugin_test.py FFFFFFFFFFF                         [ 50%]
tests/integration/api_secret_test.py EEEEE                               [ 51%]
tests/integration/api_service_test.py EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 60%]
EEEEEEEEEEEEEEEEEEEEEEEEE                                                [ 67%]
tests/integration/api_swarm_test.py FFFFFFxsFFFxFFFFFFF                  [ 71%]
tests/integration/api_volume_test.py .F..FF...                           [ 74%]
tests/integration/client_test.py ..F..                                   [ 75%]
tests/integration/context_api_test.py FFF                                [ 76%]
tests/integration/errors_test.py F                                       [ 76%]
tests/integration/models_containers_test.py .FFF.F..FFFF.FFFFFFFF.FF.... [ 83%]
.F.F.FFF.                                                                [ 86%]
tests/integration/models_images_test.py FFFF..FFFFF.F..                  [ 89%]
tests/integration/models_networks_test.py FFFF                           [ 91%]
tests/integration/models_nodes_test.py F                                 [ 91%]
tests/integration/models_resources_test.py .                             [ 91%]
tests/integration/models_services_test.py EEEEEEEEEEEEEExE               [ 95%]
tests/integration/models_swarm_test.py FF                                [ 96%]
tests/integration/models_volumes_test.py .F                              [ 96%]
tests/integration/regression_test.py F...F.                              [ 98%]
tests/integration/credentials/store_test.py EEEEEE                       [ 99%]
tests/integration/credentials/utils_test.py .                            [100%]

[...]

= 171 failed, 118 passed, 2 skipped, 8 xfailed, 1 warnings, 90 error in 1407.22 seconds =

full log

@kwiesmueller
Copy link
Contributor

kwiesmueller commented Dec 4, 2020

Hey there,
I'm currently trying to make a project work with podman and am also getting the
unable to upgrade to tcp, received 409 using the podman socket with docker-cli.

It happens for basic commands like docker run hello-world /bin/bash.

Client: Docker Engine - Community
 Version:           20.10.0-rc2
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        dca98e3
 Built:             Wed Dec  2 22:19:20 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: linux/amd64/fedora-33
 Podman Engine:
  Version:          2.1.1
  APIVersion:       2.0.0
  Arch:             amd64
  BuildTime:        2020-10-07T18:21:20+02:00
  Experimental:     true
  GitCommit:        
  GoVersion:        go1.15.2
  KernelVersion:    5.9.11-200.fc33.x86_64
  MinAPIVersion:    2.0.0
  Os:               linux
 Engine:
  Version:          2.1.1
  API version:      1.40 (minimum version 1.24)
  Go version:       go1.15.2
  Git commit:       
  Built:            Wed Oct  7 18:21:20 2020
  OS/Arch:          linux/amd64
  Experimental:     true

@riyad
Copy link
Contributor

riyad commented Dec 8, 2020

The bug in #8547 gets more and more confusing by the minute 😖 ... I tried to compare Podman 2.1.1 with 3.0-dev (e2f9120) and CLI with API behavior:

  • Podman 2.1.1 CLI broken
  • Podman 2.1.1 API correct
  • Podman 3.0-dev CLI correct
  • Podman 3.0-dev API broken

@yajo
Copy link

yajo commented Jan 1, 2021

take a closer look at the tests ... they use swarm and a bunch of stuff we will never do.

I don't know if you're aware of the test filtering features pytest has. You can test specific files of the suite, or even filter them with expressions using -k or fixtures (depending on how the test suite is organized). Probably it would be a good idea to filter out tests that are known to fail and still run the ones that should.

You can maintain all those settings in a pytest.ini file, or through CLI flags in the CI command.

@rhatdan
Copy link
Member

rhatdan commented Jan 4, 2021

Interested in opening a PR to do this?

@riyad
Copy link
Contributor

riyad commented Jan 6, 2021

This is how my pytest.ini currently looks like:

[pytest]
addopts =
    --tb=short
    -rxs
    --no-header
    -v
    -k 'not SwarmTest and not NodesTest and not ServiceTest and not SecretAPITest and not TestStore and not ConfigAPITest and not test_create_network_attachable and not test_create_network_ingress and not test_create_inspect_network_with_scope'

junit_suite_name = docker-py
junit_family = xunit2

testpaths =
    tests/integration/

I set testpaths to only run the integration tests (i.e. exercising the API and not testing docker-py internals).
The -k option currently filters all tests that rely on Docker Swarm either directly or indirectly (~116 tests at the moment).
The rest of the options is basically for the output to be in a useful format (for me).

@rhatdan Is there a rough list of (API) features/aspects that Podman is not going to replicate? e.g.

  • Swarm (and by extension Nodes, Services, Tasks, Secrets and Configs APIs)
  • linking containers
  • updating containers
  • health checks
  • plugins

@rhatdan
Copy link
Member

rhatdan commented Jan 6, 2021

That is a good starting list. @baude @mheon WDYT?

@jwhonce
Copy link
Member

jwhonce commented Jan 7, 2021

@riyad There are some outstanding endpoints like /network/prune that are TBD on being implemented.

@riyad
Copy link
Contributor

riyad commented Feb 6, 2021

Because @matejvasek asked over in another PR:

I've put together some scripts and documentation on how to run the docker-py integration tests against Podman.
Please have a look at https://github.com/riyad/podman-integration-test-utils

I hope someone finds it useful. 😃

@matejvasek
Copy link
Contributor

@riyad nice, I'll try it out.

@riyad
Copy link
Contributor

riyad commented Feb 10, 2021

I hope all the issues I'm opening aren't getting on your nerves 😅

@TomSweeneyRedHat
Copy link
Member

@riyad never! But we'd love it if you sent in a PR or two too! 😃

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Mar 15, 2021

@riyad Is this still an issue?

@riyad
Copy link
Contributor

riyad commented Mar 15, 2021

IMHO this issue can be closed. 👍

If I'm allowed to reinterpret the original issue: it was steering Podman's API efforts towards something that could be described as "ecosystem compatibility". With all the effort put in fixing issues uncovered by the docker-py test suite as well as the docker-compose compatibility I'd attest that this matter is taken seriously. 😄
Although there're still gaps in compatibility it's enough to address them individually (as has been the case lately anyway).

With regard to the docker-py test suite I've put together https://github.com/riyad/podman-integration-test-utils as a way to document and automate running docker-py's integration tests against Podman's API service. It also has some rudimentary tools (and data) to display and track the progress in API compatibility.

To summarize Podman's progress ... is quite impressive to be honest:
Passing tests per Podman verison:

  • Podman 2.1.1: 120
  • Podman 2.2.1: 131
  • Podman 3.0.0/3.0.1: 159
  • Podman 3.1.0-dev: 173

These are the "conservative" numbers: you'll generally get +2 if using crun and there're 1-3 tests which are flaky.

@rhatdan rhatdan closed this as completed Mar 16, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

10 participants