-
Notifications
You must be signed in to change notification settings - Fork 503
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
Proposal: buildx history command #2711
Comments
Should we have a |
|
Opened WIP PR in #2891 Some UX questions have arisen: The list command lists all builds for the current builder instance. This is a good default, but I think we could also provide:
What would make sense for the UX of these options/filters? Only the first one would probably be in the initial version, but we should think about future-proofing for the other ones. For the builds in Desktop's storage, how could these builds interact with other commands like
This is the special key we currently use in Desktop Build UI, but is it too hacky to expose to CLI users? This proposal doesn't currently clarify syntax for viewing raw files like attestations, traces, image configs etc. If the build is multi-platform, then the attestations are per-platform. Is something like Docker containers/images support accessing objects by a prefix of the ID. BuildKit History API does not support this, so full ID needs to be passed by the user all the time(it is 26 character string). Is this OK, or do we somehow need to support prefixes as well? We could just do |
I guess this will be based on VCS info and fallback to localstate? Maybe a final fackback on buildName if both return nothing?
Why would we need to rely on Maybe also list both local builds and imported when filtering builds of working directory from 1).
With my previous comment I think we could merge 1) and 3) so it displays both local and imported builds matching VCS info.
I guess you mean the global Maybe a shorthand
I was thinking maybe inspect could print the list of blobs attached to the record with Command will be quite huge though so maybe a new |
The token is needed to pull the
I don't think it is a good idea to mix builds from specific builder with the imported builds in desktop storage. They look very different concepts and also there is some overhead of loading both. I do get that while "instance builds", "desktop builds", "ci builds" are all "build sources", the "current directory" case is more like a filter, that could maybe be applied to all sources, and maybe should be one case of more generic filtering mechanism (eg. another filter could be by a Dockerfile name). Still question about the flags for these.
Possibly indeed. And
This would mean you always need to run a command to copy digest if you wish to, for example, download a provenance/trace/sbom/error for a build. Not ideal I think.
I'm ok with the subcommand but UX question is still how to set what type and platform of blob is needed. I don't want to hardcode the names as well if we should add more; that's why I thought maybe the media type is the ok solution. |
E.g.
And, not for the first iteration, but, I guess we could imagine more ways to filter the
How about reusing the |
Ah ok this is to download the artifact through GitHub API, looks good then!
Yes good point
The local store was strictly linked to the Docker Desktop case but with the history command now being able to import builds and inspect them I agree that
You're right, it feels better to use the content type as input but still think we should have a way to print attached blobs and display
Yeah they could be shorthand for |
Description
Goals
docker buildx
users. History APIs were added to BuildKit in version v0.11--progress=plain
(in default TTY mode logs disappear once a build step completes successfully). The same can be used to print logs without the multiplexing switches that happen when build steps run in parallel.Build summary (could be separate PR)
Currently, when running buildx build or buildx bake in a machine where Docker Desktop is installed, “View build details: docker-desktop://dashboard/build/…” will be printed after build is complete allowing access to Docker Desktop Build Views. This should be replaced with more generic “summary” feature.
Summary should contain:
docker buildx history ls
Lists all the builds BuildKit history API knows about. Most recent builds are shown on top.
Open link can be used to open build in Docker Desktop if supported.
Note that this command shows only the build for the active builder in Buildx, not like the build UI in Docker Desktop, that shows builds across all your builders.
docker buildx history logs [<id>]
Replay the logs for a specified build.
The logs would appear with the same formatting as
--progress=plain
, but there is no need to ever do multiplexing of build steps. Every step will only appear once in the output and print its whole log.If
<id>
argument is not set, then the last build for the current builder will be shown. If there are no builds, then an error is shown.docker buildx history inspect [<id>]
Print all details for a specified build. This includes data about duration, status, build request, outputs, build materials etc.
With some -
-verbose
flag, we could also print the whole graph of steps, but this can be left for a future iteration.Inspect output could end with examples of all other open/trace/logs etc commands for the same build.
Optionally, this command can be used to retrieve raw blobs from the build history, eg. the raw in-toto provenance, SBOM, image config, or opentelemetry trace. This can be done either with some use of
--format
flag or smth. like--type <mediatype>
.docker buildx history open [<id>]
Open specified build in Docker Desktop. This command requires Docker Desktop to be installed.
docker buildx history trace [<id>]
Open opentelemetry trace for the specified build.
In the initial implementation, this can run JaegerUI container (if one does not already exist), load the trace into it via POST request, and then open the link to the browser to view it. Optionally user could set their own URL to their JaegerUI instance with a flag. JaegerUI remains running, and users would need to call docker stop if they want to stop it.
docker buildx history rm [<id>...]
Delete a history record from the active BuildKit instance.
docker buildx history export [<id>…]
Export a specified build to a
.dockerbuild
archive that can be then imported to Docker Desktop (in another machine). This is the same archive currently generated by Docker’s Github Actions. The current implementation in Actions can start to just call buildx directly for this command.docker buildx history import < file
Import a build into Docker Desktop from a
.dockerbuild
file created byhistory export
command or downloaded from Docker’s Github Actions. This command requires Docker Desktop to be installed as the store for imported builds is managed by Desktop(that is across builders). When completed, Buildx will show a link for opening the imported build in Desktop.The text was updated successfully, but these errors were encountered: