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
Support vsock connection to task api #9738
Conversation
Hi @abel-von. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
91eef4e
to
ebf9144
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.
Very nice, just some code cleanup suggestions.
Also would be nice to not use strings.Split
which forces an unbounded allocation and instead chomp away at the address with strings.Cut
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 have a few minor suggestions, but overall looks good!
core/runtime/v2/shim/util_unix.go
Outdated
conn.Close() | ||
// when it is EOF, maybe the server side is not ready. | ||
if err == io.EOF { | ||
time.Sleep(10 * time.Millisecond) |
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.
10 a bit too much IMO.
Should we reduce this or at least add a warning message.
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.
Changed this value to timeout/10
to do 10 retries before timeout. and warning log is added.
if port > math.MaxUint32 { | ||
return nil, fmt.Errorf("vsock port %d is invalid", port) | ||
} | ||
return vsock.Dial(uint32(contextID), uint32(port), &vsock.Config{}) |
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.
Recent Linux kernels got vsock with loopback support. Possibly we could have a test for this just for sanity check? (I'm fine to have this in follow up)
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 seems we have to listen the loopback first and then we can check the connection to it. Shall we do it when init or use a sync.Once to make the check done only once.
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'd do everything within a single unit test.
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.
oh, I got what you mean now.
a94a51c
to
967dc6a
Compare
e8d4933
to
d891a8c
Compare
@abel-von could you pls rebase the PR ? |
Signed-off-by: Abel Feng <fshb1988@gmail.com>
done @mxpv |
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.
LGTM
In VM based sandbox scenario, we can start Task api Server inside VM. and containerd could connect it directly, without a shim process to do the api proxy or conversion.