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
cri: support io by streaming API #9965
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. |
The Usage of streaming io:
Then containerd will connect to the sandbox endpoint(the same address to serve Task API), and create streaming client to transfer the io stream. the id of the stream will be the the in the form of "-stdin", "-stdout", or "-stderr", id is either container id or exec id. and in the CreateTaskRequest the Stdin will be in the form of |
@abel-von please rebase thanks |
done |
// if it is not set, the named pipe will be created for the container | ||
// we can also set it to "streaming" to create a stream by streaming api, | ||
// and use it as a channel to transfer the io stream | ||
IOType string `toml:"io_type" json:"io_type"` |
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 think we should add validation for this.
Only allow streaming
, named_pipe
and ``.
It can be handled in the 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.
And update doc for cri-config as well.
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.
validation is done, will submit another pr to update the doc
} | ||
|
||
func openOutput(ctx context.Context, url string) (io.ReadCloser, error) { | ||
ok := strings.Contains(url, "://") |
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.
Currently, CRI doesn't support log binary plugin.
We need revisit this part in the future.
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, I think as it is a url form, we can easily extend the log implementation.
Signed-off-by: Abel Feng <fshb1988@gmail.com>
currently, CRI plugin only support container io by named pipes. but in some scenario named pipes may not work for some kind of sandboxes, for example, for VM based sandboxes, It is not easy to hotplug the named pipe into the vm. So for those kind of runtimes, they have to transfer io in some other way.
But if containerd support io streams by the streaming api, the shim process or the sandbox can serve the Streaming API of containerd, and containerd can create streams for the container stdios.
needs rebase after #9736