Skip to content

Containerd sandbox#460

Open
LeonSun-CS wants to merge 2 commits into
open-lambda:mainfrom
LeonSun-CS:containerd
Open

Containerd sandbox#460
LeonSun-CS wants to merge 2 commits into
open-lambda:mainfrom
LeonSun-CS:containerd

Conversation

@LeonSun-CS

Copy link
Copy Markdown

No description provided.

@tylerharter tylerharter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Haven't read everything yet, still working through it.

Comment thread go/common/lambdaConfig.go
file, err := os.Open(path)

if errors.Is(err, os.ErrNotExist) {
// TODO: use slog

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably simpler to just do it rather than add a comment (or just leave it out of this PR since it is not related).

} else {
slog.Info(fmt.Sprintf("run pip install %s from a new Sandbox to %s on host", p.Name, scratchDir))
if err := os.Mkdir(scratchDir, 0700); err != nil {
filesDir := filepath.Join(scratchDir, "files")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need this change?

Comment thread go/go.mod
github.com/containerd/containerd v1.6.26
github.com/fsouza/go-dockerclient v1.10.1
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think containerd is obvious, but could you let me know what each of the other two dependencies provide?

Comment thread go/worker/helpers.go
if errors.Is(err, syscall.EINVAL) {
fmt.Printf("Sandbox mount root is not mounted. No need to clean up.\n")
} else {
} else if errors.Is(err, syscall.ENOENT) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this related to the other changes? As, does in surface more regularly now? Might be simpler as a separate PR is this is an unrelated issue you stumbled upon.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, this is related. The context is when stopped dirty, stoppedDirtyToStoppedClean func runs and tries to unmount "root-sandboxes", and containerd would ran into no such file error because it doesn't use "root-sandboxes" dir.


if err := waitForServerPipeReady(c.HostDir()); err != nil {
c.Destroy("waitForServerPipeReady failed")
if err := WaitForServerPipeReady(c.HostDir()); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is using the pipe the most elegant way to do this? We don't necessarily need to follow what the docker implementation is doing.

}()

// Resource limit calculations
cpuPeriod := uint64(100000) // using Standard CFS period: 100ms (100,000 microseconds)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you just put the comments before? In a 2-column GitHub diff, it is hard to read this long.

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.

2 participants