Repository navigation
Introduce Progrock and inline progress UI - #5078
Conversation
There was a problem hiding this comment.
Made this by-value because there was a place I wanted to assign defaults to the given config, but didn't want to mutate the input.
There was a problem hiding this comment.
Note to reviewer: you'll be seeing this a lot.
Progrock provides FromContext and ToContext but I'm not sure if we want to commit to that. I started with it, but then there was one place the recorder was dropped because we intentionally create a context.Background(), and that spooked me into making it explicit in a later commit. But it is everywhere and now I'm seeing the value in context.Context again. 😅
Let me know what you prefer! I'm really on the fence.
There was a problem hiding this comment.
This shimmies the recorder through context.Context so ToResolver can use it.
There was a problem hiding this comment.
Changing this to truncate instead of appending, per conversation w/ @marcosnils and @aluzzardi
There was a problem hiding this comment.
@sipsma Moved this from internal/engine/client.go so it can use LogOutput; we need to be careful about printing to os.Stderr now since it messes with the inline TUI. I remember this was tied to a certain use case though, so not sure if this change is OK.
In the future we could add a Progrock vertex for internal logs (and maybe mark it "internal"), but this tweak is a smaller lift.
There was a problem hiding this comment.
Yeah I think this is good. The current use case was just to do a quick unblock of the desire to know which engine an SDK is connected to when looking at plain progress output directly (e.g. in GHA logs).
As long as it's still viewable in that context this is all good. What we should actually be doing here is emitting an event so that it shows up in the cloud UX (and presumably all the local TUIs too then?), but not needed now
|
This is looking mighty fine! 💪 A few things that I think would make it even better - each suggestion is separated by a horizontal rule: Once a timer goes over When an operation is cached, it should have a slightly greyed colour. Using the
When the pipeline run ends, I think that we should show the total execution at the bottom. Case in point: this pipeline is too long to fit on one screen: When I scroll to the beginning of this pipeline, I see Lastly, I am wondering how to make the various stages more obvious. Seeing where one stage starts and another one ends, as well as how long each stage took, is something that I am missing. I like the white bold colour used in several places, but I am not sure whether it's highlighting the right thing. I am also unable to see the duration of each stage. This could be a potential follow-up. It's also OK to not do it if it's too hard or only make sense to me. |
|
I have a few more improvement suggestions (e.g. rave, etc.), but don't want to make this too big. Leaving it for another time. |
There was a problem hiding this comment.
Did you mean to delete these?
There was a problem hiding this comment.
Maybe. I'm not sure if anyone is using this, or if it's a leftover from when we were still figuring out how to bootstrap our CI stack. I had to remove these because my go.work points to ../foo which doesn't get picked up and causes all the builds to fail.
For me the fastest feedback loop is doing dev/test with native go test etc., and then using ./hack/make test as the final "about to push" run, where ignoring go.work and go.work.sum gives me a valuable reminder to actually bump the dependencies in go.mod.
cc @sipsma @marcosnils @jlongtine @helderco @aluzzardi to see if anyone's depending on this and whether I can remove it. 🙏
gerhard
left a comment
There was a problem hiding this comment.
These changes read very well to me. Excited to see this in the hands of users! 🤘
so this can be reused for benchmarks too Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
to be honest, this kind of demonstrates the value of using context, but I'm committing this anyway so we can decide which flavor we want Signed-off-by: Alex Suraci <[email protected]>
rather than converting pipeline paths to progrock groups in core/, convert them while converting from buildkit events to progrock. we may want to unroll this later if/when we decide to switch to progrock everywhere, better to prioritize compatibility for now. Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
otherwise this collides with the inline TUI Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
out with multi-group vertexes, in with separate vertex instances Signed-off-by: Alex Suraci <[email protected]>
seems worth it, at least one other person thought so too, also allows for passing into our GatewayClient This reverts commit 6af33b0526c3815a85920c403b6d4f1677e3ea96. Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
also remove ctx argument from LLBOpt and ProgressGroup, unlikely that we'll need it there now that we can emit groups in GatewayClient Signed-off-by: Alex Suraci <[email protected]>
in a lot of cases we already have one, plus this allows us to record *pb.Definition vertex membership before creating a Directory/File Signed-off-by: Alex Suraci <[email protected]>
key points:
* the Progrock code paths are now completely independent from
ProgressGroups, which are only preserved for compatibility with Dagger
Cloud
* the gateway client now automatically records memberships for all
inputs to Solve
* implicit Dagger pipeline groups must manually emit membership for LLB
that they build, in lieu of setting a ProgressGroup.
- applies to the following:
* from <image>
* host.directory <path>
* docker build
* service <hostname>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
used for collecting events into a journal file for comparing side-by-side with old journal format Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
* record any Digestible params as inputs to the --debug vertex * display digests instead of giant FooID values Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
The inline TUI works better for fast feedback loops and scripting, since it doesn't take over the screen and it doesn't require an extra interaction to quit back to the terminal. + fix --debug --interactive deadlock + propagate command error from inline TUI Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
| return nil, err | ||
| } | ||
|
|
||
| if edible, ok := any(res).(Digestible); ok { |
|
I did another pass with the latest changes yesterday. This is what the final output looks like: Screen.Recording.2023-05-10.at.20.28.24.mp4While some of my earlier points are still outstanding, I don't see any merge blockers 🚀 |




This PR introduces Progrock to the codebase, in a backwards-compatible way.
The main user-facing feature here is the addition of an alternative inline style TUI.
Comparing & contrasting inline and interactive (aka tree-style) TUIs:
dagger.WithLogOutputformat is used if a TTY is not detected on stdout/stderr.git log --graph.I prefer the inline UI for quick local iteration, since it keeps you in the terminal, but I don't intend to replace the current "interactive debugger" style UI. They both have different strengths and weaknesses, and I expect to support both as long as they are useful to people.
Besides the shiny new UI, this change gives us full control of the progress stream, meaning we can now display whatever progress items we want to the user. Some places where it should help:
solve()APIContainer { import }that's invisible to Buildkit--debugThis progress protocol is largely based on Buildkit's
*client.SolveStatus, with some refinements: