Repository navigation
use TUI for dagger do, dagger query, dagger listen - #5151
Conversation
don't need TCP support anymore Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
TODO: groups Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
* track numeric offset rather than current entry * highlight non-current but same vertexes 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]>
* inline TUI now default, not experimental * interactive TUI now enabled by _EXPERIMENTAL_DAGGER_INTERACTIVE_TUI * console output now used if stdout/stderr is not a TTY 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]>
this was a temporary experiment; don't think this is _quite_ what we want, since it still clips output at the vterm height Signed-off-by: Alex Suraci <[email protected]>
|
@sipsma So this is sort of implemented for (Code) Side notes from experimentation:
|
Yeah I suspected this might cause problems, I think it's due to the fact that the command is executing as a nested session served from the shim: https://github.com/sipsma/dagger/blob/0ef2bb305d8e9c177698b1e61aab58b05eaed078/cmd/shim/main.go#L533-L533 Not 100% sure though, let me know if that makes sense to you. If that is indeed the problem, my guess is that we will want some way of forwarding events from that nested session to the outer session. Coincidentally, I have been banging my head against a similar-ish problem while trying to add support for interacting with the caller's I don't know if that would exactly solve the problem here, but if not maybe a similar approach could be taken where we create a socket that enables forwarding of events from the command to the outer session?
That's behaving as intended. Each resolver is executed and cached individually. I could see it possibly making sense to display it differently though, but no immediate ideas.
Yeah that makes sense. My immediate thought is to put this in dagger.json. I'll create a linear issue
Yep, we specifically designed this so that you can get maximal caching in the same way you get caching for any Exec. If your command only makes Dagger API calls, this doesn't really matter since those will be cached. But commands are just code, so you are also free to import libraries and do whatever expensive work you want to do directly in the language you're using, no "shelling out" via For use cases that need to always run, we probably should just add a |
Ah-ha, yeah that has to be it. I added a
Yeah, after a quick look that's what comes to mind for me too. I can try mounting a socket and sending Progrock status updates over it. |
|
Based on the conversation, I don't think that this is ready to be merged so that it goes out in today's release. If I don't hear otherwise in the next few hours, leaving this for next week. |
|
Note to self: this (loosely related) issue is worth checking out before next week's release: |
Signed-off-by: Alex Suraci <[email protected]>
still not quite perfect DX but better than nothing Signed-off-by: Alex Suraci <[email protected]>
|
@sipsma Proxying through a socket worked! |
Awesome! This doesn't need to be in this PR, but another consideration with dagger do is that before we even invoke the users commands we have to build their project. If uncached, that can involve pulling base images for their language and running a few execs with that, so it can take a while and we want to make sure there's not dead air. On the other hand, those steps are really internal to the implementation of projects, so it feels like it would be nice to not display them prominently maybe. Like we want to show that the project is building, but not necessarily every little step involved, at least by default. If we updated those project build steps to all be under a certain pipeline label would that help organize it all in the TUI too? Just spitballing. |
sipsma
left a comment
There was a problem hiding this comment.
Looks great, just a few non-blocking nits
| } | ||
|
|
||
| func (p *Project) getResolver(ctx context.Context, gw bkgw.Client) (graphql.FieldResolveFn, error) { | ||
| func (p *Project) getResolver(ctx context.Context, gw bkgw.Client, progSock *Socket) (graphql.FieldResolveFn, error) { |
There was a problem hiding this comment.
nit: not a blocker, but the same problem you solved here applies to any dagger exec where ExperimentalPrivilegedNesting is true, so it would be good to make the same change in core/container.go too someday.
(Honestly, this project code should probably be refactored to just call that container code so we can get rid of the duplication, but I can take care of that separately. There's some other refactorization we need here anyways to enable sdk-specific cache mounts.)
There was a problem hiding this comment.
Done! Had to pass the socket through a few places because of the default-exec behavior, but nothing too crazy.
| return "", nil, nil, err | ||
| } | ||
|
|
||
| return progSock, progW, l.Close, nil |
There was a problem hiding this comment.
nit: unix sock won't be deleted from the fs when it's closed, so we could toss in an os.Remove with the cleanup too. Otherwise I suppose over time you will keep accumulating leftover sockets indefinitely, which is mostly harmless but technically takes up inodes I suppose.
There was a problem hiding this comment.
Go stdlib will unlink on close for Unix sockets:
I confirmed they're being cleaned up locally, but it's definitely possible to leak them over time if you aggressively kill the dagger process, and I had one leaked probably from a SIGQUIT I sent earlier. Maybe this could be switched to TCP? 🤔
edit: also strictly speaking this should probably be in RuntimeDir rather than CacheHome
There was a problem hiding this comment.
Go stdlib will unlink on close for Unix sockets:
Oh cool, I had no idea, that's very nice of it!
I confirmed they're being cleaned up locally, but it's definitely possible to leak them over time if you aggressively kill the dagger process, and I had one leaked probably from a SIGQUIT I sent earlier. Maybe this could be switched to TCP? 🤔
Eh I wouldn't worry about it then. I was just concerned that like 1000 runs of dagger would result in 1000 sockets, but if it only rarely leaks it really doesn't matter in practice I don't think.
There was a problem hiding this comment.
👍 sounds good! I think putting it in xdg.RuntimeDir should help too, since that tends to be a directory that gets blown away when the machine reboots, so any leaks won't last for long.
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
* silence RPC logs * print all output on completion Signed-off-by: Alex Suraci <[email protected]>
This PR extracts the TUI setup from
dagger runand implements it for all other commands that start an engine.It also does a few other things:
_EXPERIMENTAL_DAGGER_TUIenv has been removed._EXPERIMENTAL_DAGGER_INTERACTIVE_TUIenv.--debugis no longer required to see console output. It seems a little odd to me to be completely silent by default when there's no TTY, but maybe there was a good reason for this?