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

Implement gvproxy networking using cmdline wrapper #19723

Merged

Conversation

jakecorrenti
Copy link
Member

Converts the host networking code in podman machine to use the Command type introduced in containers/gvisor-tap-vsock#258

[NO NEW TESTS NEEDED]

Does this PR introduce a user-facing change?

None

@jakecorrenti jakecorrenti changed the title Implement gvproxy cmdline Implement gvproxy networking using cmdline wrapper Aug 23, 2023
@jakecorrenti jakecorrenti force-pushed the implement-gvproxy-cmdline branch 3 times, most recently from 6c79466 to 84fee33 Compare August 23, 2023 19:25
pkg/machine/applehv/machine.go Outdated Show resolved Hide resolved
pkg/machine/applehv/machine.go Outdated Show resolved Hide resolved
pkg/machine/hyperv/machine.go Outdated Show resolved Hide resolved
pkg/machine/qemu/machine.go Outdated Show resolved Hide resolved
@baude
Copy link
Member

baude commented Aug 24, 2023

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: baude, jakecorrenti

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 24, 2023
cmd = append(cmd, []string{"-forward-dest", destSock}...)
cmd = append(cmd, []string{"-forward-user", forwardUser}...)
cmd = append(cmd, []string{"-forward-identity", m.IdentityPath}...)
cmd.AddForwardSock(socket.GetPath())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder ... should we follow a pattern here like:

cmd := gvproxy.Command().AddForwardSock(...).AddForwardDest(...)...

and then if we must afterwards:

cmd.foo = "bar"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can definitely do that if you don't mind that it blocks this PR

Copy link
Member Author

@jakecorrenti jakecorrenti Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was giving this a go and, this is just me, but when we start chaining 2-3 functions the line gets really long. I think this is a little difficult to read when you have to go really far to the edge of the screen versus just reading straight down. Regardless, I can still implement it if it's what we want.

afaik go doesn't like it when we do something like this (which works in something like Rust):

gvproxy.NewGvproxyCommand().AddForwardSock()
                           .AddForwardDest()
                           .AddForwardIdentity()

@mheon
Copy link
Member

mheon commented Aug 24, 2023

Do we want to ensure that we use tagged releases of gvisor in Podman releases, or is that not something we should be concerned about?

@jakecorrenti
Copy link
Member Author

containers/gvisor-tap-vsock#266 should fix the failing tests

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 7, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 7, 2023
Converts the host networking code in `podman machine` to use the
`GvproxyCommand` type introduced in containers/gvisor-tap-vsock#258

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <[email protected]>
@jakecorrenti jakecorrenti force-pushed the implement-gvproxy-cmdline branch 2 times, most recently from d2c0bf2 to 289e59e Compare September 19, 2023 13:23
@mheon
Copy link
Member

mheon commented Sep 19, 2023

LGTM

@rhatdan
Copy link
Member

rhatdan commented Sep 19, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 19, 2023
@openshift-merge-robot openshift-merge-robot merged commit 9101060 into containers:main Sep 19, 2023
97 checks passed
jakecorrenti added a commit to jakecorrenti/podman that referenced this pull request Sep 28, 2023
Removes the line in applehv and qemu `machine.go` file. These are
remnants from containers#19723. This lines was written to add stdin, stdout,
stderr as extra files, but that is not how `c.ExtraFiles` works (unlike
`os.ProcAttr`).

go source: https://cs.opensource.google/go/go/+/go1.21.1:src/os/exec/exec.go;l=147

Signed-off-by: Jake Correnti <[email protected]>
jakecorrenti added a commit to jakecorrenti/podman that referenced this pull request Sep 28, 2023
Removes the line in applehv and qemu `machine.go` file. These are
remnants from containers#19723. This lines was written to add stdin, stdout,
stderr as extra files, but that is not how `c.ExtraFiles` works (unlike
`os.ProcAttr`).

go source: https://cs.opensource.google/go/go/+/go1.21.1:src/os/exec/exec.go;l=147

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <[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 Dec 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants