nerdctl
nerdctl copied to clipboard
feat: system prune also cleanup build cache
Signed-off-by: Zhou Zhiqiang [email protected]
close https://github.com/containerd/nerdctl/issues/1279
Changes:
- call
builderPruneAction()
within commandsystem prune
PTAL!
@Zheaoli @AkihiroSuda
Signed-off-by: STRRL
Thanks, but please use real name
Signed-off-by: STRRL
Thanks, but please use real name
Updated!
Hi @AkihiroSuda @junnplus , I meet some trouble when using TabReader
to parse the output of buildctl prune
.
The output of the buildctl prune
is not soo standard, it would use both \t
and white-space as the delimiter:
![image](https://user-images.githubusercontent.com/20221408/182607860-99516f04-737c-47a3-88ea-c78c3172b7b5.png)
I also updated the testcase, so it would be failed with the current TabReader
implementation because it extracts values based on the character position.
What should I do now? Make a new implementation like TabReader
but only for buildctl prune
? or wait https://github.com/moby/buildkit/pull/2992 getting merged?
What should I do now? Make a new implementation like
TabReader
but only forbuildctl prune
? or wait moby/buildkit#2992 getting merged?
I just noticed that PR already get merged! :tada:
I think I could update code based on the json output!
I think I could update code based on the json output!
Are we not compatible with older versions?
I think I could update code based on the json output!
Are we not compatible with older versions?
Well, if we want to be compatible with the older version of buildctl
, it seems I must build the parser for resolving the output of buildctl prune
. 🤔
Or maybe using the BuildKit go API would be the better way?
PTAL @junnplus @AkihiroSuda
The output of the buildctl prune is not soo standard, it would use both \t and white-space as the delimiter:
You can convert \t
to whitespace.
Parse the JSON if the JSON output is available, otherwise we can just print the bare output from buildctl builder prune
Parse the JSON if the JSON output is available, otherwise we can just print the bare output from buildctl builder prune
Honestly, I wish we could be compatible with older versions because most users are using them.
The output of the buildctl prune is not soo standard, it would use both \t and white-space as the delimiter:
You can convert
\t
to whitespace.
Parse the JSON if the JSON output is available, otherwise we can just print the bare output from
buildctl builder prune
What about using BuildKit Go API? I prefer to use that instead of parsing the text, because go API seems more stable and easy to use. 🤔
What about using BuildKit Go API? I prefer to use that instead of parsing the text, because go API seems more stable and easy to use. 🤔
SGTM.
What about using BuildKit Go API? I prefer to use that instead of parsing the text, because go API seems more stable and easy to use. thinking
SGTM.
Hi @junnplus @AkihiroSuda @fahedouch, I took a look at using buildkit go API instead of using buildctl
for pruning cache. It seems it would take more changes, but I still think that worth it.
I think I would create a tracking issue about:
- migrate the existed
build prune
using buildkit API - then finished the work about
system prune
What do you think about it?
Using buildkit API sounds good but fearing it may increase the binary footprint
Cc @ktock
It has been a long time since this PR not active, I would continue the work in another PR with new codebase.