-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add separate console socket #1356
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
Conversation
5f5325c to
69c82f9
Compare
|
@cyphar if you are checking out prs can you take a look at this one? I still have to fix a weird mount test pr but overall it looks good |
|
Yup, will do. |
69c82f9 to
89b140c
Compare
| // relates to (to allow for consumers to use a single unix socket to handle | ||
| // multiple containers). This structure will probably move to runtime-spec | ||
| // at some point. But for now it lies in libcontainer. | ||
| type TerminalInfo struct { |
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.
The reason for this was so that you could use a single console-socket and listen for multiple instances of runc passing file descriptors. Without this, you can't tell which container a particular pty comes from. This was one of the concerns raised about the scalability of console-socket -- how do you handle starting hundreds of containers simultaneously if you keep hammering bind and socket?
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.
Do we know for a fact that it is a slow point in the execution or just a premature optimization?
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.
To be honest I didn't benchmark it, but it seemed like a useful optimisation because it allowed us to also pass around information about the container to the caller (rather than just a file descriptor). But if you feel that's not necessary, we can implement it in cri-o with a new socket for every conmon and presumably you can do the same thing in containerd-shim.
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 can create a new socket for every container for now, at least before we figure out the double socket issue.
|
I'll review this by tomorrow. |
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This maybe a nice extra but it adds complication to the usecase. The contract is listen on the socket and you get an fd to the pty master and that is that. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
c0c2125 to
957ef9c
Compare
These were added in 244c9fc (*: console rewrite, 2016-06-04, opencontainers#1018) alongside procConsole and the associated handling. procConsole and that handling were removed in 00a0ecf (Add separate console socket, 2017-03-02, opencontainers#1356), but 00a0ecf missed this comment. Signed-off-by: W. Trevor King <wking@tremily.us>
Fixes #1302
Signed-off-by: Michael Crosby crosbymichael@gmail.com