Skip to content

builder: add worker gc policies and labels - #1440

Merged
crazy-max merged 2 commits into
docker:masterfrom
crazy-max:gc-policies
May 22, 2023
Merged

builder: add worker gc policies and labels#1440
crazy-max merged 2 commits into
docker:masterfrom
crazy-max:gc-policies

Conversation

@crazy-max

@crazy-maxcrazy-max commented Nov 30, 2022

Copy link
Copy Markdown
Member

needs #1430

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

$ docker buildx inspectName: builder2Driver: docker-containerLast Activity: 2022-11-30 12:42:47 +0100 CETNodes:Name: builder20Endpoint: unix:///var/run/docker.sockDriver 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: runningFlags: --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.hostBuildKit: v0.10.6Platforms: 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/v6Labels: 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: overlayfsGC Policy rule#0: All: false Filters: type==source.local,type==exec.cachemount,type==source.git.checkout Keep Duration: 48h0m0s Keep Bytes: 488.3MiBGC Policy rule#1: All: false Keep Duration: 1440h0m0s Keep Bytes: 24.21GiBGC Policy rule#2: All: false Keep Bytes: 24.21GiBGC Policy rule#3: All: true Keep Bytes: 24.21GiB

Comment threadbuilder/driver.go
Comment on lines +214 to +217
if idx == 0 {
d.GCPolicy = w.GCPolicy
d.Labels = w.Labels
}

@crazy-maxcrazy-maxNov 30, 2022

Copy link
Copy Markdown
MemberAuthor

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-maxcrazy-max added this to the v0.11.0 milestone Feb 3, 2023
@jedevc

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

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-maxand 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
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

@jedevc

Copy link
Copy Markdown
Collaborator

@crazy-max@tonistiigi, anything blocking this?

@jedevcjedevc added the kind/enhancement New feature or request label May 18, 2023
@crazy-max
crazy-max merged commit a6b0959 into docker:masterMay 22, 2023
@crazy-max
crazy-max deleted the gc-policies branch May 22, 2023 09:46
Sign up for freeto 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

@crazy-max@jedevc