#help wanted with getting _EXPERIMENTAL_DAGGER_TUI to work

1 messages ยท Page 1 of 1 (latest)

peak whale
#

I've been trying to get the new shiny UI to work but without success.

here is my runtime

# set some vars

podman run \
        --name $dagger_runner \
        --restart always \
        -d \
        -e _EXPERIMENTAL_DAGGER_TUI=1 \
        -v "$dagger_cache:$default_state_dir" \
        --privileged \
    ghcr.io/dagger/engine:"$engine_version" --debug

and example container

// ...
    img := client.Pipeline("install").Container().From(baseImage)

    base := img.
        WithEnvVariable("CI", "true").
        WithEnvVariable("YARN_CACHE_FOLDER", yarnCacheDir).
        WithEntrypoint(nil).
        WithSecretVariable(nxCloudTokenEnv, nxCloudToken).
        WithSecretVariable(geoipLicenseKeyEnv, geoipLicenseKey).
        WithWorkdir(path).
        WithMountedDirectory("./", installDependencies).
        WithMountedCache("./node_modules", client.CacheVolume("node_modules")).
        WithMountedCache(yarnCacheDir, client.CacheVolume("yarn")).
        WithMountedCache("./yarn/install-state.gz", client.CacheVolume("install-state")).
        WithExec([]string{"/bin/sh", "-c", `
            apk add --no-cache build-base python3 gcc jq git && \
            ln -sf /usr/bin/python3 /usr/bin/python && \
            yarn install --immutable
        `})
// ...

running this with the following but still no fancy term ui ๐Ÿ˜„

export _EXPERIMENTAL_DAGGER_TUI=1 # export client side also just in case
dagger run go run main.go

Something I am missing?

I see nothing out of the ordinary in the logs either

wide quarry
#

Could you please confirm that you're using Dagger 0.5?

peak whale
#

yep, also tried running the image from main

#

should the log output be set differently maybe?

    client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
mystic stirrup
#

@dull lagoon ๐Ÿ‘† any ideas?

#

I'll try it too.

dull lagoon
#

is your program calling something to make the container run? e.g. .ExitCode, .Stdout

#

also what actually happens? (no output at all? UI doesn't start?)

peak whale
#

it did, but I removed it

#

UI doesn't start and I get the standard output as before

mystic stirrup
#

podman install taking a bit...๐Ÿ˜…

peak whale
#

๐Ÿ˜„

#

simplifying a bit with no fmt.Print either...

#

no, the same output

#1 resolve image config for docker.io/library/node:18.8.0-alpine3.15
#1 DONE 1.2s

#2 importing cache manifest from dagger:10686922502337221602
#2 DONE 0.0s

#3 install
#3 DONE 0.0s

#4 fetching ref: 2b019dbf0e3b149e4c081dbbf4d11c15d6e0007a
#4 DONE 0.0s

#5 from node:18.8.0-alpine3.15
#5 resolve docker.io/library/node:18.8.0-alpine3.15
#5 resolve docker.io/library/node:18.8.0-alpine3.15 0.3s done
#5 DONE 0.3s

#3 install
#3 DONE 0.0s

#6 build
#6 CACHED

#7 export
#7 CACHED

#8 exporting to client directory
#8 copying files 41.14MB 0.1s
#8 copying files 77.28MB 0.2s done
#8 DONE 0.2s
#

going to try another shell

mystic stirrup
peak whale
#

same in Alacritty

#

yep

dull lagoon
#

just to confirm, is your dagger CLI the latest version? that's potentially different from your SDK version and could be out of sync. you could dagger version to confirm

peak whale
#

ohh shit

#
dagger 0.3.7 (2bd84ee24) linux/amd64
dull lagoon
#

a-ha

peak whale
#

hmm... let me install again

#

just installed from latest

dull lagoon
#

to be fair you never really had to install the CLI before, so I imagine when we launch this more broadly we'll want to do a round of docs updates to make it more integral to the flow of things (cc @wide quarry)

peak whale
#

my god, this is amazing!

and works

#

such a noob ๐Ÿคฆโ€โ™‚๏ธ

#

thanks ๐Ÿ™

mystic stirrup
#

Woohoo!! ๐ŸŽ‰ I'm just getting it going too @peak whale ! We're just on the cutting edge ๐Ÿ˜Ž

peak whale
#

yes!!

#

this is so amazing

mystic stirrup
#

@peak whale for my learning ๐Ÿค“ ...podman noob here
I'm on a Mac M1 so I did this

brew install podman
podman machine init
podman machine start
#

should I be ready to run containers?

peak whale
#

yep, what do you get from podman --version ?

mystic stirrup
#
podman version
Client:       Podman Engine
Version:      4.5.0
API Version:  4.5.0
Go Version:   go1.20.3
Git Commit:   75e3c12579d391b81d871fd1cded6cf0d043550a
Built:        Fri Apr 14 06:28:20 2023
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      4.3.0
API Version:  4.3.0
Go Version:   go1.18.7
Built:        Fri Oct 21 01:12:52 2022
OS/Arch:      linux/arm64
peak whale
#

woo, there is a minor bump already!, nice, need to check it out

#
#!/bin/bash

set -eoux pipefail

# cache_config_env=_EXPERIMENTAL_DAGGER_CACHE_CONFIG
# services_dns_env=_EXPERIMENTAL_DAGGER_SERVICES_DNS
default_state_dir=/var/lib/dagger
engine_version=${1:-v0.5.0}
dagger_cache="dagger-cache"
dagger_runner="dagger"

podman volume create $dagger_cache || true
podman rm -f $dagger_runner || true


podman run \
        --name $dagger_runner \
        --restart always \
        -d \
        -e _EXPERIMENTAL_DAGGER_TUI=1 \
        -v "$dagger_cache:$default_state_dir" \
        --privileged \
    ghcr.io/dagger/engine:"$engine_version" --debug
mystic stirrup
#

cheat code ๐Ÿ˜

peak whale
#

haha... sloppy

#

and just run it without args, or if you want to be on the bleeding edge pass main as arg ๐Ÿ˜„

mystic stirrup
#

woot!

podman ps                                                           git:main
CONTAINER ID  IMAGE                         COMMAND     CREATED        STATUS        PORTS       NAMES
9659398eafdf  ghcr.io/dagger/engine:v0.5.0  --debug     6 seconds ago  Up 6 seconds              dagger
peak whale
#

nice.. wait.. one more env in the shell were you run your scripts

#
export _EXPERIMENTAL_DAGGER_RUNNER_HOST=podman-container://dagger
#

and you are all set

#

or just zshrc, bashrc

mystic stirrup
#

cool. I stopped all my Dagger Engines running in docker

docker stop $(docker ps -a -q -f 'name=dagger-engine')
docker rm $(docker ps -a -q -f 'name=dagger-engine')
docker system prune -f -a --volumes
peak whale
#

or no, it will override your normal flow

#

nice

mystic stirrup
peak whale
#

w00b!

mystic stirrup
#

on podman!

#

๐Ÿ˜„

peak whale
#

nice!

mystic stirrup
peak whale
#

ahh nice, this is great. I should contribute

#

hey, one question, could you post a screenshot of logs from TUI?

#

I think my nvim config is somewhat messing something up

mystic stirrup
#

sure!

peak whale
#

ahh no, works now

mystic stirrup
#

I think there is work to be done to make it smooth in all terminals including those inside of IDEs, etc

#

took me a second to get used to the left and right arrows to fold, unfold (tried space bar, enter, random keys), but now I'm a maestro ๐Ÿ˜† ๐ŸŽน

peak whale
#

ahh right... but as a draft it's absolutely amazing

#

I mean, this is RC material, right?

mystic stirrup
#

Yep! Still early days! But awesome already ๐Ÿš€

dull lagoon
#

I still have a growing list of things to fix ๐Ÿ˜…

mystic stirrup
#

Glad we didn't hold this back.

peak whale
#

how does this come out in browser shells, like github actions?

#

I need to try it

#

wondering if vim bindings like h and l could also be mapped to collapse/expand

dull lagoon
#

it's really meant for the interactive use case haha

#

maybe the solution there is to just have it print all the logs on exit

#

it's a difficult thing to do without a TUI of some kind, since multiple things run concurrently. the original console output tries to handle that by hopping between steps as they print with a "cooldown", but it can also be kind of hard to grok

mystic stirrup
#

I used my Vim key binding plugin in VS Code and I can go up/down with J/K, but no effect with H/L

#

so, not real VIM

dull lagoon
#

ah, someone requested that keybind in the thread already ๐Ÿ‘ it's easy to add

#

if anyone wants to PR ๐Ÿ™‚

mystic stirrup
#

But for interactive use on dev laptops the TUI is chef_kiss

peak whale
#

yeah, absolutely, and since devs that will adapt Dagger as a toolkit for local development they will be moving away from endless bash scripts to remember or yarn wrappers, hence, a TUI is important

#

especially when Dagger will be used beyond pipelines

peak whale
dull lagoon
#

yeah exactly, rather than interleaved (current/old console UI)

dull lagoon