-
Notifications
You must be signed in to change notification settings - Fork 75
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
RHOAIENG-18459: chore(tests/containers/workbenches): make the ipv6 listening test work on macOS #868
RHOAIENG-18459: chore(tests/containers/workbenches): make the ipv6 listening test work on macOS #868
Conversation
c3fb7f2
to
36045ab
Compare
…stening test work on macOS
36045ab
to
d77fbda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/override ci/prow/images
n/a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/override ci/prow/images
this is my override thread
@jiridanek: Overrode contexts on behalf of jiridanek: ci/prow/images In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/lgtm |
# Usage example | ||
if __name__ == "__main__": | ||
tunnel_process = open_ssh_tunnel( | ||
"podman-machine-default", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure of a good/right place to document this.. but we should ideally call out (for purposes of running locally) - we require a machine named podman-machine-default
to exist. I realize it errors after the fact appropriately in this script... but this is codifying a requirement worth calling out in a readme or something maybe?
(as a case in point - I don't (as of now - but will soon!) have a podman-machine-default
machine - as its too underpowered to run many notebooks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, you have a differently named podman machine? in that case this should probably detect whatever machine you're using and use that, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, perhaps if we just had the system choose the currently active connection - that makes it "one less stumbling block"
➜ ~/ $ podman system connection ls
Name URI Identity Default ReadWrite
rhoai-default ssh://core@127.0.0.1:50943/run/user/501/podman/podman.sock /Users/astonebe/.local/share/containers/podman/machine/machine false true
rhoai-default-root ssh://root@127.0.0.1:50943/run/podman/podman.sock /Users/astonebe/.local/share/containers/podman/machine/machine true true
seems podman system connection ls
can give you a data structure that lists which machine is currently default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good point, I added a commit here that addresses that; I look what the realpath docker_socket
is, and compare that with the sockets given in podman machine info
. I did not need podman system connections ls after all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, turned out this does not really fix anything with 1+ podman machines present. That's because podman machine inspect
without machine name inspects the default machine only. Followup pr needed.
@@ -0,0 +1,41 @@ | |||
from pydantic import BaseModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you look into https://podman-py.readthedocs.io/en/stable/index.html ? Can we get some of this boilerplate "for free" if we use the Podman Python SDK? (or, conversely, is the Podman Python SDK "more hassle than its worth" ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's quite a lot of various docker/podman libraries like this
since I went with testcontainers (which uses docker-py) originally, I intended to keep to docker-compatible apis; but, turns out, more is oftentimes needed
besides testcontainers, there's all that Adriel mentioned at one of the qe meetings
- https://terratest.gruntwork.io/examples/
- https://github.com/pytest-dev/pytest-testinfra
- https://dagger.io/
there are other stuff, for example something from red hat people that runs podman
commands as a subprocess; so whatever you script in python, you have an obvious way to reproduce on commandline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that podman machine api is exposed there... but I'd have to check more thoroughly to find out.
I spent few minutes and no joy so far. I really think podman-machine not part of the libpod api.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally fine - not worth spending much time on it - appreciate you sharing thoughts/motivation behind the question... you can consider this conversation resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a good thought, cc @jstourac maybe we'd just stop pretending we use docker and will fully embrace podman
there's also https://issues.redhat.com/browse/RHOAIENG-18060 that asks to write these test so that they can be run on docker/podman and also openshift; that's gonna be another challenge, but maybe a lesser one than all this macOS stuff
…dling: detect the right one to use if user has multiple machines around
@jiridanek: Overrode contexts on behalf of jiridanek: ci/prow/images In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
I tested here and looks good! /lgtm |
/lgtm I have confirmed if I have a machine named
ℹ️ I am on MacOS |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jiridanek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
follow-up for
Description
Uses the pydantic library to load output from
podman machine info
and sets-up a ssh tunnel from the podman machine vm to the machine running the test.This is a workaround for macOS/rootful issues in Podman
How Has This Been Tested?
Merge criteria: