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

Display buildkit and runc version in nerdctl #1209

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

manugupt1
Copy link
Contributor

@manugupt1 manugupt1 commented Jul 8, 2022

Fixes#1082 #1082

Signed-off-by: Manu Gupta manugupt1@gmail.com

Testing details

➜  nerdctl git:(support-container-file) ✗ make && sudo make install && nerdctl version
GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w -X github.com/containerd/nerdctl/pkg/version.Version=v0.21.0-95-g733285c -X github.com/containerd/nerdctl/pkg/version.Revision=733285c464aa0e68810977a4b2c68848079e0280"  -o /home/manu/go/src/github.com/containerd/nerdctl/_output/nerdctl github.com/containerd/nerdctl/cmd/nerdctl
install -D -m 755 /home/manu/go/src/github.com/containerd/nerdctl/_output/nerdctl /usr/local/bin/nerdctl
install -D -m 755 /home/manu/go/src/github.com/containerd/nerdctl/extras/rootless/containerd-rootless.sh /usr/local/bin/containerd-rootless.sh
install -D -m 755 /home/manu/go/src/github.com/containerd/nerdctl/extras/rootless/containerd-rootless-setuptool.sh /usr/local/bin/containerd-rootless-setuptool.sh
Client:
 Version:       v0.21.0-95-g733285c
 OS/Arch:       linux/amd64
 Git commit:    733285c464aa0e68810977a4b2c68848079e0280
 buildctl:
  Version:      v0.10.3
  GitCommit:    c8d25d9a103b70dc300a4fd55e7e576472284e31

Server:
 containerd:
  Version:      1.6.6
  GitCommit:    10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc:
  Version:      1.1.2
  commit:       v1.1.2-0-ga916309
  spec: 1.0.2-dev
  go:   go1.17.11
  libseccomp:   2.5.3

@manugupt1 manugupt1 force-pushed the support-container-file branch 3 times, most recently from e99b50a to c73f694 Compare July 8, 2022 07:05
@manugupt1 manugupt1 marked this pull request as ready for review July 8, 2022 07:09
cmd/nerdctl/version.go Outdated Show resolved Hide resolved
@manugupt1 manugupt1 force-pushed the support-container-file branch 2 times, most recently from de45837 to 6e74159 Compare July 9, 2022 00:36
@manugupt1 manugupt1 changed the title Display buildkit version in nerdctl Display buildkit amd runc version in nerdctl Jul 9, 2022
@manugupt1 manugupt1 changed the title Display buildkit amd runc version in nerdctl Display buildkit and runc version in nerdctl Jul 9, 2022
@manugupt1 manugupt1 force-pushed the support-container-file branch 3 times, most recently from 3eb2523 to 21fd1be Compare July 10, 2022 01:35
@junnplus
Copy link
Member

 runc:
  Version:      1.1.3
  spec::        1.0.2-dev
  go::  go1.18.3
  libseccomp::  2.5.4

Why spec::

pkg/infoutil/infoutil.go Outdated Show resolved Hide resolved
@manugupt1
Copy link
Contributor Author

Why spec::
This is returned by runc version; we can skip it if it if you think it is not reqd.
Docker returns runc version and git commit only. I can keep the same if reqd.

@AkihiroSuda AkihiroSuda added this to the v0.22.0 milestone Jul 10, 2022
@junnplus
Copy link
Member

This is returned by runc version; we can skip it if it if you think it is not reqd.
Docker returns runc version and git commit only. I can keep the same if reqd.

I mean there is a double :, ok now

pkg/infoutil/infoutil.go Outdated Show resolved Hide resolved
pkg/infoutil/infoutil.go Outdated Show resolved Hide resolved
Copy link
Member

@junnplus junnplus left a comment

Choose a reason for hiding this comment

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

LGTM

@junnplus
Copy link
Member

@AkihiroSuda PTAL

PS, Can we release a new version after this merge?

@manugupt1
Copy link
Contributor Author

@AkihiroSuda PTAL

PS, Can we release a new version after this merge?

I need to fix this to update to reflect buildctl in client. Can we wait till tomorrow

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Jul 13, 2022

https://github.com/docker/cli/blob/v20.10.8/cli/command/system/version.go#L74-L87

Docker's clientVersion struct doesn't seem to have the []ComponentVersion property.
(Instead they show CLI plugin versions in docker info, not in docker version)

I guess we can safely extend the struct for nerdctl though.

stdout, err := exec.Command(buildctlBinary, "--version").Output()
if err != nil {
logrus.Warnf("unable to determine buildkit version: %s", err.Error())
return dockercompat.ComponentVersion{Name: "buildkit"}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return dockercompat.ComponentVersion{Name: "buildkit"}
return dockercompat.ComponentVersion{Name: "buildctl"}

Fixes#1082

Co-authored-by: Akihiro Suda <suda.kyoto@gmail.com>

Signed-off-by: Manu Gupta <manugupt1@gmail.com>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@junnplus junnplus left a comment

Choose a reason for hiding this comment

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

LGTM

@AkihiroSuda AkihiroSuda merged commit 5c6128e into containerd:master Jul 15, 2022
@manugupt1 manugupt1 deleted the support-container-file branch July 15, 2022 02:29
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.

None yet

5 participants