#maintainers
1 messages · Page 11 of 1
If we could somehow make that work in all SDKs, then we could always default source to . in all cases, it would simplify a lot of things
If you want to extend the Dagger API with Functions, you develop that in ./internal/dagger/main. The Go SDK can generate boilerplate for you there.
I get the idea but then we are essentially changing the source dir path to be./internal/dagger/main/which I hesitate on given all the feedback we got on defaulting todagger/😄
But the big big difference would be that 1) it would be SDK-specific, and 2) chosen by each SDK to be a "native" location. Something that eg. the Go team would not object to.
And it wouldn't be a change in source (which would remain .) but more like an adjustment in the internal layout of the source dir. Which the SDK already does
But yeah regardless of that, like I said I think we should approach this by updating the generated dependency bindings to be importable equivalently on a library and in modules, so in agreement on that.
Right 100%, I'm looking for a "kill 2 birds with 1 stone" situation
Where maybe we take it further than "the client bindings are an importable library", and also add "the module's implementation is also an importable (at least locally) library"
So in the case of the Go SDK, the generated main function would import "internal/dagger/main" or import "internal/dagger/entrypoint" or whatever we decide the package name is
In Python it might be src/dagger/entrypoint alongside src/dagger/sdk
"the module's implementation is also an importable (at least locally) library" - that specifically I don't have any interest in supporting. We should support that by adding self bindings so then they just show up in the codegen alongside the bindings for each dependency.
Otherwise once we do add self bindings, it's going to be very confusing. On top of the fact that trying to get the author's implementation working in both of those modes is likely going to be very complicated and impose a bunch of requirements that don't seem worth supporting
Yeah but I want that for a different reason. For project layout reasons.
The goal is not for me as a developer to import my own module implementation (technically I could still do that today by importing github.com/dagger/dagger/dev) it's for the SDK to have a place to store these files that doesn't conflict with an existing Go/Python/Typescript project. Which in turn solves our unresolved "source path, dev module?" dilemma
The only code importing that sub-package will be the generated runtime's main function
So you want bindings to be a library for a reason, and I want the server-side implementation to be a library for another reason, what if we made them both libraries, and standardized where they both live, and make that the new standard DX, to solve a bunch of problems all at once
Each SDK is free to decide where each library lives, to respect native conventions, but they have to be libraries (as opposed to full-blown "apps" like today)
Oh I thought you meant it would be importable and usable as a library by non-dagger code. As long as we aren't trying to support that, SGTM. I still find user feedback on the paths where they author module code hard to predict, so am still cautious in a non-blocking way, but I get the theory and agree that makes sense.
There's a bunch of corner cases around internal packages, having separate go.mods, etc. that we'd need to figure out with the dependency codegen bindings, etc. But agree on a high level. Have to go do the release so TBC on an issue 😄
Yeah this is still a thought experiment (one day old), but I'm trying hard to find a way forward, because we've been stuck on this "knot" for a while (source directory / contextual-vs-standalone / dev module-or-not), and all the options have at least one major downside, hence the stallmate. I really would like to break that stallmate...
In summary, this possible approach would be:
dagger initanddagger developalways set"source": "."by default.- Changing
sourcewould be considered an escape hatch, and relatively rare (unlike today) - Each SDK would be responsible for generating client bindings in a well-documented, static location within the module source. The location should be the most standard possible location for a sub-package of a project. The SDK is encouraged to make sure that sub-package can also be imported by an existing project.
- Each SDK would also be responsible for 1) loading a module implementation from another sub-package, to be developed by the module author, and 2) generating a boilerplate for said sub-package, to help the author get started.
- SDKs should not assume the module is a standalone "app" - eg. every change they make to the module source directory (creating, deleting or modifying files) should assume there is another "tenant" in the source directory, and minimize disruption
@civic yacht in the case of Go, are you saying that having generated client bindings in eg. internal/dagger is not enough today to proeprly use modules from an external client, because there also needs to be a generated dagger.gen.go in the caller package?
If that's the case, I'm OK with the location of those caller packages being a config field for the Go SDK in the dagger.json. "Hey in addition to internal/dagger/entrypoint, I would like to call the Dagger API from ./cmd/mytool and ./pkg/mything/plugins/dagger please and thank you 🙏 "
{
"source": ".",
"sdk": {
"name": "go",
"config": {
"bindings_callers": ["./cmd/mytool", "./pkg/mything/plugins/dagger"]
}
}
}
I'm just thinking about cases where the module ends up with it's own go.mod but then a separate consumer of it (importing it as a library) wants to use it. Go doesn't let you import from under internal/ across go modules, so they would not be able to use it as a library. The fix could also be as simple as not putting it under internal/ in theory. But that has it's own implications worth thinking through, etc.
Making every path configurable in dagger.json does seem like the right approach provided we have good defaults so users who don't want to think about this don't have to (obviously I suppose, but important)
I think the idea would be that you daggerize an existing Go module. Then it's always OK to use internal, because you're adding a layer of configuration to your existing module basically.
And if there's no go module to daggerize, you create your own standalone dagger+go module, and everything works the same (just easier)
Right, that's a good default. But I could also imagine someone wanting to make a dedicated git repo that just has these bindings and then gets consumed by other git repos (basically, those who follow the opposite of the monorepo philosophy, which does exist in corp environments I worked in in the past). Then they would be screwed if there's no escape hatch
I'm OK with saying "if you want to import generated dagger bindings from your go module, add a dagger.json to your go module, with the dependencies you want bindings for"
Yeah agree, in that case a SDK-specific file eg. sdk.config.xxx would be the way for sure. eg. {"sdk":{"go":{"bindings":"."}}} -> to generate bindings at the root of the module instead of internal/dagger
@Erik Sipsma in the case of Go, are you saying that having generated client bindings in eg. internal/dagger is not enough today to proeprly use modules from an external client, because there also needs to be a generated dagger.gen.go in the caller package?
Still curious about this. I guess you need a local dagger.gen.go for dag. ?
Oh, devil in the details, but on a high level I think we can make this work. When I did early POCs of all this before modules launch I believe I found a way to make the client work in both modes, detecting whether it was in a containerized module execution or if it was just being imported on the host.
Roger that.
Note that, in this model, worst case if it worked exactly as today (eg. caller needs its own dagger.gen.go) it wouldn't be the end of the world, it would just require an SDK config field in the dagger.json. Not quite as magical as everything "just working" without any custom dagger.json config. But still much much better than the current situation where you just can't use modules from an external client, period
@civic yacht another corollary to this approach: since we no longer would rely on "dev modules" (you just dagger init at the root of your project), we would need an alternative for testing modules. I think this naturally pushes us towards your idea of allowing a module to "test itself", a-la tes_xxx.go. My thinking is that there could be a special // +dev pragma to mark a function as "dev only", then a dagger --dev flag for loading your module in "dev mode". If that seems roughly directionally correct, I'll write up an issue to get the conversation going.
I don't even know if we'd need a pragma tbh, there's probably approaches that could avoid it. But yes directionally I agree 😄 Sorry getting into the release nitty gritty so will leave expand more later
I don't know if it's related to the "otel draining" issues I keep hearing about, but on my "slow but not terrible" internet, there is a noticeable lag time (2-5 seconds) after my dagger commands complete, where it just sits there hanging before returning to the shell. Anecdotically, the more spans in the call, the longer it seems to take. So my guess is that it's uploading telemetry. Very noticeable, not sure if there's a solution but thought I'd share.
This is on very slow countryside broadband. Probably not noticeable on very fast home internet. But at this speed, Dagger is otherwise usable. So the 5s lag stands out
Possible solution could be having the CLI send telemetry into the engine and configuring the engine to emit to Cloud instead, but that's a significant change to unpack
It's kinda nice only having to configure that client-side
A future optimization perhaps - buffer otel in a local sqlite file, and start a background draining thread every time the CLI is called?
I guess the CLI could forward its config over too 🤔
depending on the engine also means no telemetry on anything the CLI might do when an engine is not around
(which may or may not matter)
No way to support maps in function signatures, right?
graphql doesn't have maps sadly
We don't support it now. We could, but yeah because they aren't in gql we'd represent them internally as a list of k/v pairs and convert to the SDK language's map equivalent. Totally possible, just hasn't come up as a high priority yet.
@civic yacht Yep -- the widespread pattern (what we use in Cloud for e.g. map of span attributes) is a "custom" scalar Map (not so custom -- gqlgen for instance does it by default). https://gqlgen.com/reference/scalars/#map
Under the hood I believe it's just a JSON representation
scalar in graphql leaves stuff "raw" (but strongly typed) and then the marshailing/unmarshaling is left to the client and server
But yeah, not urgent
Hey Erik, can I request some of your brain / bandwidth following the changes on Sockets 🙏
Fix for the TestLegacy flakes is good to go: https://github.com/dagger/dagger/pull/7943
Was hoping it might fix other flakes but looks like those are still there (https://github.com/dagger/dagger/issues/7979 and https://github.com/dagger/dagger/issues/7662 are the worst offenders right now it seems). Even worse, I still can't repro those other ones locally, but at this point just gonna resign to debugging in CI
Actually I have a guess based on reading the error output and logs for 7979, sent an attempt out here: https://github.com/dagger/dagger/pull/7989 but need confirmation from @still garnet it's actually just handling an expected case in the tests vs. just side-stepping a bug without fixing it
The updates to use v0.12.1 in CI are good to go too, should avoid the hangs we see in SDK jobs: https://github.com/dagger/dagger/pull/7983
More follow-ups once release is done:
Fix ordering of instructions to ensure that the changelog PR is always included in engine+cli tag: https://discord.com/channels/707636530424053791/1262430315...
Do we have any command to generate dagger.gen.go (and friends) to all modules under the dev module? I could do traverse directory to do that. But I think you all might face this problems already. 😂
Not yet, I think we have an issue to add support for that though
Ah thank you. 🙏
Could use a review on https://github.com/dagger/dagger/pull/7940
And also https://github.com/dagger/dagger/pull/7877 🙏
Probably need to ship a patch for this: https://github.com/dagger/dagger/pull/8001
tl;dr: the root span emitted by the dagger CLI never fails, so checks and traces never fail. The command itself still exits nonzero, so actual CI jobs will do the right thing; it's only a telemetry issue.
I have to head out for an errand but I can do the release for this when I'm back. Been a while since I've done one.
fix root span never failing by vito · Pu...
v0.12.2 release - 22nd July 2024
hello folks, if I want to test changes to codegen locally, how could I do that
from the dagger repo, dagger call -m dev --source=.:default sdk all generate export --path . will re-run codegen for all SDKs
dagger call -m dev --source=.:default sdk <sdk name, i.e. go/python/etc.> generate export --path . will run it for just that SDK
We also have tons of integ tests for various parts of SDK module codegen under ./core/integration/module*_test.go if that's easier to test something specific (i.e. test something with a specific module, etc.).
You can run individual tests there with dagger -m dev call --source=.:default test custom '--run=TestModule/<TestName>' --pkg=./core/integration
i was trying to add a testcase for https://github.com/dagger/dagger/issues/7941. I added that new testcase here: https://github.com/dagger/dagger/blob/636d931f33a888e82372afd93bccc0b4dd6558b5/core/integration/module_test.go#L43
but when I try running tests using: dagger call -m dev --source=.:default test important, it almost seems like it never ran that test
Oh when you run test important it's running hundreds of test cases. And depending on your machine it may take quite a while so you might need to append an extra timeout. It takes 30m for me locally (8 cpus) so I usually do dagger call -m dev --source=.:default test important --timeout=40m to be safe.
We need to improve overall performance so they run faster locally, but in the mean time you should feel free to just run a smaller set of test cases locally. So in your case you could just do
dagger -m dev call --source=.:default test custom '--run=TestModule/TestGoInit' --pkg=./core/integration
FWIW, yesterday when I ran the tests, it was taking forever (I am on Macbook M2 pro) and I stepped out. when I came back after 2hours, it was still running (probably stuck). 🙂
Hm yeah 2hours is way too long. Are you on the latest dagger version (can check with dagger version)? There were fixes for hangs in v0.12.1
what i am doing right now is:
- i have a fresh copy of dagger checked out
- verified latest version of dagger is installed (v0.12.2)
- no dagger engine is running (verified using docker ps)
- commented out everything inside TestGoInit function
- added just one testcase
t.Run("from scratch", func(ctx context.Context, t *testctx.T) {
require.Equal(t, "a", "a")
})
- ran test using
dagger call -m dev --source=.:default test custom --pkg="./core/integration" --run="^TestGoInit" --progress plain - it seems to be running much more than that specific testcase
I am wondering if somehow its using a cached copy of testcases somewhere?
the syntax would need to specifically be --run=TestModule/TestGoInit (just double checking in case that was a typo).
When I run that I do get a bunch of output first for building the engine, but then it runs just TestGoInit test cases, which takes a total of like 3mins for me. We need to build the engine first to run the tests since they are all running against an engine built from your local code. Is it possible you were seeing the output of building the engine first? In --progress=plain mode specifically that will all kind of fly by and might look like tests cases running (it's a bit more clear when you don't use --progress=plain, the TUI output has been cleaned up a bunch in recent versions)
yep, that was it. it had to be --run=TestModule/TestGoInit
thank you for the pointers and additional info
No problem at all, thanks for working on that issue!
✨ v0.12.3 - July 30th 2024?
👋 fyi y'all - i've just merged https://github.com/dagger/dagger/pull/7973
the idea is to try and encourage longer and more informative changelogs - please write down as much as you want, the person doing the release will edit/format/etc if it needs to be pared down 🙂
Time to practice writing: For the night is dark and full of terrors...
Re-lobbying for reviews on https://github.com/dagger/dagger/pull/7943 Just to trim a chunk of the annoying test flakes we're hitting currently
Wait, I had to refresh the page apparently, it has been reviewed, thank you Jed 😄
I'm hitting the path limit length with t.tmpdir on unix: 108bytes. What's your go-to strategy to shorten it usually ? I'm about to Sha it, but open to better ideas with better readibility 👼
hello folks, I am still looking at https://github.com/dagger/dagger/issues/7941, and identified a potential issue on code-generation side (still trying to verify by running the e2e testcase).
Now code generation seems ok, but when I make a call to "dagger query", it fails with here: https://github.com/dagger/dagger/blob/4c58dd459a8e5e32d64356ec1805ede988a85c6f/dagql/objects.go#L193 with error: query has no such field: aModule". (my module name is a-module).
my question is does the engine load the schema:
- from already generated code, or
- from cache it possibly built during dagger --init, or
- generates the code again on engine side and load it from there
- or some other way
I'm hitting the path limit length with t
hello folks, I am still looking at https
I like the idea of lobbying for reviews, so if anyone who builds dagger directly (like core devs) has any strong opinions on https://github.com/dagger/dagger/pull/7858, I would appreciate any/all feedback 🙂
I might also raise during our little architecture discussion later
when running integration tests, is there a way to see engine logs. I am trying to trace a function call by using panic, but I don't see stack trace. only that engine returned 502 error.
engine logs in integration tests
@civic yacht 👋 Do you think "module self invocation" is still relevant?
Yes very, want it for all sorts of reasons (better spans that show self calls, better function caching once that's out, the implementation for self calls will also fix some limitations around interfaces as a side effect, etc.)
Ok great, that's what I thought, but it was from months ago wondering if that changed
AFAIK there's no issue tracking that (?), I'll create one
Huh yeah apparently there isn't 🤷♂️ sounds good!
https://github.com/dagger/dagger/issues/8030 <-- created a skeleton
Feel free to edit if I missed something
@tepid nova, can I lobby for your opinion on reusing .gitignore files by default to add to a module's exclude patterns? 👉 https://github.com/dagger/dagger/issues/6627
hey folks, re: https://github.com/dagger/dagger/issues/7941, this issue is happening because of how strcase works for different inputs. specifically ToCamel function.
one of the fix could be to use our own version of strcase (or a completely different library), and verify it translates the strings as expected (and add testcases to verify/document those), but I am worried if changing that can trigger backward compatibility issues for existing dagger modules.
any thoughts or preferences?
👋 planning to tackle this one https://github.com/dagger/dagger/issues/7527 quickly today since it's hurting some users https://discord.com/channels/707636530424053791/1265736714685513909. Sharing for visiblity cc @rancid turret @civic yacht
Docker build secrets
Can you make sure there's a flag to opt-in to the previous default behavior? 🙏
Main Dagger module is now github.com/dagger/dagger
Sub-modules moved to the root of the repo
The rest is in .dagger
FIXME: had to (temporarily) uninstall sdk/python/dev, because of a mysterious error
hey folks, re: https://github.com/dagger
Woooo, begone -m dev 🎉
Left some quick feedback on a pass through, but happy to circle back round for more detailed comments/etc tomorrow 🙂
Can you make sure there's a flag to opt-
@rancid turret
Was it intentional that WithExec() ignores the conatiner's entrypoint by default while AsService()does not?
I was planning to create an issue to harmonize the two if they should be the same
Yes, it's intentional, but it's possible there's some details we overlooked for services. Context: https://github.com/dagger/dagger/issues/7821#issuecomment-2213999367
Ah, okay. I don't think everyone understood that.
Sort of similar to other questions we had this morning, seems it could make sense to have a table of the options and ensure we like the behavior.
To be clear the entrypoint is only used when no WithExec is defined in the Service. Not on every WithExec. Basically services fallback to the default command (CMD). Stdout used to do this as well, that’s what that PR removed.
Right, that makes sense, but in the case of a stdout on a container without a WithExec(), you need extra args in the stdout case:
Error: response from query: input: container.from.stdout resolve: no command has been set: stdout requires an exec
You have to add with-exec --args "" --use-entrypoint stdout
or at least with-exec --args "" stdout to get the defaultArgs to be used (if you don't need entrypoint)
Yes, that’s what I said. Falling back to the default command was removed from stdout but not asService. That was a separate breaking change from not using the entrypoint in WithExecs. The reasoning for not touching asService was that it seems likely when running services that you’d want to run CMD. But I agree that using the entrypoint there makes it inconsistent with when you do define a WithExec.
@civic yacht @spark cedar do you know by any chance if the runtime containers make use of the proxy variables set in the engine?
I'm starting an engine with HTTP_PROXY=http://foo.com but dagger init --sdk go works without issues which makes me think that it might not be using the supplied proxy as I was expecting it to fail given the wrong proxy value
if I exec to that same engine and run curl https://google.com it effectively fails stating that it can't reach the proxy
Can't speak for incorrect proxy but I have tested a correct proxy to work with Go etc.
I think you're using the _DAGGER_ENGINE_SYSTEMENV approach, correct?
🧵 for discussing the upcoming v0.12.4 release 🎉
I am not. Just setting HTTP_PROXY (both lower and upper case). have you tried both http_proxy and HTTP_PROXY?
yes. That's strange, since go get completely ignores the HTTP_PROXY variable in my case
are you sure the proxy is being used Nipuna? 😅
130|marcos:tmp/lala (⎈ |eks-prod)$ HTTP_PROXY=127.0.0.1:8080 http_proxy=127.0.0.1:8080 go get -u -v github.com/fatih/color
go: downloading github.com/fatih/color v1.17.0
go: downloading golang.org/x/sys v0.18.0
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading github.com/mattn/go-colorable v0.1.13
go: downloading golang.org/x/sys v0.22.0
go: trying upgrade to golang.org/x/sys@v0.22.0
go: added github.com/fatih/color v1.17.0
go: added github.com/mattn/go-colorable v0.1.13
go: added github.com/mattn/go-isatty v0.0.20
go: added golang.org/x/sys v0.22.0
^ this just works and I was expecting it to fail
Yeah if the engine has HTTP_PROXY set that will get passed to every container started by the engine. So I think go just ignores invalid values of it
@civic yacht 👋 How unlikely it is for us to be able to support bind mounts from the host? I'm going with the assumption of "very unlikely", just wanted your thoughts before I explore alternatives further
It depends on what you mean. If you mean "bind mount from the client's host into the container", then no it's not possible because we don't assume the client and the engine are on the same host. If you mean "bind mount from the engine's host into containers", then it's technically possible, but not sure we want that as it's very confusing; it's the equivalent of connecting to a remote docker with DOCKER_HOST, running docker run -v /foo:/bar ... and then getting very confused when the bind mount you end up with is not from your host
There are options to create the same sort of effect as a bind mount through continuous filesync (e.g. mutagen or similar), but not technically a bind mount
ok, the go proxy is https.. chaning from http to http(s) made it work
This is the closest open issue we have for this sort of feature https://github.com/dagger/dagger/issues/6990
Yep, that's what I'm looking into ... wanted to get your opinion on volumes before diving further. Main downside is it's slow compared to an actual bind mount (for instance, initial sync of dagger cloud using mutagen takes a few minutes)
upside is it works remotely
Yeah filesync is very much in the Hard Problem ™️ category.
Storing cache volumes on the host is somewhat related to all this in that it lets you mount in a directory from the engine's host into containers. After a bunch of failed attempts the approach I've settled into is writing a containerd snapshotter implementation to support it, which is interesting because it makes it more reusable in other cases potentially. I've started thinking we may want to consider reconceptualizing the whole thing from "cache mounts" to more like "persistent volumes" (which cache mounts are a subset of)
Not sure what use cases you have in mind and if they would be related to all that potentially
the use case is giving a quick attempt to this (live dev of dagger cloud with hot code reload) ... right now trying to plumb mutagen into the pipeline, see how it behaves
Cool, yeah if you haven't already done this, mutagen supports different sync behaviors that have different performance. I think two-way read-write sync is the slowest, but for this case we probably just want one-way "client -> server"? Which could make it faster maybe.
Also, even if the initial sync is slow, provided that is cached and mutagen knows how to reuse existing directories for sync, it may be a one-time up front cost that's acceptable since it'll be faster later
I do think that it would be nice to generalize the whole volumes concept here, beyond just cache mounts. E.g. you could use the API to create a volume that is automatically setup with mutagen and synced with the client
Oh interesting. Right now only attempted a very simple test using ssh transport, I was thinking we could embed the mutagen agent on the shim and the client on the CLI
However, you got me thinking ... maybe using a volume concept (starting with a cache volume -- assuming it can be shared) could be a beter option
Also right now I'm working with services ... not sure if "file sync" should be limited to services or broadly available
Yeah for the server side I have imagined this as "Service running mutagen that has the volume mounted in; any other containers with that volume mounted in will receive all the updates". I like that because it's just re-using existing features and could be generalize beyond mutagen.
The client side is tricky though because yeah it's either "embed mutagen" (in which case it's not generalized anymore, hardcoded to mutagen) or "ask user to start mutagen locally", which is not nearly as seamless
Oh ... also also -- we can only Up() services from the CLI to get h2c networking, right? e.g. if we Up() them from a module then it's actually "module to container" rather than h2c networking? Meaning right now we can only "up" a single service for h2c?
Basically -- with this approach, is it possible for the user to up both the mutagen service and their code service in one shot?
If the code service is a container or another service, then yes you can do that via a service binding
It's dumb in this case since there's no "real" network dep between them, but that would work for now. But that's why this may all call for some new primitives. Like the engine should know "this container mounted in this volume, that volume is backed by this other service so I gotta start that service"
sweet, nice workaround
yep. "ask user to start mutagen locally" could work as a stopgap even if not that smooth ...
the one downside is that mutagen is very principled in how it communicates (it starts a binary remotely with docker cp, then docker execs it and talks over stdin/stdout). I was thinking by embedding we could make it dagger-native
but I'm looking into workarounds, currently reading through the "mutagen compose" codebase, they use a different approach with a sidecar container, trying to see if we can re-use that
Yeah I'd be totally fine with embedding it for now, better to have the feature even if it's not generalized. It just would be nice to try to figure something generic in the longer term
@civic yacht The volume approach is very nice though, I'm going to try that
Initially I was looking into starting another process in the service, or re-using the shim
but the volume approach is much simpler and better
and caching
This gets into huge separate cans of worms, but one way to generalize this support on the client side would be WASM and/or rootless containers. Then every part of this could be implemented by users. They write a "service-backed volume" as a module and can return a container for the client side that's run via wasm/rootless-support. Then anyone could swap out mutagen for something else, or potentially use this for completely different types of use cases.
Dreaming here obviously, but not implausible in the long term 🙂
Misunderstood this bit ... with a service binding both services come up, but I can't reach the "other" service from the host?
Ah okay, that makes sense. So just to double check:
- The client wants to up the "code dev" service and the "mutagen" service
- The client also wants to proxy ports from both of those services locally
Right? If so, I think you could for now use https://daggerverse.dev/mod/github.com/kpenfound/dagger-modules/proxy@beaf4600637b3f492cd3e1e1598ef799d8cd3164 to group multiple services into a single one.
Which is a beautiful module and amazing it's possible, but really this should probably be something built-in to the core API
Thanks! Yep. Well, the client really wants to up the code dev service ... the mutagen service is not something they want but something they need
I could either:
- have them both start together (using the proxy module for instance)
- have the user start both individually, sharing the same cache volume?
- inject the agent into the end user service
Yeah if you want to encapsulate this into a single "dagger call ... up" I think 1) or 3) would have to be how you do it. I like 1) more because it's more easily re-used without customizing each service.
- works but would require running multiple "dagger call ... up"s in parallel
👍
Just tried 2 to give it a shot and it works 🙂
I'll look into cleaning that up
func (m *Livedev) Dev(ctx context.Context) (*dagger.Service, error) {
code := dag.CacheVolume("code")
app := dag.Container().
From("python").
WithWorkdir("/code").
WithMountedCache("/code", code, dagger.ContainerWithMountedCacheOpts{
Sharing: dagger.Shared,
}).
WithExec([]string{"python", "-m", "http.server", "8080"}).
WithExposedPort(8080).
AsService()
return app, nil
}
(that's the cloud frontend mutagen'd into the dev contianer)
sharing a friendly one-liner I use to build all the packages in the dagger/dagger repo excluding the /docs folder as those fail if ./... is supplied. go list ./... | grep -v docs | xargs go build
no sure if there's an "easier" way? 🤔.
might be worth adding a dagger function for this maybe? cc Justin
Hey, I am working on tracking few metrics from our Github issues (number of issue "kind/bug" created per week / month). Same for merged PR. I am going over our issues and PRs. Can we make sure from now on we properly label the PRs with kind/bug when it's a bugfix? That will help get some useful insights.
Following a conversation with Andrea to ensure the SSH ref style vision / DX impact, your feedback is more than welcome as we approach the final stages of the private support ref style: https://github.com/dagger/dagger/issues/6113#issuecomment-2264712473 🙏
Current pending PR implementation will be tweaked tomorrow to fit this new last ref style
I've not had any pings from GitHub about the contextual module issues for a while now. Are these still in progress?
👋 David! Will very likely get merged in the upcoming 1 / 2 weeks. Only thing missing is just another pass on the DX and some internal checks in the overall approach. The feature is pretty much complete as described in the current PR
That's awesome. Can't wait!
yep
@rancid turret I'm quite confused by this error and cannot reproduce it locally, could you have a look please, it seems like it's blocking the PR CI, both are related to Python :/
https://dagger.cloud/dagger/traces/e430bb2bc3a9b2ff354869279866c7f7#f602ddb3068b5d38
Same for: https://dagger.cloud/dagger/traces/746a0edae06fe2df975c3aebf0d20bdd?span=ec6e31eec725513b#026ad2556483914b
I know what it is.
@fair ermine, it appears the Python code in the PR fixes an issue that I wasn't even aware. It changes a required arg to an optional one (correctly), but that means it also changes the signature when it's being used (in /dev). Basically you get a function arg with a default but no optional(True). I think the engine should enforce it. The problem with the root /dev is it needs to run both on a released engine and a dev one. So we need the compat layer here. I'll work on fixing it in a separate PR.
Okay, thanks! Let me know how is it going
Actually, previous behavior makes sense, in that having a default doesn't necessarily mean it accepts a None (null), which is what withOptional(true) means. This has to do with https://github.com/dagger/dagger/issues/6749.
In TS, if there's a default, I set it as no-optional, except if there's an object or context dir, cause I do not have the choice
Problem is you lose the expressiveness in GraphQL, that's why I needed a bit of time to investigate more on that issue. What I mean by expressiveness is that you can have non-nullable fields with default values. For example:
name: String! = "main"
If you set withOptional(true) whenever there's a default value you won't be able to get the result above. We do have a test case that suposedly covers that, so I'd need to investigate what you're saying.
For now you don't see any real effect on making it nullable, but as I show in the issue, the API is ignoring null values (considering them omitted). I've reached out to the core devs a while ago and it it's not intentional. When that's fixed and you force a withOptional(true), you'll possibly get a null on a param that doesn't allow for it. So you need to buffer for that case in the SDK.
Still... it's important to make things intuitive in the SDK side, but rather than rely on IS_NULL in codegen, it should also consider default values before marking an arg as optional or required.
@fair ermine, I'll just make a quick fix for the dev module. The PR won't be blocked on https://github.com/dagger/dagger/issues/6749.
Okay!
Hey, you can merge and rebase this:
- https://github.com/dagger/dagger/pull/8107
The real fix is in this one, but it's a breaking change in Go: - https://github.com/dagger/dagger/pull/8106
This is a workaroud until the following is fixed:
#8106
Not a part of that PR because it's needed for:
#7744
👀 turns out, you can put Container.From in the middle of a chain... it doesn't need to be the first item in it.
is this what we want? could we potentially break this in the next release?
(definitely didn't spend a few minutes tracking down where my nice container went)
Yes, this is known. We have tests for providing defaults before a From, so they don't get wiped and are instead merged. Env vars, for example.
But only ImageConfig stuff are merged. Mostly lists and maps. The rest is overwritten.
i get the logic for keeping Env - but it's really weird for the root filesystem to get silently overwritten
Motivation for that feature in https://github.com/dagger/dagger/issues/4588
Discord context: #1074736111131304057 message Summary: Container.From() and Container.Build() create a new container. Chaining this with ....
There's a summary table on this follow-up PR, re: crud methods for deciding what to merge or not: https://github.com/dagger/dagger/pull/5158
i get the logic for merging the image config + similar - i just don't think we should rewrite the FS if one has already been created
e.g. doing .From.From should be invalid (but doing .WithEnv.From seems fine)
or in my case, i accidentally did dag.Wolfi.From and was surprised when dag.Wolfi just disappeared
👋 just a heads up that @meager summit will be helping out with various OSS engine issues in the upcoming weeks. He's taking https://github.com/dagger/dagger/issues/7941 as a starter and will very likely need our input to streamline his understanding of the codebase 🙏
👋 helping a user here (https://discord.com/channels/707636530424053791/1270424034659799051) I've realized that WithMountedCache doesn't respect the currently set container user to set the Owner flag which might cause some non-desired behaviors as seen on the help request. It'd be nice if this could be handled automatically. @civic yacht any preliminary thoughts before opening an issue to address it?
Using the container's user feels reasonable to me, but the current implementation isn't great in that the owner field only works the first time a cache volume with a given key is used (mentioned in the docs for the API: https://github.com/sipsma/dagger/blob/479c8251479b993ca1d703e138310a26665cbe49/docs/docs-graphql/schema.graphqls#L600-L600)
I've been thinking a lot about this since I need to support it in the new cache volume implementation obviously. It's surprisingly kind of tricky. The only "good" solution I know of is to use id-mapped mounts, but that's a pretty recent linux feature so we can't rely on its existence yet: https://man7.org/linux/man-pages/man2/mount_setattr.2.html
The solution I'm going with for now is that we will always honor the owner setting of the mount (different than current implementation) but for now you will get different cache volume instances for each owner setting. This still is not ideal, but I prefer it since you at least always get the owner you asked for
Using the container's user feels reasonable to me, but the current implementation isn't great in that the owner field only works the first time a cache volume with a given key is used (mentioned in the docs for the API: https://github.com/sipsma/dagger/blob/479c8251479b993ca1d703e138310a26665cbe49/docs/docs-graphql/schema.graphqls#L600-L600)
That's fine and it makes sense it works this way until better underlying features like id-mapped mounts / shiftfs become more popular. Still I think that using the Owner field the first time the volume is created is a progress to what we have today
The solution I'm going with for now is that we will always honor the owner setting of the mount (different than current implementation) but for now you will get different cache volume instances for each owner setting.
Oh I see.. so you'll be changing the behavior of how ownership work in cache mounts. Is your plan to attach the Owner attrbiute to the CacheVolume type now?
I was considering doing that and deprecating the setting on ContainerWithMountedCacheOpts, yeah. Same for the Source field there since it requires the same behavior of actually creating a new cache mount for each Souce value.
The current behavior is also extra weird because internally what happens now is buildkit mixes in the low-level cache ref ID of the Source, which is a completely random value associated with buildkit internals, so the "real" cache volume ID is unpredictable. Another part of the changes I'm making is for the cache volume's unique ID to be based on a content hash of the Source, so it's at least consistent and predictable in that sense.
nice, that definitely make sense. Will the Owner field of the cache volume be mandatory? or you're planning to use the container's default Owner if unspecified?
I was currently retaining the existing behavior of defaulting to root if not explicitly set, but I can throw in defaulting to the container's user too, very trivial
that'd be awesome 🙏
@civic yacht @still garnet Hey, just pushed a PR to compute file digest, it was asked by @tepid nova
https://github.com/dagger/dagger/pull/8114
Could one of you review when you have a moment? 😄
So many conflicts in all my PRs...
Version management feedback: I'm on dagger 0.12.2. Getting this error: failed to load sdk module github.com/dagger/dagger/sdk/php: select: failed to create module: select: module requires newer engine version: version v0.12.2 does not meet required version v0.12.3
Isn't it excessive that a module requiring 0.12.3 fails to load with an engine 0.12.2?
Thanks Dagger team for your support! I enjoyed that
that was a good one David. You took quite a challenging project to start with (k8s, dind, etc) but we managed to wrap it quite nicely in the end 🙌
@still garnet @dense dust @fair ermine with context directory (almost) merged, is there an opportunity to use the context directory as a more reliable source of git metadata, for cloud?
I would have to get into the internals of how it works honestly
basically the workdir becomes irrelevant (IMO)
So all the edge cases might just melt away
We may need to add support for a --context flag for certain cases
@dense dust do you have a writeup of all known edge cases for git metadata? Situations where it doesn't work properly
I think the closest we have is https://github.com/dagger/dagger/issues/7802
catching up on https://github.com/dagger/dagger/pull/7744 now
hmmm, I don't know, need some exploration on that
hello folks, when running tests for PR https://github.com/dagger/dagger/pull/8122, I am running into an issue with how acronym "JSON" is handled. 🧵
hello folks, when running tests for PR
could someone, with enough permissions, please re-trigger the failing step on this action: https://github.com/dagger/dagger/actions/runs/10312360020/job/28547468112?pr=8122
done ❤️
👋 it's thread time for v0.12.5 👀
@spark cedar could you help me get https://github.com/dagger/dagger/pull/8042 through? I think we have consensus on everything, it's just failing CI now, and it's a tough one to keep up-to-date
Question on our Github Actions configuration.
There is a lot of boilerplate config for allowing us to run a dev dagger engine. What is that for? Don't we already use dagger-in-dagger all over the place? Do we really need to also do this in YAML?
cc @astral zealot @stray heron
@rancid turret - on https://github.com/dagger/dagger/pull/8127
i think i'm gonna keep working on this in the next couple of weeks, do you have any specific asks about it? (I can delay if you'd prefer)
I think I agree on the "return object on sync" point, I quite like that - but IMO, that's a super breaking change, and it feels a little orthoganal? Maybe, I'm still tring to wrap my head around what it would mean
General comment on our GHA configuration: LESS YAML ENGINEERING PLEASE
The complexity is insane
I'm trying to do passes of simplification after the fact, but it's a major time investment for me, it would be much easier if the focus on simplicity, and avoiding yaml engineering, were infused from the start
We're telling our users "Dagger will make your yaml smaller, and less weird and unique" and we're doing the exact opposite
Sync
fyi y'all 🎉
once we merge https://github.com/dagger/dagger/pull/8042 (soon ™️), the dagger dev module will be gone. no more -m dev, you can just leave it off now.
I commented on the PR, but the readme in the python sdk removed -m dev when it doesn't apply there.
Ahh good catch, my bad will fix that 🎉
I'm hitting a weird bug in Directory.terminal(). If the directory contains a withNewFile() then the terminal fails with "exit 1".
This works for me:
dagger call -m github.com/shykes/core directory terminal
But this doesn't:
dagger call -m github.com/shykes/core directory with-new-file --path=hello.txt --contents='hello world' terminal
On vanilla 0.12.4
cc @wet mason
This works too:
dagger core directory with-file --path=README.md --source=README.md terminal
@spark cedar @astral zealot @stray heron sadly I won't be able to attend the demo call later today, but I wanted to share my side project with you: a dagger module to generate Github Actions configurations 🙂 My goal is to replace our unique snowflake YAML with a clean generated config.
Example:
dagger call -m github.com/shykes/dagger2gha \
--public-token FOOBAR \
--dagger-version latest \
on-push --branches=main --command '--source=.:default engine test important' \
on-pull-request --command 'engine test all' \
on-pull-request --command 'sdk python test' \
on-pull-request --command 'sdk go test' \
config \
-o ./my-repo
Resulting file tree:
$ find my-repo
my-repo
my-repo/.github
my-repo/.github/workflows
my-repo/.github/workflows/push-1.yml
my-repo/.github/workflows/pr-1.yml
my-repo/.github/workflows/pr-2.yml
my-repo/.github/workflows/pr-3.yml
Each trigger is its own workflow, with a single job. Contents of pr-3.yml:
{
"name": "sdk go test",
"on": {
"pull_request": {}
},
"jobs": {
"dagger": {
"runs-on": "ubuntu-latest",
"steps": [
{
"name": "Checkout",
"uses": "actions/checkout@v4"
},
{
"name": "Call Dagger",
"uses": "dagger/dagger-for-github@v6",
"with": {
"args": "sdk go test",
"cloud-token": "FOOBAR",
"module": ".",
"version": "latest"
}
}
]
}
}
}
I think eventually this approach could make the dagger-for-github action unnecessary. Instead you just generate the yaml blog that you need. Instead of parametrizing the github action in yaml (complex and brittle), you parametrize the generating pipeline instead. Then the generated yaml can be much simpler, because it has no dynamic parameters.
btw @spark cedar it includes a complete (or almost complete) native GHA schema. If you want to experiment with exposing the entire low-level schema as a Dagger API, it should give you a solid starting point. But sadly the native types don't all translate directly to Dagger, because there are maps...
looking nice as an MVP.
Each trigger is its own workflow, with a single job. Contents of pr-3.yml:
Any particular reason you've decided to output json instead of yaml? Does GHA support workflow definitions in JSON?
well json is valid yaml 🙂 I was just lazy
lol, SGTM
hi folks, after pulling in the latest changes, the typescript sdk has these errors (on clean main branch). I tried running dagger develop inside runtime dir, but that didn't help.:
./main.go:36:16: undefined: Directory
./main.go:49:17: undefined: Directory
./main.go:65:71: undefined: ModuleSource
./main.go:65:104: undefined: File
./main.go:65:112: undefined: Container
./main.go:107:65: undefined: ModuleSource
./main.go:107:98: undefined: File
./main.go:107:106: undefined: GeneratedCode
./main.go:130:69: undefined: ModuleSource
./main.go:130:102: undefined: File
./main.go:130:102: too many errors
Also when I run the typescript based integration tests it works on main (but fails with ^^ error on my branch). I am using following command to run the tests:
any pointers what I could be doing wrong here?
only difference I can think of is that typescript-runtime/dagger.json is pointing to dagger v0.11.3, but with my branch I am using latest from main?
this sounds like the breaking changes introduced in v0.12.0 - https://github.com/dagger/dagger/blob/main/sdk/go/.changes/v0.12.0.md#-breaking-changes
you now need to prefix Directory as dagger.Directory
hm, the typescript runtime needs updating
Yeah that is what i thought
if you're around that area, help updating the typescript sdk to use a v0.12 version would be super useful (otherwise, i can pick that up)
I am happy to do it, let me check what that entails. Thank you for confirming.
I have one more question though, the CI integration tests should also fail due to this? Like it is failing for me on my local run?
yeah, so the version in dagger.json is significant here
with v0.11, the new dagger engine is attempting to emulate the old api - so it still works
but with v0.12 and more, it drops this emulation, and so breaks
you can run dagger develop without doing the engineVersion bump, by passing the --compat flag to dagger develop
that might help unblock you if you were working on something else and don't want to get distracted here
Yeah, i would love to be able to finish the strcase lib replacement ticket first :), i dont want to jinx it but it seems like typescript tests are the only failing tests right now
But if i get around to it, i will post it here before starting to ensure no duplicate effort is done on that update
Thanks again for the pointers
awesome awesome, thanks 🙏
feel free to ping more aggressively once the strcase replacement pr is ready to go 😄 sorry, it's been so busy the last week
Sure thing, thank you
Raising a red flag on possible blocker for "daggerizing without littering": do we actually know how a Typescript module can co-exist with an app in the same repo? https://github.com/dagger/dagger/issues/8123#issuecomment-2284536121
Problem By default, daggerizing an existing project (either with dagger init --sdk=NAME, or dagger develop --sdk=NAME) will cause littering, by mixing Dagger-managed files with pre-existing files. ...
ah! looks like this already got done in https://github.com/dagger/dagger/pull/7864 🎉
ha ha, yeah. I created a branch today to start looking at updating the SDK and noticed that. 🎉
btw, the strcase lib PR is ready for review/feedback. There is one pending question, but otherwise it looks ready for feedback
awesome, i'm doing a lot of reviews/etc today, so will get on it! 🎉
Currently hitting an issue while testing some ideas that require the use of dagger in dagger.
I have this container where I install the dagger CLI, clone a repository with a module and do a dagger call with priviliged nesting, this works just fine:
return dag.Container().
From("ubuntu").
WithWorkdir("/home/ubuntu").
WithExec([]string{"sh", "-c", "apt update && apt install -y git-core curl"}).
WithExec([]string{"sh", "-c", "curl -LO https://dl.dagger.io/dagger/install.sh && chmod +x install.sh"}).
WithExec([]string{"sh", "-c", fmt.Sprintf("DAGGER_VERSION=%s BIN_DIR=/usr/local/bin ./install.sh", daggerVersion)}).
WithExec([]string{"sh", "-c", "git clone https://github.com/shykes/daggerverse"}).
WithWorkdir("/home/ubuntu/daggerverse/hello").
WithExec([]string{"sh", "-c", "dagger call hello"}, dagger.ContainerWithExecOpts{ExperimentalPrivilegedNesting: true})
However, when I run both the git clone and the dagger call in the same command:
WithExec([]string{"sh", "-c", "git clone https://github.com/shykes/daggerverse && cd daggerverse && dagger call hello"}, dagger.ContainerWithExecOpts{ExperimentalPrivilegedNesting: true}).
It fails indicating that there is no module source available:
input: module.withSource.initialize resolve: module name and SDK must be set
I'm not entirely sure how buildkit works, but I imagine this has something to do with a command generating layers that dagger then tries to use but somehow have not yet been synced 👀 ? Not sure if there is a workaround to this. Tried with cache volumes to see if that would help but same issue
can you please try with -m . ?
That was my first guess, but its the same result. It also would not explain why it works fine in one way and not in the other
Dug a bit
Current guess (which joins yours, but to be confirmed by the experts ahah) is that the setupNestedClient is being called before the actual run of the exec, when the ExperimentalPrivilegedNesting flag is set to true:
-
we set the clientID to a non-null value when option is true: https://github.com/dagger/dagger/blob/main/core/container_exec.go#L122
-
Prior running the step, some setupFunctions are run: https://github.com/dagger/dagger/blob/main/engine/buildkit/executor.go#L162
-
setupNestedClient checks that value, which is then non-null and sets up the filesyncer:
https://github.com/dagger/dagger/blob/main/engine/buildkit/executor_spec.go#L899-L903. This newly created session will thus have a state without the git repo -
Lastly, I believe that this setupNestedClient just prepares any nested dagger client to talk to this nested session
So to me, you are indeed copying the repo (I checked with an ls and some sleep) in the main session, and then the nested session state's doesn't resync after as it was done as a setupFunction.
**If correct, I have no solutions / wouldn't know how to help though, sorry. I'll let the big guys talk ahah 👼 **
think I've found the issue: #1271408553848209491 message
Thanks for the deep dive!! 
That makes sense, what I'm not sure is what would the correct behavior be. We can probably argue both ways, what is a bit confusing is that in the filesystem of the underlying container where the commands are being executed the files are there. Like you mentioned, doing an ls shows that the contents exist, so its a bit counter intuitive that a dagger call wouldn't be able to pick them up. Not sure either if its possible to fix, I'll look further at the code and see if I can grasp a bit better the overall structure
@spark cedar any 🧠 here? Just wondering if there might be a workaround?
mm yeah, i think this is probably a bug... i am confused as to how this happens still. I think @obsidian rover's right, this probably is something to do with setting up the nested client
that said, i think the NewFilesyncer code is right - it's just passing the path, so when it gets populated later, it should be fine right?
if someone could put together an integration test, that would be super useful, either posting it as a comment in an issue, or opening a draft pr
i think this probably deserves some more time to properly investigate, i don't have any immediate ideas
that said, i think the NewFilesyncer code is right - it's just passing the path, so when it gets populated later, it should be fine right?
but IIUC the Filesyncer won't see any new changes in the path after the WithExec has been started? So reproducing Matia's issue if you do touch foo.txt && dagger call in the same WithExec, the Filesyncer won't pick the change, correct?
wait
the command is wrong
git clone https://github.com/shykes/daggerverse && cd daggerverse && dagger call hello
the dagger.json at the root of shykes/daggerverse is invalid
you cannot call it
@astral zealot seems like we forgot the hello in path of cd?
@spark cedar you get the same error if you do cd daggerverse/hello
hm
you're right
okay, i think i understand what's happening https://github.com/dagger/dagger/issues/8154
tl;dr @obsidian rover is right - however, the state is 100% correct, it seems to be related to the current directory
the error message about missing the sdk and name is indicating that no matter what directory we cd into, we're getting the top-level (as the filesyncer code seems to kind of indicate might be happening)
@matipan seems like we forgot the
@astral zealot @wild zephyr any chance you can take a look at https://github.com/dagger/dagger/pull/8122#issuecomment-2286368594
trying to decide whether we need to do module compat here (because if we do, it's going to be such an unenjoyable amount of tedious work, and i would love to avoid doing/reviewing it if at all possible)
and for sure, in principle we should definitely be adding it, but it's just such a huge expansion of module compat into every little corner of the codebase
what's the comment particularly? the link doesn't take me to a specific one 😬
oops, updated the link
quick question on context dir. When the caller's module and callee module are not the same, which context does defaultPath? Caller or callee? I assumed caller because it's way more useful that way. But it never came up during implementation, so I am suddenly dreading that it's implemented as callee
I'm starting to wonder how a function might write to the context directory... This would make codegen use cases smoother. cc @still garnet I haven't forgotten about our dagger call fix conversation, I still want to do it... Would be nice if the command really could be that short. no -o PATH necessary...
Would love to hear thoughts on this!
🙏 @fair ermine
This is the issue actually happening and holding the merge, there’s a confusion when a module’s using a dependency and how the path shall be resolve.
In my opinion, it should be relative to the module itself, so I guess the calle? Maybe you can precise who is what
Hi @spark cedar , thank you for merging the PR around stuck tests. but it seems like the CI is still red. Looking at the history, it started to take > 30 mins (which was ~14 mins) recently: https://github.com/dagger/dagger/actions/workflows/engine-and-cli.yml?query=branch%3Amain
Not 100% sure I understand what you mean. where's the issue comment about this?
FYI @still garnet 🙏 https://github.com/dagger/dagger/issues/8162
@spark cedar @still garnet I started getting weird errors in my experimental CI pipelines, that seem to coincide with the 0.12.5 release. I reverted the pipeline to 0.12.4 (yes that is a supported option of my generator) but still getting weird errors. They are go build errors that seem to involve opentelemetry and bass somehow, so I thought I'd copy you @still garnet 😛
huh that's fun
...could that just be a network error potentially?
i'm not familiar with bass errors
yeah i blame the internet
if you re-run does it happen again? could still potentially be release related, but it is super unlikely that we could have broken the last release as well
i'd actually be proud if we managed that 🙂
re-running
@spark cedar it went away
phew 😅
docs PR fail
@tepid nova I recall we discussed about this in the #Daggerize the world forum and the argument against having it at the end was that it felt unatural when your function had an output to show the trace URL right below that. I guess we're ok with overriding that decision now? cc @little stone
(replied in the issue)
Is the context directories available in 0.12.5?
Additional question: Is Daggerverse already compatible with 0.12.5? I'm getting errors trying to publish (CLI) a module upgraded to that version to the Daggervese.
could not load module
I wasn't able to load a module from github.com/Excoriate/daggerverse/module-template@0dbf688a20cf568b9d1edd7acbd776b48ef0eeb6. Check the logs below for details.
get name: input: moduleSource.asModule resolve: failed to create module: select: module requires incompatible engine version: version v0.12.5 is greater than supported version v0.12.4
Creating new Engine session... OK!
Establishing connection to Engine... Setup tracing at https://dagger.cloud/traces/setup. To hide: export NOTHANKS=1
OK!
1 : connect
2 : connecting to engine
2 : | engine name=daggerverse-64d5cb5df5-7khrr version=v0.12.4 client=jn0vfcksdicjja461ucvcllp9
2 : | cloud url=https://dagger.cloud/traces/setup
2 : connecting to engine DONE [0.0s]
1 : connect DONE [0.0s]
3 : moduleSource(refString: "github.com/Excoriate/daggerverse/module-template@0dbf688a20cf568b9d1edd7acbd776b48ef0eeb6"): ModuleSource!
4 : git://github.com/Excoriate/daggerverse#0dbf688a20cf568b9d1edd7acbd776b48ef0eeb6
Ref: https://github.com/Excoriate/daggerverse/actions/runs/10416963022/job/28850234715
https://github.com/Excoriate/daggerverse/blob/17e4a738a4ba33e68e0ae144cb0114e2f9452558/.github/workflows/cd-publish-last-version-dag-module.yml#L13
it's not yet, no, you can track the progress by using the issue here: https://github.com/dagger/dagger/issues/7647
yeah, sorry don't think it's been updated, will follow up internally!
Diving into some CI failures 🧵
Thanks @spark cedar !
@civic yacht @spark cedar @still garnet Hey guys,
I did some research on the context directory issue and caught the problem, however, I don't know how to solve it because it's related to internal and dep module's execution environment.
I put a summary of my research there: https://github.com/dagger/dagger/pull/7744#issuecomment-2293510819
Could I get some help on this? Any idea is more than welcome.
/cc @tepid nova you can find more details about the issue I'm having there ^^^
just to connect the dots that is exactly what I was talking about here, right? #maintainers message
We want caller's context but are getting callee's context.
And not just immediate caller but top-level caller.
Yes exactly! I didn't quite understand your point by that time, but now I do haha
However, I don't know how to insert the caller's context into the callee, I'm not sure if we even thought about it during the implementation :/
I'm reading the code rn to find out where I can fix that
Yeah you probably need to pass that directory around from call to call all the way down from the root call, like an actual context in go
Yeah, I need to find where to do that!
I think this 👆 will answer the question... It's not ready yet sorry
wait top-level caller? 🤔 is it not a security issue if any of your nested deps can pull content from the top-level?
For context directory, it's pretty required :/
i'm confused though, if module A calls module B, then the context directory for B should be from A, not from whoever happens to be calling A
that would also play absolute havoc with our caching model - that means that it's unsafe to cache the call from A->B, right? because now it depends on a third external thing
So how can we solve the current context dir issue?
i think we can do it from the direct caller right?
The context of the direct caller isn't the host afaik, this is why I can see /scratch
right, i actually think that's probably the correct behavior 😛
it's uploading from the data inside the module right?
definitely the wrong behavior
what's the alternative? if we just mount the entire host directory in, there goes all our module security
Hmm
Limit context dir to module directly called from the host and not dependency, but I guess it's not an option
no not the host directory, the top level module's context directory
or MAYBE the direct caller's context directory (debatable)
i'm not entirely sure what the way to implement this is gonna be
i'm also a bit worried, i feel like i'm really struggling to understand the implications of this, which to me is worrying because we have to document this/explain it to users.
i think i need to try poking around at this properly
maybe i need monday morning insight as well tbf, instead of tired friday thoughts
We can sync on this on Monday, no problem!
I have couple of other things to do
Sorry @tepid nova that this feature is taking such a long time to be merged :/
I feel like everyone is finally actually reading my issue
hm, okay, it doesn't seem infeasible to propagate the parent module source into module function's Call, but it's fiddly enough that it does feel weird
maybe re-read it one more time to be sure 😛
btw views are implemented wrong also
but that's ok because we'll deprecate them soon
don't worry about deadlines though @fair ermine . I only care about us getting it right
Small detail but it's not the module source it's the entire parent module's context directory (ie. the whole git repo)
I'll echo @spark cedar 's surprise that that's the behavior we want, only because it's inconsistent with all the other "host access" APIs whereby "host" always means the nearest local "host" i.e. the calling module.
Not saying it's right or wrong - the fact that Tom ran into it on his own seems to imply that's what we want - just pointing out that it will probably be a point of confusion if we don't document it properly. Also having trouble picturing a concrete example that hinges upon that behavior, since in my mind context dir was always sugar applied to the outermost layer, not something you'd really think about for dependencies. But I've been distant from the problem area for a while
hey @tender lava ! Daggervese has been updated!
hey folks, it seems like the integration tests are still hanging on CI/local setup. do we have a possible fix for it that I can try out?
not yet, sorry 😦 looking into this now, but i'm not sure there's a particularly easy fix rn
not yet, sorry 😦 looking into this now
Im running into a strange issue locally, just trying to run dagger functions
and running into this problem around the php sdk.
dagger functions
Full trace at https://dagger.cloud/levs-test-org/traces/2a5b42d1f0ee570cedac9d17e0384080
✔ connect 1.5s
✘ initialize 3.2s
! input: moduleSource.withContextDirectory.asModule resolve: failed to create module: select: failed to update module dependencies: failed to initialize dependency modules: failed to initialize dependency module: select: failed to initialize module: failed to call module "php-sdk-dev" to get functions: call constructor: process "/src/sdk/php/dev/entrypoint.php" did not complete successfully: exit code: 127
✔ resolving module ref 0.2s
✘ installing module 3.0s
! input: moduleSource.withContextDirectory.asModule resolve: failed to create module: select: failed to update module dependencies: failed to initialize dependency modules: failed to initialize dependency module: select: failed to initialize module: failed to call module "php-sdk-dev" to get functions: call constructor: process "/src/sdk/php/dev/entrypoint.php" did not complete successfully: exit code: 127
✔ ModuleSource.resolveFromCaller: ModuleSource! 1.7s
✘ ModuleSource.asModule: Module! 1.3s
! failed to create module: select: failed to update module dependencies: failed to initialize dependency modules: failed to initialize dependency module: select: failed to initialize module: failed to call module "php-sdk-dev" to get functions: call constructor: process "/src/sdk/php/dev/entrypoint.php" did not complete successfully: exit code: 127
Error: input: moduleSource.withContextDirectory.asModule resolve: failed to create module: select: failed to update module dependencies: failed to initialize dependency modules: failed to initialize dependency module: select: failed to initialize module: failed to call module "php-sdk-dev" to get functions: call constructor: process "/src/sdk/php/dev/entrypoint.php" did not complete successfully: exit code: 127
Stderr:
': No such file or directory
This is on a fresh clone of dagger/dagger on 0.12.5
is there a way to reset the engine schema? I am trying to evaluate if I can install a module, run some test and reset the engine to run the second test
Im running into a strange issue locally
wooo, https://github.com/dagger/dagger/pull/7708 is finally in 🎉
private modules via ssh auth is in! (huge kudos to @obsidian rover)
maybe worth cutting a release this week to bring it in? looks like context modules is also on the home stretch
And thank YOU for all the reviews 😍
🧵 release discussion 🎉
nice @obsidian rover !!
👋 quick ask for when anyone has a spare moment - i've got a few easy-to-review eclectic open prs that need some eyes 🙂
Guys I am getting bricked modules with 0.12.5
Repro:
$ dagger version
dagger v0.12.5 (registry.dagger.io/engine:v0.12.5) darwin/arm64
$ dagger -q -m github.com/shykes/sha functions
[...]
Stdout:
marshal: json: error calling MarshalJSON for type *dagger.GeneratedCode: input: container.from.withEnvVariable.withDirectory.withWorkdir.withMountedCache.withEnvVariable.withMountedCache.withEnvVariable.withExec.file resolve: process "go build -o /bass ./entrypoint" did not complete successfully: exit code: 1
Stderr:
# dagger/bass/entrypoint
entrypoint/main.go:38:8: not enough arguments in call to telemetry.Close
have ()
want (context.Context)
How do I downgrade to 0.12.4 on mac? I am stuck
Are you able to download the released binary from github?
I'll try that next
Just tried this (from our docs install instructions):
cd /usr/local
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.12.4 sudo sh
And it actually always installs the latest
so the DAGGER_VERSION variable seems to be useless
Someone else reported yesterday that they were unable to roll back to v0.12.4
@tidal spire OK getting the binary from github worked (MacOS complained a lot though)
Confirming that the same command works with 0.12.4.
the script seems to work for me (on linux as well as mac). Is the /usr/local/bin/dagger 0.12.4 and the latest is installed somewhere else and taking precidence in the path?
sorry I was out at lunch. No it positively installed dagger 0.12.5 in /usr/local/bin/dagger
Just making sure maintainers see this 👆
Two workflow are timing out constantly since yesterday: Engine & CLI / test and Engine & CLI / testdev (pretty sure they passed last week). Asking for getting my PR merged. Any pointer? It sucks that we end up ignoring those.
Sudo doesn't forward env variables
(sorry on mobile)
But you can pass -e to sudo to get DAGGER_VERSION in correctly (that flag forwards env vars correctly)
Hmm the error looks like we changed the telemetry API in a non backwards compat way in the otel refactoring recently
I guess we should have had module compat for this? But we've not had this case before, I hadn't really thought of that telemetry API as "stable" in that way before so missed this
cc @still garnet any thoughts on that? do we maybe need to start versioning our telemetry API?
This specifically affects the Bass SDK, because a bit of its non-generated code depended on the telemetry API from the generated code, making it a bit of a moving target. I fixed it in the Bass SDK so that it depends on a stable library instead: https://github.com/vito/daggerverse/commit/d168f0a3422c4979f8ad5fe9f37ba3bc7f0df0a6 - but any modules using it will have to bump the (apko*) dependency for v0.12.5+. I'm not sure if module compatibility layer would be able to fix this or if it's "just" an artifact of the weirdness I mentioned around the Bass SDK having to contend with two different versions of Dagger
The dependency to bump is /apko - but, now that I think about it more, yeah the module compat. layer is probably the right solution regardless (in the interest of avoiding all possible breakage) - assuming it's possible
Two workflow are timing out constantly
OK, this is copy-pasted from our docs FYI
@still garnet is there something special about apko that makes it break on 0.12.5 and not other dependencies?
(ie should I watch my other modules for something similar?)
Yeah, it uses the bass sdk
Ah so it's something about custom SDKs? Would all custom SDKs automatically break unless they update their telemetry code?
(or something like that)
Normally the changed code interface is only used by generated code, so it's always in sync
Specifically the bass sdk had code that broke that assumption
Got it
So literally just the bass sdk, which has ended up in a few dependency trees 😛
OK I updated the whole chain (DX note: pretty cumbersome to do that, maybe we can add features to make it easier). Should be good to go.
Tomorrow I'll have to track down all dependencies of my wolfi module, and get them to update.
So yeah it's definitely the kind of situation we were trying to avoid with compat mode I'd say
That would be sweet
Would be good to keep working that muscle
In any case, I also got the feeling that this kind of laborious "mass update" would deserve some sort of hosted product to help me automate it. I would love for daggerverse to just hook up into all my upstreams and downstreams, and just keep things up to date for me
Also - run my module's tests (which don't exist at the moment)
Basically I need CI for my CI modules 🙂
FWIW, I am adding a module to compare schema with different versions of dagger engine, so maybe we can add that check in CI of CI modules
Agreed 💯 good side hustle idea 🙏👀
eeek!
Compat for internal go code
thanks 🙏 you got to it faster than I could
Bringing this one back on the radar: https://github.com/dagger/dagger/issues/7358
I found an issue on the cli output if I do return a list of containers here https://github.com/dagger/dagger/issues/8202
Not sure what result should be, but I remember that shellcheck return list of struct so this should returns list of objects? Or I may do something wrong.
@civic yacht (low priority, just want to pick your brain on something you mentioned before).
You mentioned you had ideas to allow a module to test itself, without even requiring a special annotation like +dev or equivalent. I'm all ears!
Context: trying to wrangle the knot of DX issues around daggerizing an existing repo. Since we're discarding the "dev module" idea, it's becoming more important to make the DX really good with just one module. In particular:
- Where do I put functions to test my module
- Where do I put functions to generate the CI config that will wrap my module
@still garnet something extremely odd is happening w/ output when running tests locally:
dagger call --source=.:default test specific --pkg="./core/integration" --run="TestModule"- Let it run for a few minutes
- Ctrl-c to cancel
- It spends a minute or so printing insane amounts of output (can't tell for sure but might be a lot of duplicate output?), can't interrupt it at all
@vito something extremely odd is
bleh, @civic yacht you mentioned something about having each test generate a unique module name 🤔
it feels like that's exactly what we seem to be hitting in https://github.com/dagger/dagger/issues/8207
giving up for the day on this misery, upped the verbosity of the error even more https://github.com/dagger/dagger/pull/8214, and tried clarifying a few assumptions as well 😦 it feels so similar to the python error here where we can't find some file contents
@wet mason bug report in Directory.terminal:
dagger core directory with-new-file --contents=hello --path=/hello terminal
exit 1
Yeah it feels very similar to the python bug and also to the ones in TestLegacy that were fixed... I'm starting to wonder if my fix there (which was to use the stable client ID) handled some subset of cases but left others around.
I am now setup with eks cluster access so plan is to just repro these errors in CI (since I can't locally) and then debug on those machines. At this point, it's just a matter of time+println debugs+strace and we should have answers 🙂
I'm also curious if you see that overlayfs error in kernel logs when it happens 🤔
"undefined behavior" in the filesystem could explain a whole host of issues
Oh right, I almost forgot about that! Yeah that's highly sus. Basically there has to be something wrong somewhere and agree it could be a culprit here (but also possible it's unrelated, we'll see)
I’m off until Monday — can you file a bug and assign to me?
Also maybe @twin crow can help — he just tweaked that code this week
Hello 👋 , if I want to contribute to one of the core APIs (E.g., git. go in the /core package) like here https://github.com/dagger/dagger/blob/ea6489ef18302593539239174d7198829ef5ff90/core/git.go — where is the best place to boot a complete local environment, test the changes, etc.? The .dagger module seems to be a good place to start reading, but I found its documentation (https://github.com/dagger/dagger/blob/ea6489ef18302593539239174d7198829ef5ff90/.dagger/README.md#L1) a bit high-level for what I'm asking 🤔
Disclaimer: I am quite new to this project as well and there may be better ways to do it. But….
I have been writing integration test to exercise the code i want to change/test and run that test. The good thing is that the test itself takes care of having dev-engine + cli and the required plumbing automatically.
if you want a local env, you can also call ./hack/dev to build and launch the engine
then prefix commands to run in this dev environment with ./hack/with-dev
we should probably link to the ./hack/README from .dagger/README or CONTRIBUTING.md, etc
Could anyone help me with this? 🙏
Questions on our CI:
- What is the 'dev engine' option and when do we use it
- What is the concurrency / group name tweak for
- What's the difference between the
dagger-g2-v0-12-5-4canddagger-g2-v0-12-5-16c-st-odrunners
Also, why do we have GHA jobs that sequentially call several dagger functions, instead of just collapsing the sequence in a single dagger function?
What is the concurrency / group name tweak for
Answering myself: it allows "workflow preemption" so only one instance of each workflow runs at a time on each PR. Newer preempts the older. Only enabled on some workflows, presumably the most expensive?
@spark cedar @still garnet @civic yacht Hey guys, if you guys have some time today to review this PR: https://github.com/dagger/dagger/pull/7744
That would be amazing 🚀
Off on bank holiday today, but will take a look tomorrow 🎉
A fun sidenote. As I reverse engineer our own CI, here is my process:
- Find weird manual YAML. example:
concurrency:andgroup:. - Ask about it, read the code, figure out the intent (mostly figuring it out on my own, as people are busy and haven't had time to respond to me most of the time)
- Implement the intent as a new feature in my generator 😛 *example: https://github.com/shykes/gha/commit/a33ebda923541d21422069963d8cf287f0ed221b
- Rinse repeat
cc @tidal spire 🙂
@wet mason I did some work on the TS SDK, reordering the steps and it looks very promising!
https://github.com/dagger/dagger/pull/8236
@hasty basin If you have some time to play with that version, let me know if the TS SDK feels faster!
Normally, dependencies should only be downloaded if necessary but cached otherwise, I mount the source code after doing all the init/install job to trigger more cache hit, hope it helps!
@civic yacht @still garnet Up 😄
@tepid nova I have a small question related to context dir with dep
If we have:
parent/
dagger.json
main.go
dep/
dagger.json
main.go
.git
From the dep perspective, the / will root to the context dir, but the relative . should root to where? The parent module or ./dep?
I guess since we use the caller context, . should root the the parent module, that feel a big strange though
. should always mount to the dep-module imo - so in this case ./dep
if you want the top-level, you should be able to do /
otherwise, you get very different results if you call the dep directly or through another module
Okay, I need to fix this then!
I think this is what @civic yacht means by "There's some fixes needed to ensure that the actual paths we use in each case are always based on the "callees" paths when a dep"
kudos to @meager summit for his work on the new modules/compatcheck module - now we can more confidently run a dagger module to work out when we've accidentally broken the daggerverse 🎉
Per the spec it should be dep/$(jq -r .source dep/dagger.json)
but as usual we can change it if it's wrong
hm, just had a thought about TestPythonProjectLayout and why it might still be flaking 🤔
i think the idea behind the older fix might have been right, but the implementation isn't quite right - it would need to be in the sdk: https://github.com/dagger/dagger/issues/7662#issuecomment-2312732580
hm, ideally we could pass a unique hash of the . package? but this doesn't seem to have an effect from what i can tell.
we need different root paths for a unique module. maybe we could use the new .Digest functionality?
put this into https://github.com/dagger/dagger/pull/8245 - @civic yacht @rancid turret if you have a moment, would appreciate your thoughts, potentially this might kill one of our flakes 😄
Attempts to fix #7662, follow-up to #8051.
I think #8051 was the right approach - however, the tests weren't the issue. The paths in the tests aren't actually part of the uv cache k...
almost done with analytics!
Go / Python / Typescript [/cc @rancid turret]
Looks like they all have the same problem of loosing all cache as soon as anything chnages in the source
I'm having an issue with this, because the context seems to be the parent, I'm not sure I can guess that the current called module is a children.
@civic yacht Is there a way from what you've done to get some children information such as the path? I don't see it in the client metadata
Or maybe I need to combine both parent context to get the client metadata but also use the current context to get data about the children ctx, that might be the way
. should just refer to the module source dir right? We know that path relative to the context root, it's stored as part of ModuleSource. So ModuleSource.LoadContext should be able to resolve any . paths based on that source dir path
Yeah but for that kind of pattern above ^^
It seems the session return the parent relative root, not the dep module
I'm checking if I can use sourceRootPath to append it
The session isn't returning any paths to use. The session's involvement is only around which client to connect with in order to load files.
So if the wrong dir is being loaded then incorrect values for paths are being supplied somewhere
I poked around a bit on your PR locally @fair ermine, it seems like the issue may come down to the fact that src.SourceRootRelSubPath() is incorrectly returning . on the dep module: https://github.com/TomChv/dagger/blob/0e3ab2e05c6ef4e28ec6f79b6188bcc12d96ff88/core/modulesource.go#L400
Will let you go from there, but that is what's leading to the wrong module source dir being used.
I already pushed a fix normally, by using moduleRootPath when path is relative
The next generation is starting 😛 https://github.com/dagger/dagger/pull/8241
On mobile but saw the diff, it looks like you are avoiding the bug I mentioned by just ignoring that incorrect return value, but we should probably just fix the bug in that ResolveContextFromModule method. Otherwise we’re just leaving a bug around in it. Afaict you could just make the same fix but in the method rather than ignoring the return value
True!
@astral zealot @spark cedar does this GHA error ring a bell? Is this a known infra issue, or a misconfiguration on my end? https://github.com/dagger/dagger/actions/runs/10584876301?pr=8241
go sdk: test
The self-hosted runner: dagger-g2-v0-12-5-4c-6822z-runner-gbh4m lost communication with the server. Verify the machine is running and has a healthy network connection. Anything in your workflow that terminates the runner process, starves it for CPU/Memory, or blocks its network access can cause this error.
Ok I fixed it by adding the rootSubPath in the method as you mentioned
Hi @spark cedar I have a question regarding how views are used on client side and engine side 🧵
Feature request: better middleware support.
It's not easy to wrap an existing module with many optional arguments, and simply inject / change a few arguments while passing through everything. In go I want to take the ... dagger.OtherModuleFuncOpts and pass it through, but I can't. I have to copy-paste every single argument, and manually plumb them through one by one
Fun fact I implemented our self-hosted runner naming logic in a dagger function 🙂 Thank you @astral zealot for explaining it all to me.
Example:
dagger call -m github.com/dagger/dagger/.github@pull/8241/head \
runner --cpus=16 --dagger-version=v0.12.5 --dind=false --generation=2 --no-spot --single-tenant
I also reverse-engineered our existing runner configurations, and took the liberty of packaging them 🙂
INTRODUCING.... The bronze, silver, gold and platinum runners!
$ dagger functions -m github.com/dagger/dagger/.github@pull/8241/head
[...]
bronze-runner Bronze runner: Multi-tenant spot instance, 4 cpu
silver-runner Silver runner: Multi-tenant spot instance, 8 cpu
gold-runner Gold runner: Single-tenant on-demand instance, 16 cpu
platinum-runner Platinum runner: Single-tenant on-demand instance, 32 cpu
Example: "give me a platinum runner with docker-in-docker, top of the line"
$ dagger call -m github.com/dagger/dagger/.github@pull/8241/head platinum-runner --dind
${{ github.repository == 'dagger/dagger' && 'dagger-g2-v0-12-5-32c-dind-st-od' || 'ubuntu-latest' }}
Nice!! We used to have 64c runners, would those be Adamantium? Or vibranium for the marvel fans 😆
Is it ready to review yet? 😍
and any thoughts on moving the gha module into dagger/dagger? or do we want to keep it separated out?
ahhh it's so cool
i'm just ever-so-slightly annoyed i didn't get to work on this 😛 it's cool
left some high level ideas on just glancing through, but i think i'm biased towards merging soon (next week? 👀) - i can carve out some time to help as well if needed
i really wanna give this approach a real go
RFC: https://github.com/dagger/dagger/issues/8140 \cc @tepid nova @hasty basin
Thank you! Yes I would love to merge it quickly to avoid conflicts...
Not sure if this came up already... But it's a pebble in my shoe. https://github.com/dagger/dagger/issues/8271
@astral zealot be advised 😛 https://github.com/dagger/dagger/pull/8241/commits/7a139f6322891298fde1128b6de3c7440c23da0c
I had to try
Everything is queued 😦
Lets see the world burn

Need a quick shipit on a dep upgrade that I have some vague hope could help with one of the flakes (and harmless to update otherwise): https://github.com/dagger/dagger/pull/8272
Want us on the latest version of this since it's in the realm of plausibility that a bug in golang.org/x/tools/packages could explain some of the flakes we've been having.
There&am...
omfg I finally caught one of the mystery flakes in action and manually confirmed something terrible is happening involve the go build cache:
fail to build due to an import not being found:
buildkitsandbox:/src# /usr/local/go/bin/go build -o /runtime .
internal/dagger/dagger.gen.go:23:2: package dagger/bare/internal/querybuilder is not in std (/usr/local/go/src/dagger/bare/internal/querybuilder)
internal/dagger/dagger.gen.go:24:2: package dagger/bare/internal/telemetry is not in std (/usr/local/go/src/dagger/bare/internal/telemetry)
But when looking at the file it's erroring on, the lines it's complaining about don't match the error at all:
buildkitsandbox:/src# head -n 100 internal/dagger/dagger.gen.go
// Code generated by dagger. DO NOT EDIT.
package dagger
import (
"context"
"encoding/json"
"errors"
"fmt"
"net"
"net/http"
"os"
"reflect"
"strconv"
"strings"
"github.com/Khan/genqlient/graphql"
"github.com/vektah/gqlparser/v2/gqlerror"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/trace"
"dagger/test/internal/querybuilder"
"dagger/test/internal/telemetry"
)
Then, rm -rf the whole go build cache and now it magically builds again!!
buildkitsandbox:/src# rm -rf /root/.cache/go-build/*
buildkitsandbox:/src# /usr/local/go/bin/go build -o /runtime .
I don't see any reasonable explanation other than some bug in go that corrupts the build cache
Put the above GH issues here: https://github.com/dagger/dagger/issues/8031#issuecomment-2320086983
This is the most elated I've been at finding a bug in a while 😄 Was starting to lose hope for a bit there
@spark cedar if I have a v0.12 module with a v0.10 or v0.11 dependency, how should I think about how that executes?
🤔 how do you mean sorry
it should execute "as expected" - each module gets presented a schema that is compatible with it's declared engineVersion
So compat mode should work "all the way down" 🙂
yeah, so if your deps have deps, then they all still get served the right versions as well
figured as much, but also figured I'd ask if there were caveats
funny you ask, i've been fighting weird compat mode things the last half an hour or so lol (i'm writing some new tests for behavior i want to remove https://github.com/dagger/dagger/issues/8065)
Source of my question: I had sent a PR to @astral zealot for his Pulumi module (merged and working fine) and at the time had glanced at the dagger.json deps and thought the sha of the docker modu'e dep "looked like" the sha for the latest version of Solomon's docker module, but it was an old v0.10.x version. I need to send another PR eventually, but it made me think, hmmm....if the dep's API changes, of course you have to accomodate, and you need to consider any Dagger API changes.
I think maybe Rajat's work can help here, eh @wild zephyr ?
thankfully, you don't need to consider any dagger api changes - well, maybe one day you might have to (e.g. handling addition and removal of types is something module compat doesn't do yet)
but for example, a module might return a container - even if that container from the perspective of your module has method, if that method was removed in the version of the caller, then it's only the caller who doesn't see it
the callee still gets to see it and it's fine
Right! Since the maintainer of the dependency would have handled the breaking change for me and I'm just consuming my dependency module's API.
exactly
honestly, i'm just really impressed that the design of the module compat stuff has held up, there was always the potential that some insane case would appear that just was fundamentally broken (and even the strcase work has kinda been doable with it)
gave up on my fancy approach for tackling the python flake in https://github.com/dagger/dagger/pull/8245 - it should be good to go now (i've opened a separate pr to improve the api for this in the future)
🧹 hopefully one flake down
Actually, should be two flakes down 🙂 There's another Python flake that may be cause by this same issue.
Hi Jeremy, I would be curious to try this out with the compatibility check module. could you provide a little more details?
deps compat checks
I'm observing some differences between our +ignore behavior, and the .gitignore behavior
Which we should fix quickly (if they are real) before people start relying on the current behavior
Managed to get this reproducible in a docker image by tar'ing up one of our containers in CI that hit it, used that to open an issue in the go repo: https://github.com/golang/go/issues/69179
Commands to repro are in there if anyone else wants to poke around at it!
Go version go version go1.23.0 linux/amd64 Output of go env in your module/workspace: GO111MODULE='' GOARCH='amd64' GOBIN='' GOCACHE='/root/.cache/go-build' GOENV=&#...
What does dagger call dev-export do?
It looks new
"creates a static dev build" so it's dagger call build?
sort of, it builds the cli and the engine together - bundles them up and throws them in bin together. the reason is, building them separately was resulting in loading the entire dev module twice (which is a bit slow, perf investigations are ongoing with cache, etc)
ideally, we'd solve this with a "dagger script" - but we still don't really have that yet
⚠️ think we need to release v0.12.7 today - pretty major regression found in https://github.com/dagger/dagger/issues/8291
essentially, doing dagger install github.com/foo/bar@version no longer works - working on a fix now
EDIT: v0.12.7 has been released and resolves the issue
@wild zephyr do you have push access to github.com/shykes/hello? i know we want to avoid pointing people to it, but can we get a tag for v0.3.0 (or v0.2.1) to point to the current head? the last tag v0.2.0 cannot build in a recent version of dagger (this was before mod-compat)
Let me check...
No, I don't have access 😦
ah, no worries
i wonder if we should have a github.com/dagger/hello or something that we can call during our quickstart? then we have an "official" repo to point to, since users might not be aware of who we all are, and dagger definitely feels much more official
I think I do.
Working now: dagger functions -m github.com/shykes/hello@v0.3.0
thanks thanks ❤️
Thank you!
@spark cedar do you think we can merge 8241 today? 🙏
the conflicts are nothing too big (0.12.7 bump today) but it does take a little time to deal with
@fresh harbor thanks for looking at the elixir error! Do you think the YAML config itself could be responsible for the cache volume error?
UX nit: can we please rename dagger core dagger-engine to dagger core engine? 🙏 Also keep me in the loop for API review so I can weigh in on aesthetics 😛
same thing for blob... Include me in design review people please
Fun fact, if I call dagger core dagger-engine local-cache, it includes prune in the auto-printable fields list... Which means it actually prunes your cache
failed to get configured module: failed to get module ref kind: Post "http://:mem/query": context canceled
Error: response from query: Post "http://:mem/query": command [docker exec -i dagger-engine-d522a778c2389390 buildctl dial-stdio] has exited with exit status 137, make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=
Smells like an OOM? But I have plenty of ram on the docker VM. And never hit this issue before
👋 Can someone help review the PR https://github.com/dagger/dagger/pull/8328 ? My team found the issue that buildctl dial-stdio suddenly disappear when connecting to the engine on kubernetes.
i've seen this before, the :mem in the name isn't significant i don't think? it's from https://github.com/dagger/dagger/blob/7dd8635b56a24b60a66b89f44c6aeedd48853ba8/engine/client/client.go#L1144, but i don't know the logic of why it's set to that (blame points to the git blame hole that is https://github.com/dagger/dagger/pull/5757)
opened an issue to track it, so at least it can be searched for on github easier: https://github.com/dagger/dagger/issues/8329
same thing for blob... Include me in
v0.13.0 release thread 🧵
I found an error during call dagger develop on main:
$ dagger develop
Stdout:
marshal: json: error calling MarshalJSON for type *dagger.GeneratedCode: input: container.from.withEnvVariable.withDirectory.withWorkdir.withMountedCache.withEnvVariable.withMountedCache.withEnvVariable.withExec.file resolve: process "go build -o /bass ./entrypoint" did not complete successfully: exit code: 1
Stderr:
verifying github.com/klauspost/compress@v1.16.5/go.mod: checksum mismatch
downloaded: h1:G7mAYYxgmS0lVkHyy2hEOLQCFB0DlQFTMLWggykrydY=
go.sum: h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.
For more information, see 'go help module-auth'.
hm
i do not see this 🤔
potentially could be some network corruption? does it happen on retries?
Oh, let me try disable corporate proxy first.
is your coprorate proxy "an attacker" 😄
Work after turn off. So scary. 😱
Hi @rancid turret , when you get chance, could you please look at https://github.com/dagger/dagger/issues/6713#issuecomment-2325880673 and provide your feedback on that. many thanks.
Replied, let me know if you need further clarification.
Anyone still around to help me get 8241 and 8284 through the finish line?
I have a bunch of failing checks now, no idea why.. flake, no flake?
yeah just saw all the failures on 8241
Actually I was able to reproduce that one
dagger call -m github.com/dagger/dagger@pull/8284/head check --targets=sdk/go
There's a failing git clone but I have no idea where it comes from
fatal: repository '' does not exist
ooh I think I know what it is
- This is very hard to debug because of lack of self-calls
- I just recently added
TestPublish
- I think I forgot to pass an important argument to
TestPublishit needs a specific tag I think
This would actually be immediately made better by splitting out each sdk-specific pipelines into sub-modules
Mmh, just checked and all the dag.Git( calls inside .github seem to have sprintf formatting, with at least a string
btw if we're looking for performance optimizations... our pipelines are still litered with ad-hoc from("alpine").withExec(["apk", "add", "random", "crap"])
how come would it be ""
@obsidian rover it's also because of lack of self-calls. I added a top-level function (Check) that wraps the SDK's Publish functions (among other things). Because it's an intra-module call, I lose all the default values of optional arguments
So I have to either move everything into a sub-module (useful but lots of work), or copy-paste all the values from the +default pragma
interesting case 👌
I'm unblocked, will try to power through the gruntwork before my cutoff, thanks!
OK, breaking out the SDK sub-modules is even worse than I thought, because the SDK pipelines depend on Engine().installer(), so to avoid dependency loops I also need to break out an engine/ submodule
copy-pasted default arguments it is
I'm having a lot of trouble with +ignore
it seems pretty badly broken
Update: it's specifically includes (!foo) that seem to break
now stuck on this: https://dagger.cloud/dagger/traces/62823894f5e4a544440b2ef3c85ce4ed
@spark cedar 👋
Do you happen to know what's the "fallback case" for the docker provisioner?
https://github.com/dagger/dagger/blob/main/engine/client/drivers/docker.go#L106-L124
hm, so this is if the image cannot be resolved for whatever reason, we fallback to any old engine we can see? from how i understand it?
i don't really know about that, i feel like if the image isn't local, and we can't pull it, that should be a hard failure 🤔
Yeah ... I was wondering if there's a weird dev case where it's used
behavior was introduced in https://github.com/dagger/dagger/pull/4489 it looks like
I opened https://github.com/dagger/dagger/pull/8341 as an alternative of https://github.com/dagger/dagger/pull/8340 which is much dumber -- just uses the tag
However, I don't know if there are side effects associated with that, especially in "non production" (e.g. ./hack/dev etc)
(* unless a digest was provided, then it's back to the old behavior minus the registry lookup, which I think should work in the hack/dev scenario?)
hm, yeah, i really don't understand the logic of this, i think it's a good idea to remove this (if it breaks any use case, it was quite weird, and v0.13 can handle such changes)
we don't hit this path at all in ./hack/dev actually 😆 we're hitting the other "engineconn" driver, since we've got docker-container:// in the url
this is only for docker-image://
huh
wondering what all scenarios are ...
currently that code handles images with digests directly, otherwise looking up the digest, fallback etc
imo, i think 8340 is cleaner as an approach, i like that it keeps the image id in the name of the container
mm, i'm pretty convinced we should remove this specific case actually, it adds complexity - and also there's no guarantee that the container you're trying to start here is even the right version of the container you want
this is like asking for "v0.13.0", and fails to pull, so you fall back to "v0.12.7"
I thought so too ... but deep down, I think it's meaningless?
In the sense that it's not really content addressed at the end in any case
Since we're conditionally pulling and resolving the digest at different stages, there's no guarantee that we're running the same thing
e.g.
- We docker pulled v0.12.7 with digest X
- THEN, we get the digest of v0.12.7 as digest Y
- We'll create a new container Y, not run a docker pull, and just end up with running digest X named Y
false sense of content addressability
at the end of the day, what matters in that logic is the tag name regardless.
#8341 makes it so containers are named accordingly rather than thinking they're more content addressable than they really are
mm, this does improve container naming as well
yeah, what I was thinking is: in the end, they're the same (one does not offer more guarantees than the other). But the latter happens to be less code and shaves off ~half a second on first run (when we don't have an image locally and need to talk to the registry)
ahhhhh neat
right i get it now
sure, i agree now, i prefer approach 2 😄
"first run" happens to be either when someone first looks at dagger, or in CI (e.g. GHA) for each build when it's ephemeral runners, so that half second is pretty important
@rancid turret @fair ermine I have some questions on private properties 🙂
btw on a slow internet, it's much more than half a second.
so the performance benefit is even greater than that
this error again... @spark cedar
No worries, just wanted to add to your list
Search is failing me, is there an open issue for syncing a directory for local development?
I can't find one either, but I'd be surprised that there isn't one. Happy to create one if nobody else knows
What are you trying to do? I want to be able to make changes to code locally and see them reflected in my running Dagger services similar to how docker-compose and docker run --v works. In particul...
Your wish is my command 🙏
I'm stuck on https://github.com/dagger/dagger/pull/8241... CI fails
java test publish job does not work, that's why it was disabled before
not sure about engine lint 🤔 looks like the job got cancelled? at the infra level?
one of the commits needs a sign-off, which is why DCO is failing
Oh right! I had an if statement but forgot to put it back
pushed with java test-publish omitted
I don't see an missing signoff?
seems to be fixed now 👀
I've been through so many loops with flakes, after a while you start assuming everything is a flake
(yes it is me, captain obvious)
Looks like the checks are passing! Although this is awfully slow... the github UI hadn't refreshed, checks were already done
All checks are green, all reviews have been addressed... Last call before merge 🙂
@hybrid widget FYI some notes from the group review of your "merge manuals" PR here: https://github.com/dagger/dagger/pull/8087#issuecomment-2332467812
Sorry it took so long to get around to it
Note: This is a large PR and the easiest way to review it will be via the preview: https://deploy-preview-8087--devel-docs-dagger-io.netlify.app/api/
merged! Our pipelines officially use context directory 🙂
Thanks for this! I'll make the changes over the next 1-2 days and ping for further review
You can ignore the one on CI integrations for now, it's pretty decoupled
Also @little stone started sub-issues to allocate those invididual review tasks, we're going to divide and conquer with @tidal spire @hasty basin @wild zephyr @little stone
Problem: when loading a module from git, the .git directory is not available in the context... Any way we could change that?
This doesn't seem good... https://dagger.cloud/dagger/traces/71e574d5e24fd36b9951e5c4fae1940a
@still garnet telemetry explosion of some kind?
looks like a network flake? the giant error barf is because we currently yeet stdout/stderr into error messages, which is part of the in-flight work I'm trying to land
I'm re-running, let's find out!
Context dir in action: open an interactive terminal with a dev build of any PR ready to go:
dagger call -m github.com/dagger/dagger@pull/8353/merge dev terminal
Need a quick LGTM on this 🙏 to un-break dagger call -m github.com/dagger/dagger https://github.com/dagger/dagger/pull/8353
When loading the module from a git remote, .git is not available. This caused our default 'dagger call -m github.com/dagger/dagger` to fail for every function call.
Contextual everything! https://github.com/dagger/dagger/issues/8354
@tepid nova looks like we found the first issue with the gha action: https://github.com/dagger/dagger/actions/runs/10737366478/job/29778707888#step:5:14797
the job "succeeds", and you get this super helpful little email from github
"pr failed" but "all jobs succeeded"
@tepid nova i've rebased https://github.com/dagger/dagger/pull/7940, i'm gonna merge it and bring it in if that's alright
i had a use case for wanting the alpine module somewhere else, so wanted to get it in asap
(tldr, trying to tidy up issue/pr backlog of things this afternoon before i head off on a couple days of pto next week)
that's great thank you!
is it specific to java?
the gh link i put links to the exact line that fails - it's:
Error: $GITHUB_STEP_SUMMARY upload aborted, supports content up to a size of 1024k, got 1082k. For more information see: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary
it only appears to be java for now, but not quite sure, i'm unfamiliar with the step summary
oh! I did see that yesterday
it's the markdown file I generate. it contains all stderr , so that hit a file size limit I wasn't aware of
Hello folks, I am making changes to make resolving Directory lazy (ref https://github.com/dagger/dagger/issues/6713), and running into a scenario where I am not sure where to actually check for the existence of dir:
From("alpine:latest").
Directory("/dont-exist").ID(ctx)
in this case the id is returned from the server (a base64 string).
what would you expect to happen here after the Directory is made to resolve in a lazy way
Hello folks, I am making changes to make
Would anyone be available to help me figure out interfaces? I can't get it to work
@tidal spire @wild zephyr any chance I could pick your brains for a few minutes? I'm really stuck
I have a quick meeting with Gerhard in two minutes
let's go to #team-audio in the meantime
The conclusion so far is that interfaces are unusable in practice
Would love someone to contradict me
@tepid nova found my example. It's on v0.10.x. Let me bump it to v0.12 to validate if it's still supposed to work the same way
Thanks - we made some progress with @tidal spire, jumping on a call but will resume after. I think unlocking interfaces would be very valuable for all of us
ok, still works in latest
have 5 min to show you?
No I'm in another call now.. sorry. will try to free up soon
np, just ping me when you have time. i'll be around
still around?
🎶 Till now I always got by on my own
sorry had to take care of the sick kiddo
will be back in a few mn
@wild zephyr @tidal spire I got so close...
func New(
// +optional
// +defaultPath="/"
// +ignore=["!sdk/go"]
source *dagger.Directory,
engine dagger.TypesSidecar, // --> the interface, defined in another module
)
Error: get module name: input: failed to get schema: failed to get schema for module "go-sdk": failed to install constructor: failed to create function: failed to find mod type for function "" arg "engine" type
I am wondering if maybe, we don't support receiving as an argument an interface defined in another module
(yes I have 4 modules now)
Because unlike the app/platform example, I don't have N "apps" implementing the interface: I have N "platforms" receiving the interface as argument
Confirming my suspicion: if I change the code to use my own interface definition as argument (like in the example), it works:
// I don't want to define this here (duplication across SDKs)
// But it seems I have to
type Sidecar interface {
dagger.DaggerObject
Bind(ctr *dagger.Container) *dagger.Container
}
func New(
// +optional
// +defaultPath="/"
// +ignore=["!sdk/go"]
source *dagger.Directory,
//engine dagger.TypesSidecar,
engine Sidecar,
)
@obsidian rover @fair ermine @still garnet do you know by any chance if this (#maintainers message) is possible?
If you use the struct generated from the interface does that work?
@still garnet that error comes from a line you edited last, so I still have hope 😛
I think that's dagger.TypesSidecar (the module is called types and it defines an interface Sidecar)
Oh, I see.. Can't use use the interface directly then if you add the package as a Go dependency?
I'm just guessing here. Not exactly sure how this works under the hood
Ah maybe! I will try that (but later, trying to get the end-to-end plumbing to work)
If the only way to reuse definitions is by a go import, that makes it less useful IMO
it means messing with go mod replace etc
could be messy too, because the imported interface will embed a different DaggerObject from its own dagger.gen.go
(confirming that dagger modules can't reuse each other's types via go imports, because they re-generate their own version of all core types)
Makes sense I guess
...
All roads lead to .dagger/internal/build
could someone with enough permissions please rerun this workflow run: https://github.com/dagger/dagger/actions/runs/10748117433/job/29811430153?pr=8366
Done 🙂
Has there been any discussions on how we map dependencies when using functions?
When we expose everything as a function we can only map dependencies; we lose all visibility of dependants.
Are we getting one step closer to dagger.json being our BUILD file? 😁
Yeah I think ideally, your Dagger dependency graph models your project's dependency graph
@bronze hollow I'm actually working on implementing this pattern in our own repo right now
I want to have my monorepo 100% Dagger by end of Sept so happy to discuss ideas to make the DX slick
Yeah same here 🙂 We finally have the features we need
This is my WIP branch: https://github.com/dagger/dagger/pull/8355. I'm hoping that by tuesday night, it will build
I'm learning a ton on monorepo best practices as I do this, will braindump after
@bronze hollow here's a little teaser... That branch is a huge mess, the overall project doesn't build. But, I started spinning out parts of the monorepo into self-contained modules... And as a result, you can already load and consume those 🙂 If you're familiar with Bazel or Nix... this is starting to encroach in their model of packaging and distribution.
This will build our codegen tool straight from my PR:
dagger call -m github.com/dagger/dagger/cmd/codegen@pull/8355/head build --platform=current -o .
./bin/codegen --help
I'm a little worried about the perf overhead of splitting out so many modules? Hopefully we can get somewhere significant with the perf investigations soon, I've definitely felt the slowdown from the modules we've added right now (since we started several months ago)
Definitely shouldn't stop us, just curious if you've observed anything from a perf perspective so far?
Too early to tell
But in our case, I expect the enormous amount of complexity we can remove, will make it overall faster
- de-duplicating base images and system package installs
- vastly improved local dir filtering, which should bring upload times down
But yeah, module loading needs to be faster. If we feel some pressure on that point, probably a good thing
Mm yeah definitely, good point on the dir filtering especially
I'm already feeling it during local dev... It is quite pleasant!
I think I have some organizational questions as well, but probably best to hold those until we have something that's a bit more broken up
E.g. where does the go version get set? Is it set centrally in the go module? If so, that does mean it's less useful for consumers that aren't directly us, but if not, then we need another place to manage it
Or maybe we can infer it from the go.mod of the project root (which would be pretty cool)
But I guess the same question applies to things like alpine versions
Yeah I didn't get to that part yet. But I am also wondering
Oooh do you know what would actually be neat. If in my dagger.json, I could have dependency parameters, that were automatically passed to the constructor? Then I could say I want this version of the Alpine module, that installs "edge" or another version
You could be able to annotate your constructor params with a pragma to indicate that you could do that
Like this? https://github.com/dagger/dagger/issues/6323
It's old... and obsolete also. But the idea has been floating around
I think if you dagger install had args like dagger call? And you could pass string/int/etc args to it, that populated your constructor default
Then it's just part of the single source of truth, dagger.json
I think it's important that those parameters are somehow caller defined - if it's callee defined, then the go module we write for dagger can't be reused in another project as easily, and so the ecosystem becomes that little bit more fragmented
Here's what I think. On the topic of daggerizing big monorepos, we had been stuck for a long while. Right now, this feels like we're demolishing a wall, and finally making forward progress again.
I think in a couple weeks, once the dust settles from removing the obstacles immediately in front of us, we will mentally move to the next set of problems - and I expect we will make rapid progress fixing those too.
TLDR: we have momentum again on monorepos
But the implementation of caller defined, there's lots of options
Agreed 🫡
In the meantime could you capture this idea of yours in an issue next week? I think it will be relevant very soon
Absolutely, will make a note to do this when I'm back in the office on Wednesday 🙂
I actually tried to add config to a module and expected it to work and it didn't. Just 3 days ago
I added my constructor method and realised it broke codegen / module discovery
Module builds are SLOW. This feels like something that could be fixed by pulling the build from OCI instead of freshly building?
Contextual modules is the key for me. It works soooo nicely
It's not just that they're slow atm, there's a bug where they're not appropriately cached on subsequent runs, which needs investigation
I don't think we need to totally rethink the approach just yet, there's a lot of benefits to distributing through git instead of oci
If it can run from cache after the first build, I'll be converted 😁
I just want to double down on this. Where Dagger is today is a huge step from a few months ago, maybe even weeks ago.
I haven't been this excited since the CUE days, I think I can actually be successful today with adopting and this really wasn't possible weeks ago without a lot of toil on my side.
Wonderful job, all of you.
Observation: the next bottleneck for monorepo will be self-calls.
Before context dir, it was an inconvenience. Now it makes some patterns actually impossible, because when you call a function within the same module, you don't get context directory access
When using dagger install, it would be nice to have a short-hand for a relative path from the Git root.
dagger install /dagger/typescript or dagger install git://dagger/typescript
Opened an issue
👋 @wild zephyr @rancid turret @still garnet with context dir not allowing access to the caller context, this "platform module" pattern will not be as nice. IMO we should either fix it, or stop recommending it. wdyt?
platform modules
Can we get a point release with https://github.com/dagger/dagger/pull/8362 ? 😄
I want to see if this improves my monorepo tasks 🙂
If I switch my Dagger engine to registry.dagger.io/engine:main will this allow me to test?
The CLI and registry container are tightly coupled. Probably better to do this:
dagger call -m github.com/dagger/dagger@pull/3862/merge dev with-mounted-directory --source=. --path=. terminal
then test in that terminal
I think there's a dev export too which you can save to the local filesystem, but not sure how to set it up after
@stray heron @spark cedar [/cc @wild zephyr] For the CLI to support a "version check" (e.g. nag when a new version is available), what are your thoughts on:
- Publishing a
engine:latesttag - Including a version field in the manifest with the actual published version
- ... so that the CLI can grab the manifest for
latest, extract the version and compare against the localengine.Versionconst? (assuming it's not a dev engine, yadda yadda)
as discussed previously, SGTM vs checking the current latest_version endpoint as we already have the telemetry in place and having a latest image pinned to the lastest stable release seems ok to me.
Context directory ignore patterns
SGTM - I think that's good, we can use an oci annotation on the index? That way we don't need to do a fetch for the index, and then for the manifest, so we only need one request for the check.
Yes, that's the plan. To use an OCI annotation for the engine version so we just query one manifest
Comparing against engine.Version, also good, there should already be a helper to detect if there's a dev version present
...back to holiday now 🏖️ 🍻
Enjoy and sorry for the ping : 🍸🍹
Problem One benefit of your CI pipelines being code, is that you can test them. Or at least, that's the theory. In practice, while it's possible to test Dagger pipelines, it's neither e...
Yes, that will work 👍
Publishing :latest is straightforward since we added support for arbitrary tags a few weeks ago (maybe months at this point).
If anyone has a moment, could use a quick review on this PR: https://github.com/dagger/dagger/pull/8384
I say "quick" because it just moves code around with no semantic change. Not sure why so many CI things failed, looking into it, but seems unrelated. This is a precursor to WASM + the other work I had in flight, to make those future PRs less confusing
^ all green now
yeah CI is painful today
yes please...
Update @bronze hollow, since that PR is merged, you can test simply with -m github.com/dagger/dagger. I just used this trick, and it worked great.
In case it's useful to someone:
function dagger-dev() {
set -x
script=$(mktemp); echo "dagger $@" > $script
dagger call -m github.com/dagger/dagger \
dev \
with-mounted-file --source=$script --path=/entrypoint.sh \
with-mounted-directory --source=. --path="" \
with-exec --args=sh,-x,/entrypoint.sh \
stdout
}
Example:
$ dagger core version
v0.12.7
$ dagger-dev core version
v0.13.0-010101000000-dev-90e2ebfc2ec9
Does anyone know how to do a 0.12.8 release? Would be nice to get this out quickly, context dir is unusable without it on real monorepos (@bronze hollow and myself both affected)
I'm getting this error while building the CLI:
[...]
go: downloading github.com/morikuni/aec v1.0.0
go: downloading github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4
go: downloading github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab
go: downloading github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
go: downloading golang.org/x/time v0.3.0
go: downloading github.com/docker/distribution v2.8.3+incompatible
go: downloading github.com/moby/locker v1.0.1
go: downloading github.com/google/go-cmp v0.6.0
go: downloading github.com/containerd/stargz-snapshotter/estargz v0.15.1
go: downloading github.com/klauspost/compress v1.17.9
go: downloading github.com/containerd/ttrpc v1.2.5
go: downloading github.com/secure-systems-lab/go-securesystemslib v0.4.0
go: downloading github.com/shibumi/go-pathspec v1.3.0
go: downloading github.com/containerd/stargz-snapshotter v0.15.1
go: downloading github.com/vbatts/tar-split v0.11.5
error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
Does this ring a bell for anyone?
Using dagger or directly with go build ? I think you encountered it recently last week no ? It's when Go uses the "vcs ping" command to retrieve info on the repo. We do rely on it to resolve the ref, but the log would be wrapped with some other output, so I think it's the error coming from go itself here
I presume you're building outside of the git, or the "git remote ls" command fails in one of the context where you try to build. Is the .git present at the moment of failure ?
Ah I found the problem! I was trying to ignore .git/objects/* to save upload time, but that breaks go tooling.
I have to either remove .git entirely, or upload it entirely.
(note on Go SDK DX: to make this change, I have to manually edit 5 identical ignore pragmas)
Is there a way to get my current module's path relative to the context?
could you please provide an example, not sure to understand the context in which this would be applied
as an API in an sdk ?
In this function I have ./cmd/codegen hardcoded. But I would like to get that value dynamically instead
Is pushing a 0.12.8 possible?
Just noticed with @stray heron that on init, the parent directory (which contains .git) is being uploaded -- is that by design or bug?
0.13.0 is coming either today or tomorrow & it will include this.
Hi Folks, this PR has two approvals and I believe is ready for merge (happy to address if there are additional items that needs to be fixed in those changes): https://github.com/dagger/dagger/pull/8366
I just created a GitHub issue for this which has a step-by-step reproduction + Dagger Cloud Trace: https://github.com/dagger/dagger/issues/8395
[/cc @rancid turret @fair ermine SilentPing Erik Justin]
All dagger commands are SLOW, on some machines, only when the parent is a git repo -- any clue?
Is it because it actually uploads the whole repo to the engine? I got that issue on my playground repo that have 150K files in
RequiredPaths
@rancid turret if I wanted to look at the code that does the "function selection" for auto-printing an object, where should I look?
Is there a published JSON Schema for dagger.json, or should I open an issue?
Hey core maintainers,
Looking for ideas on how i could access the clientMetadata.SSHAuthSockPath from https://github.com/dagger/dagger/blob/main/engine/buildkit/executor_spec.go#L899-L902 ? I tried in vain all the possibilities I could think of, and it's the main reason https://github.com/dagger/dagger/pull/8365 is blocked atm: I need to retrieve the client's metadata so that it coincides with the client path in the nested execution
I see 0.13
@spark cedar 👋
I was unable to use the index because "index annotations not supported for single platform export" so I'm using AnnotationManifestDescriptorKey
It does the job, now I'm trying to add that to the API itself (e.g. Container.WithManifestAnnotation)
CI question: can I use a new API in .dagger or is there a chicken and egg problem (it looks like so)?
@tepid nova did you manage to get anywhere with this?
also noticed, because every job is separate, re-running failed jobs when things get cancelled like in #infrastructure message, means clicking into every single job and clicking the re-run button (instead of being able to just re-run all failed)
👋
SDK re-generation triggers a CI failure for PHP (different indentation)
Am I doing something wrong or is something broken and just happened to land on me?
dagger --source . call sdk all generate export --path .
hm, i have seen this before (i'm not seeing it)
i remember fixing this by git cleaning the sdk/php dir
I'll try, thank you!
@stray heron btw -- is there a way using test specific to run a single test of a suite? (e.g. not the entire suite)
Yep: --run=Go/Init
beat me to it 😄
you can also do regexp between each set of //
which is pretty handy
The Test prefixes aren't necessary.
you can keep adding /s btw, if you have subtests in t.Run 😄
very useful for some of the tests that have about a 100 subtests 😆
I was waiting 8+ minutes between runs of my little test
No, didn't have the time sorry . Should be a simple fix.
As someone who is spending a lot of time in integration tests, i am really appreciating the ability to run specific sub tests. 🔥🔥🎉🎉
Nested Modules / Context Arguments
@fair ermine (
#1283455682112393227 message) It seems like there's a bug with the TypeScript SDK's OTel stack:
dagger-dev call -m github.com/RawkodeAcademy/RawkodeAcademy@feat/dagger bun-install
When I run this, I don't see any activity beneath .bunInstall - just internal blob() calls. Here's the implementation: https://github.com/RawkodeAcademy/RawkodeAcademy/blob/3ab311052a09fcb3d65da63f7ae528811252c0a8/dagger/src/index.ts#L31
Bumping this: https://github.com/dagger/dagger/issues/7951
If I move install.sh and install.ps1 to a scripts/ subdirectory, will anything break?
or even installer/
It's not like that script is useful in the context of a source checkout - it feels more like a piece of the release infrastructure
Those get put up on S3, manually deployed, it looks like:
https://github.com/dagger/dagger/blob/main/RELEASING.md?plain=1#L659-L663
So if they are moved and we update the RELEASING.md with their location, should be good.
Maybe we should have a release/ directory with all related files?
I'll defer to others closer. But there aren't many other files. Mostly other repos and such to deal with during a release, so installer/ makes sense to me.
Hi Folks, when calling Up on a *dagger.service from within the module sdk, it does not seem to open tunnel to the host, but works if the module return *dagger.Service, and we call up from the CLI, is that expected?
scripts sounds better to me than release/installer - but I'm happy with this
it's just manually uploaded for now, but @stray heron will know about whether there's been any progress on automating that
any objections to a withoutFiles api? https://github.com/dagger/dagger/pull/8216
Continuing on from #6475, we should have withoutFiles, just as we have withFiles.
Ended up wanting this for working on an internal test, so decided to just add it 🎉
@fair ermine Hey btw, did we add a cache mount for corepack I don't remember?
Does dagger install of a Git local module actually mount the entire Git repository and then reexport it?
Still interested on some ideas regarding ⏫ 🙏 I'll keep digging in the meantime 👀
wrong Tom? 😄
quick fix for our dagger mod, for anyone who's been sitting around waiting for daggerDev() wondering what it's doing: https://github.com/dagger/dagger/pull/8425
hm
looks like https://github.com/dagger/dagger/pull/8362 fixed only the first case in https://github.com/dagger/dagger/issues/8287
cc @fair ermine
Very
Oh I think I might have forget that!
I got tests for both case so I'm not sure that's true, do you have a repro?
Sorry btw, I only got the ping now 😦
here
^ @fair ermine have a repro
oh i guess this is technically intended 😛
Yes actually haha
The ! doesn't act as "include only" but instead negate a potential more global ignore
That what Solomon actually asked me to support based on the issue he wrote
+ignore=["!.github/workflows"] -> nothing is ignored
Yeah I think we just missed a spot in applying the fix
Btw I'm working on the "ignore metadata" for any dir argument, I got a quick question:
From a converted dagger value (from convertToSDKInput), can I cast the value to dagger.Instance[*Directory] or *Directory?
If so, is there a better way than creating a scratch dir to copy the dir with ignored pattern to ignores files?
Because I feel like dag.directory().WithDirectory(MYConvertedDir, {ignore: xxxx}) isn't pretty at all
Maybe I could do it from the CLI, @rancid turret where do we convert a Directory path to an actual dir? That might be a better way
But modSrc.ResolveDirectoryFromCaller has no ignore support, so I wonder what's the best idea
Oh I have an idea
convertToSDKInput is probably not the right place for it
Yeah, I think it should be done on the CLI side, and forward ignore param to the engine
-> https://github.com/dagger/dagger/blob/b07f7340e0e40481873b59ee1faf1fcbff272d74/cmd/dagger/flags.go#L361
No but I mean, when I send argument to ResolveDirectoryFromCaller, that would be nice to have a ignore param there
How can I get the ignore value from the CLI though 😮
you should ideally have a loadArg function that is right next to loadContextualArg
instead of LoadContext, it should load the value from the value provided
Why doing so when the value can be ignored on first load?
If I do that, that means the dir will be load with all value, then copy with filters
because you might not always call a function with this from the cli
That's so true
you might call it from another module
Okay, hmm
but we still should have the cli optimization - that makes it nice and fast
but functionally, it's more important to have it in modfunc.go
So I need to copy the whole dir while applying the ignore pattern
That's not nice, we cannot have a Without function that not take a path but also patterns?
we could maybe one day track if a directory has already been filtered with those filters? then we could avoid applying in twice
i mean it's the same operation under the hood
Yeah..
just a bunch of llb.Copys
Alright! I'll try to do that then
Using the same logic as loadContextualArg but with load Arg
if we hit real perf bottlenecks with this, and too much disk usage - there are ways to speed this up, but they involve a lot of internal work to do hardlinking of lots of things
essentially, we'd want a new FilterOp
similar to a discussed ChdirOp I've discussed with erik before
I see
Can we have all environment variables prefixed with DAGGER passed to our functions? 😁
Nice try! I wish the same 😄
Can someone try, using the dev engine:
dagger --source . call sdk php generate export --path .
git status
I'm getting a formatting diff every time I try
/cc @stray heron @fair ermine @spark cedar @rancid turret
Strange
No worries it was my bad
I pinged the wrong Tom 🙂
Would you mind giving it a try in the background?
👋 thread about expanding variables in more functions https://github.com/dagger/dagger/issues/7951#issuecomment-2345852194. cc @meager summit @spark cedar @rancid turret
Problem Container.withEnvVariable can expand env variables with an optional expand argument (#7171). But this is not supported in other Container operations that may need it: withExec (expand varia...
I'm in a call, I can check that after
Can a Dagger module be spread across two files, or expose multiple objects?
I git clone the repository from scratch and now it works ...
No idea why
I nuked the engine volumes so I don't think it's cache related
Something in my .git?
@wet mason is it any different if you use context dir instead of --source .?
maybe it's picking up ignored stuff?
@still garnet it's a subtle thing where php code is formatted differently (like newline before brackets or something like that)
doesn't seem like it's grabbing more/less stuff
no diff here fwiw
@still garnet oh, got it -- I just wiped out sdk/php/vendor
it's .gitignore'd but I must have ended up in a broken state somehow
@tepid nova made some updates to the check function in our ci, so now we can easily check all the sdks with --targets sdk/, and even be more fine-grained with --targets sdk/go/lint.
lemme know what you think https://github.com/dagger/dagger/pull/8434
Extended the checks api, so now we have sdk/go (and others), which contain sdk/go/lint, sdk/go/test and sdk/go/test-publish.
Also, I removed the --ref arg, this doesn't seem to be used anyw...
also, curious what the long-term intention for https://github.com/dagger/dagger/blob/f1746e09a0e13caa53029805148f818b7f20766c/.dagger/main.go#L43-L47 is
i'm kinda struggling to understand the FIXME, not sure what doesn't work with TestPublish/etc? also the get-ref.sh script has an exit 0 right away?
also, is there any way we could try passing in the commit id when we need it locally (instead of the whole id)? my .git dir locally is 150MB, which is pretty big to upload every time. that's part of the reason for passing in the version string right now
(also note, that the full git directory sometimes might not be in .git, especially with git worktree, etc)
happy to make the changes myself, just trying to understand the current state of things
<@&946480760016207902> What's the weather forecast for a 13.1? 🙂
The goal is to not rely on CI passing the value of $GITHUB_REF, when the same information is available in .git/HEAD and .git/remotes
You don't actually need all .git, I just gave up on ignoring more, because the ignore syntax was driving me crazy (now fixed in 0.13) and I didn't want to waste too much time debugging. So left it for later.
(also note, that the full git directory sometimes might not be in .git, especially with git worktree, etc)
Oh that's a good point. It would be nice for the Dagger API to guarantee access to the context directory's git dir then.
It allows for portable inspection of git metadata, which has many downstream benefits.
hello @rancid turret @tepid nova , when you get chance, could you please share your thoughts on https://github.com/dagger/dagger/issues/6713
Sorry, tons of questions today. I'm trying to expose multiple services via dagger call XY up - but I don't think this is possible. Am i missing a trick?
At the moment you need to expose a proxy service that has dependencies to the other backend services. @tidal spire has a pretty good proxy module you can use
I've tried that, the only service I can reach from the host is the proxy
Oh, you mean an actual proxy like nginx to forward
Eurgh
At-least it unblocks me. Thanks
@bronze hollow the thing is, one way or the other you will need a proxying layer since several services in your array might expose the same port number
One possible optimization could be to have the builtin tunnel flatten several services into one, and just give you an error if you have port conflicts
I just modified all my modules to accept a port number argument 😅
Here's an example of the proxy module in action https://github.com/kpenfound/greetings-api/blob/main/ci/main.go#L43-L51
I am going with Devenv for local dev just now, there's too many pain points managing Dagger and then local processes.
Maybe something Dagger can handle in the future.
I don't know if this helps, but you can pass in local services as arguments to dagger. Like dagger call foo --postgres localhost:5432
It's neat but it doesn't help in this instance. I am trying to use Dagger for something it's not intended for, at least for now
I wanted to replace a Process / Docker Compose style setup
The proxy did work well but it's only half the battle.
I'm just eager. Dagger solves 8/10 problems ATM and there's that urge to take on the rest 😂
I know the feeling! We'll get there 🙂
Just got bitten by this : https://github.com/dagger/dagger/issues/8440
@fair ermine I have another context-directory fine-tuning request 🙂 Sub-modules should be excluded by default IMO. Will open an issue
@spark cedar the "directory hash" feature is cool for computing version info, but it means uploading the entire source directory even when I don't need it
just to compute that one hash
is there not another way?
Oh shit I can use context dir access for this.
Can anyone explain this snippet in engine test setup?
engine := t.Dagger.Engine().
WithConfig(`registry."registry:5000"`, `http = true`).
WithConfig(`registry."privateregistry:5000"`, `http = true`).
WithConfig(`registry."docker.io"`, `mirrors = ["mirror.gcr.io"]`).
WithConfig(`grpc`, `address=["unix:///var/run/buildkit/buildkitd.sock", "tcp://0.0.0.0:1234"]`).
WithArg(`network-name`, `dagger-dev`).
WithArg(`network-cidr`, `10.88.0.0/16`).
WithArg(`debugaddr`, `0.0.0.0:6060`)
Specifically I'm curious about why this extra config is needed for the engine & CLI tests, but not for the SDK tests. Those get an ephemeral engine too, but without all the custom config. Is that on purpose, or just an omission? Should I apply this extra config for the SDK tests too? Or will that break something important?
I'm not sure I understand what you mean by that, could you send me a link to your issue
I find it weird / frustrating that modules are not "self sufficient", e.g. we .gitignore codegen and overwrite it anyway even if there's a local copy
- at least in Go it's an anti-pattern
- opening a dagger pipeline blinks like a christmas tree in vscode unless you run dagger develop. Happens to me everytime the dagger src dir is moved around in our repo
- what I see in my editor is not what I get. Code looks alright but then dagger call fails to compile
- Breaks tooling
- We waste time codegen'ing at every dagger call
sadly, no, not until we can support lazy directory uploads (which we've discussed before, it's a pretty huge piece of work)
for version info, i've previously hashed the ID of the Directory, but also that still requires uploading it
contextual git would be useful here
@spark cedar @wet mason @rancid turret This one is ready for a review: https://github.com/dagger/dagger/pull/8430
It applied ignore paremeter to module pulled from git because it wasn't done before
Fixe based #8369 and @helderco feedbacks
Without this fix
dagger call -m github.com/wingyplus/dagger/sdk/php/runtime@cd3a3e724aa5a2ce259fe6b217f0efe5abaaabcb source-dir
_type: Directory
digest: sh...
@fair ermine I'm trying to do more weird stuff and I was wondering if you have about 60 seconds ? 😄
I'll open an issue
Maybe by design, but I did expect this to work: https://github.com/dagger/dagger/issues/8446
Obfusticating secrets within a terminal execution was a very nice touch I didn't expect
CLOUDFLARE_API_TOKEN=***
😄
I'm taking my lunch, will be available after if that works for you
huh
what a fun feature, i don't think that's intentionally there 😄 just a feature of the way it's all architected
hello folks, when adding a new field to a function with version specific Views, do we need to do anything specific for PHP SDK?
I added a new field to WithExec, but PHP check is failing.
But do we really need a hash of the whole directory in the version? What is it used for?
we need it for two purposes:
-
- to give it a unique cache directory - without this, every dev engine shares all the cache, this is bad - if we change the format and layout of that directory or the format of the cache or anything close to that, you get very hard to debug errors
-
- to give every engine a unique semver id - but if nothing has changed, we shouldn't change the semver id
getting a unique build id is common enough imo, if it hurts to do, we need to improve it - though outside of making everything lazy, i can't see how to do it very clearly
the entire source directory is going to get uploaded regardless of whether we call digest or not
if it's set as a contextual arg, doesn't it always get uploaded?
it's specifically this part that is no longer true in my pr 🙂 but specifically in the top-level constructor
I just needed to figure out where it's needed. But I have the answer thank you! I'll tie it to engine build & test
ah one more: currently we use the hash for the CLI also. based on the above, it's not really needed for every build yeah?
it still is yes
dagger version prints out the semver version it was built with
we need to be very careful about changing logic around this fyi, there's a lot of stuff with version compat that depends very heavily on setting this correctly in the ci
right but if that version doesn't have a hash in it during development, will anything break?
yes, the version compatibility stuff will likely have large issues
having the right format of version string and the style of that is important - see version.go
but isn't the hash only used in development?
