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

Expose host .sock/named pipe of the podman machine through a podman command #14231

Closed
benoitf opened this issue May 13, 2022 · 7 comments · Fixed by #14448
Closed

Expose host .sock/named pipe of the podman machine through a podman command #14231

benoitf opened this issue May 13, 2022 · 7 comments · Fixed by #14448
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. machine

Comments

@benoitf
Copy link
Contributor

benoitf commented May 13, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Today, we have a message when starting a podman machine with the path to the 'host socket'
like

API forwarding listening on: $HOME/.local/share/containers/podman/machine/my-machine/podman.sock

But then I'm unable to find the path of this socket through a podman command

We may assume socket could be in $HOME/.local/share/containers/podman/machine/<name-of-the-machine> but for example on Windows we remove podman from the machine name for the name of the named pipe so it's making errorprone the guess on the client side.

Steps to reproduce the issue:

  1. Start a podman machine

  2. Now try with a command to get that path

For example I tried podman machine inspect and podman machine list --format json but none of these commands were reporting the socket.

Describe the results you received:
No command is showing that socket path

Describe the results you expected:

A command should expose it

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

current main branch

Output of podman info --debug:

(paste your output here)

Package info (e.g. output of rpm -q podman or apt list podman):

(paste your output here)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes/No

Additional environment details (AWS, VirtualBox, physical, etc.):

cc @n1hility

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label May 13, 2022
@benoitf benoitf changed the title Expose .sock/named pipe of the podman machine through a podman command Expose host .sock/named pipe of the podman machine through a podman command May 13, 2022
@vrothberg
Copy link
Member

@baude @ashley-cui @jwhonce PTAL

@baude
Copy link
Member

baude commented May 13, 2022

we are working on this ... there is no easy button here. @benoitf wants podman to tell where the socket should go, and podman devs want podman-desktop to tell us where to put the socket .... nevertheless, we should be able to find some compromise. currently @n1hility and @jwhonce have also been discussing.

@n1hility
Copy link
Member

@baude I think you are referring to the machine event socket. @benoitf is talking about the Docker API Forwarding socket that we compute based on a few factors. I think that one we should just add to inspect, it's only needed after the machine is started, and is machine specific.

@benoitf
Copy link
Contributor Author

benoitf commented May 13, 2022

Hello, here it's about the Host socket, not the socket for machine events. So socket can be where podman wants. We only need to know the location.

@baude
Copy link
Member

baude commented May 13, 2022

Ah! Ok, yes ... @n1hility is that computed on the fly or saved somewhere? I can do the work ...

@benoitf
Copy link
Contributor Author

benoitf commented May 13, 2022

It would be nice if that's stored in the json output of machine list output as well

@n1hility
Copy link
Member

@baude cool! it's computed on the fly. On mac its just podman.sock in the machine dir:

func (v *MachineVM) forwardSocketPath() (*machine.VMFile, error) {

On windows it's in a global location, so it prefixes podman to the machine name to try to prevent conflicts (but only if its not already starting with podman):

machinePipe := toDist(v.Name)

There are cases where forwarding might be disabled (something else is listening, or its linux where we don't yet support it).

One other thing worth mentioning is that @benoitf does not want the global docker locations (we attempt to publish on both the global and a machine specific), he only wants the machine local one.

Ping me if you want me to test or implement anything!

-Jason

baude added a commit to baude/podman that referenced this issue Jun 1, 2022
For consumers of the podman.sock who want a predictable way to find the
podman sock, we now include it under 'ConnectionConfig' in podman
machine inspect.

Fixes: containers#14231

Signed-off-by: Brent Baude <[email protected]>
@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 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 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. machine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants