Skip to content

containerd integration: compute virtualsize#43815

Merged
cpuguy83 merged 1 commit intomoby:masterfrom
thaJeztah:compute_virtualsize
Jul 18, 2022
Merged

containerd integration: compute virtualsize#43815
cpuguy83 merged 1 commit intomoby:masterfrom
thaJeztah:compute_virtualsize

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jul 15, 2022

Upstreaming more commits from https://github.com/rumpl/moby

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

}

var ret []*types.ImageSummary
snapshotter := cs.client.SnapshotService(containerd.DefaultSnapshotter)
Copy link
Member

Choose a reason for hiding this comment

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

DefaultSnapshotter

Will this be configurable in a follow-up PR?

LGTM then

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we should make this configurable; looks like https://github.com/rumpl/moby is currently only using the default (but that's hard-coded in containerd to overlayfs for Linux), and we should make that configurable, similar to the existing graph drivers (and have feature detection, likely, if we also want automatic selection)

./cc @rumpl

Copy link
Member

Choose a reason for hiding this comment

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

Indeed we haven't yet added this but we definitely need it, there are some docker commands that will need to have a --snapshotter flag.

@thaJeztah thaJeztah force-pushed the compute_virtualsize branch from a3f9316 to a38eed2 Compare July 18, 2022 17:21
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the compute_virtualsize branch from a38eed2 to a46ce37 Compare July 18, 2022 17:23
@thaJeztah
Copy link
Member Author

thaJeztah commented Jul 18, 2022

Interesting failure (should not be related?);

Details
=== RUN   TestDockerSuite/TestRunPIDsLimit
    docker_cli_run_unix_test.go:1389: assertion failed: 
        Command:  /usr/local/cli/docker run --name skittles --pids-limit 4 busybox cat /sys/fs/cgroup/pids/pids.max
        ExitCode: 125
        Error:    exit status 125
        Stdout:   
        Stderr:   runtime/cgo: pthread_create failed: Resource temporarily unavailable
        SIGABRT: abort
        PC=0x810891 m=5 sigcode=18446744073709551610
        
        goroutine 0 [idle]:
        runtime: unknown pc 0x810891
        stack: frame={sp:0x7f700fffecf0, fp:0x0} stack=[0x7f700f7ff678,0x7f700ffff278)
        0x00007f700fffebf0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec00:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec10:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec20:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec30:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec40:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec50:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec60:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec70:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec80:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec90:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffeca0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffecb0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffecc0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffecd0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffece0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffecf0: <0x0000000000000000  0x0000000000000000 
        0x00007f700fffed00:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed10:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed20:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed30:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed40:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed50:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed60:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed70:  0xfffffffe7fffffff  0xffffffffffffffff 
        0x00007f700fffed80:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffed90:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffeda0:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffedb0:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffedc0:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffedd0:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffede0:  0xffffffffffffffff  0xffffffffffffffff 
        runtime: unknown pc 0x810891
        stack: frame={sp:0x7f700fffecf0, fp:0x0} stack=[0x7f700f7ff678,0x7f700ffff278)
        0x00007f700fffebf0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec00:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec10:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec20:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec30:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec40:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec50:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec60:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec70:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec80:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffec90:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffeca0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffecb0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffecc0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffecd0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffece0:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffecf0: <0x0000000000000000  0x0000000000000000 
        0x00007f700fffed00:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed10:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed20:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed30:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed40:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed50:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed60:  0x0000000000000000  0x0000000000000000 
        0x00007f700fffed70:  0xfffffffe7fffffff  0xffffffffffffffff 
        0x00007f700fffed80:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffed90:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffeda0:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffedb0:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffedc0:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffedd0:  0xffffffffffffffff  0xffffffffffffffff 
        0x00007f700fffede0:  0xffffffffffffffff  0xffffffffffffffff 
        
        goroutine 1 [chan receive, locked to thread]:
        github.com/opencontainers/runc/libcontainer/seccomp/patchbpf.disassembleFilter(0xc0000021a0?)
        	github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go:138 +0x338
        github.com/opencontainers/runc/libcontainer/seccomp/patchbpf.enosysPatchFilter(0x7117e6?, 0x1650d90?)
        	github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go:566 +0x36
        github.com/opencontainers/runc/libcontainer/seccomp/patchbpf.PatchAndLoad(0xc000173bd8?, 0xc00017c800?)
        	github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go:653 +0x27
        github.com/opencontainers/runc/libcontainer/seccomp.InitSeccomp(0xc00006a780)
        	github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go:105 +0x367
        github.com/opencontainers/runc/libcontainer.(*linuxStandardInit).Init(0xc000074820)
        	github.com/opencontainers/runc/libcontainer/standard_init_linux.go:171 +0xb7a
        github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0x0?)
        	github.com/opencontainers/runc/libcontainer/factory_linux.go:351 +0x5f3
        main.init.0()
        	github.com/opencontainers/runc/init.go:36 +0x174
        
        goroutine 6 [runnable]:
        internal/poll.runtime_pollWait(0x7f7014419748, 0x72)
        	runtime/netpoll.go:302 +0x89
        internal/poll.(*pollDesc).wait(0xc0001ec120?, 0xc00012c800?, 0x1)
        	internal/poll/fd_poll_runtime.go:83 +0x32
        internal/poll.(*pollDesc).waitRead(...)
        	internal/poll/fd_poll_runtime.go:88
        internal/poll.(*FD).Read(0xc0001ec120, {0xc00012c800, 0x200, 0x200})
        	internal/poll/fd_unix.go:167 +0x25a
        os.(*File).read(...)
        	os/file_posix.go:31
        os.(*File).Read(0xc000010a98, {0xc00012c800?, 0x7f70144482d8?, 0xc0000406f0?})
        	os/file.go:119 +0x5e
        bytes.(*Buffer).ReadFrom(0xc0001ea180, {0xa0ee40, 0xc000010a98})
        	bytes/buffer.go:204 +0x98
        io.copyBuffer({0xa0e260, 0xc0001ea180}, {0xa0ee40, 0xc000010a98}, {0x0, 0x0, 0x0})
        	io/io.go:412 +0x14b
        io.Copy(...)
        	io/io.go:385
        github.com/opencontainers/runc/libcontainer/seccomp/patchbpf.disassembleFilter.func1()
        	github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go:127 +0x47
        created by github.com/opencontainers/runc/libcontainer/seccomp/patchbpf.disassembleFilter
        	github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go:126 +0x218
        
        rax    0x0
        rbx    0x7f700ffff700
        rcx    0x810891
        rdx    0x0
        rdi    0x2
        rsi    0x7f700fffecf0
        rbp    0xa29242
        rsp    0x7f700fffecf0
        r8     0x0
        r9     0x7f700fffecf0
        r10    0x8
        r11    0x246
        r12    0xb
        r13    0x7f700ffff100
        r14    0xc000003860
        r15    0x802000
        rip    0x810891
        rflags 0x246
        cs     0x33
        fs     0x0
        gs     0x0
        /usr/local/cli/docker: Error response from daemon: cannot start a stopped process: unknown.
        time="2022-07-18T18:04:25Z" level=error msg="error waiting for container: context canceled" 
        
        
        Failures:
        ExitCode was 125 expected 0
        Expected no error
    --- FAIL: TestDockerSuite/TestRunPIDsLimit (0.78s)

return virtualSize, err
}
for _, chainID := range identity.ChainIDs(diffIDs) {
usage, err := snapshotter.Usage(ctx, chainID.String())
Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW; some optimisations coming when upstreaming rumpl#17 - let me have a look if I can include that one in this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, that makes things a bit more complicated; let me keep it separate for now

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@cpuguy83 cpuguy83 merged commit 2fbc307 into moby:master Jul 18, 2022
@thaJeztah thaJeztah deleted the compute_virtualsize branch July 19, 2022 07:51
@thaJeztah thaJeztah added the containerd-integration Issues and PRs related to containerd integration label Jul 21, 2022
crazy-max pushed a commit to crazy-max/moby that referenced this pull request Sep 29, 2022
containerd integration: compute virtualsize
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/images Image Distribution containerd-integration Issues and PRs related to containerd integration status/2-code-review

Projects

Development

Successfully merging this pull request may close these issues.

6 participants