-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
control: add info service #2725
Conversation
Test that looks flaky but not related to this PR: https://github.com/moby/buildkit/runs/5534127937?check_suite_focus=true#step:6:1092 cc @sipsma
|
api/services/control/control.proto
Outdated
string package = 1; | ||
string version = 2; | ||
string revision = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this basically semver or something else?
@@ -157,3 +158,11 @@ message ListWorkersRequest { | |||
message ListWorkersResponse { | |||
repeated moby.buildkit.v1.types.WorkerRecord record = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to add it to WorkerRecord
as well in case in the future we will allow worker versions mismatch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
89c8051
to
896bae4
Compare
Last commit adds a new field to expose built-in dockerfile frontend version. This one is a bit tedious so might be consider in a follow-up if you want. I'm using a comparison table in a JSON file to guess the dockerfile frotnend version linked to the buildkit one: https://github.com/moby/buildkit/pull/2725/files#diff-edcbcc2959221b86d31f2cda9e7d365d8e317e111d4f5913c149a7ee40005dd1R1-R32. This JSON file could be reused elsewhere like displaying the frontend version linked to the BuildKit one on Moby. If buildkit version is a dirty one, we try to find the closest one. Will look like this: $ buildctl debug info
BuildKit:
Package: github.com/moby/buildkit
Version: v0.10.0-7-g50735431.m
Revision: 5073543122a9b8d043db23a5c7c2dbad9ce945db.m
Built-in Dockerfile Frontend:
Version: ~1.4.0 |
896bae4
to
43ad8ab
Compare
"github.com/urfave/cli" | ||
) | ||
|
||
var InfoCommand = cli.Command{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the command needed? We already have version
command. Is there a valid use-case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a version command, only the --version
flag. I think info
is only for debug purposes like the workers
one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add this also to WorkerRecord
then it can just be shown on exiting commands. Trying to avoid adding new things if there isn't a clear need for them.
@@ -0,0 +1,32 @@ | |||
{ | |||
"0.10.0": "1.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather avoid this. It is messy to manage. If someone needs this information it can be implied from the buildkit revision. Users should not try to detect the default version but put a fixed version on top of the Dockerfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure will remove this commit. I still think it's useful to know this information. Searching through GitHub Releases is not easy as buildkit releases are not tied to the frontend one. Agree that it's a poor implementation to handle that. Will think about a better way to do it in a follow-up.
@@ -157,3 +158,11 @@ message ListWorkersRequest { | |||
message ListWorkersResponse { | |||
repeated moby.buildkit.v1.types.WorkerRecord record = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
43ad8ab
to
56f0715
Compare
Signed-off-by: CrazyMax <[email protected]>
56f0715
to
859ad49
Compare
e269946
to
3469aa2
Compare
Signed-off-by: CrazyMax <[email protected]>
3469aa2
to
d2a757f
Compare
added to worker record: $ buildctl debug workers -v
ID: nqb09zw7vu11yer337j323rek
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
BuildKit: github.com/moby/buildkit v0.10.0-43-gd2a757f8 d2a757f862957bf8a4cfb6f1bb990fa6dc33d153
Labels:
org.mobyproject.buildkit.worker.executor: oci
org.mobyproject.buildkit.worker.hostname: pc-sff
org.mobyproject.buildkit.worker.network: host
org.mobyproject.buildkit.worker.oci.process-mode: sandbox
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: 512MB
GC Policy rule#1:
All: false
Keep Duration: 1440h0m0s
Keep Bytes: 26GB
GC Policy rule#2:
All: false
Keep Bytes: 26GB
GC Policy rule#3:
All: true
Keep Bytes: 26GB $ buildctl debug workers --format "{{json .}}" | jq
[
{
"id": "nqb09zw7vu11yer337j323rek",
"labels": {
"org.mobyproject.buildkit.worker.executor": "oci",
"org.mobyproject.buildkit.worker.hostname": "pc-sff",
"org.mobyproject.buildkit.worker.network": "host",
"org.mobyproject.buildkit.worker.oci.process-mode": "sandbox",
"org.mobyproject.buildkit.worker.snapshotter": "overlayfs"
},
"platforms": [
{
"architecture": "amd64",
"os": "linux"
},
{
"architecture": "amd64",
"os": "linux",
"variant": "v2"
},
{
"architecture": "amd64",
"os": "linux",
"variant": "v3"
},
{
"architecture": "arm64",
"os": "linux"
},
{
"architecture": "riscv64",
"os": "linux"
},
{
"architecture": "ppc64le",
"os": "linux"
},
{
"architecture": "s390x",
"os": "linux"
},
{
"architecture": "386",
"os": "linux"
},
{
"architecture": "mips64le",
"os": "linux"
},
{
"architecture": "mips64",
"os": "linux"
},
{
"architecture": "arm",
"os": "linux",
"variant": "v7"
},
{
"architecture": "arm",
"os": "linux",
"variant": "v6"
}
],
"gcPolicy": [
{
"filter": [
"type==source.local,type==exec.cachemount,type==source.git.checkout"
],
"all": false,
"keepDuration": 172800000000000,
"keepBytes": 512000000
},
{
"filter": null,
"all": false,
"keepDuration": 5184000000000000,
"keepBytes": 26000000000
},
{
"filter": null,
"all": false,
"keepDuration": 0,
"keepBytes": 26000000000
},
{
"filter": null,
"all": true,
"keepDuration": 0,
"keepBytes": 26000000000
}
],
"buildkitVersion": {
"Package": "github.com/moby/buildkit",
"Version": "v0.10.0-43-gd2a757f8",
"Revision": "d2a757f862957bf8a4cfb6f1bb990fa6dc33d153"
}
}
] |
adds version service that returns BuildKit package, version and revision:
could be handy for buildx:
Signed-off-by: CrazyMax [email protected]