nerdctl icon indicating copy to clipboard operation
nerdctl copied to clipboard

feat: use buildkit API for clean up build cache within `system prune`

Open STRRL opened this issue 3 years ago • 4 comments

Signed-off-by: Zhou Zhiqiang [email protected]

This PR does not change the logic of nerdctl builder prune, please let me know if we should also update it.

prev #1284

close #1279

STRRL avatar Sep 07 '22 08:09 STRRL

I think this PR is ready for review! PTAL @junnplus @AkihiroSuda @fahedouch

STRRL avatar Sep 07 '22 08:09 STRRL

https://github.com/containerd/nerdctl/pull/1284#issuecomment-1214188334

After integrating with buildkit API directly, I noticed that the size of nerdctl increased from 29M to 32M.

But introducing buildkit API would bring some dependency issue, for example, buildkit pinned docker with github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220831131523-b5a0d7a188ac+incompatible, so we also have to pin on that version. I have tried to use v20.10.7 but it failed to compile because of some API changes.

STRRL avatar Sep 07 '22 08:09 STRRL

needs rebase

ktock avatar Sep 26 '22 07:09 ktock

needs rebase

Updated, PTAL!

STRRL avatar Sep 28 '22 13:09 STRRL

Needs rebase

AkihiroSuda avatar Oct 19 '22 02:10 AkihiroSuda

CI Windows/containerd-1.6 failed because it does not run buildkitd with windows container runtime.

What should I do? @AkihiroSuda

STRRL avatar Dec 05 '22 12:12 STRRL

CI Windows/containerd-1.6 failed because it does not run buildkitd with windows container runtime.

What should I do? @AkihiroSuda

The test should be skipped when buildkitd is missing.

Also please squash commits

AkihiroSuda avatar Dec 06 '22 01:12 AkihiroSuda

Also please squash commits

Hi @AkihiroSuda, it seems we already used "Squash and Merge" so the origin commits would not be taken in the main branch as is. Or are there any other things that I should consider?

STRRL avatar Dec 06 '22 04:12 STRRL

it seems we already used "Squash and Merge"

Untrue. We do not use this button, as we want to keep the commits including DCO sign-off as-is

AkihiroSuda avatar Dec 06 '22 04:12 AkihiroSuda

it seems we already used "Squash and Merge"

Untrue. We do not use this button, as we want to keep the commits including DCO sign-off as-is

Oops, got that, I would try to rebase the commits on the latest main branch.

Thanks for your explanation. :heart:

STRRL avatar Dec 06 '22 04:12 STRRL

Hi @AkihiroSuda, @Zheaoli, there are 2 unrelated testcase failed

  • TestRunWithJsonFileLogDriver in test-integration-rootless (22.04, main)
  • TestRunWithJsonFileLogDriver, TestRunWithJsonFileLogDriverAndLogPathOpt in test-integration-rootless (22.04, v1.6.10)

Maybe they are flaky tests, and give it a retry? PTAL, thanks!

STRRL avatar Dec 08 '22 13:12 STRRL

Commits don't seem squashed

AkihiroSuda avatar Dec 09 '22 00:12 AkihiroSuda

Commits don't seem squashed

Do I need to squash them into only 1 commit?

STRRL avatar Dec 09 '22 12:12 STRRL

Commits don't seem squashed

Do I need to squash them into only 1 commit?

1 topic = 1 commit. This doesn't necessary mean that 1 PR = 1 commit, though.

AkihiroSuda avatar Dec 12 '22 03:12 AkihiroSuda

I have

  • removed the testcase condiitons for rootles containers
  • squashed into 1 commit

PTAL @AkihiroSuda :heart:

STRRL avatar Dec 14 '22 07:12 STRRL

BuildKit v0.11 will support buildctl du --format json, so maybe we will reopen https://github.com/containerd/nerdctl/pull/1284 after its GA

AkihiroSuda avatar Dec 16 '22 18:12 AkihiroSuda

BuildKit v0.11 will support buildctl du --format json, so maybe we will reopen #1284 after its GA

So you mean we still prefer to parse the JSON output rather than importing buildkit as a library?

STRRL avatar Dec 21 '22 12:12 STRRL

BuildKit v0.11 will support buildctl du --format json, so maybe we will reopen #1284 after its GA

So you mean we still prefer to parse the JSON output rather than importing buildkit as a library?

Yes, that might be better to avoid the replace() hell in go.mod

AkihiroSuda avatar Dec 22 '22 08:12 AkihiroSuda