#Dagger, and work sessions

1 messages · Page 1 of 1 (latest)

charred tinsel
#

zellij / tmux / screen are persistent (effectively nohup'd) so they'll stay running if the connection drops.. but.. i can't see how to reconnect to the session?

rain thorn
#

since terminal has been mostly designed for troubeshooting purposes and not intented for long unattended programs

#

it actually panics 😅

.withExec(args: ["apk", "add", "tmux"]): Container!

[detached (from session 0)]
exit 0
Caught panic:

runtime error: index out of range [115] with length 115

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /usr/lib/go/src/runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
        /usr/lib/go/src/runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc00074c000, {0x1aece00, 0xc000eac138})
        /go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.5/tea.go:810 +0xac
github.com/charmbracelet/bubbletea.(*Program).Run.func

cc @simple bridge

#

dagger -c 'container | from alpine | with-exec apk add tmux | terminal --cmd tmux '

#

^ and then detach from that session

charred tinsel
rain thorn
#

getting into a working session that you can eventually resume?

#

the thing is that none of the things that you do in that working session will be permanently stored given the core primitives of Dagger

charred tinsel
#

actually what does happen to the image when | terminal ends?

charred tinsel
rain thorn
charred tinsel
#

currently my dagger client is local, and I'm running the engine on aws under docker: so there's lots of ways to lose my connection.

The client connects with ssh over "aws ssm".

I get this intermittently (sometimes after minutes, sometimes hours):

Full trace at https://dagger.cloud/cross-stream/traces/7901d4a49b59b5b5bd171b8d6fadf1e9
Error: Post "http://dagger/query": command [docker exec -i dagger-engine-v0.18.10 buildctl dial-stdio] has exited with exit status 1, make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=command [ssh -o ConnectTimeout=30 -T -l root -- i-0c399fef00acac0cb docker system dial-stdio] has exited with exit status 255, make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=mux_client_request_session: session request failed: Session open refused by peer
ControlSocket /Users/andy/.ssh/cm-root@i-0c399fef00acac0cb:22 already exists, disabling multiplexing
Bad packet length 565646221.
ssh_dispatch_run_fatal: Connection to UNKNOWN port 65535: Connection corrupted
rain thorn
charred tinsel
rain thorn
charred tinsel
#

I'm thinking about a flow, something like ... | terminal | publish registry:5000 <session-id> -- I could then use container | from <session-id> | terminal | publish registry:5000 <session-id> to resume

rain thorn
charred tinsel
rain thorn
#

unless you use a cache volume and persist the changes there but cache volumes are "best effort" ephemeral caching which could be garbage collected