#daggernauts

1 messages ยท Page 10 of 1

sharp zealot
#

yeah that's the remaining puzzle... We're dealing with this for @warped canyon 's playwright module too. Every playwright configuration needs a single service to target... So how do you select that service in a way that is both 1) configurable by the end user, 2) programmable by higher-level modules

#

Clearly, the first step is: a global module setting (user-friendly name for "module constructor argument") of type Container

#

So let me do that next ๐Ÿ™‚

thorn moat
#

uh oh - do we need a dependency injection framework

sharp zealot
thorn moat
#

yeah but the dependency injection framework is what magically fills in that argument with its all-knowing knowledge galaxybrain

#

since nothing in the user's code actually calls that function, there's no opportunity for them to actually pass an argument (afaik?)

#

(i've never actually used a DI framework and historically thought they were dumb vs. just passing arguments, to be clear, just exploring the thought since it seems to match the use case)

sharp zealot
#

dagger settings go base-image docker.io/my/image

#

which will add one line to .dagger/config.toml

thorn moat
#

definitely makes sense for simple values

sharp zealot
thorn moat
#

not acutely, just still have the open question about how to map it to a function that e.g. builds an image using apko with all my favorite dependencies installed

#

wonder if interfaces could help at all, too

sharp zealot
# thorn moat not acutely, just still have the open question about how to map it to a function...

Right. We're betting on artifacts / collections for that. Since it gives us a coordinate system for uniquely selecting any artifact (and any individual "verb" on that artifact). And an API for making that selection in the workspace.

The idea is to also define a selector syntax for expressing such selector in a string. Then incorporate that in the address API, so users can specify those selectors.

Now to find the thread for that...

#

(searching for threads)

#

Unrelated @thorn moat : is dang sensitive to loading order of files?

warped canyon
sharp zealot
#

LLM is convinced that it is, and prefixing my files with 00-, 01- etc

thorn moat
thorn moat
warped canyon
sharp zealot
warped canyon
sharp zealot
#

Fun fact: if you forward your ssh agent into an ephemeral container, you get your local ssh credentials for free ๐Ÿ™‚

Example

Make sure you have ssh identities added... ssh-add ...

dagger core container \
 from --address=alpine \
 with-exec --cmd=apk,add,openssh \
 with-unix-socket --path=$SSH_AUTH_SOCK --source=$SSH_AUTH_SOCK \
 with-env-variable --name=SSH_AUTH_SOCK --value=$SSH_AUTH_SOCK \
 terminal
#

Now I just need to figure out how to get apk to work on the engine playground...

sharp zealot
#

Another cool discovery: a @generate function is a great way to drop skills in a repo ๐Ÿ™‚

sharp zealot
#

FYI we've agreed yesterday that the workspace branch will soon be tagged with 1.0.0-beta1 and we will start beta-testing for 1.0 even before we merge it

#

Then after merging, we will continue 1.0 beta testing as needed off of main

sharp zealot
#

This one's interesting @thorn moat :

  • PR to add support for custom base image in dagger/go (as requested)
  • base and version are mutually exclusive - we can only guarantee version on the default base image
  • to enforce mutually exclusive arguments, we must switch to explicit constructor
  • the resulting diff is large, because all public fields must now be part of this custom constructor

This might be fine actually. It just caught my eye, though I'd pass it on

https://github.com/dagger/go/pull/11

GitHub

Problem
The Go module always built its Go execution containers from golang:<version>-alpine.
That blocked users who need their own Go base container with internal certificates, proxy ...

thorn moat
#

there's a tension here - an alternative could be not adding all those args and using withFoo pattern instead, but maybe there's a reason to avoid that, like constructor args being more natural to expose through config - is that at play?

sharp zealot
#

Oh yeah, that ship has sailed for user-facing modules... dagger settings is built on the assumption that a module's constructor arguments are part of the UI

#

(strictly for user-facing configuration)

#

that's what all those arguments are for in my case

dense canyon
#

looking for a Java experienced human to challenge LLMs on this one

restive shore
#

let me check

dense canyon
restive shore
#

Good to try it out though

dense canyon
restive shore
#

I don't see a PR tied to that issue

muted plank
#

Yeah we'll open it

restive shore
#

I have an unrelated question. Is dagger ready for checked in generated code? I remember there was a PR around having a flag that prevents code gen at runtime. Is that already released? Even without codegen prevention, is it workable to have the code gen committed to repo and then doing linting (golangci-lint) without re-generating code?

dense canyon
restive shore
#

I should use dagger develop right? Or dagger generate?

warped canyon
restive shore
warped canyon
restive shore
warped canyon
restive shore
#

I've been keeping an eye on that. We have our own modules, so, I haven't really put any thought into how that would translate.

warped canyon
#

My hope is that with 1.0 you'll be able to remove most of the code in your own modules to use the generic ones and only worry about maintaining the stuff that is really specialized for your projects. I think a lot of people will just be able to use our modules, but probably not you guys ๐Ÿ˜›