Skip to content

Conversation

lengrongfu
Copy link
Contributor

This pr is Sansbox API work in #7312. Implemented Controller.Status

@k8s-ci-robot
Copy link

Hi @lengrongfu. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@mxpv
Copy link
Member

mxpv commented Oct 4, 2022

/test pull-containerd-sandboxed-node-e2e

@mxpv mxpv added this to the 1.7 milestone Oct 4, 2022
@lengrongfu lengrongfu force-pushed the feat/sandbox_api_status branch from d34a46c to deafdab Compare October 6, 2022 02:00
@samuelkarp samuelkarp added the area/cri Container Runtime Interface (CRI) label Oct 7, 2022
@samuelkarp
Copy link
Member

/ok-to-test

@samuelkarp
Copy link
Member

/test pull-containerd-sandboxed-node-e2e

@lengrongfu lengrongfu force-pushed the feat/sandbox_api_status branch 2 times, most recently from 3a735a0 to fb2f985 Compare October 8, 2022 01:56
@mxpv mxpv mentioned this pull request Oct 10, 2022
17 tasks
@mxpv mxpv requested a review from fuweid October 10, 2022 23:00
@@ -149,7 +165,7 @@ func (c *Controller) waitSandboxExit(ctx context.Context, id string, exitCh <-ch
}

// handleSandboxExit handles TaskExit event for sandbox.
func handleSandboxExit(ctx context.Context, sb sandboxstore.Sandbox) error {
func handleSandboxExit(ctx context.Context, e *eventtypes.TaskExit, sb sandboxstore.Sandbox) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest to use handleSandboxExit(context.Context, sandboxstore.Sandbox, TaskExit)

and since the TaskEvent is designed for shim.Task, do you need to extend the TaskExit with sandboxID here?
cc @mxpv @mikebrow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, in order to keep the responsibility single, TaskEvent should not be used here in theory, but TaskEvent is currently used elsewhere, e.g.a

About this problem, I think it can be solved in two steps:

  1. In the short term, TaskEvent is still used, consistent with other places
  2. In the long run, we can add a SandboxEvent designed for sandbox, and then make a unified replacement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fuweid @lengrongfu would it be ok to leave a TODO for this and get this PR in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add TODO issue #7548

@mxpv
Copy link
Member

mxpv commented Nov 8, 2022

Can you rebase against main branch? It should include a fix for the Vagrant CI job.

@lengrongfu lengrongfu force-pushed the feat/sandbox_api_status branch from 9d804c0 to d6a5f63 Compare November 9, 2022 05:02
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
@lengrongfu lengrongfu force-pushed the feat/sandbox_api_status branch from d6a5f63 to 0f54c47 Compare November 9, 2022 06:36
@mxpv
Copy link
Member

mxpv commented Nov 15, 2022

/test pull-containerd-sandboxed-node-e2e

@mxpv
Copy link
Member

mxpv commented Nov 15, 2022

@fuweid LGTY?

@fuweid fuweid self-requested a review November 16, 2022 02:02
@mxpv mxpv linked an issue Nov 17, 2022 that may be closed by this pull request
17 tasks
@mxpv mxpv removed a link to an issue Nov 17, 2022
17 tasks
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment..

@@ -123,7 +139,7 @@ func (c *Controller) waitSandboxExit(ctx context.Context, id string, exitCh <-ch

sb, err := c.sandboxStore.Get(id)
if err == nil {
if err := handleSandboxExit(dctx, sb); err != nil {
if err := handleSandboxExit(dctx, sb, &eventtypes.TaskExit{ExitStatus: exitStatus, ExitedAt: protobuf.ToTimestamp(exitedAt)}); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nod to @fuweid 's suggestion to add new api params to the end vs insert new/additional fields in between.. I see you already did that!

Additionally it feels(reads) wrong to create a partial task exit event for a sandbox then only use the new fields.. and discard the task exit event.. maybe just pass in the new fields as params? ExitedAt time.Time and ExitStatus uint32

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Let's handle the suggestion in followups

@mxpv mxpv merged commit 6d830d3 into containerd:main Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cri Container Runtime Interface (CRI) ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants