#coopt `dagger run` ?

1 messages · Page 1 of 1 (latest)

humble garnet
#

I think given the small adoption of dagger run and the anticipated audience of zenith (10x larger conservatively, 1000x larger if we execute well 🙂 then it may be worth it. Using “am I inside an env” as the trigger is the missing piece of the puzzle IMO

#

Downside (besides breakage): doesn’t map entrypoint name

#

While we’re discussing crazy options: what if CLI and Shell were layered?

humble garnet
#

bonus points it gives @vast lance a playground to slowly introduce the scripting language of the future, whatever it ends up being (yeah i didn’t forget 😁)

#

dagger shell --lang bourne

#

dagger shell --lang graphql

#

dagger shell --lang bass ? 🙂

#

so we start with a simple “shlex” parser like buildkit uses, just word splitting nothing fancy

#

dagger shell -c “publish -v 0.2.3”

lament karma
# humble garnet in other words: there’s a default shell; it’s populated by the environment CLIs....

Yes I was thinking about this exact thing the other day 😁 I took a tiny baby step towards it by having dagger shell, if invoked w/ no args, drop you into a shell for the environment runtime container itself (which was mostly useful for debugging atm). But we can go much further w/ preloading all the env commands as actual invokable commands; maybe expose artifacts+checks in some way.

Basically, this shell would be the interactive manifestation of your environment, so to speak

humble garnet
#

or:

dagger shell
> publish -v 0.2.3
lament karma
#

I like the idea of pluggable interpreter too

#

also, integration with our fancy interactive tui

humble garnet
lament karma
#

(I guess that in particular might have too much overlap with a cloud ui)

vast lance
#

I was about to type something and then re-read the scrollback and realized it's already what you're talking about chef_kiss

#

I'm not sure where we would put the current meaning of dagger run. dagger exec comes to mind but that's probably confusing w/ docker exec and kubectl exec meaning something different.

But aside from that, I like the idea, since dagger run <env command> does feel like the more natural way to expose commands (you run them, you don't...do them)

vast lance
# lament karma also, integration with our fancy interactive tui

Working on this now (dagger shell playing nice with our TUI)! It's a real stress-test of the vt100 implementation 😅 I have most things working but htop looks awful, there must be some ANSI sequences it's not handling correctly.

As part of this change I'm also removing the interactive parts of Progrock so there's no longer competition for keyboard input. The only key anyone uses is q anyway, and you can just use Ctrl+C instead like with any other CLI.

humble garnet
#

how do you feel about layering CLI/command over Shell?

#

ie merging dagger do into dagger shell

humble garnet
vast lance
humble garnet
#

so you’d have 2 kinds of ways to implement a shell:

  • shells backed by a container
    or
  • shells backed by individual commands
lament karma
#

so then dagger shell publish calls your publish command because publish resolves to the binary implementing that

#

we'd still want to support what currently exists where you can define a shell entrypoint that is defined as a Container, but could probably make that work too somehow...

humble garnet
#

would have to be dagger shell -c publish or echo publish | dagger shell

lament karma
#

yeah or dagger shell -- publish, etc.

#

though at that point I'd argue it probably still makes sense to just rename shell->run

#

it would also make sense in that everyone already knows docker run, dagger run would be more or less the equivalent for us

#

Obviously with lots of differences in the details, but conceptually similar

#

e.g. we run environments rather than container image references

lament karma
#

Also, for Service entrypoints, it would be intuitive if dagger run --port <container port>:<localhost port> <the name of the service> resulted in the service running and forwarding the ports as specified.

With bikeshedding a better name than --port being a TODO 🙂

humble garnet
lament karma
#

There's actually a ton of underneath-the-hood problems to solve to get an async service running beyond a single dagger ... cli call, but those are good problems to solve anyways

humble garnet
#

also this way you can dagger up and by default it brings all services up