{"action":"created","comment":{"url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/comments/241918236","pull_request_review_id":185319352,"id":241918236,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTkxODIzNg==","diff_hunk":"@@ -84,6 +101,58 @@ func (ts *TaskService) Create(ctx context.Context, req *shimapi.CreateTaskReques\n \treturn resp, nil\n }\n \n+func (ts *TaskService) proxyStdio(ctx context.Context, stdin, stdout, stderr string) {\n+\tgo proxyIO(ctx, stdin, internal.StdinPort, true)\n+\tgo proxyIO(ctx, stdout, internal.StdoutPort, false)\n+\tgo proxyIO(ctx, stderr, internal.StderrPort, false)\n+}\n+\n+func proxyIO(ctx context.Context, path string, port uint32, in bool) {\n+\tif path == \"\" {\n+\t\treturn\n+\t}\n+\tlog.G(ctx).Debug(\"setting up IO for \" + path)\n+\tf, err := fifo.OpenFifo(ctx, path, syscall.O_RDWR|syscall.O_NONBLOCK|syscall.O_CREAT, 0700)\n+\tif err != nil {\n+\t\tlog.G(ctx).WithError(err).Error(\"error opening fifo\")\n+\t\treturn\n+\t}\n+\tlistener, err := vsock.Listen(port)","path":"agent/service.go","position":101,"original_position":101,"commit_id":"36fa8b6a9dd4297bad0c03259cf82bfa714f8ecf","original_commit_id":"36fa8b6a9dd4297bad0c03259cf82bfa714f8ecf","user":{"login":"xibz","id":1964445,"node_id":"MDQ6VXNlcjE5NjQ0NDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1964445?v=4","gravatar_id":"","url":"https://api.github.com/users/xibz","html_url":"https://github.com/xibz","followers_url":"https://api.github.com/users/xibz/followers","following_url":"https://api.github.com/users/xibz/following{/other_user}","gists_url":"https://api.github.com/users/xibz/gists{/gist_id}","starred_url":"https://api.github.com/users/xibz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xibz/subscriptions","organizations_url":"https://api.github.com/users/xibz/orgs","repos_url":"https://api.github.com/users/xibz/repos","events_url":"https://api.github.com/users/xibz/events{/privacy}","received_events_url":"https://api.github.com/users/xibz/received_events","type":"User","site_admin":false},"body":"@mxpv - Talked with Cody, and he stated he could refactor things later to allow for the `net.Listener` to be passed in which would solve the issue. So, I am okay with adding the test later when we refactor this code.","created_at":"2018-12-14T23:18:37Z","updated_at":"2018-12-14T23:18:37Z","html_url":"https://github.com/firecracker-microvm/firecracker-containerd/pull/27#discussion_r241918236","pull_request_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/27","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/comments/241918236"},"html":{"href":"https://github.com/firecracker-microvm/firecracker-containerd/pull/27#discussion_r241918236"},"pull_request":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/27"}},"in_reply_to_id":241895803},"pull_request":{"url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/27","id":234474588,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0NDc0NTg4","html_url":"https://github.com/firecracker-microvm/firecracker-containerd/pull/27","diff_url":"https://github.com/firecracker-microvm/firecracker-containerd/pull/27.diff","patch_url":"https://github.com/firecracker-microvm/firecracker-containerd/pull/27.patch","issue_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/issues/27","number":27,"state":"closed","locked":false,"title":"Add stdio proxying between container, agent, runtime","user":{"login":"IRCody","id":4969568,"node_id":"MDQ6VXNlcjQ5Njk1Njg=","avatar_url":"https://avatars1.githubusercontent.com/u/4969568?v=4","gravatar_id":"","url":"https://api.github.com/users/IRCody","html_url":"https://github.com/IRCody","followers_url":"https://api.github.com/users/IRCody/followers","following_url":"https://api.github.com/users/IRCody/following{/other_user}","gists_url":"https://api.github.com/users/IRCody/gists{/gist_id}","starred_url":"https://api.github.com/users/IRCody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IRCody/subscriptions","organizations_url":"https://api.github.com/users/IRCody/orgs","repos_url":"https://api.github.com/users/IRCody/repos","events_url":"https://api.github.com/users/IRCody/events{/privacy}","received_events_url":"https://api.github.com/users/IRCody/received_events","type":"User","site_admin":false},"body":"Add stdio proxying from the container fifos to the agent, from the agent over\r\nvsock to the runtime, and from the runtime to the fifo's specified by\r\ncontainerd.\r\n\r\n*Issue #, if available:*\r\ncloses #17 \r\n*Description of changes:*\r\nProxies the stdout of the container over vsock to the runtime where it is re-written to the fifo's that containerd expects the output to be written.\r\n\r\n\r\nTested by running alpine /bin/sh and was able to use it interactively.\r\n```\r\n% sudo ./ctr run --runtime aws.firecracker --snapshotter firecracker-snapshotter docker.io/library/alpine:latest 2123 /bin/sh\r\nps\r\nPID   USER     TIME  COMMAND\r\n    1 root      0:00 /bin/sh\r\n    6 root      0:00 ps\r\nls -al\r\ntotal 16\r\ndrwxr-xr-x   18 root     root          1024 Nov 29 00:31 .\r\ndrwxr-xr-x   18 root     root          1024 Nov 29 00:31 ..\r\ndrwxr-xr-x    2 root     root          3072 Nov 29 00:31 bin\r\ndrwxr-xr-x    5 root     root           320 Nov 29 00:32 dev\r\ndrwxr-xr-x   15 root     root          1024 Nov 29 00:31 etc\r\ndrwxr-xr-x    2 root     root          1024 Sep 11 20:23 home\r\ndrwxr-xr-x    5 root     root          1024 Nov 29 00:31 lib\r\ndrwxr-xr-x    5 root     root          1024 Nov 29 00:31 media\r\ndrwxr-xr-x    2 root     root          1024 Sep 11 20:23 mnt\r\ndr-xr-xr-x   64 root     root             0 Nov 29 00:32 proc\r\ndrwx------    2 root     root          1024 Sep 11 20:23 root\r\ndrwxr-xr-x    2 root     root            40 Nov 29 00:32 run\r\ndrwxr-xr-x    2 root     root          1024 Nov 29 00:31 sbin\r\ndrwxr-xr-x    2 root     root          1024 Sep 11 20:23 srv\r\ndr-xr-xr-x   11 root     root             0 Nov 29 00:32 sys\r\ndrwxrwxrwt    2 root     root          1024 Sep 11 20:23 tmp\r\ndrwxr-xr-x    7 root     root          1024 Nov 29 00:31 usr\r\ndrwxr-xr-x   11 root     root          1024 Nov 29 00:31 var\r\n```\r\nThere is still an error related to how we shut down the container/agent/runtime: \r\n`ctr: rpc error: code = Unknown desc = ttrpc: client shutting down: read vsock:host(2):1222: transport endpoint is not connected: unknown`\r\n\r\nBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.\r\n","created_at":"2018-11-29T00:57:22Z","updated_at":"2018-12-14T23:18:37Z","closed_at":"2018-12-14T23:12:13Z","merged_at":"2018-12-14T23:12:13Z","merge_commit_sha":"7bfe8e5a761e6b2c7be145797e1a805033643b74","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/27/commits","review_comments_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/27/comments","review_comment_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/issues/27/comments","statuses_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/statuses/36fa8b6a9dd4297bad0c03259cf82bfa714f8ecf","head":{"label":"IRCody:stdio","ref":"stdio","sha":"36fa8b6a9dd4297bad0c03259cf82bfa714f8ecf","user":{"login":"IRCody","id":4969568,"node_id":"MDQ6VXNlcjQ5Njk1Njg=","avatar_url":"https://avatars1.githubusercontent.com/u/4969568?v=4","gravatar_id":"","url":"https://api.github.com/users/IRCody","html_url":"https://github.com/IRCody","followers_url":"https://api.github.com/users/IRCody/followers","following_url":"https://api.github.com/users/IRCody/following{/other_user}","gists_url":"https://api.github.com/users/IRCody/gists{/gist_id}","starred_url":"https://api.github.com/users/IRCody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IRCody/subscriptions","organizations_url":"https://api.github.com/users/IRCody/orgs","repos_url":"https://api.github.com/users/IRCody/repos","events_url":"https://api.github.com/users/IRCody/events{/privacy}","received_events_url":"https://api.github.com/users/IRCody/received_events","type":"User","site_admin":false},"repo":{"id":159370163,"node_id":"MDEwOlJlcG9zaXRvcnkxNTkzNzAxNjM=","name":"firecracker-containerd","full_name":"IRCody/firecracker-containerd","private":false,"owner":{"login":"IRCody","id":4969568,"node_id":"MDQ6VXNlcjQ5Njk1Njg=","avatar_url":"https://avatars1.githubusercontent.com/u/4969568?v=4","gravatar_id":"","url":"https://api.github.com/users/IRCody","html_url":"https://github.com/IRCody","followers_url":"https://api.github.com/users/IRCody/followers","following_url":"https://api.github.com/users/IRCody/following{/other_user}","gists_url":"https://api.github.com/users/IRCody/gists{/gist_id}","starred_url":"https://api.github.com/users/IRCody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IRCody/subscriptions","organizations_url":"https://api.github.com/users/IRCody/orgs","repos_url":"https://api.github.com/users/IRCody/repos","events_url":"https://api.github.com/users/IRCody/events{/privacy}","received_events_url":"https://api.github.com/users/IRCody/received_events","type":"User","site_admin":false},"html_url":"https://github.com/IRCody/firecracker-containerd","description":"firecracker-containerd enables containerd to manage containers as Firecracker microVMs","fork":true,"url":"https://api.github.com/repos/IRCody/firecracker-containerd","forks_url":"https://api.github.com/repos/IRCody/firecracker-containerd/forks","keys_url":"https://api.github.com/repos/IRCody/firecracker-containerd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IRCody/firecracker-containerd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IRCody/firecracker-containerd/teams","hooks_url":"https://api.github.com/repos/IRCody/firecracker-containerd/hooks","issue_events_url":"https://api.github.com/repos/IRCody/firecracker-containerd/issues/events{/number}","events_url":"https://api.github.com/repos/IRCody/firecracker-containerd/events","assignees_url":"https://api.github.com/repos/IRCody/firecracker-containerd/assignees{/user}","branches_url":"https://api.github.com/repos/IRCody/firecracker-containerd/branches{/branch}","tags_url":"https://api.github.com/repos/IRCody/firecracker-containerd/tags","blobs_url":"https://api.github.com/repos/IRCody/firecracker-containerd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IRCody/firecracker-containerd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IRCody/firecracker-containerd/git/refs{/sha}","trees_url":"https://api.github.com/repos/IRCody/firecracker-containerd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IRCody/firecracker-containerd/statuses/{sha}","languages_url":"https://api.github.com/repos/IRCody/firecracker-containerd/languages","stargazers_url":"https://api.github.com/repos/IRCody/firecracker-containerd/stargazers","contributors_url":"https://api.github.com/repos/IRCody/firecracker-containerd/contributors","subscribers_url":"https://api.github.com/repos/IRCody/firecracker-containerd/subscribers","subscription_url":"https://api.github.com/repos/IRCody/firecracker-containerd/subscription","commits_url":"https://api.github.com/repos/IRCody/firecracker-containerd/commits{/sha}","git_commits_url":"https://api.github.com/repos/IRCody/firecracker-containerd/git/commits{/sha}","comments_url":"https://api.github.com/repos/IRCody/firecracker-containerd/comments{/number}","issue_comment_url":"https://api.github.com/repos/IRCody/firecracker-containerd/issues/comments{/number}","contents_url":"https://api.github.com/repos/IRCody/firecracker-containerd/contents/{+path}","compare_url":"https://api.github.com/repos/IRCody/firecracker-containerd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IRCody/firecracker-containerd/merges","archive_url":"https://api.github.com/repos/IRCody/firecracker-containerd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IRCody/firecracker-containerd/downloads","issues_url":"https://api.github.com/repos/IRCody/firecracker-containerd/issues{/number}","pulls_url":"https://api.github.com/repos/IRCody/firecracker-containerd/pulls{/number}","milestones_url":"https://api.github.com/repos/IRCody/firecracker-containerd/milestones{/number}","notifications_url":"https://api.github.com/repos/IRCody/firecracker-containerd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IRCody/firecracker-containerd/labels{/name}","releases_url":"https://api.github.com/repos/IRCody/firecracker-containerd/releases{/id}","deployments_url":"https://api.github.com/repos/IRCody/firecracker-containerd/deployments","created_at":"2018-11-27T16:59:59Z","updated_at":"2018-11-27T17:00:48Z","pushed_at":"2018-12-13T22:50:00Z","git_url":"git://github.com/IRCody/firecracker-containerd.git","ssh_url":"git@github.com:IRCody/firecracker-containerd.git","clone_url":"https://github.com/IRCody/firecracker-containerd.git","svn_url":"https://github.com/IRCody/firecracker-containerd","homepage":null,"size":136,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"firecracker-microvm:master","ref":"master","sha":"280e378972790869ef38be2e1a5c5a744da3d194","user":{"login":"firecracker-microvm","id":44477506,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NDc3NTA2","avatar_url":"https://avatars0.githubusercontent.com/u/44477506?v=4","gravatar_id":"","url":"https://api.github.com/users/firecracker-microvm","html_url":"https://github.com/firecracker-microvm","followers_url":"https://api.github.com/users/firecracker-microvm/followers","following_url":"https://api.github.com/users/firecracker-microvm/following{/other_user}","gists_url":"https://api.github.com/users/firecracker-microvm/gists{/gist_id}","starred_url":"https://api.github.com/users/firecracker-microvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firecracker-microvm/subscriptions","organizations_url":"https://api.github.com/users/firecracker-microvm/orgs","repos_url":"https://api.github.com/users/firecracker-microvm/repos","events_url":"https://api.github.com/users/firecracker-microvm/events{/privacy}","received_events_url":"https://api.github.com/users/firecracker-microvm/received_events","type":"Organization","site_admin":false},"repo":{"id":157781317,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc3ODEzMTc=","name":"firecracker-containerd","full_name":"firecracker-microvm/firecracker-containerd","private":false,"owner":{"login":"firecracker-microvm","id":44477506,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NDc3NTA2","avatar_url":"https://avatars0.githubusercontent.com/u/44477506?v=4","gravatar_id":"","url":"https://api.github.com/users/firecracker-microvm","html_url":"https://github.com/firecracker-microvm","followers_url":"https://api.github.com/users/firecracker-microvm/followers","following_url":"https://api.github.com/users/firecracker-microvm/following{/other_user}","gists_url":"https://api.github.com/users/firecracker-microvm/gists{/gist_id}","starred_url":"https://api.github.com/users/firecracker-microvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firecracker-microvm/subscriptions","organizations_url":"https://api.github.com/users/firecracker-microvm/orgs","repos_url":"https://api.github.com/users/firecracker-microvm/repos","events_url":"https://api.github.com/users/firecracker-microvm/events{/privacy}","received_events_url":"https://api.github.com/users/firecracker-microvm/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/firecracker-microvm/firecracker-containerd","description":"firecracker-containerd enables containerd to manage containers as Firecracker microVMs","fork":false,"url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd","forks_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/forks","keys_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/teams","hooks_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/hooks","issue_events_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/issues/events{/number}","events_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/events","assignees_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/assignees{/user}","branches_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/branches{/branch}","tags_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/tags","blobs_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/git/refs{/sha}","trees_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/statuses/{sha}","languages_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/languages","stargazers_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/stargazers","contributors_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/contributors","subscribers_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/subscribers","subscription_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/subscription","commits_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/commits{/sha}","git_commits_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/git/commits{/sha}","comments_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/comments{/number}","issue_comment_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/issues/comments{/number}","contents_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/contents/{+path}","compare_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/merges","archive_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/downloads","issues_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/issues{/number}","pulls_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls{/number}","milestones_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/milestones{/number}","notifications_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/labels{/name}","releases_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/releases{/id}","deployments_url":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/deployments","created_at":"2018-11-15T22:36:30Z","updated_at":"2018-12-14T23:12:16Z","pushed_at":"2018-12-14T23:16:03Z","git_url":"git://github.com/firecracker-microvm/firecracker-containerd.git","ssh_url":"git@github.com:firecracker-microvm/firecracker-containerd.git","clone_url":"https://github.com/firecracker-microvm/firecracker-containerd.git","svn_url":"https://github.com/firecracker-microvm/firecracker-containerd","homepage":null,"size":118,"stargazers_count":349,"watchers_count":349,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":14,"open_issues":12,"watchers":349,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/27"},"html":{"href":"https://github.com/firecracker-microvm/firecracker-containerd/pull/27"},"issue":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/issues/27"},"comments":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/firecracker-microvm/firecracker-containerd/statuses/36fa8b6a9dd4297bad0c03259cf82bfa714f8ecf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"xibz"}}