#I did read you mentioning sessions etc

1 messages ยท Page 1 of 1 (latest)

cyan stag
#

Yeah long-running engine is going to require a lot more changes since it would by default result in there only ever being one buildkit session, which breaks a lot. Fixable, but most likely not by the next SDK release.

Last night what I did was put buildkitd+cloak in an image and then use commandconn to do docker exec into that container to exec the engine. But then I later realized that -v /:/host doesn't really work on macos, so I think we probably need to fallback to just having SDKs do a local fork/exec of the binary, same as before.

Either way, need the stdio-dialer

fallow pike
#

Hey @cyan stag and @last wyvern, quick check-in before going to bed... need some feedback from me?

cyan stag
fallow pike
#

Ok, can you sum up for me how we are on provisioning in the other SDKs? There's quite a bit of discussion but I don't have time to go through.

cyan stag
fallow pike
#

Ok ๐Ÿ‘ I've put a pause on that feature until we know what's best ๐Ÿ™‚

#

Oh man, I'm behind 67 commits ๐Ÿ˜ฒ (from main)

cyan stag
#

Just to update here, I'm currently building on the previous prototype but this time instead of doing commandconn to docker exec I'm bundling cloak in the dagger-engine image and then having the SDK copy it out of there locally (for its platform) and using that to talk to buildkitd running in the dagger-engine image. Makes packaging way easier (just an image, not an image plus also figure out how to bundle binaries in pypi+npm) and also makes it way easier to switch to the approach where engine is fully remote in the future.

I'm just running through it w/ go first to make sure it actually works (so don't take as final design or anything), but if anyone has any immediate thoughts lemme know. The end result would be that SDKs need to do a little bit of shelling out to docker (similar to what engine does today), but I'm thinking that's a good tradeoff given the packaging work it saves us and other benefits

last wyvern
#

(the volume hack I assume?)

cyan stag
#

Oh I've abandoned the volume hack at this point, but my new approach of having the sdks obtain the cloak binary out of the container image is working

last wyvern
#

(to me it makes sense -- long running engine > engine as a command in the container > engine copied from the container and executed locally)

last wyvern
cyan stag
last wyvern
#

option 1 is the long term approach
option 2 is kinda long term as well: SDKs will always exec a command (dial-stdio). We cheat to start and dial-stdio spawns a new engine instead of proxying traffic to long running
option 3 is the stopgap

#

what I liked about option 2 is that there kinda wouldn't be any SDK changes -- we just change the meaning of dial-stdio (and btw, that's how buildkit does it -- dial-stdio is a proxy from stdio to unix)

cyan stag
#

The code I have works on linux-client<->linux-host and now I'm just making some updates so it works on darwin-client<->linux-host, once I see that working I'll send out a draft PR. Code will need cleanup but we can get consensus on the details of the plan

last wyvern
#

but if it's not possible, the next best thing is option 3 (downside is extra work for the SDKs, copying stuff into the user machine). Not the end of the world

cyan stag
last wyvern
#

awesome

cyan stag
#

it's going in ~/.cache/dagger

last wyvern
#

yeah to me, option 3 is way better than "just talk to a CLI that got installed somehow, disregard compat issues"

cyan stag
last wyvern
# cyan stag it's going in ~/.cache/dagger

pre-emptive nit: should probably include <os>-<arch>-<version>. Making sure that multiple SDK versions on the same machine don't end up using "whatever the other SDK pulled"

cyan stag
#

I'm doing all the good stuff like including the sha with name, downloading it to a tmp file and then rename(2) it to the final things, etc. etc.

round dove
cyan stag
#

But also making sure i'm only doing stuff that's available in nodejs+python stdlibs (nodejs lacks flock...)

last wyvern
last wyvern
#

Like, not a "simpler websocket endpoint", but literally "over websockets"

#

which someday could become a simpler websocket endpoint (e.g. v1 is gRPC as is, v2 is a simpler protocol)

round dove
#

is there a practical difference between that and a HTTP/2 connection upgrade? the latter seems to be what docker<->buildx<->buildkit does

last wyvern
#

Fair.

The only practical difference is we'll probably end up using websockets one way or another. GraphQL subscriptions are websockets-based

That's what I picked websockets for dagger service attach -- could have been http/2, but I figured we'll pull in WS for other reasons (e.g. if we expose logs over GraphQL, it's probably going to be a WS subscription)

#

But ... it's a nice to have. Like, priority -12

round dove
#

gotcha. i don't feel strongly really, just curious. sounds like something we can slip in later too if/when we want it right? (including if "when" is just after I finish my prototype)

#

also what are our plans for graphql subscriptions?

last wyvern
#

yeah, agree. Eventually I think we'll have our own protocol (not sure if you agree with this) so that SDKs can implement it directly. Right now with the gRPC based approach, SDKs will have to spawn a binary to handle this

round dove
cyan stag
last wyvern
last wyvern
# round dove also what are our plans for graphql subscriptions?

none yet

I think in the future the first use case is logs

Right now for instance, the only way for SDKs to grab logs is from stderr

As soon as the Engine is a long running container and we communicate exclusively over HTTP, that trick is gone -- we'll need to stream logs somehow, subscriptions sound like a good candidate

#

e.g. right now we're cheating: the API is GraphQL + stderr. Make the engine a "true" API server, and we need to shove logs somewhere else

round dove
last wyvern
round dove
#

it did take a while to grok. seems really handy once you know it, there's a lot of moving parts

cyan stag
#

just tried to test on macos but I can't run git because I updated to ventura and now I have to reinstall all dev command line tools including git........

While I'm waiting @last wyvern we're gonna need a container image registry by the next SDK release and associated automation for releasing to it when we do engine releases. Do you have any thoughts on what registry to use? I'm also guessing it would be nice to use a vanity URL so we can switch backends in the future, but I have no clue if that's possible with registries, never tried before

last wyvern
cyan stag
last wyvern
#

@cyan stag Yeah agreed. Especially since we still need to run the "engine" image for buildkit itself

#

I mean, not a hard requirement for next week, but we could have an engine image that includes the engine binaries and also a "runner" binary (buildkitd), so you pull this one thing and done

cyan stag
#

(draft PR is imminent)

last wyvern
#

yeah, neat!

#

so either way -- even if we pull tarballs, we still got to distribute the image right?

cyan stag
#

Do we have a timeline on talking to dockerhub about rate limiting? It would be good to figure that out sooner than later. I can make an issue too (presuming there is not one already)

round dove
#

lol, I just implemented another singleConnListener before finding we had one already. (not that it's a ton of work, just funny that we've now run into such an odd thing twice.)

cyan stag
#

(in a good way ๐Ÿ™‚ )

round dove
midnight widget
# last wyvern we're supposed to chat with the docker folks about rate limiting etc (/cc <@4884...

On the topic of hosting providers:

  • @stiff temple is talking to Docker about their special startup program
  • @dapper grotto mentioned that ECR is a very strong candidate: pricing is basically S3, will be hard for Docker to beat that since they're on top of AWS
  • Either way I agree that having a vanity URL would be good for future flexibility. Note that docker hub short name is not a vanity url! since obviously it's tied to Docker Hub
last wyvern
# midnight widget On the topic of hosting providers: - <@933501536624054272> is talking to Docker...

Chatted with @dapper grotto about ECR and so forth.

So far my preference would be:

  1. Vanity URL + ECR.
  • With a vanity URL users don't see the "real" registry address, and that's the only thing Docker Hub has going on
  • Vanity requires infrastructure which will be on AWS, might as well have the registry there and not pay traffic between the 2
  • ECR is cheaper and way more stable than Hub
  1. IF vanity URLs don't work ... I'd suggest we go with GitHub
  1. Hub: this would be last preference, depending on the startup program
  • If vanity doesn't work, we get a "vanity-ish" image (hub short name)
stiff temple
last wyvern
midnight widget
#

whatโ€™s the pricing like on Github?

stiff temple
#

So for example where image is 50MB (and we store several copies, maybe up to 1TB storage) and 100TB of egress

#

But if the package is consumed by any user's GH Actions workflow, then egress is not charged, and there is some egress included for all plans

last wyvern
#

Also -- it's free for public images

#

at least for now

#

so pricing is $0 with GH

stiff temple
last wyvern
#

Wouldnโ€™t be surprised we hit rate limits that are only lifted for projects not backed by a company