Skip to content

Conversation

@abel-von
Copy link
Contributor

@abel-von abel-von commented Feb 27, 2024

In this PR,The tasks is divided into shimTask and sandboxedTask, shimTask is the legacy implementation and compatible with the podsandbox controller, the sandboxedTask is the task running in the sandbox created by sandbox sontroller, which is no longer simulated by pause container.

The core commit is the latest one, and this pr has to be rebased after #9882

@k8s-ci-robot
Copy link

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 /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.

Details

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.

@abel-von
Copy link
Contributor Author

image

@Burning1020
Copy link
Member

/ok-to-test

@abel-von
Copy link
Contributor Author

/cc @mxpv @dmcgowan @fuweid

@k8s-ci-robot k8s-ci-robot requested review from dmcgowan, fuweid and mxpv July 15, 2024 08:11
@abel-von abel-von force-pushed the add-sandboxed-task branch from c417e68 to de32b56 Compare July 23, 2024 02:31
@mxpv
Copy link
Member

mxpv commented Oct 18, 2024

Thanks for working on this!

Apologies it took a while to review.

I wonder if we should introduce 2 different implementations to handle shims ("legacy" + "sandbox"). Might add an extra burden. Bootstrap params look pretty generic and can be useful for both implementations (not just for sandboxed shims), we probably could add "features" field to bootstrap params to tell us whether shim needs to be sandboxed or not. I also not sure if we're going to deprecate "legacy" implementation any time soon.

Possible we could abstract lifecycle management and have just one ShimManager instead of introducing having 3 sub managers? Some napkin notes:

classDiagram
    Task <|-- SandboxedShim
    Task <|-- TaskedShim
    ShimManager .. Task

    class ShimManager {
         tasks []Task
    }
    class Task {
         Load()
         Shutdown()
         
         TaskService()
         SandboxService()
    }
    class SandboxedShim {
    }
    class TaskedShim {
    }
Loading

@abel-von
Copy link
Contributor Author

abel-von commented Oct 21, 2024

Thanks for reply @mxpv . I think when a task is SANDBOXED, containerd should no longer handle any shim lifecycle related logic for it. containerd will just get an address from the sandbox to call Task API. "SandboxedShim" is actually one kind of implementations of sandbox, and all the shim lifecycle management is moved into "shim sandbox controller", so TaskManager here can no longer handle the lifecycle of shim, TaskManager just create/start/stop/delete Tasks by calling the API through the address in the sandbox, without any knowledge of the existence of the shim.

There are maybe other kind of sandbox implementations, rather than implementing the runtime sandbox API, we may just only implement the sandbox controller API. In this case there maybe no such a thing as shim at all, the Task API can be served in a VM, or in a remote machine, or in a thread inside a sandbox controller, anywhere.

So I think if we split the Task into the "shimTask"(which containerd will manage the shim lifecycle for the task), and the "sandboxedTask"(which containerd just get the address from the sandbox to call Task API), we may get a cleaner codes to handle the two kinds of thing. When a task is a "shimTask" containerd will handle shim for it, when a task is a "sandboxedTask", containerd will handle sandbox for it.

@AkihiroSuda AkihiroSuda added this to the 2.1 milestone Oct 21, 2024
there are two kinds of task, shimTask and sandboxedTask,
shimTask is the legacy implementation and compatible with the
podsandbox, the sandboxedTask is the task running in the sandbox created
by sandbox sontroller v2

Signed-off-by: Abel Feng <fshb1988@gmail.com>
@k8s-ci-robot
Copy link

PR needs rebase.

Details

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-sigs/prow repository.

@dmcgowan dmcgowan modified the milestones: 2.1, 2.2 Apr 23, 2025
@dmcgowan dmcgowan moved this from Needs Triage to Needs Update in Pull Request Review Apr 23, 2025
@github-actions
Copy link

This PR is stale because it has been open 90 days with no activity. This PR will be closed in 7 days unless new comments are made or the stale label is removed.

@github-actions github-actions bot added the Stale label Jul 23, 2025
@github-actions
Copy link

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Jul 30, 2025
@github-project-automation github-project-automation bot moved this from Needs Update to Done in Pull Request Review Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants