Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builder: add worker gc policies and labels #1440

Merged
merged 2 commits into from
May 22, 2023

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Nov 30, 2022

needs #1430

Adds builder GC Policies with worker labels. Will be displayed when using inspect command:

$ docker buildx inspect
Name:          builder2
Driver:        docker-container
Last Activity: 2022-11-30 12:42:47 +0100 CET

Nodes:
Name:           builder20
Endpoint:       unix:///var/run/docker.sock
Driver Options: env.BUILDKIT_STEP_LOG_MAX_SPEED="10485760" env.JAEGER_TRACE="localhost:6831" image="moby/buildkit:latest" network="host" env.BUILDKIT_STEP_LOG_MAX_SIZE="10485760"
Status:         running
Flags:          --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
BuildKit:       v0.10.6
Platforms:      linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
Labels:
 org.mobyproject.buildkit.worker.executor:         oci
 org.mobyproject.buildkit.worker.hostname:         docker-desktop
 org.mobyproject.buildkit.worker.network:          host
 org.mobyproject.buildkit.worker.oci.process-mode: sandbox
 org.mobyproject.buildkit.worker.selinux.enabled:  false
 org.mobyproject.buildkit.worker.snapshotter:      overlayfs
GC Policy rule#0:
 All:           false
 Filters:       type==source.local,type==exec.cachemount,type==source.git.checkout
 Keep Duration: 48h0m0s
 Keep Bytes:    488.3MiB
GC Policy rule#1:
 All:           false
 Keep Duration: 1440h0m0s
 Keep Bytes:    24.21GiB
GC Policy rule#2:
 All:        false
 Keep Bytes: 24.21GiB
GC Policy rule#3:
 All:        true
 Keep Bytes: 24.21GiB

Comment on lines 214 to 217
if idx == 0 {
d.GCPolicy = w.GCPolicy
d.Labels = w.Labels
}
Copy link
Member Author

@crazy-max crazy-max Nov 30, 2022

Choose a reason for hiding this comment

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

Atm it returns GC Policies and labels only for the default worker.

@crazy-max crazy-max marked this pull request as ready for review January 26, 2023 13:07
@crazy-max crazy-max added this to the v0.11.0 milestone Feb 3, 2023
@jedevc
Copy link
Collaborator

jedevc commented Feb 6, 2023

Hm, this does make the output a bit noisier, and the policies are slightly tricky to mentally parse. I wonder if the GC policies should be hidden behind a verbose flag? Not sure about this, it's definitely useful information, but probably not to the average user.

I think the labels should be good without that, they're not too long.

@crazy-max
Copy link
Member Author

Hm, this does make the output a bit noisier, and the policies are slightly tricky to mentally parse.

Yeah that's noisy but still relevant and for parsing we should do smth like #830 (comment)

I will move Platforms before Labels.

crazy-max and others added 2 commits February 11, 2023 22:56
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@jedevc
Copy link
Collaborator

jedevc commented Feb 13, 2023

LGTM, but we should make sure to get the follow-up to tidy the output and parsing into the same release as this.

@crazy-max
Copy link
Member Author

@jedevc
Copy link
Collaborator

jedevc commented Apr 26, 2023

@crazy-max @tonistiigi, anything blocking this?

@jedevc jedevc added the kind/enhancement New feature or request label May 18, 2023
@crazy-max crazy-max merged commit a6b0959 into docker:master May 22, 2023
@crazy-max crazy-max deleted the gc-policies branch May 22, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants