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
feat: improve plain progress #7272
base: main
Are you sure you want to change the base?
Conversation
Looking good @jedevc 💪 |
Okay, continuing to make progress here, did some refactoring, but also started reworking the output a bit. One of the main problems with plain progress is that we lose a lot of context for when anything appears. This was always kind of a problem, but it's now really quite annoying. So ideally, what we should do is try and provide some amount of context for each vertex. One idea I've been playing around with is to show each vertex with its parent call (if there is one): The merging between parts isn't quite right, but the grouping does seem to help improve readability. Unlike the pretty progress, it's not really doable to nest these indefinitely, since this will really clog up the output - but showing the most recent parent call does really help to understand where something comes from. |
7dab49c
to
d3e1667
Compare
598b59d
to
869181f
Compare
Okay, so a lot of work from this got spun out into separate PRs: #7347 #7371 #7385 I also got some more time to focus on this one for a bit yesterday and today - I refactored most of the progress, and so now we have a lot of nice shared code between the plain and the pretty output. Here's the current state: There's a few more steps to take early next week before this is done:
|
e22fcc9
to
c0a4166
Compare
@jedevc I like the way this renders a lot. I don't think it's part of this PR likely, but I'd still like to see less/none of the |
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.
Code LGTM! Obviously need to solve the test failure mystery, but otherwise good to merge
} | ||
depth-- | ||
indent(out, depth) | ||
depth-- //nolint:ineffassign |
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.
wtf, silly linter... 😄
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.
First off, this looks great! I love that it keeps all the info and coloring from the TUI, and it doesn't feel too insanely verbose. The refactor is very sensible too.
Purely UI feedback, but we can iterate, it's already better than what we have:
I mentioned spacing previously, and I think keeping the top-level items separate but keeping the nested items flush is probably the best we can do. Besides maybe double-spacing at the top and single-spacing at the inner levels. Maybe worth trying, but dunno if it'd be better.
That being said it seems like sometimes calls "break out" into separate sections instead of being nested properly. Maybe a bug? (See the extra "Apko.wolfi" header below)
Could use a blank line here above "Container evaluated." to make it feel more final.
Since we're already omitting args on the "DONE" line maybe we should omit the return type too? Seems slightly noisy.
The spacing on the numbers feels a little awkward but I get that it keeps things aligned. Maybe the number could be right-aligned so it's flush with the
:
? Maybe 0-padded?
MAYBE the top-level inline args are indented one level too far? Not sure if intentional, but it means the children align a little differently than when it's not a multiline code block.
That's all I got for now! Again nothing blocking.
cmd/dump-id/main.go
Outdated
@@ -10,6 +10,8 @@ import ( | |||
) | |||
|
|||
func main() { | |||
// XXX: check that this still works! |
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.
Not a big deal if it doesn't, it's already a bit nerfed from TUI refactoring. It used to give you a deep dump of the ID, but now it abbreviates into things like Container.withExec
which isn't as useful.
dagql/idtui/frontend.go
Outdated
} | ||
return view | ||
// ConnectedToEngine is called when the CLI connects to an engine. | ||
// TODO: remove this |
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.
Mostly curious, any particular reason to remove it? The thinking was that a plain UI would just print this, but a pretty TUI might show it somewhere onscreen
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.
It gets refactored away in https://github.com/dagger/dagger/pull/7385/files#diff-375c41f6a94e797edee687b8fa151865e2192d8aa9088acaffa174d0de2c3578R284
We can just use slog
here (at least for now).
case tea.WindowSizeMsg: | ||
fe.SetWindowSize(msg) | ||
return fe, nil | ||
type Frontend interface { |
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.
👍
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
Rebased onto main after #7385 was merged. |
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
2aaaccf
to
acb5e49
Compare
These now strike a balance between the old and the new plain progress, while trying to take as much advantage of our new OTEL tooling as possible. These new logs use the span database, sharing the logic with the pretty progress as well (but handling logs entirely differently, we don't need/want fancy vterm handling for these). Signed-off-by: Justin Chadwell <me@jedevc.com>
We don't want to display these at all for the new TUI. Signed-off-by: Justin Chadwell <me@jedevc.com>
This got missed somewhere during a rebase. Signed-off-by: Justin Chadwell <me@jedevc.com>
Right. I think I have a handle on what's going on. Compare the failing check on this PR here and the passing check on my work-in-progress PR here. There's one key difference here: Here's my best guess what's going on - somewhere, there's an unexpected layer of output buffering, which is preventing flushing data from the output stream - this seems to manifest as blocking something critical in a python test. If we just become more chatty on our logs... we flush more data. Alongside the hard evidence of the different PRs:
From the python subprocess side, we do set |
Interesting! Yeah, the runtime also disables it for modules: dagger/sdk/python/runtime/main.go Line 160 in 643aa61
But CI doesn't: Lines 181 to 183 in 643aa61
It's an easy change to put there. |
Signed-off-by: Justin Chadwell <me@jedevc.com>
Hm, that doesn't seem to have worked. Something weird here is also that the extra chattiness I added was for stderr - while I think we do a lot of our essential session communication over stdout. Still not quite sure what this could be though. |
Fixes #7137.
With the changes as part of #6835 (in v0.11.0), all old TUIs were removed, including the old
--progress=plain
output. With #7069 (in v0.11.1), a limited version of the plain TUI was restored. However, as noted in #7137 (comment) and #7223 (comment), this new plain progress has issues - it only reports spans that have logs, and loses a lot of additional information.This PR attempts to strike a balance between the v0.10.X plain output and the v0.11.X plain output - unfortunately, the old behavior cannot be perfectly restored due to the architectural changes in the move to OpenTelemetry.
Specifically, some guiding ideas I'm trying to stick to: