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

ls: display buildkit version of the nodes#998

Merged
merged 3 commits into from
May 10, 2022

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Mar 14, 2022

needs moby/buildkit#2725

vendor buildkit to bring moby/buildkit#2725: moby/buildkit@3e38a2d...86c33b6

$ docker buildx ls
NAME/NODE              DRIVER/ENDPOINT             STATUS                 BUILDKIT             PLATFORMS
builder2               docker-container
  builder20            unix:///var/run/docker.sock running                N/A                  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
builder3               docker-container
  builder30            unix:///var/run/docker.sock running                86c33b6              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
builder4 *             docker-container
  builder40            unix:///var/run/docker.sock running                v0.10.0-91-g86c33b66 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
xenodochial_davinci    docker-container
  xenodochial_davinci0 unix:///var/run/docker.sock running                N/A                  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
desktop-linux                                      protocol not available
default                docker
  default              default                     running                N/A                  linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

Maybe we could display this info with a --no-trunc flag and not by default. cc @thaJeztah

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

@crazy-max crazy-max marked this pull request as ready for review April 8, 2022 23:53
commands/util.go Outdated
inf, err := c.Info(ctx)
if err != nil {
if st, ok := grpcerrors.AsGRPCStatus(err); ok && st.Code() == codes.Unimplemented {
d.version = "N/A"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should have a fallback for it. Version can be queried by running --version on buildkitd or from docker version for docker driver. We could add this in the driver interface and let it decide.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added fallback for docker-container and docker driver. Left unimplemented for kubernetes and remote drivers for now (cc @jedevc @AkihiroSuda):

$ docker buildx ls
NAME/NODE              DRIVER/ENDPOINT             STATUS                 BUILDKIT             PLATFORMS
builder2               docker-container
  builder20            unix:///var/run/docker.sock running                v0.10.3              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
builder3               docker-container
  builder30            unix:///var/run/docker.sock running                v0.10.3              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
builder4 *             docker-container
  builder40            unix:///var/run/docker.sock running                v0.10.0-91-g86c33b66 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
xenodochial_davinci    docker-container
  xenodochial_davinci0 unix:///var/run/docker.sock running                v0.9.3               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
desktop-linux                                      protocol not available
default                docker
  default              default                     running                20.10.14             linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM - I don't think there's a good way to work out what version the remote driver is running if the gRPC call fails

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@thaJeztah
Copy link
Member

Maybe we could display this info with a --no-trunc flag and not by default. cc @thaJeztah

Yeah, still wondering a bit what information is most relevant in the overview. The "staggered" / alternating lines, together with the long list of (possible) architectures supported make the list hard to "grasp" in a quick look. I'm also trying to find what order is used to print these (doesn't appear to be ordered by NAME or NODE?)

A more "toned-down" representation with one item per line could look like;

docker buildx ls
NAME                    NODE                   DRIVER             STATUS     BUILDKIT               PLATFORMS
builder2                builder20              docker-container   running    N/A                    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
builder3                builder30              docker-container   running    86c33b6                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
builder4 *              builder40              docker-container   running    v0.10.0-91-g86c33b66   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
default                 default                docker             running    N/A                    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
desktop-linux           default                docker             running    N/A                    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
xenodochial_davinci     xenodochial_davinci0   docker-container   running    N/A                    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

Or even (omitting the PLATFORMS in the default overview);

docker buildx ls
NAME                    NODE                   DRIVER             STATUS     BUILDKIT            
builder2                builder20              docker-container   running    N/A                 
builder3                builder30              docker-container   running    86c33b6             
builder4 *              builder40              docker-container   running    v0.10.0-91-g86c33b66
default                 default                docker             running    N/A                 
desktop-linux           default                docker             running    N/A                 
xenodochial_davinci     xenodochial_davinci0   docker-container   running    N/A                 

The --format flag could still be used to include other columns, and of course docker buildx inspect to get the nitty-gritty details of each builder 🤔

@crazy-max
Copy link
Member Author

crazy-max commented May 10, 2022

@thaJeztah I will continue working on #830 based on your comment here and this one #830 (comment)

@tonistiigi tonistiigi merged commit 55b85f5 into docker:master May 10, 2022
@crazy-max crazy-max deleted the ls-buildkit-version branch May 10, 2022 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants