Skip to content

Conversation

@jmtd
Copy link
Collaborator

@jmtd jmtd commented Mar 22, 2024

This introduces an environment variable CTF_API_SOCK, defaulting to unix://var/run/docker.sock, to permit a user to point it at another API end-point, such as Podman.

@jmtd jmtd force-pushed the podman branch 2 times, most recently from 2f713a5 to 5ca0444 Compare November 21, 2024 16:12
@jmtd jmtd changed the title WIP: Adjust behave-test-steps so it can be used with Podman Some adjustments to use behave tests with Podman May 2, 2025
@jmtd
Copy link
Collaborator Author

jmtd commented May 2, 2025

Hi @rnc, for your consideration :)

@jmtd jmtd marked this pull request as ready for review May 2, 2025 09:55
@jmtd jmtd requested review from goldmann and rnc May 2, 2025 10:46
@rnc
Copy link
Contributor

rnc commented May 2, 2025

Hi @rnc, for your consideration :)

This is very interesting. Does it solve cekit/cekit#495 ? I think there needs to be some documentation or pointers at least for setup? In that issue you mentioned about logging - is that still a problem?

@jmtd
Copy link
Collaborator Author

jmtd commented May 2, 2025

This is very interesting. Does it solve cekit/cekit#495 ?

I don't think it completely solves it, but it moves us much closer. I think some of the steps may need adjusting to work with both docker and podman.

I think there needs to be some documentation or pointers at least for setup?

Should that go in this repo, or extend the Cekit docs?

In that issue you mentioned about logging - is that still a problem?

I need to try re-running all our image tests with this change and podman to see how they fair.

@rnc
Copy link
Contributor

rnc commented May 2, 2025

This is very interesting. Does it solve cekit/cekit#495 ?

I don't think it completely solves it, but it moves us much closer. I think some of the steps may need adjusting to work with both docker and podman.

I think there needs to be some documentation or pointers at least for setup?

Should that go in this repo, or extend the Cekit docs?

Well the only docs in this repo is what you just did in #78 so I think perhaps adding to CEKit docs in https://docs.cekit.io/en/latest/handbook/testing/behave.html might be best.

In that issue you mentioned about logging - is that still a problem?

I need to try re-running all our image tests with this change and podman to see how they fair.

Ok cool.

@jmtd
Copy link
Collaborator Author

jmtd commented May 8, 2025

@jmtd wrote:

I need to try re-running all our image tests with this change and podman to see how they fair.

I did that, good results:

   docker:
     13 features passed, 0 failed, 2 skipped
     44 scenarios passed, 0 failed, 26 skipped
     124 steps passed, 0 failed, 80 skipped, 0 undefined
     Took 19m12.514s

    podman:
     13 features passed, 0 failed, 2 skipped
     44 scenarios passed, 0 failed, 26 skipped
     124 steps passed, 0 failed, 80 skipped, 0 undefined
     Took 19m44.736s

@rnc wrote:

I think perhaps adding to CEKit docs in https://docs.cekit.io/en/latest/handbook/testing/behave.html might be best.

I'll prepare that in another PR. Do you consider that blocking this one?

@jmtd
Copy link
Collaborator Author

jmtd commented May 27, 2025

I've recently learned/remembered the env var DOCKER_HOST which is honoured by the official Docker client (i.e. /usr/bin/docker) and some API tooling : the python-docker library supports it for the main client API; and it seems s2i also honours that variable.

However, this repo doesn't use the python-docker client API, but the low-level API, which doesn't honour DOCKER_HOST.

I think this PR could be shrunk to only 80519a2 if we used DOCKER_HOST as the name, and bd6f051 would no longer be necessary. I am testing.

@jmtd
Copy link
Collaborator Author

jmtd commented May 27, 2025

Confirmed with local testing. PR shrunk and improved. I've left in the clean-up 36f8f8b even though it's no longer strictly necessary; I think it aids code clarity.

jmtd added 2 commits May 27, 2025 11:11
DOCKER_HOST is an environment variable to describe the URI to connect
to.

It was originally defined and honoured by /usr/bin/docker and some bits
of the python docker API (the Client API, but not the low-level API we
use, alas). It's also supported by s2i.

BY honouring it in behave-tests-steps, the end-user can use Podman
instead of Docker, e.g.

    $ systemctl --user start podman.service
    $ export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
    $ cekit … test behave

Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
Use python3 f-strings so we can use the variable name directly at
the substitution site and not have to keep count of the number of
'%s' we've put in.

Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
@jmtd
Copy link
Collaborator Author

jmtd commented May 27, 2025

Docs: cekit/cekit#943

Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
@jmtd jmtd merged commit 8eb8a6d into cekit:v1 May 29, 2025
1 check passed
@jmtd
Copy link
Collaborator Author

jmtd commented Jun 3, 2025

Note: it turns out s2i supports unix:///run/user/1000/podman/podman.sock but not the prefixed versions of the URI http+unix:///run/user/1000/podman/podman.sock

@jmtd jmtd deleted the podman branch July 4, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants