Skip to content

Conversation

@crosbymichael
Copy link
Member

@crosbymichael crosbymichael commented Mar 2, 2017

Fixes #1302

Signed-off-by: Michael Crosby crosbymichael@gmail.com

@crosbymichael crosbymichael force-pushed the console-socket branch 3 times, most recently from 5f5325c to 69c82f9 Compare March 3, 2017 00:26
@crosbymichael
Copy link
Member Author

@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

@cyphar
Copy link
Member

cyphar commented Mar 3, 2017

Yup, will do.

@cyphar cyphar self-requested a review March 3, 2017 01:25
@crosbymichael crosbymichael added this to the 1.0.0 milestone Mar 3, 2017
// 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 {
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Contributor

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.

@crosbymichael
Copy link
Member Author

@mrunalp @cyphar we need this merged before we can think about integrating in docker because exec is broken without it.

@mrunalp
Copy link
Contributor

mrunalp commented Mar 15, 2017

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>
@mrunalp
Copy link
Contributor

mrunalp commented Mar 16, 2017

LGTM

Approved with PullApprove

@hqhq
Copy link
Contributor

hqhq commented Mar 18, 2017

Looks much cleaner.

LGTM

Approved with PullApprove

@hqhq hqhq merged commit d270940 into opencontainers:master Mar 18, 2017
@crosbymichael crosbymichael deleted the console-socket branch March 20, 2017 17:50
wking added a commit to wking/runc that referenced this pull request Feb 23, 2018
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants