Using a freshly built dagger engine, for each of the Go, Python and Typescript SDK, benchmark the following operations:
dagger initdagger functionsdagger functions(cached)dagger functions(after modifying the source code)
1 messages ยท Page 12 of 1
Using a freshly built dagger engine, for each of the Go, Python and Typescript SDK, benchmark the following operations:
dagger initdagger functionsdagger functions (cached)dagger functions (after modifying the source code)Add packageManager config doc page.
Update runtime page with version configuration.
Tiny thing I noticed while working on flakes, seems worth a quick fix.
I saw a test flake where these tests failed due to a 500 error from example.com (like the actual real website) when the go tooling was checking for imports from it:
reading https://example.com/test/internal/querybuilder?go-get=1: 500 Internal Server Error
There's no need for us to be hitting examp...
when trying to run compatcheck from main branch, its failing with error:
/src/dagql/introspection/query.go:5:12: pattern query.graphql: no matching files found
We use introspection.Query in compatcheck module, and introspection.Query uses go:embed of a local graphql file..
$ pwd
~/go/src/github.com/dagger/dagger
$ ls dagql/introspection
query.go query.graphql types.go
But when running dagger functions, it seems like when the source is copied...
We are calling two functions after AsModule().Initialize(), and the second one is not hitting cache:
mod := modConf.Source.AsModule().Initialize()
err = mod.Serve(serveCtx)
name, err := mod.Name(ctx)
https://dagger.cloud/dagger/traces/fefb70456e44a55fad89198adf9ef3ac?span=845b4c6062bbfaba
Additional context:
Bumps the engine group with 22 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/a-h/templ | 0.2.731 |
0.2.771 |
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
0.27.1 |
| github.com/containerd/containerd | 1.7.20 |
1.7.21 |
| [github.com/containernetw... |
To get go 1.23 in goreleaser, we need to bump goreleaser up to the latest release - there are also breaking changes and deprecations we need to resolve.
This should fix the broken cli and engine publish on main: https://github.com/dagger/dagger/actions/runs/10594823172/job/29359279613
I updated the dagger CLI to v0.12.5. I updated Go to 1.23. Every dagger module gives the following error message:
cannot use log (variable of type "go.opentelemetry.io/otel/sdk/log".Record) as *"go.opentelemetry.io/otel/sdk/log".Record value in argument to e.OnEmitcompilerIncompatibleAssign
dagger v0.12.5 (registry.dagger.io/engine:v0.12.5) linux/amd64
internal/telemetry/exporters.go:92:23
 darwin/arm64
Some of these lints had stopped working, since the paths had gotten mixed up - this was because we were taking loop references (which is safe in go 1.22 - but requires that all the modules actually use go 1.22 in their go.mods).
This fixes that issue by updating go.mods, disables the loop capture checker (since this isn't required anymore in go 1.22), and also fixes the linting issues that we hadn't been catching anymore!
Signed-off-by: Marcos Lilljedahl
...and also fix the found issues.
[!WARNING]
Depends on https://github.com/dagger/dagger/pull/8261.
When running our integ tests, checking the kernel logs shows periodic warnings about invalid overlay mounts:
overlayfs: lowerdir is in-use as upperdir/workdir of another mount, accessing files from both mounts will result in undefined behavior.
The kernel logs can usually be check by running sudo dmesg.
I see this locally from time to time when running the full integ tests with `dagger call --source=.:default --docker-cfg=file:/home/sipsma/.docker/config.json test all --par...
I would really helpful when guard every required arguments to make sure the user pass the correct data type.
Idea in my mind:
Example 1:
defmodule Dagger.Container do
def with_env_variable(name, value) when is_binary(name) and is_binary(value) do
...
end
end
Example 2 - struct:
defmodule Dagger.Container do
def with_secret_variable(name, %Secret{} = secret) when is_binary(name) do
...
end
end
...
As discussed during the v0.12.6 release process:
imo, we can take this opportunity to update this process and daggerize more - ideally we should build all the images, and then push all the images
This consolidates a ton of the publishing logic together into a loop over a table (familiar to anyone familiar with go table tests). Because all of the logic in go, it's now super easy to force evaluation of all the containers before we start pushing them.
Finally, I removed the `TestPubli...
dagger.json does not contain version information for its dependencies. Instead, it only stores the result of digest lookup at the time of install. This makes it impossible to cleanly update dependencies in accordance with developer's wishes, because we don't know the developer's wishes.
In addition to storing the exact digest of each dependency, also store the version information as provided by the developer at install time.
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's a few commits in the diff that have some potential of being related:
Bumps the engine group with 23 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/a-h/templ | 0.2.731 |
0.2.771 |
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
1.0.1 |
| github.com/containerd/containerd | 1.7.20 |
1.7.21 |
| [github.com/containernetwo... |
There's a chance this could help us diagnose ephemeral context canceled flakes.
I have a similar change upstream in buildkit that I think is much more likely to be useful, but this is a best practice anyways for providing more context to errors than "canceled" so may as well make this change in our code too.
We are trying to run the UI Playwright tests and export the test results to the host machine. This works fine when all tests pass. However, when there is a test failure, the container exits with error code 2 and does not export the test report.
func (m *Demo1) RunTest(ctx context.Context, source *dagger.Directory) *dagger.File {
// Connect to the Dagger eng
container := dag.Container().
From("mcr...
This is currently failing out on main - by doing #8264, we have massively increased the number of packages we're linting, so resources on the machine are now more contested. I think it's definitely reasonable to bump this up now.
Bumps the engine group with 24 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/a-h/templ | 0.2.731 |
0.2.771 |
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
1.0.1 |
| github.com/containerd/containerd | 1.7.20 |
1.7.21 |
| [github.com/containernetwo... |
Hi,
I'm writing an application that uses the io_uring Linux feature.
It looks like io_uring is not supported by default because I'm running into permission issues executing the io_uring syscalls:
queue_init: Operation not permitted
However this can be solved by executing with InsecureRootCapabilities:
WithExec([]string{"io_uring-cp", "/foo", "/home/vincent/foo"}, dagger.ContainerWithExecOpts{
InsecureRootCapabilities: true,
}).
...
I think Dagger is amazing and I'd like to bring its awesomeness to the Apple development ecosystem, where there's a strong appetite from moving away from Fastlane's Ruby approach to automation. Developers want to write their automation in Swift, and I think Dagger is the missing piece, not only to address that, but to start breaking the strong dependency with proprietary CI pipeline formats.
Following the SDK's CONTRIBUTING.md guidel...
Makes the API changes specified in #8065.
Builds on #8114, adding Digest to Directory and ModuleSource.
The original need for these is internal, see the discussion in https://github.com/dagger/dagger/pull/8245#discussion_r1733172781. However, there's still a use for these in the public API as well, and it's just generally good consistency :tada:
I guess this actually validates our idea of keeping the digest with the metadata as the default - since it doesn't really make sense to compute a Directory.digest without meta...
[...] I plan to write the logic for generating the code, and then open a PR in the https://github.com/dagger/dagger SDK. Any pointes regarding recommended next steps are appreciated.
If I understand correctly, you've prototyped the client library and need pointers to start on codegen to generate the library from the API schema next?
Is there a library in Swift to make GraphQL requests? Does it support making an "introspection query" or do you need to do it "yourself"? To be clear, you...
From the first screenshot below, the runtime compiles the project during the initialization step:
Then, during calls of a function, it compiles the module again:
dagger v0.12.5 (registry.dagger.io/engine:v0.12.5) li...
This uses the new "context directory" feature in Dagger 0.12.6
Thank you for starting this conversation!
copying @grouville and @aduermael based on past conversations!
When using the new dagger.Ignore annotation on object fields, I get a TypeError: unhashable type: 'list' error.
@object_type
class DaggerUnhashableTypeList:
directory_arg: Annotated[dagger.Directory, DefaultPath("/"), Ignore([".venv"])] # Causes TypeError
dagger v0.12.6 (registry.dagger.io/engine:v0.12.6) linux/amd64
Using the below module, run dagger functions.
from typing impor...
Many commands that I run especially in a corporate environment require authentication of some sort. Typically this is username/password but sometimes it could be a certain file or token too.
When using Dagger modules it's typical to split certain functionality into it's own functions and each function can end up requiring to consumer to enter credentials. Examples:
compile, test, deploy...Our new +ignore pragma (for directory arguments) should be compatible with the gitignore format (for simplicity to the user, and easier interop), but currently it's not.
A few examples:
| Pragma | Expected behavior | Actual behavior |
|---|---|---|
+ignore=["**", "!.github/workflows"] |
everything is ignored except .github/workflows |
everything is ignored |
+ignore=["!.github/workflows"] |
nothing is ignored | everything is ignored except `.github/workf... |
Following a discussion with @aweris #1279115372116705422 message
Digging into that
This gets rid of the multiple levels of type aliasing used to be just one level.
This is a very mild simplification that worst case seems harmless, but the motivation right now is a shot in the dark attempt at seeing if it avoids some of the flakes we have been getting in the Go SDK with this object.
I'm probably doing something wrong but i cant seem to figure out what is going wrong.
When i try to install the example from dagger install --help i get the following output:
dagger install github.com/shykes/hello@v0.1.0
Output:
โ moduleSource(refString: "github.com/shykes/hello@v0.1.0"): ModuleSource! 0.0s
! failed to resolve git tags: select: git command failed: exit status 128
Error: failed to get module ref kind: input:...
Bumps the sdk-python group with 2 updates in the /sdk/python/runtime directory: python and astral-sh/uv.
Updates python from 3.11-slim to 3.12-slim
Updates astral-sh/uv from 0.2.32 to 0.4.2
Release notes
Sourced from astral-sh/uv's releases.
0.4.2
Release Notes
Enhancements
Adding support for .pyc files in uv run (#6886)
Treat missing top_level.txt as non-fatal (#6881)
Bug fixes
Fix is_disjoint check for supported environments (#6902)
Remove dang...
Bumps the sdk-typescript group with 12 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @opentelemetry/exporter-trace-otlp-grpc | 0.52.1 |
0.53.0 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| @opentelemetry/sdk-node | 0.52.1 |
0.53.0 |
| [adm-zip](https://github.com/cthackers... |
Bumps the engine group with 24 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/a-h/templ | 0.2.731 |
0.2.771 |
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
1.1.0 |
| github.com/containerd/containerd | 1.7.20 |
1.7.21 |
| [github.com/containernetwo... |
Bumps the sdk-java group with 12 updates in the /sdk/java directory:
| Package | From | To |
|---|---|---|
| io.smallrye:smallrye-graphql-client-api | 2.8.4 |
2.9.2 |
| io.smallrye:smallrye-graphql-client-implementation-vertx | 2.8.4 |
2.9.2 |
| org.eclipse:yasson | 3.0.3 |
3.0.4 |
| org.apache.commons:commons-lang3 | 3.14.0 |
3.17.0 |
| org.apache.commons:commons-compress | 1.26.2 |
1.27.1 |
| org.slf4j:slf4j-api | 2.0.13... |
Bumps the docs group with 10 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| @docusaurus/core | 3.4.0 |
3.5.2 |
| @docusaurus/preset-classic | 3.4.0 |
3.5.2 |
| @docusaurus/theme-mermaid | 3.4.0 |
3.5.2 |
| [c... |
while working on a different issue, it seems like we are not using sdkVersion when loading aliased sdk.
Fixes https://github.com/dagger/dagger/issues/8291.
Previously, extracting the git tags from a URL skipped a level of url pre-processing that was in buildkit (essentially, one that allowed no protocols in URLs). We need to add this level of pre-processing manually.
Without this, parsing module refs of the form "github.com//@" would fail with:
! failed to resolve git tags: select: git command failed: exit status 128
Error: failed to get module ref kind: input: moduleSource resolve:...
Initial report by @smolinari
Now that we publish a new Helm version whenever there is a new Dagger version, we should not allow specifying different versions for Dagger.
We should still support setting custom images in case someone wants to use a specific image variant. We should add a comment warning which explains why the two versions need to be kept in lock-step.
I have an existing repo with go code in the ./go directory and a go.work file in the root. The go directory contains modules that are private and can only be fetched with a valid ssh key.
go.work
`go 1.23
use ./go
I instantiate the dagger like this:
# This works
$ dagger init --sdk go --license ""
# This also works
$ dagger develop
When running dagger functions i get the following output.
โ conne...
fixes #6655
As discussed on the ticket, we are now using a static list of supported sdk to come up with the error msg (to keep it in sync with the actual builtin sdk's) and doing it on server side.
~/go/src/github.com/dagger/testme (cloud-docker/ap-south-1)
$ ../dagger/hack/with-dev dagger init --name testme --sdk foobar
Full trace at https://dagger.cloud/rajatjindal/traces/ffb2887ad89ec3fb95c8d4c98f12ea6f
โ connect 0.2s
โ cache request: mkfile /schema.json 0.0s
โ mkfile /...
This should prevent the weird helm test failure described in https://github.com/dagger/dagger/pull/8268#discussion_r1736117495 and https://github.com/dagger/dagger/pull/8299#issuecomment-2324783582, which happens when we bump the appVersion in the Chart.yaml to a version of the dagger engine that hasn't yet been released.
Potentially conflicts with https://github.com/dagger/dagger/issues/8301, but I'm not quite sure of another good approach here :thinking:
I realized that the sdkVersion defaults to engine.Tag and in a released version it would be a semver release version. The unit tests didn't consider that in the original implementation.
The unit tests have now been modified to set an engine.Tag to simulate real usage, and validation logic has been fixed to account for that correctly. I have also added several additional tests to cover these scenarios.
This PR also modifies the function parseSDKName to include basic validation, whi...
We are trying to run the UI Playwright tests and export the test results to the host machine. This works fine when all tests pass. However, when there is a test failure, the container exits with error code 2 and does not export the test report.
func (m *Demo1) RunTest(ctx context.Context, source *dagger.Directory) *dagger.File {
// Connect to the Dagger eng
container := dag.Container().
From("mcr.microsoft.com/playwright:v1.46.1-...
The schema reference generation takes the schema.graphqls file as input, so each generate step effectively required two passes. This is kinda messy, so we should just feed one generation step into the next.
This is kinda neat, since the dagger engine will deduplicate the schema generation, so we don't end up computing it and generating it twice.
Create a uv.lock file instead of requirements.lock on dagger init, with dependency to generated ./sdk library ready to go, and update documentation recommending new project management workflow using uv.
uv 0.3.0 was released two weeks ago, finally stabilizing uv.lock and generally making end-to-end project management (and more) ready for produ...
Most other tools default to it already. I think it's time. Users can pin an older version like 3.11 easily, for example, with a .python-version file:
3.11
private-modules don't work with the Dagger Windows binary release, because Windows does not recognise export SSH_AUTH_SOCK. This is because on Windows, SSH is handled through a system wide OpenSSH pipe. \.\pipe\openssh-ssh-agent.
I think both documentation needs to reflect this and a discussion around features supported or unsupported with the different dagger binaries is needed.
:json from Erlang 27 and drop :jason. Now dagger_codegen has no dependency anymore!Before:
After:
 this dramatically slows down their pipelines. Similar to what we do for layers, we want cache mounts to be synced on-demand.
When a container gets executed we will download the cache volumes that will be used for it. This will only happen once per cache volume during the lifetime of the engine.
[!CAUTION]
This change will make in...
0.12.6
dagger core dagger-engine local-cache
Some output on the terminal, possibly useful, with no side effects.
The local cache is pruned
prune() is a function which returns a scalar, and has no required arguments, so it gets selected by the "auto-print filter", and is called.
Fix Type.from_map/1 crash when the description may not present in the schema json file when that schema generated from module.
The MinConnectTimeout was set to 1s which is good for a fast recovering from the situation that the engine is not ready to accept connections, while at the same time, it's too aggressive for a remote engine, eg. Dagger Engine on a Kubernetes [1], the engine may not complete the connect phase within the deadline and always failed in the connection checking loop [2].
Until the buildkit implements the better way of client creation [3], increase the timeout with a less aggressive 3s could ...
Occasionally, this error appears:
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=
Seen in:
Seen last in https://github.com/dagger/dagger/actions/runs/10692693511/job/29641584369?pr=8241 (but I also do think I've seen this flake out before):
Stdout:
marshal: json: error calling MarshalJSON for type *dagger.GeneratedCode: input: container.from.withEnvVariable.withDirectory.withWorkdir.withMountedCache.withEnvVariable.withMountedCache.withEnvVariable.withExec.file resolve: evaluating released result
Error: input: moduleSource.withContextDirectory.asModule resolve: fa...
Previously, if a field access was made immediately after the default constructor was called, then the access would fail (because the field had not been set).
So, in this case, we try and convert a nil value, to get the default value for this.
Case list of enum didn't handle properly, cause to enter default case, return struct rather than convert all enums to proper value.
And in this bump mneme, the snapshot testing library in codegen to fix the issue https://github.com/zachallaun/mneme/issues/85.
When writing a function like this:
defmodule GithubWorkflow do
@moduledoc """
GitHub Workflow definitions.
"""
use Dagger.Mod.Object, name: "GithubWorkflow"
@doc """
Returns a container that echoes whatever string argument is provided.
"""
defn pipelines() :: [Dagger.GhaPermission.t()] do
dag()
|> Dagger.Client.gha(dagger_version: "v0.12.7")
|> Dagger.Gha.with_pipeline(
"integration test",
"echo 'he...
Dagger has no equivalent to go doc: an easy way to get API documentation for a module's available types and functions.
There is dagger functions, and dagger call --help, but it's not as complete or useful.
Implement a command-line equivalent of Daggerverse module docs & core API reference docs. Possibly make them call Daggerverse to reuse existing docs generation capabilities?
This is related to:
Create a convenience in the API for a Container.run function that executes the entrypoint + default arguments and returns the combined stdout and stderr output.
It was brought to my attention by @jpadams that, because the CLI is more and more powerful, he wanted to play with the alpine/git image but expected it to work more like docker run. Itโs simple to see what the image does ...
Bug found: #1280527928861655112 message
I believe it is linked to the lexical relative path function: https://github.com/dagger/dagger/blob/main/engine/client/pathutil.go#L9-L12
Updates to https://github.com/opencontainers/runc/releases/tag/v1.1.14, which includes a fix for https://github.com/opencontainers/runc/security/advisories/GHSA-jfvp-7x6p-h2pv.
Low severity, but no reason to not take this.
Update Function page to include contextual value. Add examples with code snippets.
Discovered during support in Discord.
In order to document a constructor-only argument you canโt wrap Annotated[InitVar[str], Doc("...")] because the dataclass transformation wonโt see it, however doing the inverse also doesnโt work:
@object_type
class Example:
url: dataclasses.InitVar[Annotated[str, Doc("So...
Functions annoated with @func() on abstract classes are not visible when extended to a concrete class.
v0.12.7
I've got an abstract class:
export abstract class PackageManager {
protected readonly version: string;
protected readonly directory: Directory;
protected abstract image: string;
protected abstract executable: string;
constructor(directory: Directory, version: string) {
this.directo...
Use generics to construct classes within a single function, to provide an easy to use NodeJS factory function for any package manager.
type newPackageManager = new (directory: Directory, version: string) => T;
@func()
withPackageManager(
type: newPackageManager,
directory: Directory,
version: string
): T {
return new type(directory, version);
}
This should allow me to offer a nice API, such as:
dag.nodejs().withPack...
Based on [a discord chat](#1281272011024236624 message), it might be possible for a function to identify the module that called it.
If that's true, then we should disable this. We don't want functions behaving differently based on who is calling them. The correct way to configure a function's behavior, is with an argument.
Disable the ability for a function to know its caller (if in fact it exists)...
Adds a "Dagger Module Ref Schemes" section to our docs, covering:
Fixes https://github.com/dagger/dagger/issues/8259
This was incorrectly rendering some carriage return output (outside of certain test cases). To handle this, we need to track a proper cursor, which is a bit annoying, but unavoidable.
The approach in https://github.com/dagger/dagger/issues/7653 wasn't quite right (since \r\n would essentially wipe the entire contents of the line). But also, what silly unix tool would produce windows-style newlines like that? (apt, that's who)
Now that the chart version moves in lock-step with the app version, we want to remove the app version so that we minimize the change for incompatibilities, as was the case in https://github.com/dagger/dagger/issues/8301.
The options are:
A. You want a custom app image, and then you are responsible for making sure that the chart is compatible with your image OR
B. You use the default image which we ensure that is compatible with the chart we publish.
The third option is to use this YAM...
Mostly opening this one for tracking, I've seen this a few times now:
Error Trace: /app/core/integration/platform_test.go:186
Error: Received unexpected error:
input: container.from.withMountedCache.withExec.sync resolve: process "sh -x -c cat /cache/s2r819a2l1q07r1x64xvzwajylinux/amd64/uname | grep 'x86_64' && cat /cache/s2r819a2l1q07r1x64xvzwajylinux/arm64/uname | grep 'aarch64' && cat /cache/s2r819a2l1q07r1x64xvzwajylinux/s390x/uname | grep 's390x'" did not ...
I'd like to be able to decoration functions and be able to run them as a group.
@func()
@label(["Test"])
myFunction () {
}
and run like:
dagger call --label test
Currently we can add an aggregate function which calls all the functions needed, but a mroe dyanmic approach that reduces boilerplate seems to be a common thread of improvement for Dagger.
I am writing a Dagger Module that tests a local Dagger Module.
For this, I want the runtime to be Bun; but specifically I'd like it to execute the code with bun test to take advantage of the assertions and expectations.
I'd like a function like this to be able to show bun test output and get useful information on my pull-requests rather than generic Dagger failure messages.
Failures with the bun test output should p...
I'm trying to move deps.get out of the entrypoint in runtime and got this error:
Error: response from query: input: potato.containerEcho resolve: call function "ContainerEcho": process "mix cmd --cd /src/sdk/elixir/potato/potato mix do deps.get --only dev + dagger.invoke" did not complete successfully: exit code: 1
Stdout:
Resolving Hex dependencies...
Resolution completed in 0.035s
Unchanged:
jason 1.4.4
nimble_options 1.1.1
** (ArgumentError) err...
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.
A Dagger function can't access its client's platform (OS and arch). As a result, the only way to build a native binary for the client, is to request mandatory arguments.
For example:
dagger call native-build --os=$(uname -s) --arch=$(uname -m) -o .
Instead I would like to do:
dagger call native-build -o .
Apply the same "context access" model as for contextual directories:
Dagger v0.12.5 added a ulimit call in the engine entrypoint, breaking podman running in rootless.
This allows the call to fail with a warning (the ulimit can be done manually by the user if needed).
It's tricky to test because the latest version of dagger (v0.12.7) does not run on podman rootless (both root mode VMs do not share any data), so you cannot build the engine in rootless to test this change. I had to build the engine in rootful, export the dagger-engine.dev container, expor...
[!WARNING]
Depends on #8149.
There's a rather nasty bug with // +private fields (and the equivalent in python/typescript). If an ID is stored in there, we have no way of knowing it's there.
As discussed in discord, it's not feasible to expose each private field to the API - there may be data in there that cannot be exposed to the API (e.g. today maps are a big case), but there may definitely be others. For ...
Remove Include usage in context directory to only use excludes negation since it seems it works.
Add a couple of tests to verify that behaviour.
Fixes #8287
I spent quite some time today trying to replicate Solomons example of Gha module with submodule examples folder to have examples and show them on the daggerverse. I ran into a lot of issues and was confused with the output of the CLI tool, i was trying to follow as close as possible solomons Gha module. It turns out the missing piece of the puzzle was not doing git init in the main parent module!!
I managed to get this problem installing local modules but only o...
I have dagger in a few repos, and they may be different versions of dagger, and these may also differ from my dagger version when calling dagger run foo.
I really hate when I'm running a build from one repository, and then start a second build and it kills the docker container from my first build due to differing versions. I wish there was a way this could just fail the mismatched build rather than breaking my previously started build.
Example:
Repo ...
@quaint umbra ๐
This PR addresses issues with SSH_AUTH_SOCK handling and improves test coverage:
The decision to avoid making the SSH_AUTH_SOCK path relative is based on several fa...
Yes!!
This changeset add support for optional argument when user defined type of the argument as AType | nil. Let see the example:
defmodule Potato do
@moduledoc """
Potato module
"""
use Dagger.Mod.Object, name: "Potato"
defn hello(name: String.t() | nil) :: String.t() do
if is_nil(name) do
"Please give me a name. ๐"
else
"Hello, #{name}"
end
end
end
When calling hello function without argument:
wingyplus@WINGYM...
I found that this error happens when adding a context.Context field in the module's struct.
Like this:
type DaggerBugMinimal struct {
Context context.Context
}
Running any function while having a Context field results in an error:
Error: generate code: template: module.go.tmpl:85:3: executing "_dagger.gen.go/module.go.tmpl" at : error calling ModuleMainSrc: cannot code-generate for foreign type Context
dagger ...
deps.get out of the entrypoint.--only dev to deps.get to ensure we have only necessary dependencies for invoke a function. entrypoint.Addresses a high severity stdlib vulnerability that could cause panics in deeply nested gob decoding. Trivy flagged this in our engine image scan.
โ ๏ธ Needs #8367
The function arguments can now annotate metadata by using a tuple
({}). The current metadata now support only:
:doc - The argument description.:default_path - The context directory.:ignore - The ignore patterns.The default value is not included in this commit.
"The only way dagger install will actually allow you install ../../, is if the project has a .git, as it needs to know what the scope of the project is. This is not documented anywhere when using dagger install. I think it would be useful for both the CLI and docs to mention this clearly.
Bumps the engine group with 28 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/a-h/templ | 0.2.731 |
0.2.778 |
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
1.1.0 |
| github.com/containerd/containerd | 1.7.20 |
1.7.21 |
| [github.com/containernetwo... |
Bumps the sdk-python group with 2 updates in the /sdk/python/runtime directory: python and astral-sh/uv.
Updates python from 3.11-slim to 3.12-slim
Updates astral-sh/uv from 0.2.32 to 0.4.7
Release notes
Sourced from astral-sh/uv's releases.
0.4.7
Release Notes
Enhancements
Add --no-emit-project and friends to uv export (#7110)
Add --output-file to uv export (#7109)
Prune unused source distributions from the cache in uv cache prune (#7112)
Take inte...
Bumps the docs group with 11 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| @docusaurus/core | 3.4.0 |
3.5.2 |
| @docusaurus/preset-classic | 3.4.0 |
3.5.2 |
| @docusaurus/theme-mermaid | 3.4.0 |
3.5.2 |
| [c... |
Bumps the sdk-typescript group with 13 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.11.2 |
| @opentelemetry/exporter-trace-otlp-grpc | 0.52.1 |
0.53.0 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| [@opentelemetry/sdk-node](https://github.com/open-telemetry/opent... |
Bumps the sdk-java group with 11 updates in the /sdk/java directory:
| Package | From | To |
|---|---|---|
| io.smallrye:smallrye-graphql-client-api | 2.8.4 |
2.10.0 |
| io.smallrye:smallrye-graphql-client-implementation-vertx | 2.8.4 |
2.10.0 |
| org.apache.commons:commons-lang3 | 3.14.0 |
3.17.0 |
| org.apache.commons:commons-compress | 1.26.2 |
1.27.1 |
| org.slf4j:slf4j-api | 2.0.13 |
2.0.16 |
| org.slf4j:slf4j-simple | 2.0.13 |
2.0.16 |
| [org.junit:junit-b... |
In our services we rely on dagger to run go test for our services, some of our services have quite long test logs (in the megabytes). Dagger cuts off this response if it gets too large before sending it to the client, this leads to it missing out on details.
Using the output from dagger engine itself could work, but it doesn't give us any control over the response, and we need it for parsing the errors and whatnot. Our only other option is putting the respo...
I would like to make it easier to install a module from the root of a Git repository, especially useful for mono repositories.
While this may seem confusing, it's a pretty nice syntax and Dagger already blocks its usage outside of a Git repository; why not allow this and provide a warning when used that it's scoped to the Git repository instead of blocking it?
dagger install /dagger/MODULE
...
[!WARNING]
GoReleaser is not yet available. Merge after it ships.
As soon as https://github.com/goreleaser/goreleaser/pull/5126 ships in GoReleaser v2.3.0 this can be merged.
Fixes the Go v1.23.1 requirement when publishing the CLI: https://dagger.cloud/dagger/traces/5b2e5658cf5f372fc6efb57b385f608a#309ba7d23cd65cbd:L84
Follow-up to:
If we can't wait, we should consider replacing GoReleaser with Dagger.
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 easy nor well documented.
Make it completely seamless to test Dagger modules, and document it well.
Currently, +ignore doesn't support multi-line declaration so I need to declare it on a single line. What I want to purpose is make it support multi-line. For example:
// +ignore=[
// "**/*",
// "!generated/",
// "!src/",
// "!scripts/",
// "!composer.json",
// "!composer.lock",
// "!LICENSE",
// "!README.md"
// ]
Single-line ignore is hard to read when t...
This is purely structural refactor so that a WebAssembly-based frontend can reuse this code without choking on the Bubbletea package dependency.
I'll have a lot more diffs on top of this later, so wanted to split it out so they don't get lost in all the other code being tossed around.
NB: the naming here isn't amazing but would rather just blindly stick to it for now to make my life easier trying to land all the other changes on top.
There seems to be a flake on the socket mounting, when running the test suite in parallel: socket default not found.
A bit confused by this error: https://dagger.cloud/dagger/traces/6d3e1fd82f7bb9ee5ff855155a6f9e97?span=c24cdc1442769090#c24cdc1442769090:L5
Bumps the engine group with 28 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
1.1.0 |
| github.com/containerd/containerd | 1.7.20 |
1.7.22 |
| github.com/containernetworking/cni | 1.2.2 |
1.2.3 |
| [g... |
When loading a module remotely, .git is stripped from the module's context directory. This breaks functions that rely on accessing .git.
Example:
func GitHead(
// +optional
// +defaultPath="/.git"
gitDir *dagger.Directory,
) *dagger.File {
return gitDir.File("HEAD")
}
This function will work when loading the module locally:
dagger call -m . git-head
But it will not work when loading remotely:
dagger c...
Allows you to poke around the DAG after the command completes, rather than closing. Just a quick feature that helped me out while working on the TUI itself.
Previously OTLP log data recorded into the client's SQLite database was dropping somewhat important information such as the OTel resource that generated the logs. I noticed this while investigating duplicate logs in Cloud, since half of them had a blank resource, and half of them didn't - the root cause of that ended up being https://github.com/open-telemetry/opentelemetry-go/issues/5782 but that blank resource value seemed worth fixing anyway, and led to a few other refactors which I'll expl...
Changes relative path root to root source dir instead of source dir based on #1280818249633890365 message
Adapt tests based on that.
Bumps the engine group with 27 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
1.1.0 |
| github.com/containerd/containerd | 1.7.20 |
1.7.22 |
| github.com/containernetworking/cni | 1.2.2 |
1.2.3 |
| [g... |
This is a split from:
In queue:
Arg, deprecated in https://github.com/dagger/dagger/pull/8109When running a module from a subdirectory, the parent directory gets uploaded to the Engine:
# ...
cache request: upload /var/folders/z5/n5y08g4j073_ld2d9019j3_80000gn/T/tmp.s1fViQInu2/dagger from 45fhofmgv7lscg6ac23c50pz3
upload /var/folders/z5/n5y08g4j073_ld2d9019j3_80000gn/T/tmp.s1fViQInu2/dagger from 45fhofmgv7lscg6ac23c50pz3
copy upload /var/folders/z5/n5y08g4j073_ld2d9019j3_80000gn/T/tmp.s1fViQInu2/dagger from 45fhofmgv7lscg6ac23c50pz3
# ...
`...
Run an update check in the background and notify if updates are
available. This is a best effort check: if not completed by the time the
command completes, then the check is cancelled.
Bumps the sdk-typescript group with 12 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.11.2 |
| @opentelemetry/exporter-trace-otlp-grpc | 0.52.1 |
0.53.0 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| [@opentelemetry/sdk-node](https://github.com/open-telemetry/opent... |
This is a follow-up to:
Given the following host:
noefetch
///////////// gerhard@h22
///////////////////// -----------
///////767//////////////// OS: Pop!_OS 22.04 LTS x86_64
//////7676767676////////////// Kernel: 6.9.3-76060903-generic
/////76767//7676767////////////// Uptime: 31 days, 7 hours, 31 mins
/////767676///*76767////...
The path for agent.socket is being evaluated as a URL, escaping spaces for example on darwin, which gave values like %20 for space etc.
v0.12.7
No response
No response
When you have a beautiful chain of 20 function calls, no error checking end-to-end... except the one in the middle, then you're forced to break your chain, plumb error checking all the way up... So much beauty ruined.
Allow me to attach an error to the container, so that it is lazily returned to the caller, and I don't have to deal with error passing in my code. Example:
func Beautiful(ctx context.Context) *dagger.Container {
return dag.Contai...
We are trying to build a golang code once it complied we are try to use scratch as base image and just put the executable go binary.
############################
############################
FROM golang:alpine AS builder
RUN apk update && apk add --no-cache git
WORKDIR $GOPATH/src/mypackage/myapp/
COPY . .
RUN g...
No response
No response
No response
This may result in a surprising behaviour, as captured in:
You can still set this if needed, we are just removing it as the default option.
So that we can compare the two different workflows side-by-side. This is something that we have learned ~2 weeks after the last test suite split:
We know that the split suites are faster & more reliable, but without this change, we cannot compare the two workflows side-by-side. All that we know is that the Engine & CLI workflow is failing more often (flakes are now 2x as likely to happen). This change will show us how all the tests, but split d...
Add support for default path and ignore in modules created using the PHP SDK.
Signed-off-by: Marcos Lilljedahl
This needs to match the bun version that we use in the SDK code.
Fixes the failing main provision tests: #1280818249633890365 message
This likely broke after merging #8237.
Missed that it was appearing twice in this file.
Let's pretend I've created a generic reusable module, golang - it can build, test, lint, generate docs, etc, everything I want a module to do.
I want to install this module as a dependency to my project. Because golang is a good module, it even supports setting the version in the constructor.
But there's an issue with this - if I want to call golang at multiple points in my module, and I need to pin the version everywhere, today I have a few options:
version e...Dagger functions can currently return an error OR any other value but they can't do both at the same time. This makes it impossible to implement pipelines steps that may fail (and ultimately should fail the pipeline), but always yields some report. Typical example: test or lint results.
ref: https://discord.com/channels/707636530424053791/1275216033862647890
Similarly to how other CI pipeline steps currently...
Bumps the engine group with 26 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
1.1.1 |
| github.com/containerd/containerd | 1.7.20 |
1.7.22 |
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| [github.com/... |
The instances running these have either 32 or 48 CPUs. By explicitly setting the parallelism to 16, we are artificially making these runs slower. In the past, this was necessary since we had race conditions, and slower disks.
Having performed a bunch of local runs on an i9 13900KS and TMPFS (a.k.a. RAMDISK) this artificial limitation is making runs about 20% slower on average.
Let's see how well removing this limit works in our single tenant CI runners.
[!note]
This is my own brainstorming epic, just putting it out there to allow me to reference it in discussions. It also provides an overview on the subject, allows for tracking and contributions to the conversation, but should create separate issues to facilitate discussion and tracking progress on specific items.
We have a problem with some terminology. When Modules were being developed, we used the same names for things that have a more expanded meaning in that conte...
right now this is uploading everything which takes quite a while
TestDev is not a suite that exists. Not sure what this is doing here, I don't think this has an effect?
Even if it did have an effect, it looks like it would be doing the opposite?
Looks like this was introduced here: 8ec2238 (#8212)
This adds expanding environment variables in WithNewFile. ref: #7951. If this looks OK, I will add similar changes to other API's in this same PR.
No response
No response
No response
We added a bunch of new workflows that we have not been tracing. This fixes it. Follow-up to:
Fixe based https://github.com/dagger/dagger/pull/8369 and @helderco feedbacks
Without this fix
dagger call -m github.com/wingyplus/dagger/sdk/php/runtime@cd3a3e724aa5a2ce259fe6b217f0efe5abaaabcb source-dir
_type: Directory
digest: sha256:4efcbbc3978405e30f078b41ff5acb6a0d1f6084906a42d3cf32d4377190a414
entries:
- .changes
- .changie.yaml
- .gitattributes
- .gitignore
- .php-cs-fixer.dist.php
- CHANGELOG.md
- LICENSE
- README.md
...
First off, I'm very grateful for the work done to get #7708 merged. Thanks to all who contributed to getting that out the door.
That being said, I'm confused on how I can actually use the feature since there's no documentation around it and I don't know how much of the discussion on that PR is part of the actual implementation vs forward-thinking conversations.
Context: I have a private module hosted on GitHub that I'd like to run as part of a GitHub Actions pipeline. I'm currently doi...
Hi @hariscodes, docs was just updated: https://docs.dagger.io/manuals/user/remote-repositories ๐
Currently only authentication via SSH refs is possible, PAT support is ongoing
Hi @hariscodes, docs was just updated: https://docs.dagger.io/manuals/user/remote-repositories, module ref is detailed there ๐
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 anywhere, we can rely on the git-ref.sh script everywhere it seems (or at least, that's what we're currently doing and it works).
Make Elixir SDK consistent with PHP (in #8369), the include patterns is now moved to +ignore directive.
Update ModuleFunction.setCallInputs to apply ignore patterns on Directory that have ignore as metadatas.
Update ResolveDirectoryFromCaller arguments to supports optional ignore argument.
Update CLI Directory handling to also apply ignore on Directory if ignore is set.
Still need to add tests, I only manually tested now.
Example with Typescript:
import { Directory, object, func, argument } from "@dagger.io/dagger"
@object()
class Test {
@func()
ignoreDir...
They are getting disrupted often, and that becomes annoying after a few weeks of turbulence.
Before we can merge this, need to introduce dind-od instances.
Right now we show you how to add multiple env var in container but not a single one. We should show both in the cookbook.
https://docs.dagger.io/cookbook/#set-environment-variables-in-a-container
I can access files "embedded" in my module source, with dag.CurrentModule().Source(), which is super practical. But if I make a mistake and the file is not there, I will not get an error when loading the module - only when calling the particular function that uses the file. I just got bit by this today.
It would be great if missing embedded files were detected at module load. This would give me more confidence that I am not shipping my module with a hidden fl...
I don't think the CLI is supposed to return with a go panic.
panic while resolving Directory.digest: runtime error: invalid memory address or nil pointer dereference followed by a large stacktrace
dagger v0.13.0 (registry.dagger.io/engine:v0.13.0) windows/amd64
dagger call directory - happens on windows/linux afaik
I checked if a more 'legimate' usage was also broken, such as `dagger core directory with-new-direc...
I have an Astro project (what is Astro?) that was daggerized. Whenever I run npm run build to statically build my project, I got several TypeScript errors because the command also runs, by default, astro check (this behaviour can be altered by changing the project's package.json though).
I can fix it by:
dagger to .daggerThere is scenarios where we are creating golang executable binary at first step and in second step we want to use the binary but not creating a container only we want to build image using binary.
Could you please help on this use care in dagger. thanks
No response
No response
Perhaps this is by design, but I can currently do the following:
@object()
class RawkodeAcademy {
@func()
config(): Config {
return new Config();
}
@func()
myString(): string {
return "hello";
}
}
but I can't do the following:
@object()
class RawkodeAcademy {
@func()
config = new Config()
@func()
myString = "hello";
}
0.13.0
Users often with use _EXPERIMENTAL_DAGGER_RUNNER_HOST during development with a dev engine or in corporate environments where they are using a custom engine with certs or proxies set. It's all too easy to leave that env var set in your shell (or in CI) when you intend to use a released Dagger engine via the dagger CLI, for example.
see also: https://github.com/dagger/dagger/issues/6599
We should give users informative messages if `_EXPERIMENTAL_DAGGER...
Follow up to:
With the new uv: Unified Python packaging, and Python Dagger Modules now using uv.lock by default, it's time to update our docs and make uv our main recommendation to develop Dagger Modules with Python, which simplifies workflows.
Currently it's pretty awkward to fetch all output from an exec, this could be made simpler:
withExec().stdAll() or withExec().output()
No response
No response
Hi
I'm getting this error during test
Error: ../../../go/pkg/mod/dagger.io/dagger@v0.13.0/telemetry/exporters.go:92:23: cannot use log (variable of type "go.opentelemetry.io/otel/sdk/log".Record) as *"go.opentelemetry.io/otel/sdk/log".Record value in argument to e.OnEmit
dagger v0.13.0
No response
No response
Dagger SDKs have access to the entire context of their host project. This allows for in-depth integration, but it also creates the risk of SDKs accidentally interfering with the project. This risk increases with the number of SDKs, and the fragmentation of host projects (different package managers, different conventions, etc).
Recently I have noticed an increase in the number of users reporting problems of this nature.
I propose sandboxing SDKs. This would p...
instrument both layer and cachemount downloads with corresponding OTEL
spans along with their corresponding layer digest and size.
Signed-off-by: Marcos Lilljedahl
When we write a Dagger module, we need a package.json, go.mod, etc.
These files contain version information that can be consumed by the Daggerverse publishing process.
Currently, we're expected to use Git tags, which when used in a repository housing many modules is far from ideal; mostly because Git and GitHub just don't expect developers to work in this paradigm.
I'd like to see the package manager file used and mapped to a SHA rather than litter...
Bumps the engine group with 27 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.51 |
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| github.com/charmbracelet/bubbletea | 0.26.6 |
1.1.1 |
| github.com/containerd/containerd | 1.7.20 |
1.7.22 |
| [github.com/... |
Bumps the sdk-python group in /sdk/python/runtime with 2 updates: python and astral-sh/uv.
Updates python from 8ac54da to 15bad98
Updates astral-sh/uv from 0.4.9 to 0.4.10
Release notes
Sourced from astral-sh/uv's releases.
0.4.10
Release Notes
Enhancements
Allow uv tool upgrade --all to continue on individual upgrade failure (#7333)
Support globs as cache keys in tool.uv.cache-keys (#7268)
Add Python package (main.py) support to uv run (#72...
Bumps the docs group with 12 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| @docusaurus/core | 3.4.0 |
3.5.2 |
| @docusaurus/preset-classic | 3.4.0 |
3.5.2 |
| @docusaurus/theme-mermaid | 3.4.0 |
3.5.2 |
| [c... |
Bumps the sdk-go group with 5 updates in the /sdk/go directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.51 |
| github.com/adrg/xdg | 0.4.0 |
0.5.0 |
| go.opentelemetry.io/otel | 1.27.0 |
1.30.0 |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemet... |
Bumps the sdk-typescript group with 13 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.11.2 |
| @opentelemetry/exporter-trace-otlp-grpc | 0.52.1 |
0.53.0 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| [@opentelemetry/sdk-node](https://github.com/open-telemetry/opent... |
Bumps the sdk-go group with 5 updates in the /sdk/go directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.51 |
| go.opentelemetry.io/otel | 1.27.0 |
1.30.0 |
| go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc | 1.27.0 |
1.30.0 |
| [go.opentelemetry.io/otel/exporters/otlp/o... |
Bumps the engine group with 9 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.51 |
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| github.com/moby/buildkit | 0.16.0-rc2.0.20240912123401-2a7accc029ec |
0.16.0 |
| github.com/vito/midterm | 0.1.4 |
0.2.0 |
| ... |
Partially fixes https://github.com/dagger/dagger/issues/8329.
The :mem: host here is really weird, I don't know the logic for it, but it makes for some very confusing error messages, so we should fix it to something more reasonable and recognizable.
I have a function that returns Secret[] and when I call it from the CLI it prints all the secret material to the terminal.
dagger call secrets
- _type: Secret
name: cloudflare.apiToken
plaintext: XXX
- _type: Secret
name: restate.host
plaintext: XXX
- _type: Secret
name: restate.apiToken
plaintext: XXX
- _type: Secret
name: restate.identityToken
plaintext: XXX
- _type: Secret
name: restate.adminApiToken
plaintext: XXX
- _...
Fixes https://github.com/dagger/dagger/issues/5981.
[!WARNING]
Depends on https://github.com/moby/buildkit/pull/5339 for the logic that actually makes this work.
Rawcode spotted an issue https://discord.com/channels/707636530424053791/1284180822135406656 where traces where no longer published to traces.
The issue is introduced by a change of the type from a plain JSON object to Headers which break the current opentelemetry propagator. This PR fixes that issue by using a custom injector to set the traceparent header
I have the following directory structure:
.
โโโ bar
โโโ dagger.json
โโโ LICENSE
And the following dagger function that uses context directory:
func (m *Lala) Test(
// +defaultPath="/"
// +ignore=["bar"]
dir *dagger.Directory,
) *dagger.Directory {
return dir
}
If I call dagger call test entries, I can see the barfile in the output. As discussed with @TomChv, the only way to make thebar` file getting actually ignored,...
Trying out a possible mitigation to https://github.com/dagger/dagger/issues/8031 (which is pending on an upstream go issue).
This changes the cache mounts for the Go SDK to be mode Locked, rather than Shared. This means that only one invocation of the Go SDK can run at a time (though the cache mount will still be re-used across different invocations).
The Go bug is not root caused, so it remains to be seen if this even actually avoids the pro...
Signed-off-by: Marcos Lilljedahl
Example:
I've only seen this one time so far, was after an OTEL related commit though.
cc @vito, not sure if this one is older and I just haven't seen it until now or if there's any chance of being related to that OTEL commit.
Sometimes a Dagger module needs to import code from the project it's embedded in. For example, in our own CI we use a distconsts package to share constants across the Dagger codebase, and the pipelines shipping it. Things like the default path of the engine's state directory; etc.
There's no officially recommended way to do this. What Dagger does for its own CI, is not mentioned in the docs, and we don't know whether it's a good pattern, because we haven't discussed it. So let's discuss ...
This is all theoretical still, but the flakes we see in the test would be explained by actual expected behavior: cache mounts are best effort and free to be pruned at any time. If the cache mount used in this test is pruned in the middle of it (between execs that use it), then we'd expect to see the errors we're getting of No such file or directory.
This attempts to deflake the test by running an exec in the background that has the cache volume mounted throughout the test.
Other possi...
Currently we use the secret scrubber just for the results of withExec - this is neccessary so we don't end up accidentally caching secrets in the output.
However, this isn't entirely sufficient - secrets can still appear in the logs, for example by calling dagger call get-secret plaintext (where get-secret is a field that returns a Secret). Since these logs are uploaded to dagger cloud, we should censor all the logs.
This will additionally have the effect of scrubbing the cli ou...
Noticed this from a support request in Discord.
Indents first level of indentation to 4 spaces,
This level of indentation matches standards: PSR2, PSR12, PER2
Was indented to 5 spaces for some reason.
Downside of leaving it at 5 spaces: it confuses a lot of IDE's and new code is misaligned until you manually correct the whole file.
There's been some confusion on following the recommendation for moving the code out of __init__.py. This is a quick fix to clarify how it's done but will have follow-ups:
This hopefully reduces the chance for cache invalidation by not including .venv inside the context directory on ModuleRuntime.
The Dagger API lets you manage the platform (OS + Architecture) of containers. But there are limitations in the API that make some use cases awkward, or sometimes impossible.
For example, given a Container that may point to a multi-architecture image, I can't select a platform:
// Return the version of an image for a specific platform, or an error if the platform is not available
func GetPlatform(img *dagger.Container, platform dagger.Platform) (*dagger.Conta...
When my function receives a container as argument, I can't set a default value for it. The way the CLI accepts a string value for container arguments, and interprets it as a remote Container.from() pipeline, could be used in the same way here. But it's not.
I would expect this to work:
func Foo(
// +optional
// +default="alpine:latest"
c *dagger.Container,
)
But it doesn't.
Make the above example work :)
The only way to create a symlink in a directory is to execute ln -s, which is not ideal.
Add Directory.withSymlink and Container.withSymlink to the core API.
See https://github.com/dagger/dagger/pull/8245#discussion_r1733172781 for context.
The previous module ID hashing just really isn't very stable - we can hash the contents for way better results.
Hi folks!
Sorry for my late response, I've been busy with other stuff.
f I understand correctly, you've prototyped the client library and need pointers to start on codegen to generate the library from the API schema next?
Is there a library in Swift to make GraphQL requests? Does it support making an "introspection query" or do you need to do it "yourself"? To be clear, you don't have to. You can get the introspection (as JSON) from our codegen CLI in the dagger/dagger repo.
I cou...
Deprecate Argument attribute.
Doc attribute has a single responsibility and is reusable.
Objects can have descriptions now. Demonstrated on this example module
Support description for base module.
This requires additional work as I need to identify the base object for the module.
Hi
From this: https://docs.dagger.io/manuals/user/chaining
Running this func:
dagger -m github.com/kpenfound/dagger-modules/golang@v0.2.0 call build --source=https://github.com/dagger/dagger --args=./cmd/dagger entries
Error: response from query: input: golang.build resolve: call function "Build": process "/runtime" did not complete successfully: exit code: 2
Stdout:
marshal: json: error calling MarshalJSON for type *dagger.Directory: input: contai...
Found from https://github.com/dagger/dagger/actions/runs/10903421041/attempts/1
1) test container with mounted cache (Dagger.ClientTest)
test/dagger/client_test.exs:126
match (=) failed
code: assert [ok: "1\n", ok: "1\n2\n", ok: "1\n2\n3\n", ok: "1\n2\n3\n4\n", ok: "1\n2\n3\n4\n5\n"] = out
left: [ok: "1\n", ok: "1\n2\n", ok: "1\n2\n3\n", ok: "1\n2\n3\n4\n", ok: "1\n2\n3\n4\n5\n"]
right: [
ok: "1\n2\n3\n4\n5\n1\n"...
This isn't set up right - it ends up stranded, establishing itself as the root span of its own trace.
I'm not sure if we got much from this span, but if we want to bring it back we might need to wait to do it until after we set up the frontend + root span (in cmd/dagger/engine.go).
Bumps the engine group with 9 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.53 |
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| github.com/moby/buildkit | 0.16.0-rc2.0.20240912123401-2a7accc029ec |
0.16.0 |
| github.com/vito/midterm | 0.1.4 |
0.2.0 |
| ... |
Current engine / client communication relies on the url.URL type to encode / decode different kinds of socket path:
However, this leads to some encoding issues for the unix path: spaces are converted to %20, special chars are escaped.
This PR fixes it and adds a corresponding test
This is an attempt to move forward #4368, to do so, we need code to use .ts import extension so it can be handled by the Deno Runtime.
This PR fixes that issue so we'll only have to create a deno.json file, some runtime adjustment & we should be good to go.
On the daggerverse modules can have long and short descriptions..
PHP SDK Modules do not currently support this.
ValueObject\DaggerJsonFile
name property, should be the name of the module.getBaseClassName method, should return the expected name of the base class.Service\FindsDaggerJsonFile....Stop including all Go packages in a repo with every Go module within it, and give control back to the user on which files should be included outside the moduleโs root directory (i.e., the directory with the dagger.json).
The biggest reason for doing this is performance. Itโs also confusing to folks that this happens in the first place:
The RequiredPaths feature was added in v0.9.9, when Dagger Mod...
deno.json to map all deps importyarn test:deno command and making sure it worksci/sdk/typescriptdeno.json is detectednode_modules to run deno run?)TestTypeScript suite[!WARNING]
Still very work-in-progress :warning:
This is kind of a bundle of various different patches all to enable "better multi-module navigation". With the incoming work in #8355, we're gonna have even more modules than we currently do today (and we already have a few). Working on a multi-module project is quite difficult, and it's challenging to navigate between functions defined in different modules.
The end goal is to produce something like this (for a module dep that c...
ref: https://discord.com/channels/707636530424053791/1286344441950375986
When running dagger in a bug monorepo, because of the default SDK include and exclude patterns in the initialize phase, the engine can take quite some time (> 30s) to initialize.
I think part of this problem is that we're currently being very optimistic in the patterns that we set "just in case" the user decides to use some of his monorepo code into the module. Maybe a different approach here co...
dependabot erroneously bumped this to a lower version - what a jerk
This is a proof of concept for:
It reads all the .gitignore files from a git repo root, up to a module being loaded, and adds the patterns inside to the list of "excludes" in dagger.json automatically, to limit the files getting uploaded from the host.
Consider these .gitignore files:
.gitignore
.venv__pycache__sdk/python/.gitignore
.*_cachedist/docs/_ buildBumps the engine group with 8 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| github.com/moby/buildkit | 0.16.0-rc2.0.20240912123401-2a7accc029ec |
0.16.0 |
| github.com/vito/midterm | 0.1.5-0.20240307214207-d0271a7ca452 |
0.2.0 |
| [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp]... |
For a windows user running the installation against a version incompatible with the latest language features (looking at you... the user who holds onto Windows Powershell 5.1 until their last breath and still tries to use ISE ๐คฃ)....
PowerShell has language feature to put required version so the error message is more useful in the installation script.
[#Requires](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?v...
For windows users, should have a winget install version of the product.
This should reduce friction and probably would make it easier for a windows user to adopt.
I am trying to build a container with the Rust SDK and export it afterwards. Building the container works fine, but when trying to export it I get an error that seems to point to mismatched types somewhere in the API layer.
Unpack(Deserialize(Error("invalid type: boolean `true`, expected a string", line: 0, column: 0)))
dagger v0.13.0 (registry.dagger.io/engine:v0.13.0) darwin/arm64
First, create a new Rust cra...
I see it is already there https://github.com/microsoft/winget-pkgs/blob/master/manifests/d/Dagger/Cli/0.13.0/Dagger.Cli.yaml.
And has a PR to put it as an official one at https://github.com/dagger/dagger/pull/7620.
(cgroup monitoring is working, OTEL metrics pipeline is WIP, sending out in case I need to ask OTEL questions ๐)
My love for https://github.com/dagger/dagger/pull/8442 grows :cry:
It looks like this gRPC bump started causing this issue, cc @aweris:
failed to set call inputs: failed to load contextual arg "source": failed to load contextual directory "/": failed to import local module src: rpc error: code = Internal desc = received 4294967289-bytes data exceeding the limit 131128 bytes
This is distinct from issues like https://github.com/dagger/dagger/issues/6743, I've never actually ...
Came up as an idea when discussing with @shykes. Currently, we can use this pattern:
ctr = dag.
Container().
From("alpine").
With(func (ctr *dagger.Container) *dagger.Container {
if !dev {
return ctr
}
return ctr.WithExec([]string{"go", "env"})
}).
WithExec([]string{"go", "build", "-o", "binary", "./pkg"})
With can be used to easily insert little conditionals into the chain, without breaking it! However, it's a bit unwiedly. What would be really nice...
Bumps the sdk-go group with 4 updates in the /sdk/go directory: github.com/99designs/gqlgen, go.opentelemetry.io/otel, go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc and go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp.
Updates github.com/99designs/gqlgen from ...
Bumps the engine group with 10 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.53 |
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| github.com/docker/cli | 27.2.1+incompatible |
27.3.0+incompatible |
| github.com/docker/docker | 27.2.1+incompatible |
`27.3.0... |
This issue is a catch-all for a birdseye view on the general subject of SDKs integrating with existing projects or monorepos in Dagger modules. Specific ideas or proposals benefit from a dedicated issue though.
SDKs have 2 conflicting requirements:
This results in "wack-a-mole" situation where users encounter confusing errors when daggerizing, and require custom community suppor...
We ship containers based on the s6 init overlay, not the common default dumb-init. We want to use dagger to test this container, but it requires the containers that dagger spawns to be allowed to use a different init system.
Dagger does currently allow jobs to specify a custom entrypoint, so I thought this would work already. But dagger is still prepending it's own /.init process to it, which I find unex...
This change in my trivy module cuases the following error:
invoke: returned error 422 Unprocessable Entity: {"errors":[{"message":"Expected Name, found \u003cInvalid\u003e","locations":[{"line":1,"column":1677}],"extensions":{"code":"GRAPHQL_PARSE_FAILED"}}],"data":null}
dagger v0.13.1 (registry.dagger.io/engine:v0.13.1) darwin/arm64
See the above PR.
##...
Follow-up to:
When a dagger call chain ends in an object, the CLI selects every "no-arguments" function that returns a scalar value (primitive).
For example:
โฏ dagger call
_type: Playground
baseImage: python:3.12-alpine
cacheKey: playground-cache
Itโs very useful in many cases, but thereโs also the potential for **unwanted side-effect...
[!note]
This was requested by @shykes, and a follow-up to (or implemented at the same time):
It would be interesting to support printing objects recursively in the CLI.
Lists arenโt simple scalars, but they are already handled recursively via their element types. We can do the same for object types. When printing an object and checking for available functions, if function F returns an object, look for that objectโs fields and chain...
level=error msg="Running error: can't run linter goanalysis_metalinter\nbuildssa: failed to load package dagger: could not load export data: no export data for \"dagger/devex/internal/dagger\""
I noticed this and while I like not including the generated files, I think I might need them so the linting can succeed. Any ideas?
Sometimes I need information about the current state of the git repository for my context. Things like:
I can get some of this information indirectly with hacks, but it's not 100% reliable.
Add a core API to introspect git information about the context.
tested manually locally:
dagger on ๎ fix-version-nag [$] via ๐น v1.23.1
โฏ go build -ldflags "-X github.com/dagger/dagger/engine.Version=v0.13.2 -X github.com/dagger/dagger/engine.Tag=v0.13.2" -o ./bin ./cmd/dagger
dagger on ๎ fix-version-nag [$] via ๐น v1.23.1 took 2s
โฏ ./bin/dagger version
dagger v0.13.2 (registry.dagger.io/engine:v0.13.2) linux/amd64
dagger on ๎ fix-version-nag [$] via ๐น v1.23.1
โฏ ./bin/dagger core version
โ connect 0.3s
โ initialize 0.4s
โ prepare 0.0...
On a US keyboard, - does not require shift to be pressed, but + does (on the = key). This makes it annoying to adjust the verbosity quickly. This adds = as an alias for + so either can be used to increase the verbosity, and you can avoid using the shift key altogether.
This has been a paper cut for me as I try to turn up the verbosity to learn what dagger is doing and then trying to dial it back down to the default.
When running a build with the Tyepscript SDK this error causes the entire build to fail.
We have seen this happen in several different Typescript projects since 0.13 came out.
dagger v0.13.2 (registry.dagger.io/engine:v0.13.2) darwin/arm64
I run into this intermittently on this project: https://github.com/levlaz/medplum on the daggerize branch
dagger call build-matrix entries
I am not able to reproduce this co...
Custom spans haven't been working in Python since the move to the http OTLP exporter:
Simplest solution is to replace the package dependency from the grpc exporter to http, but apparently these env vars are no longer set by the engine too:
OTEL_LOGS_EXPORTER=otlpOTEL_METRICS_EXPORTER=otlpOTEL_TRACES_EXPORTER=otlp\cc @TomChv for TypeScript
There's a few env vars that SDKs need to set manually, but they're essential to telemetry and should be provided by the engine automatically:
OTEL_LOGS_EXPORTER=otlp
OTEL_METRICS_EXPORTER=otlp
OTEL_TRACES_EXPORTER=otlp
OTEL_EXPORTER_OTLP_INSECURE=true
OTEL_EXPORTER_OTLP_METRICS_INSECURE=true
OTEL_EXPORTER_OTLP_LOGS_INSECURE=true
OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
I want to simplify SDKs as much as pos...
Yes, I know https://github.com/dagger/dagger/issues/7703 was debated. Not sure if the typescript SDK is not fixed yet or what.
Dagger is a build system for end-user projects. You should never arbitrarily add a LICENSE file if one does not exist.
@helderco -- your comments specify the exact behavior end users expect:
dagger init --sdk .... -- no license file createdThe sdk/python/.readthedocs.yaml isn't being used yet. It's meant to replace the one at the root, but needs this fix before switching.
A module cannot return another module's type. This makes it harder to break down larger projects into several modules.
I'm not sure what the solution is.
I wonder if the dependency hell problems could be solved with name mangling?
For example:
...
So, at a high level, I have the following folders:
โโโ .yarn
โ โโโ berry
โโโ node_modules
โ โโโ .store
โโโ apps
โ โโโ skills
โ โ โโโ node_modules
โ โโโ stocks
โ โ โโโ stocks-api
โ โ โ โโโ node_modules
โ โ โโโ stocks-ui
โ โ โโโ node_modules
โ โโโ landing
โ โโโ node_modules
โโโ packages
โ โโโ pinnacle-layer
โ โ โโโ node_modules
โ โโโ typescript-config
โ โ โโโ node_m...
In a dagger.json's include/exclude patterns, make absolute paths (patterns starting with a /) relative to the moduleโs context directory (git repo root), while keeping relative paths relative to the dagger.json file.
The proposed solution for importing code from outside a module in a monorepo is to add dagger.json files to target directories and use them as module dependencies:
Look for and resolve cache misses in Pythonโs runtime module.
Weโve been steadily improving Pythonโs performance, with the introduction of uv:
But some of the pipeline improvements have yet to be properly measured and fine tuned. They were rushed out mostly on intuition. This was flagged in the [first issue](https://gi...
Create custom enumerations the same way theyโre generated by codegen.
Python enumerations are generated like this:
from dagger.client.base import Enum
class Severity(Enum):
"""Vulnerability severity levels"""
UNKNOWN = "UNKNOWN"
"""Undetermined risk; analyze further"""
LOW = "LOW"
"""Minimal risk; routine fix"""
MEDIUM = "MEDIUM"
"""Moderate risk; timely fix"""
HIGH = "HIGH"
"""Serious risk...
Generate a src/my-module package for new modules instead of the hardcoded src/main package.
The entrypoint for Pythonโs runtime container imports a moduleโs source code via an hardcoded import main:
This forces the moduleโs layout to always be under src/main (unless otherwise configured for the build backend), so every module ...
Bumps the sdk-typescript group with 14 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.11.3 |
| @opentelemetry/exporter-trace-otlp-grpc | 0.52.1 |
0.53.0 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| [@opentelemetry/sdk-node](https://github.com/open-telemetry/opent... |
Bumps the docs group with 12 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| @docusaurus/core | 3.4.0 |
3.5.2 |
| @docusaurus/preset-classic | 3.4.0 |
3.5.2 |
| @docusaurus/theme-mermaid | 3.4.0 |
3.5.2 |
| [c... |
Bumps the sdk-python group in /sdk/python/runtime with 1 update: astral-sh/uv.
Updates astral-sh/uv from 0.4.10 to 0.4.15
Release notes
Sourced from astral-sh/uv's releases.
0.4.15
Release Notes
Bug fixes
Revert "Treat invalid platform as more compatible than invalid Python (#7556)" (#7608)
Documentation
Add the execution policy to powershell installs for single versions (#7602)
Install uv 0.4.15
Install prebuilt binaries via shell script
...
Bumps the sdk-go group with 4 updates in the /sdk/go directory: github.com/99designs/gqlgen, go.opentelemetry.io/otel, go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc and go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp.
Updates github.com/99designs/gqlgen from ...
Bumps the engine group with 10 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.54 |
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| github.com/docker/cli | 27.2.1+incompatible |
27.3.1+incompatible |
| github.com/docker/docker | 27.2.1+incompatible |
`27.3.1... |
Apologies, my previous PR closed and I can't seem to reopen it even with the branch having the commit re-added.
Related to https://github.com/dagger/dagger/pull/8411#discussion_r1764090130
Deprecate Argument attribute.
Doc attribute has a single responsibility and is reusable.
Objects can have descriptions now. [Demonstrated on this example module](https://daggerverse.dev/mod/github.com/charjr/dagger-modules/test-php-doc@150bdd93729eb4cf2769f88f1f577487ea25a6a8#TestP...
People are confused over what "initialize" is, but more so with "prepare" when they try to understand whatโs slowing down their pipelines. We can make this slightly better by giving more descriptive names, but especially in a way that users are able to more easily make sense of why a step may be taking longer than expected.
Inside "initialize" thereโs also "installing module" and "analyzing module" which can be more descriptive as well.
Fixes https://github.com/dagger/dagger/issues/6999 (actually this time).
This PR follows-up on https://github.com/dagger/dagger/pull/8409, and ensures annotations are correctly attached for Container.Export and Container.AsTarball as well.
To have a better understanding of https://github.com/dagger/dagger/issues/8524 this PR display the cause field from the error object.
I couldn't find a GraphQL client in Swift with a builder-like interface to construct a query, so I built a simple thing myself for the sake of the prototype.
The Go SDK also has a custom query builder (and TypeScript SDK too). You can get inspiration here: https://github.com/dagger/dagger/tree/main/sdk/go/querybuilder
One thing to note is that the query builder doesnโt have to support every feature a usual third-party GraphQL query builder would, because we use a simpler single field ...
On windows, if one of the directories under dagger is a symbolic link then any dagger operation that loads the entire directory will crash.
This seems to be related to a well commented (and unresolved since May 2024) issue in the docker github repo docker/for-win/issues/14083 .
A simple way to fix this kind of issue would be to implement a .daggerignore analogous to .gitignore and .dockerignore, on a side note, running dagger init or dagger git on a 1...
Our test suite is slow and unreliable. While we fix that, we have created a split version of the same test suite, that can run on multiple machines. The split version is considerably faster and more reliable.
But we still run both versions of the test suite on each PR. As a result PRs still suffer from long check time, and frequent flakes.
There is a valid reason for continuing to run the slow test suite: fresh data for "flake hunting". But our contribution experience is p...
Make include/exclude patterns dagger.json relative to the context directory if they start with a slash (/).
The include and exclude patterns in a dagger.json are always relative to the dagger.json file.
But with the recent Context directory feature, module authors are able to specify a path that is either relative to the root directory, or absolute to the context directory.
Example for a `f...
When loading a module, the engine compiles a list of include/exclude patterns in order to filter the files that need to be uploaded from the host to the engine.
This is how the engine joins include patterns:
//dagger.json/**/*Notice that a moduleโs dagger.json patterns are added before anything else so it doesnโt have a chance to override anything thatโs more global like the entire root directory, or the SDKโs implicit includes (required paths).
The **ex...
Given how parseRefString works, it could happen that the ref parsed
yields to a StatCallerHostPath failure and also be a local ref as
well. This commit shorts circuits the function by exiting early and
avoiding an extra client RPC call
fixes #8398
Signed-off-by: Marcos Lilljedahl
this helps to easily open tunnel http endpoints from the terminal
Signed-off-by: Marcos Lilljedahl
Related to https://github.com/dagger/dagger/issues/7699
Two related commits here:
engine: log buildkit errors in right place to reveal stack traces
Previously we started logging buildkit solve errors with a %+v in
order to reveal the stack traces embedded in the errors by buildkit's
usage of github.com/pkg/errors, which in many places in buildkit is the
only way to get any extra informatio...
I've seen this one a handful of times in CI now, most recent occurrence a few commits ago on main:
The test case appears to be going as expected, the interactive container is opened after the failed exec, runs some commands, successfully sends exit and then the test hangs until the timeout on the whole suite of 30m is hit.
The next test case lines don't show up in progress output, so I'd guess i...
When using config from docs, got this error:
[31;1mFATAL: Could not handle configuration merging from template file[0;m [31;1merror[0;m=couldn't load configuration template file: toml: line 2 (last key "runners.environment"): expected a comma (',') or array terminator (']'), but got '='
Based on other vars set in the array, the last item seems to have 2 additional "
The npm packages version 0.13.2 and .3 lack the dist folder. As I couldn't find any information about a change like that I doubt this was intentional?
dagger v0.13.3 (registry.dagger.io/engine:v0.13.3) linux/amd64
No response
No response
This reverts commit f15c2996d26dbbc17bec4b6377629bdf1e934ddf.
Fixes #8559
Recently we have been noticing many examples where dagger engine aggresively uses up all available disk space and seems to never clean up after itself.
It is not clear if this is a new regression, or if we are getting a bigger wave of larger projects, but over the last few weeks there have been many different users that report these sorts of issues.
One example looks like this:
When loading a module that requires a more recent engine, the error is not clear:
Error: failed to generate code: input: moduleSource.withContextDirectory.withDependencies.asModule resolve: failed to create module: select: module requires incompatible engine version: version v0.13.3 is greater than supported version v0.13.1
Setting aside the general noise of our errors (a problem for another issue), this is still confusing:
`version v0.13.3 is greater than supported v...
The instructions we have for MacOS will not work because it tells you to cd /usr/local and then run the install script, but users do not have permission to install things in /usr/local by default.
This is part of wider refactor of our monolithic CI module. See #8355 .
Based on #maintainers message
Tested on https://github.com/TomChv/dagger-git-ctx-dir
Before:
dagger call -m https://github.com/TomChv/dagger-git-ctx-dir/go rel
_type: Directory
digest: sha256:d2a243922ee5ddef94022fdaf7f6159020750476eae9fb9784df5c9362aa0904
entries:
- go
After:
dagger call -m https://github.com/TomChv/dagger-git-ctx-dir/go rel
_type: Directory
digest: sha256:b...
Fixes https://github.com/dagger/dagger/issues/8562.
Previously, these could be a little tricky to read, so we rephrase them to make them a little easier to read.
Follow up to #7832 to also apply ignore pattern at the engine level when a directory is passed as argument to another module's call.
No response
No response
I've seen this happen in CI a few times now:
Most recent occurrence:
Seeing this test fail in #8442 but it doesn't seem related.
Example:
Error: module at source dir "" doesn't exist or is invalid
Looks like this test was added in https://github.com/dagger/dagger/pull/8365
cc @grouville
This refactor makes the engine enforce withOptional(true) on function arguments that use defaultPath. Otherwise it's a footgun for the SDKs to ensure, especially since withOptional is incorrectly named.
Context:
Right now withMountedTemp will get you a tmpfs mounted at the specified location, but there's no control over important attributes like the size.
We should expose at minimum an option for the size of the tmpfs mount, which should be easy since that's supported in LLB.
There are more options available on tmpfs mounts that we could consider, but size is the highest priority right now.
When testing the TestSSHAuthSockPathHandling, Alex encountered rightfully a flake on this test, leading to this error:
Error: module at source dir "" doesn't exist or is invalid
It turns out that the error comes from the tests being run in parallel whilst relying on the same client
More context here
Fixes https://github.com/dagger/dagger/issues/8136
Note: I switched the order in the UI to show includes before excludes because that's the order that buildkit applies them.
TODO: Needs tests.
Following up with #8549, it seems the issue is caused by the native fetch. I'm trying to replace the client with node-fetch which is a more optimized version of fetch for server-side request.
Same as #8525, I update the TS SDK to use HTTP client instead of gRPC.
Example:
import { dag, Container, object, func } from "@dagger.io/dagger"
import { getTracer } from "@dagger.io/dagger/telemetry";
@object()
class Test {
@func()
async echo(stringArg: string = "hello"): Promise {
return getTracer().startActiveSpan("yolo", async (span) => {
return dag.container().from("alpine:latest").withExec(["echo", stringArg]).sync();
});
}
}
The trac...
Saw this while looking into https://github.com/dagger/dagger/pull/8568
These types can't actually be constructed, but we're still putting them in the codegen for modules. We don't need to, so we can just remove these to tidy things up.
When this API was originally added, we missed these types out: https://github.com/dagger/dagger/pull/7767/files#diff-66495f543507cb3a2373d8c23981491184d26ffe1bd45140faab4445bb3a5177R28
https://github.com/dagger/dagger/actions/runs/11058080873/job/30723306886
We need --update-head-ok here:
-u
--update-head-okBy default git fetch refuses to update the head which corresponds to the current branch. This flag disables the check. This is purely for the internal use for git pull to communicate with git fetch, and unless you are implementing your own Porcelain you are not supposed to use it.
See #8564.
Engine publish is failing - https://github.com/dagger/dagger/actions/runs/11058428600/job/30724413276. We can remove those extra steps though, since now the version module handles this (the commit timestamp is used, so we get the right results here).
Also, I can't run dagger call locally - this is because, my repo is already unshallowed, so calling unshallow causes a failure. There's a neat way to do this though - we just set the --depth to the max int32 value, as speci...
This commit shows an example and clarifies the disctinction between using the /merge ref and the /head ref. This is based on the feedback we got from Mark here: https://github.com/dagger/dagger/pull/8194#discussion_r1724578389
Question from user in [Discord](#python message) about how to manage multiple virtual environments in PyCharm, and realized we can help with more clear instructions here:
Try this, have PyCharm opened in your existing project, and File > Open the Dagger moduleโs directory. You should see a dialog with the option to attach to the opened project. Just select that and, assuming you alread...
This works:
โฏ git init
Initialized empty Git repository in /tmp/tmp.ypw6aewju5/.git/
โฏ git remote add origin https://github.com/dagger/dagger.git
โฏ git fetch origin 261afb3353d300c82d5169b1854069a1efa15a33
โฏ git show 261afb3353d300c82d5169b1854069a1efa15a33
commit 261afb3353d300c82d5169b1854069a1efa15a33
Merge: c34442530 5dc7237d2
Author: Justin Chadwell
Date: Fri Sep 27 07:22:36 2024 +0800
Merge 5dc7237d20469950d0ff2f5548d690ade3468c65 into c344425308ad48d5634393328...
I create iptables rules in my container, and they persist and accumulate between pipeline runs. I would expect them to not affect containers in future pipelines as they should be isolated.
dagger v0.13.3 (registry.dagger.io/engine:v0.13.3) darwin/arm64
Run this multiple times and you'll see that the rules listed each time accumulates.
func (m *Treasury) TestIptables(
ctx context.Context,
) (string, error) ...
Thanks a lot, @helderco, for your answers ๐๐ผ. That's all I needed to continue my work. It'll take me a bit of time because I'm distracted by something else, but hopefully, I'll have something in the following weeks.
As mentioned above, we'll need to run steps in the host because some tools are macOS-only, for example, xcodebuild, which Xcode developers use to compile their apps. Has the Dagger team discussed or planned any work around solving that need?
Noticed in https://dagger.cloud/dagger/traces/b3d53b83e726ac25892517310b0ee9d2#2e580acd7b4b57ea:L3.
This doesn't help the output for our flakes when this does flake - we see multiple interrupts, which isn't right.
cleanupExec is already called as part of hostDaggerCommand.
Fixes https://github.com/dagger/dagger/issues/7898.
[!WARNING]
Work-in-progress, needs tests, explanations, etc.
As discovered by @kpenfound during friday demos
If an empty directory was passed to the version module, then .git wouldn't be available, and so all the git operations would fail. The fix is to detect it before running any of the commands.
But to do that, we need a context and an error - so we just move all this operation straight into the constructor, which also avoids a ton of extra calls to the Git function anyways.
The current services API on allows 1-to-1, one-way service dependencies. The following topologies are not allowed:
Expand the Dagger API to support a wider variety of network topologies, without losing the benefits of the current design.
Given a new function called foo that returns a dagger.Container, the first time you run dagger call foo terminal it will appear to hang because it seems to be doing work in the background but not showing you any output. Depending on the work it will eventually return the terminal as expected. This feels like a recent regression
dagger v0.13.3 (registry.dagger.io/engine:v0.13.3) linux/amd64
Given this function
``...
Signed-off-by: Marcos Lilljedahl
This is related to the following issue, which makes some clarifications on the different mechanisms for filtering a Directory uploaded from the host to the engine:
However, even if itโs clear which is which in a trace, we can help users know how to debug if theyโre actually filtered as expected.
See the following comment, which provides source material for this:
This PR updates the dotnet-sdk from https://github.com/wingyplus/dagger-dotnet-sdk/
to the Dagger to make the SDK move forward.
I restructure the SDK into 2 main parts:
dev - it's a dagger module to operate task on the SDK (test, lint, format, etc.), written in Go.sdk - the SDK part, written in C#.In the sdk, it split into 2 main libraries:
Dagger.SDK - main SDK part.Dagger.SDK.SourceGenerator - the SDK source generator that takes the `int...Bumps the sdk-go group with 5 updates in the /sdk/go directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.54 |
| github.com/vektah/gqlparser/v2 | 2.5.16 |
2.5.17 |
| go.opentelemetry.io/otel | 1.27.0 |
1.30.0 |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-... |
Bumps the sdk-python group in /sdk/python/runtime with 2 updates: python and astral-sh/uv.
Updates python from 15bad98 to ad48727
Updates astral-sh/uv from 0.4.15 to 0.4.17
Release notes
Sourced from astral-sh/uv's releases.
0.4.17
Release Notes
Enhancements
Add uv build --all to build all packages in a workspace (#7724)
Add support for uv init --script (#7565)
Add support for upgrading build environment for installed tools (uv tool upgrade --py...
Bumps the docs group with 12 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| @docusaurus/core | 3.4.0 |
3.5.2 |
| @docusaurus/preset-classic | 3.4.0 |
3.5.2 |
| @docusaurus/theme-mermaid | 3.4.0 |
3.5.2 |
| [c... |
Bumps the sdk-elixir group in /sdk/elixir with 1 update: credo.
Updates credo from 1.7.7 to 1.7.8
Release notes
Sourced from credo's releases.
v1.7.8
Check it out on Hex: https://hex.pm/packages/credo/1.7.8
Credo.Check.Refactor.Apply fixed false positive
Credo.Check.Warning.IoInspect fixed false positive
Credo.Check.Warning.UnsafeToAtom fixed false positive
Credo.Check.Readability.FunctionNames fixed false positive
Changelog
Sourced from credo's ch...
Bumps the sdk-java group with 12 updates in the /sdk/java directory:
| Package | From | To |
|---|---|---|
| io.smallrye:smallrye-graphql-client-api | 2.8.4 |
2.10.0 |
| io.smallrye:smallrye-graphql-client-implementation-vertx | 2.8.4 |
2.10.0 |
| org.apache.commons:commons-lang3 | 3.14.0 |
3.17.0 |
| org.apache.commons:commons-compress | 1.26.2 |
1.27.1 |
| org.slf4j:slf4j-api | 2.0.13 |
2.0.16 |
| org.slf4j:slf4j-simple | 2.0.13 |
2.0.16 |
| [org.junit:junit-b... |
Bumps the engine group with 12 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.54 |
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| github.com/docker/cli | 27.2.1+incompatible |
27.3.1+incompatible |
| github.com/docker/docker | 27.2.1+incompatible |
`27.3.1... |
Bumps the sdk-typescript group with 14 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.11.3 |
| @opentelemetry/exporter-trace-otlp-grpc | 0.52.1 |
0.53.0 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| [@opentelemetry/sdk-node](https://github.com/open-telemetry/opent... |
I was trying to add custom certs to the default dagger engine container. When I created the image and set the $_EXPERIMENTAL_DAGGER_RUNNER_HOST variable, the dagger cli doesn't attempt to start that container. It seems as if you opt into a custom engine container you lose the feature that starts the engine for you
I would expect dagger to attempt to detect and start the container it need...
Hello!
We're working with a really large Monorepo, and we'd like to be able to run our Dagger module including only two directories off of the root. (I'm testing this in a separate, smaller repo at the moment)
I've attempted to do this two different ways:
{
"name": "package",
"sdk": "go",
"source": ".",
"engineVersion": "v0.13.3",
"views": [
{
"name":...
I'm not sure if you already tried this but you can use an ignore pattern with defaultPath for exclusion: https://docs.dagger.io/manuals/developer/functions#directories-and-files
There are some examples and discussion of this approach also in https://discord.com/channels/707636530424053791/1288245581701058560
Hi,
I've been evaluating Dagger and I found performance to be abysmal and TUI exposing buggy and erratic behavior, e.g. (runtimes on M2 Max machine).
dagger functions took 20-25s (after aggressive exclude and filtering in module) to finish--progress=plain tended to hang indefinitelyI'm not sure if you already tried this but you can use an ignore pattern with defaultPath for exclusion: https://docs.dagger.io/manuals/developer/functions#directories-and-files
There are some examples and discussion of this approach also in https://discord.com/channels/707636530424053791/1288245581701058560
This worked, thanks a bunch! Using the ignore + defaultPath pattern worked for reducing the file upload size:
// Root directory where all modules/bases are accessible from. (Usually just the $GITHUB_WORKSPACE)
// +optional
// +defaultPath="."
// +ignore=["*", "!*.yaml", "!*.yml"]
rootDir *dagger.Directory,
I was also able to allow for optimization of files mounted to my dagger-built container using a --includes and --excludes flag with `DirectoryWithDirectoryOpts...
I was trying to follow Cookbook Build multi-arch image with cross-compliation but the mentioned command dagger install github.com/levlaz/daggerverse/containerd@v0.1.2 does not work, it fails with timeout.
Dagger itself works fine, I can use it, but the install step does not.
I also tried v0.2.0 since that seems to be the newest one, but it has the same issue.
...
I think there might be a bug of some kind here. I can still see some non-yaml files in some of my snapshots, despite wiping out my entire dagger cache before re-running:
<img width="931" alt="image" src="https://github.com/user-attachments/assets/2625069a-723b-464b-92dd-6da149e16320">
Extracts logic for normalizing class names before registering them with Dagger.
Adds tests for the extracted logic.
sdk/php/src/Command/EntrypointCommand.php is tied heavily to the dagger engine and cannot easily be tested in isolation. This service extracts logic from the Entry...
PHP SDK support for enums appears to have regressed at some point.
Draft PR till it so I can get feedback.
Currently, the structure of the Elixir module is:
dagger.json
dagger_sdk/
/
To look at the implementation, we need to change directory /lib/.ex. And readme is redundant with the root repo.
So what I want is changing the structure by moving all source under `` to the root of the module like this:
dagger.json
dagger_sdk/
lib/
mix.exs
mix.lock
...
This issue need to backward compatible with the old layout as well.
##...
from signature:
def with_directory(%__MODULE__{} = directory, path, directory, optional_args \\ [])
When we declare like this in Elixir, it means that the directory on the first and third arguments must be equal. To fix this issue, we might need to add suffix like _ to either first or third parameter to avoid naming collision.
0.13.3
No response
No response
Jumping on this discussion as I'm investigating the same issue. I'm trying to implement the pattern mentioned here, where we have a long-running build in CI and want to return multiple test results along with the exit code. With the proposed setup, we'd need to call Dagger multiple times to receive individual fields from the TestResult classโfirst to get the exit code, then again for the report file....
@marcosnils @TomChv can you add your thoughts?
The intention here should be to initialize a slice with a capacity of len(x) rather than initializing the length of this slice.
I was getting ephemeral panics from the Go runtime on my OTEL metrics PR that (seemingly?) disappeared when I upgraded to the new version of Go. Not sure precisely which change fixed it (they were "invalid pointer found in heap" errors) but there were a few fixes to the runtime and open issues that seemed possibly related, so worth an upgrade.
Bumps the docs group with 5 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| clsx | 1.2.1 |
2.1.1 |
| docusaurus-plugin-image-zoom | 1.0.1 |
2.0.0 |
| docusaurus-plugin-typedoc | 0.21.0 |
1.0.5 |
| typedoc | `0.25.... |
Dagger automatically includes dumb-init in execs by default to avoid the quirks of Linux pid 1 processes causing unexpected behavior in most common cases.
There are use cases that call for user control of pid 1 though, so we can pretty easily add an option to disable our automatic init, leaving it in the control of the user.
Bumps the engine group with 13 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.54 |
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| github.com/docker/cli | 27.2.1+incompatible |
27.3.1+incompatible |
| github.com/docker/docker | 27.2.1+incompatible |
`27.3.1... |
Goal - I am trying to disable traces and logs both.
What I did and actaul outcome - if we set this env var OTEL_EXPORTER_OTLP_LOGS_ENDPOINT to empty value(https://github.com/dagger/dagger/blob/7527e4bf607f1206afc64565fefdf78737fcef9a/sdk/go/telemetry/init.go#L125), logs exporter won't intialize(disabled)
But to disable the traces, there should not be any env var prefixe...
Signed-off-by: Marcos Lilljedahl
Expanding on https://github.com/dagger/dagger/issues/6605 which addresses the case for a dagger update command.
However, currently dependencies in dagger.json work more as a lock file - any kind of dagger install will be stored as the resolved ref. This makes it a bit hard to reason about dependencies and update them safely, etc.
It would be nice to have a way to declaratively pin the dependencies to a human-friendly ref and/or ideally a semver ex...
@crjm, I needed to swizzle the DocCard component to remove the icon. I'm not sure if there is a simpler way?
Closes DOCS-350
I see the error:
time="2024-10-04T08:35:43Z" level=warning msg="failed to rehash ca-certificates: ERROR: Access denied '/usr/local/share/ca-certificates'\n" error="exit status 2"
When I mount a configmap containing something.crt into the folder.
It does not crash the dagger-engine, which starts up afterwards.
While it does not work following container restart, if I exec update-ca-certificates in a pod the CA certificate is applied and works as expected....
I would have assumed I would have been able to pass these across to monitor a distributed trace?
Mounting a cache volume at node_modules within the workdir can cause major issues for a lot of npm apps, especially if the volume is used for multiple projects or multiple sessions. Because of this, its better to mount the volume to npm's cache directory and let npm pull from the cache itself.
This best practice applies to all usage of cache volumes, however the examples we have for Go and Python already work this way.
Hi Team,
I am running into an issue when trying to understand the current behavior of CacheVolume. I have the following simple module:
import (
"context"
"dagger/foo/internal/dagger"
"fmt"
)
type Foo struct{}
func (f *Foo) TestCacheVolumePersistence(ctx context.Context, input string) (string, error) {
_, err := f.PopulateCache(ctx, input)
if err != nil {
return "", err
}
output, err := f.ListCache(ctx)
if err != nil ...
fetching a secret by its name seems not to be possible
v0.13.4-2928b54059e25c7fd275bdc537ea85ecd76a8968
func (m *Lala) Test(ctx context.Context) (string, error) {
dag.SetSecret("foo", "bar")
return dag.Secret("foo").Plaintext(ctx)
}
โ Lala.test: String! 0.2s
! call function "Test": process "/runtime" did not complete successfully: exit code: 2
โ invoke: input: secret.plaintext reso...
I was running some functions repeatedly with dagger -s to get less verbose output to my terminal. I wanted concise output to share with colleagues as a repro. My dagger -s call commands were working fine until I added terminal to the end of a call that returned a Container type. I expected it to work as normal, but dagger threw an error.
An example:
Error: response from query: input: container.from.terminal resolve: failed to forward exit code: failed ...
The text is invisible in the architecture diagram: https://docs.dagger.io/manuals/developer/architecture/
Bumps the sdk-java group with 12 updates in the /sdk/java directory:
| Package | From | To |
|---|---|---|
| io.smallrye:smallrye-graphql-client-api | 2.8.4 |
2.10.0 |
| io.smallrye:smallrye-graphql-client-implementation-vertx | 2.8.4 |
2.10.0 |
| org.apache.commons:commons-lang3 | 3.14.0 |
3.17.0 |
| org.apache.commons:commons-compress | 1.26.2 |
1.27.1 |
| org.slf4j:slf4j-api | 2.0.13 |
2.0.16 |
| org.slf4j:slf4j-simple | 2.0.13 |
2.0.16 |
| [org.junit:junit-b... |
Bumps the engine group with 15 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.55 |
| github.com/containerd/errdefs | 0.1.0 |
0.2.0 |
| github.com/docker/cli | 27.2.1+incompatible |
27.3.1+incompatible |
| github.com/docker/docker | 27.2.1+incompatible |
`27.3.1... |
Bumps the sdk-go group with 4 updates in the /sdk/go directory: github.com/99designs/gqlgen, go.opentelemetry.io/otel, go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc and go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp.
Updates github.com/99designs/gqlgen from ...
Bumps the docs group with 5 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| clsx | 1.2.1 |
2.1.1 |
| docusaurus-plugin-image-zoom | 1.0.1 |
2.0.0 |
| docusaurus-plugin-typedoc | 0.21.0 |
1.0.5 |
| typedoc | `0.25.... |
Bumps the sdk-python group with 2 updates in the /sdk/python/runtime directory: python and astral-sh/uv.
Updates python from 15bad98 to af4e85f
Updates astral-sh/uv from 0.4.15 to 0.4.18
Release notes
Sourced from astral-sh/uv's releases.
0.4.18
Release Notes
Enhancements
Allow multiple source entries for each package in tool.uv.sources (#7745)
Add .gitignore file to uv build output directory (#7835)
Disable jemalloc on FreeBSD (#7780)
Respect P...
Bumps the sdk-typescript group with 14 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.12.0 |
| @opentelemetry/exporter-trace-otlp-grpc | 0.52.1 |
0.53.0 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| [@opentelemetry/sdk-node](https://github.com/open-telemetry/opent... |
Fetching modules from a private repository using SSH fails when the repository uses a port other than 22.
Our privately hosted Bitbucket exposes port 7999 instead of the default 22.
Seems like the port in the URL is not taken into account.
dagger v0.13.1 (registry.dagger.io/engine:v0.13.1) linux/amd64
Create a new module with dagger init --sdk=go modules/hello
Save it in a private repo which is accessible via SSH on a ...
Allows you to manually configure a hostname for a service, which will be automatically namespaced within the module. This ability allows you to express circular service dependencies, which was previously impossible with content-addressed hostnames.
Quick PR up after finally getting the circular/relay test to work, will revise
This is a slightly cleaned up version of what I did at Dagger's recent team hackathon, differences being:
--dot-output= will trigger writing a .dot formatted file to the given pathI was benchmarking alternative CI runners and noticed that these jobs were being CPU starved. They are 25% - 40% faster when given an adequate number of CPUs.
See https://github.com/dagger/dagger/actions/runs/11233423649/job/31227113107
Stdout:
invoke: input: container.from.withMountedDirectory.withMountedCache.withMountedDirectory.withExec.sync resolve: process "trivy fs --format=json --exit-code=1 --scanners=vuln --vuln-type=library --severity=CRITICAL,HIGH --show-suppressed /mnt/src" did not complete successfully: exit code: 1
Stderr:
2024-10-08T10:20:52Z INFO Need to update DB
2024-10-08T10:20:52Z INFO Downloading DB... repository...
Expecting it to fix the following error:
Fatal errorinit error: DB error: failed to download vulnerability DB: database download error: OCI repository error: 1 error
GET https://ghcr.io/v2/aquasecurity/trivy-db/manifests/2: TOOMANYREQUESTS: retry-after: 566.363ยตs, allowed: 44000/minute
Follow-up to:
I have started using devbox to set up all of my dev environments. The dagger version available through devbox add/search is 0.8.8. Is it possible to push newer versions to Devbox/Nix?
Is there a workaround to install a newer version using devbox? Any help would be greatly appreciated.
Heya :wave:
So generally, the way I handle this is by running dagger develop as the step in my pipeline - then I have the generated code, without needing to commit it.
If you've got your go linting running inside dagger, then this is pretty easy to accomplish, you can easily write a chainable With function that includes your codegen, so you can then just do directory.With(codegen) to generate it.
Hope that helps! :tada:
it would be great to view all of a user's modules from something like https://daggerverse.dev/mod/github.com/levlaz/daggerverse (i.e. removing the module name from the URL to get to an index, similar to how you can do this on github)
Further, a github user's path would be good too if the user doesn't use a daggerverse repo. So https://daggerverse.dev/mod/github.com/levlaz
No response
Tom updated the dagger-modules-test repo to include context-directory tests. I updated the repo state to all mirror repos.
This PR updates the test suite to new latest commit
since those are CentOS based, this already works with the current rhel
installer
Signed-off-by: Marcos Lilljedahl
While working on metrics stuff I realized the go build step was writing 19MB for trivial modules, thanks to Go's well known large binary size.
I tried stripping DWARF debug symbols with -ldflags='-s -w' and found it saved about 6MB.
This is not the biggest disk space hog in CI by any means, but saving 6MB per module across the 100+ we build for test runs seems like an easy marginal win given there's no real downside to dropping these debug symbols at this time (right? I can't think of a...
fixes #8573
I have many questions:
Rework the way the user's code is imported to be executed to actually uses imports instead of loading it from its decorators.
This would unblock severals features such as interface supports and compositions.
It's also a safer way to actually executes the user's code and resolve default value by reference, specially complex values since they can now be resolve by actually executing them if they are exported.
/!\ This is a breaking change! Anything that needs to be executed by the ru...
Adds CI provider information to OTEL attributes.
see https://github.com/dagger/dagger/pull/8652#pullrequestreview-2355647374 where @sipsma noticed this documentation gap.
Dagger automatically injects an init process in withExecs in order to avoid surprising behavior around processes being PID 1. I have generally gathered that this is the right default behavior, to the point that I've seen some docker maintainers say that they wish docker had defaulted to this same behavior.
However, there are less common use cases that do call for user processes being PID 1, such as when they want very custom init behavior or are testing init systems (i.e. testing systemd i...
Bumps the sdk-typescript group with 13 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.12.1 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| @opentelemetry/sdk-node | 0.52.1 |
0.53.0 |
| adm-zip | 0.5.15 |
0.5.16 |
| [execa]... |
Recently we added "${VAR}" snippets into our docs in https://github.com/dagger/dagger/pull/8427 - however, as doctype was generating MDX output, this was weirdly being interpreted as variable interpolations.
There is a setting to control this: sanitizeComments. However, this is only present in newer versions of the doctype plugin, so, a whole upgrade of doctype and its docusaurus plugins is required, so I've done that here too.
For consistency, I've also quoted the ${VAR} sni...
Bumps the docs group with 3 updates in the /docs directory: clsx, docusaurus-plugin-image-zoom and typescript.
Updates clsx from 1.2.1 to 2.1.1
Release notes
Sourced from clsx's releases.
v2.1.1
Patches
(types) Include bigint in ClassValue type: (#96): 3d960ab
Accommodates recent @types/react changes to ReactNode.
Thank you @โViliamKopecky~!
Chore...
We should find a way to consolidate the API between WithHostname and WithServiceBinding as they currently don't play along very well together in a multi-module setup.
Repro:
Module A:
// Returns a container that echoes whatever string argument is provided
func (m *Lala) Test(ctx context.Context) *dagger.Container {
svc := dag.Container().From("nginx").
WithExposedPort(80).AsService().WithHostname("web")
svc.Start(ctx)
return dag.B().Run(svc)...
steps I missed in #8652, bundled all together.
might go ahead and make a top-level function to do both generations simultaneously, then replace the instructions.
as an aside: writing this with the heading "GraphQL schema changes" immediately gave me the urge to write the typical warnings regarding backwards-incompatible changes to graphql schemas that you've got to drumbeat in a more typical SaaS graphql deployment (nullables can't be made non-nullable, renames must be duplicated and de...
Follow-up for https://github.com/dagger/dagger/pull/8318.
A few issues:
keepGitDir as the default on v0.13.0+ (due to merge timing issues) - this should only have been enabled for versions before v0.13.4.treeLegacy, then we would attempt to unmarshal into a private field (which is invalid). This wasn't t...swizzle docusaurus NotFound component so we can add a custom header for
better tracking users that land in a 404 page
Signed-off-by: Marcos Lilljedahl
In go, enum values are top-level to the package (unlike in typescript/python/etc where they are members of the type itself). Because of this, it's very easily possible to clash - two different enum types might have the same value.
To prevent this clash, we should scope the enum value with the name of the enum it's from - this is pretty standard go practice, and should be familiar.
We keep the old consts around, but alias them to the new consts, and deprecate them (to remove in v0.14.0).
Opening an issue from #go message - me and @helderco had a chat about this.
Current enum support has a few issues, which we can fix!
Naming clashes are very possible in go
Some core enum types have stuttering names
TypeDefKind.STRING_KIND should be TypeDefKind.STRING, `ModuleSourceKind.GIT_SOURCE...We couldn't do this before because we needed https://github.com/sagikazarmark/daggerverse/pull/183.
Now we can mark SDK release notes as never the latest, so we can just automatically publish these without going through draft.
Usage: ./install.sh
Install:
./install.sh
Install to :
BIN_DIR= ./install.sh
Install specified version :
DAGGER_VERSION= ./install.sh
Install latest nightly build:
DAGGER_COMMIT=head ./install.sh
Install specified nightly build :
DAGGER_COMMIT= ./install.sh
These options need to be documented - since I keep forgetting what's valid/what's not.
The current TypeScript introspector is quite limited and remove a bunch of interesting feature that are natively available and broadly uses by TS engineers such as the complete type system, generics and complex default value.
The global idea is to make the TS SDK DX much more natural to a TS engineer.
For example, this simple snippet isn't working with dagger but should after this improvement:
type User = {
name: string
age: number
}
const DEFAULT_NAME = "joh...
The goal would be to import an image using dag.Container().Import(baseImage) and use that baseImage in a FROM statement in a Dockerfile.
Sometimes, instead of rewriting a Dockerfile using Dagger SDK, it's easier to just build from a Dockerfile. But if this Dockerfile uses a base image that's only available locally, then it can't be built, since the local image is not available to the Dagger engine.
The spot-instance version of these nodes are having trouble existing right now, we want to move off spot instances anyways so just updating these right now to unblock these jobs hopefully.
I pass in a remote container and the CLI reports that it loads successfully (as indicated by checkmark) but doesn't perform any operations as defined in my dagger function.
dagger should at least report that the container failed to loed
dagger v0.13.5 (registry.dagger.io/engine:v0.13.5) linux/amd64
I have a function that is just this:
func (m *InkyBuild) PythonSetup(ctx context.Context,
...
Fixes https://github.com/dagger/dagger/pull/8673#issuecomment-2407223417
false and true values are always decoded by gqlparser as booleans - however, this might not always be the case: a standalone value might potentially be decodable as an enum instead.
The solution for this is to just add another case for decoding booleans in enums.
[!NOTE]
There's really no way to avoid this hack from what I can tell - you can put a
false/truevalue as an enum value, but ...
Colima doesn't appear to be installed by default on the new macos-15 runners.
#8676 would let use support more typescript features, specially some that doesn't support decorators such as type & enum.
However, users should still have a way to actually document & set specific metadata on top of these types. To do so, we can introduce Generic that can replace decorators when they are not usable.
For example:
type PropertyMetadata = {
doc: string
// Expose this property to the Dagger API (should we actually do the opposite and let ev...
Still getting problems starting colima: https://github.com/dagger/dagger/actions/runs/11298598079/job/31428172736#step:3:192
Based on various issues around github, getting this to work is an utter shitshow, so we're not alone.
Found this relevant issue: https://github.com/lima-vm/lima/issues/1742
Which lead to a linked issue that showed a successful setup of installing docker, trying it out here.
Currently the typescript sdk installs itself as a folder within the project and has its own package.json and lock file.
This makes things a little tricky to work around since there are now two separate places that try to manage the dependencies. This is especially true since the dagger code references the sdk.
The 'normal' way for these types of dependencies are for it to be installed via a package manager and live within...
We don't clearly answer the question: should we optimize for the best DX, or for flexibility?
Best DX: one package manager, one runtime, one way to organize your files. Probably customizable, but not infinitely so. Probably easier to learn, easier to develop, and faster. But won't "blend in" with the surrounding project; and maybe harder to import code from app into the module or vice-versa
Flexibility: adapt to your existing package manager, runtime, and layout as much as p...
Follow-up of https://github.com/dagger/dagger/issues/8385#issuecomment-2406128224
Attempting the same fix to all the tests: a few were missing + unifying how we cleanup the cancel()
During the CI / release improvements, go version in .dagger/go.mod was bumped to 1.23 which has no release for ARM, leading to this error:
.dagger git:(fix-go-version-daggerci) go env GOPROXY go: downloading go1.23 (linux/arm64)
go: download go1.23 for linux/arm64: toolchain not available
As per https://go.dev/dl/, the latest official version is 1.23.2
context: While working on the otel metrics stuff I saw the codegen steps sometimes writing several hundred MB to disk for seemingly no reason, so went off on a tangent looking into that. Still not sure, but on that tangent followed a subtangent around packages.Load taking an absurd amount of time (also seemingly randomly).
The call to packages.Load, which does the syntax parsing + type checking needed for go module codegen seems to be a pretty big bottleneck in terms of time. It's...
This pull request aims to mention dagger login at Dagger Cloud Introduction documentation.
After the dagger login there was no mentions about dagger login on Dagger Cloud Introduction documentation.
The idea is to add it (dagger login) as a new way to connect to Dagger Cloud.
Closes #7734
Reading the documentation at docs/_REAME was not possible to see the directory called docs/_versioned-docs. Is it deprecated, if yes, I can send a pull request to remove this one, WDYT?
After upgrading to 0.13.5, I noticed that the initial installing module step started to take longer than usual, both locally and on GHA.
Today, it completely gets stuck:
https://github.com/openmeterio/openmeter/actions/runs/11316804218/job/31469492784?pr=1662
I tried downgrading to 0.13.3, but that doesn't seem to fix the problem.
(Side note: although I did revert the change, it almost looks like it didn't take any effect:
Although the downloa...
My function failed when I tried to add decorators on it. I can find workaround but not sure if it should add to docs.
dagger v0.13.3 (registry.dagger.io/engine:v0.13.3) darwin/arm64
get following error when run dagger call load-context (module name is test)
`
def timer(func):
"""Print the runtime of the decorated function"""
# @functools.wraps(func)
async def wrapper_timer(*args, **kwargs):
...
Bumps the sdk-typescript group with 13 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.12.2 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| @opentelemetry/sdk-node | 0.52.1 |
0.53.0 |
| adm-zip | 0.5.15 |
0.5.16 |
| [execa]... |
Bumps the engine group with 15 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.55 |
| github.com/containerd/errdefs | 0.1.0 |
0.3.0 |
| github.com/docker/cli | 27.2.1+incompatible |
27.3.1+incompatible |
| github.com/docker/docker | 27.2.1+incompatible |
`27.3.1... |
Bumps the docs group with 5 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| clsx | 1.2.1 |
2.1.1 |
| docusaurus-plugin-image-zoom | 1.0.1 |
2.0.0 |
| sass | 1.79.4 |
1.79.5 |
| typedoc | 0.26.8 |
0.26.9 |
| typescript | 5.6.2 |
`... |
Bumps the sdk-go group with 4 updates in the /sdk/go directory: github.com/99designs/gqlgen, go.opentelemetry.io/otel, go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc and go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp.
Updates github.com/99designs/gqlgen from ...
Bumps the sdk-python group in /sdk/python/runtime with 2 updates: python and astral-sh/uv.
Updates python from 3.12-slim to 3.13-slim
Updates astral-sh/uv from 0.4.18 to 0.4.20
Release notes
Sourced from astral-sh/uv's releases.
0.4.20
Release Notes
Enhancements
Add managed downloads for CPython 3.13.0 (final) (#8010)
Python 3.13 is the default version for uv python install (#8010)
Hint at wrong endpoint in uv publish failures (#7872)
List available...
Bumps the sdk-java group with 12 updates in the /sdk/java directory:
| Package | From | To |
|---|---|---|
| io.smallrye:smallrye-graphql-client-api | 2.8.4 |
2.10.0 |
| io.smallrye:smallrye-graphql-client-implementation-vertx | 2.8.4 |
2.10.0 |
| org.apache.commons:commons-lang3 | 3.14.0 |
3.17.0 |
| org.apache.commons:commons-compress | 1.26.2 |
1.27.1 |
| org.slf4j:slf4j-api | 2.0.13 |
2.0.16 |
| org.slf4j:slf4j-simple | 2.0.13 |
2.0.16 |
| [org.junit:junit-b... |
Interestingly, Ignore seems to work only in combination with DefaultPath
@skycaptain I believe this is fixed in https://github.com/dagger/dagger/pull/8436 and available in Dagger 0.13.5.
$ git clone https://github.com/airbytehq/airbyte.git
$ cd airbyte
$ make tools.airbyte-ci.install
$ airbyte-ci connectors --name destination-postgres build
This will call dagger run airbyte-ci connectors --name destination-postgres build.
Then return err:
โ [47.03s] ERROR airbyte-ci connectors --name destination-postgres...
Reported by user in [Discord](#1295320684658036767 message).
The API has the following description on Directory.export:
Writes the contents of the directory to a path on the host.
This is misleading because when using a Dagger module, the directory is exported to the runtime container, not necessarily what you'd interpret as the "host". We should clarify this, but ...
Bumps the sdk-python group with 1 update in the /sdk/python/runtime directory: astral-sh/uv.
Updates astral-sh/uv from 0.4.18 to 0.4.20
Release notes
Sourced from astral-sh/uv's releases.
0.4.20
Release Notes
Enhancements
Add managed downloads for CPython 3.13.0 (final) (#8010)
Python 3.13 is the default version for uv python install (#8010)
Hint at wrong endpoint in uv publish failures (#7872)
List available scripts when a command is not specified for...
Fixes https://github.com/dagger/dagger/issues/8535
โ ๏ธ Stacked on top of https://github.com/dagger/dagger/pull/8708
This changes the layout for new modules. For example:
โฏ dagger init --sdk=python my-module
Generates the name my-module for the project:
[project]
-name = "main"
+name = "my-module"
And puts sources under src/my_module:
.
โโโ sdk
โโโ src
-โ โโโ main
+โ โโโ my_module
โ โโโ __init__.py
+โ ...
When it was released, the Ignore meta only applied to DefaultPath. With v0.13.4 it will filter directories that are explicitly passed too. Note that it's still not supported when passing a directory to a dependency (via code).
Does anybody have any examples of a monorepo? For example, I'm trying to learn how to:
node_modules in each projects (some node tooling we use forces us to use individual node_modules at the moment)apps/ and packages/ -- both of which are used)Does anybody have any examples of a monorepo? For example, I'm trying to learn how to:
node_modules in each projects (some node tooling we use forces us to use individual node_modules at the moment)apps/ and packages/ -- both of which are used)this does not work in its current state. instead of the test failing because the 2 containers both contain the DNAT and MASQUERADE rules, instead it fails because both iptables -t nat -L invocations have no rules configured.
I also tried setting the CNI pool size to 0. That appears to have no effect- the test fails the same way as it does on main.
This pull request aims to improve `
The previous module implementation called apko in a withExec, which resulted in every permutation of a given set of alpine packages creating a new tarball on disk (which added up to multiple GBs in our CI) and importing those tarballs to their own, single-layer containers into the engine. All of this wasted disk space and time.
The new implementation uses the apk go bindings inside apko to directly download, unpack and merge packages together all natively in Dagger.
The end result is th...
Thanks, I can confirm that Ignore now works as expected.
Note that it's still not supported when passing a directory to a dependency (via code).
That's fine. My main use case is to:
a) Limit the amount of data we need to send to the engine, as we have quite large (several GBs) build directories.
b) Address GitLab CI's requirement of placing artefacts under $CI_PROJECT_DIR, which invalidates the cache as mentioned above.
With Ignore we can address both these issues withou...
Following some Discord discussions and buildkit comments (https://github.com/moby/buildkit/issues/1143#issuecomment-2327052682), I tried using the experimental dagger cache, pushing to a private docker registry. It appears to pull the cache (if it exists), but fails to export it.
I'm not sure if this is a Dagger issue or buildkit issue, but I've noticed a context canceled error cropping up when the cache is being exported, which is only reported as a warning in t...
๐ dagger -i that should return a service, does not work
dagger v0.15.5
๐ dagger -i that should return a service, does not work
๐ dagger -i that should return a service, does not work
Today you can only refer to remote git urls so if you have a known git repo directory (has a .git dir), there is no easy way to get the current repo name, commit sha, current branch, current tags, etc.
@vmaffet-fast
Users are implementing modules for this functionality which may before in core instead.
It's often useful for tagging containers with the git sha or using in a go release process, for example.
The TUI buries a lot of warnings and messages by collapsing at the end, sometimes you need to communicate something to the user that is durable after a pipeline ends.
For example: you might be telling folks that they need to update their module versions or that there is a next step needed.
Could be implemented by priority on custom OTEL spans, perhaps.
cc @vmaffet-fast @...
I am unable to run dagger call locally.
I removed my node_modules, deleted the sdk folder and re-ran dagger develop.
Error: Cannot find package '/src/dagger/sdk/node_modules/typescript/package.json' imported from /src/dagger/sdk/introspector/scanner/scan.ts
This looks to be due to separate package managers being installed.
The sdk is using yarn v1, however my dagger module is using npm.
When npm install is run from my `dagger...
fixes #7211
This PR namespaces the cache volumes so that across the modules they have different keys.
Since #7169 is done and glob now works as expected we can close this dicussion
:wave: seems like a bug in the glob pattern matching function. According to this: https://github.com/moby/patternmatcher/blob/main/patternmatcher_test.go#L140 that pattern should work. I even cloned that repository and added the following test case:
tests := []matchesTestCase{
{"build/tmp-*/deploy/sdk*", "build/tmp-build-a/deploy/sdk/test.manifest", true},
and this passed.
It's very likely an issue coming from https://github.com/marcosnils/dagger/blob/9baaa467f14b...
Almost every pipeline has WithMountedDirectory().WithWorkdir(). It would be nice to have some sugar to do this in one call with something like WithMountedWorkdir()
The name probably needs some more thought because it could cause confusion between WithDirectory/WithMountedDirectory vs WithWordir != WithMountedWorkdir
No response
No response
dagger develop doesn't seem to be using proper grouping in the telemetry spans. Here's the output of an example call:
dagger develop
โ connect 0.2s
โ cache request: mkfile /schema.json 0.0s
โ load cache: mkfile /schema.json 0.0s
โ cache request: blob://sha256:3f96dc98cb3827315b7c4f8e21be0fec3eabd82f4c09031d83f87650b1b5519c 0.0s
โ load cache: blob://sha256:3f96dc98cb3827315b7c4f8e21be0fec3eabd82f4c09031d83f87650b1b5519c 0.0s
โ moduleSource(refString: "."): ModuleS...
This allows sharing the engine cache locally across dagger call dev
calls which results quite convenient when testing different engine
versions
Signed-off-by: Marcos Lilljedahl
fixes #6411
starting by adding a containerimagedns bk source and a failing test that tries to roundtrip an image through a dagger-service-hosted registry.
the containerimagedns source is almost completely unimplemented, but commented code is cribbed off httpdns and wired into server.go. with that implemented, the From part of the test should work, but to test that we'll need to add another test that doesn't rely on Publish working with servers.
it's still unclear how exactly we'll g...
MapSecret API
AddSecret but instead of providing the plaintext valuevault://...) to a dagger.SecretBumps the sdk-go group with 7 updates in the /sdk/go directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.55 |
| github.com/adrg/xdg | 0.5.0 |
0.5.1 |
| go.opentelemetry.io/otel | 1.27.0 |
1.31.0 |
| [go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc](https://github.com/open-telemetry/opentelem... |
Bumps the engine group with 17 updates in the / directory:
| Package | From | To |
|---|---|---|
| github.com/99designs/gqlgen | 0.17.49 |
0.17.55 |
| github.com/adrg/xdg | 0.5.0 |
0.5.1 |
| github.com/containerd/containerd | 1.7.22 |
1.7.23 |
| github.com/docker/cli | 27.2.1+incompatible |
27.3.1+incompatible |
| [github.com... |
Noticed another quick performance fix while working on other stuff.
Linting go code requires downloading deps + compiling code, so there's huge benefit to using cache volumes. Data from local runs:
| Test Scenario | No Cache | Cached | Cached + code change |
|---|---|---|---|
| main | 5m50s | 21.6s | 4m33s |
| w/ fix | 4m55s | 21.6s | 2m5s |
We do this by modifying the install instructions to read the current version from version.js - then the docs process can just bump that file.
Doing interpolation in code blocks sucks a bit - we can't use markdown code blocks, and instead have to rely on the `` component.
I also reworked the sections to read a bit closer together (kinda similar to https://github.com/dagger/dagger/pull/8563).
Spending today looking into why initialize is so slow. Starting out with why it takes multiple seconds in our CI even when everything is completely cached.
Two quick fixes here:
Tested by running dagger -m 'github.com/dagger/dagger@1adf268ec84693f6543d291083ee8b856a277be5' functions repeatedly and seeing how long initialize took when everything was cached and...
Been getting a better understanding of why initialize is slow in the uncached and partially cached cases. The fixes are a bit more involved than the other quick fixes today so still WIP. Just sending out a few easily separable fixes from that effort in the meantime.
Main change to split initialize up into more subspans, which makes it much much easier to tell what the hell is going on in the initialization timing in the trace UIs.
Other one is just a fix for something misc I noticed whi...
I can't pass a module as argument to a function. This prevents a whole class of use cases that require one module dynamically loading another. For example, the "platform module":
Build(), Test()App interface which includes Build and Test; and it implements a reusable Deploy method which takes an array of the Apps.Bumps the sdk-typescript group with 13 updates in the /sdk/typescript directory:
| Package | From | To |
|---|---|---|
| @grpc/grpc-js | 1.11.1 |
1.12.2 |
| @opentelemetry/sdk-metrics | 1.25.1 |
1.26.0 |
| @opentelemetry/sdk-node | 0.52.1 |
0.53.0 |
| adm-zip | 0.5.15 |
0.5.16 |
| [execa]... |
Bumps the docs group with 6 updates in the /docs directory:
| Package | From | To |
|---|---|---|
| @mdx-js/react | 3.0.1 |
3.1.0 |
| clsx | 1.2.1 |
2.1.1 |
| docusaurus-plugin-image-zoom | 1.0.1 |
2.0.0 |
| sass | 1.79.4 |
1.80.3 |
| [typedoc](https://github.com/TypeStrong/TypeDo... |
Bumps the sdk-java group with 12 updates in the /sdk/java directory:
| Package | From | To |
|---|---|---|
| io.smallrye:smallrye-graphql-client-api | 2.8.4 |
2.11.0 |
| io.smallrye:smallrye-graphql-client-implementation-vertx | 2.8.4 |
2.11.0 |
| org.apache.commons:commons-lang3 | 3.14.0 |
3.17.0 |
| org.apache.commons:commons-compress | 1.26.2 |
1.27.1 |
| org.slf4j:slf4j-api | 2.0.13 |
2.0.16 |
| org.slf4j:slf4j-simple | 2.0.13 |
2.0.16 |
| [org.junit:junit-b... |
Bumps the sdk-python group in /sdk/python/runtime with 2 updates: python and astral-sh/uv.
Updates python from af4e85f to 032c526
Updates astral-sh/uv from 0.4.20 to 0.4.25
Release notes
Sourced from astral-sh/uv's releases.
0.4.24
Release Notes
Bug fixes
Fix Python executable name in Windows free-threaded Python distributions (#8310)
Redact index credentials from lockfile sources (#8307)
Respect UV_INDEX_ rather than UV_HTTP_BASIC_ as documente...
add a dagger uninstall command. Following test scenarios are covered:
Spinning out from https://github.com/dagger/dagger/pull/8557#discussion_r1808457164, and other similar conversations.
Our test suites have gradually become longer, more complicated, etc - there's a lot of repetition and complexity that can be hugely simplified. Some more concrete ideas:
c.Container().From(golangImage).WithMountedFile(testCLIBinPath, daggerCliFile(t, c)), in other places as daggerCliBase.dagger init steps in...Fixes https://github.com/dagger/dagger/issues/8584 (upstream fix in https://github.com/moby/buildkit/pull/5441, but we have a vendored copy of the relevant files to handle our custom DNS for services).
Follow-up to https://github.com/dagger/dagger/pull/8673 - this wasn't quite right, since true/false/null are "special" words.
We need https://github.com/dagger/dagger/pull/8682 to be released in v0.13.6 before the original works properly.