buildx icon indicating copy to clipboard operation
buildx copied to clipboard

build: print instance being used

Open crazy-max opened this issue 3 years ago • 3 comments

Display current builder being used when building to the progress output:

$ docker buildx build .
#1 [internal] building with "builder" instance using docker-container driver
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 69B 0.0s done
#2 DONE 0.1s

#3 [internal] load build definition from Dockerfile
#3 transferring dockerfile: 2.91kB 0.0s done
#3 DONE 0.1s
...
$ docker buildx bake binaries
#1 [internal] building with "builder" instance using docker-container driver
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 32B
#2 transferring context: 69B 0.0s done
#2 DONE 0.1s

#3 [internal] load build definition from Dockerfile
#3 transferring dockerfile: 2.91kB 0.0s done
#3 DONE 0.1s

image

Can help users who need to know the type of builder in use during their build but also for log reports.

Was also thinking of displaying available nodes with BuildKit version and healthcheck used but might be a bit too much:

$ docker buildx build .
#1 [internal] building with "builder" instance using docker-container driver
#1 - node: builder0    / RUNNING  / v0.10.3
#1 - node: mac-mini-m1 / RUNNING  / v0.10.1
#1 - node: sifive      / INACTIVE / b3d272e
#1 DONE 0.2s

Signed-off-by: CrazyMax [email protected]

crazy-max avatar Jun 21 '22 13:06 crazy-max

Although, I'm not sure why we have so many identical private oneOffProgress functions, we should definitely be able to refactor all of them together.

Opened https://github.com/moby/buildkit/pull/3006 but let's do that in a follow-up when it's merged. LGTY otherwise?

PTAL @tonistiigi

crazy-max avatar Aug 08 '22 14:08 crazy-max

I'm not so sure about this. This is not really a progress item, a step that runs as part of the build on a specific time/duration. Is it more like a debug log line?

Maybe if we could fit the instance name on the first line?

[+] Building 29.1s (12/12) FINISHED                           docker-container:buildkit_intance_name
 => [internal] load git source https://github.com/docker/buildx.git                             4.1s 

For progress=plain we should print some summary after the build anyway. Eg. currently we don't tell how long the build took. Maybe we could attach this info then?

tonistiigi avatar Aug 08 '22 19:08 tonistiigi

Is it more like a debug log line?

Yes that's it.

Maybe if we could fit the instance name on the first line?

[+] Building 29.1s (12/12) FINISHED                           docker-container:buildkit_intance_name
 => [internal] load git source https://github.com/docker/buildx.git                             4.1s 

For progress=plain we should print some summary after the build anyway. Eg. currently we don't tell how long the build took. Maybe we could attach this info then?

Sounds good, I will take a look

crazy-max avatar Aug 09 '22 16:08 crazy-max