#github-feed

1 messages ยท Page 12 of 1

vivid lintelBOT
vivid lintelBOT
#

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

https://dagger.cloud/dagger/traces/ac50bb3aba9c820618d222c1f8717528?span=95c8ed5aad3a2915#95c8ed5aad3a2915:L9

There's no need for us to be hitting examp...

vivid lintelBOT
#

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...

vivid lintelBOT
#

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

  • Serve
    • AsModule: 6.4s
    • Initialize: 2.1s
  • Name
    • AsModule: 501ms
    • Initialize: 1.6s

Additional context:

https://discord.com/c...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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 version

dagger v0.12.5 (registry.dagger.io/engine:v0.12.5) linux/amd64

Steps to reproduce

internal/telemetry/exporters.go:92:23
![telemetry-problem](https://g...

#

What is the issue?

When running the command below, I get a lot of newlines, which spam the output, when using --progress=plain. I'm uncertain whether this is an issue with Dagger or something else. I've only observed this behaviour with apt so far, but I cannot recall to have seen this with previous Dagger releases. If I build the equivalent with Docker I do not see the newlines.

Dagger version

dagger v0.12.5 (registry.dagger.io/engine:v0.12.5) darwin/arm64

Steps to reprod...

vivid lintelBOT
#

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!

vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
#

What are you trying to do?

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
...
vivid lintelBOT
#

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...

vivid lintelBOT
#

Problem

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.

Solution

In addition to storing the exact digest of each dependency, also store the version information as provided by the developer at install time.

vivid lintelBOT
#

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:

vivid lintelBOT
vivid lintelBOT
#

What happened? What did you expect to happen?

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...
vivid lintelBOT
#

What is the issue?

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,
}).
...
ornate vigilBOT
#

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.

Swift SDK

Following the SDK's CONTRIBUTING.md guidel...

vivid lintelBOT
vivid lintelBOT
#

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...

ornate vigilBOT
#

[...] 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...

vivid lintelBOT
ornate vigilBOT
vivid lintelBOT
#

What is the issue?

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 version

dagger v0.12.6 (registry.dagger.io/engine:v0.12.6) linux/amd64

Steps to reproduce

Using the below module, run dagger functions.

from typing impor...
vivid lintelBOT
#

What are you trying to do?

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.

Why is this important to you?

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:

  • For a Maven module I'd need compile, test, deploy...
vivid lintelBOT
#

Problem

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...
vivid lintelBOT
#

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.

  • Obviously if this does indeed get rid of the flakes then it's not great in that we've probably just temporarily avoided a bug, but at this ...
vivid lintelBOT
#

What happened? What did you expect to happen?

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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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:...
vivid lintelBOT
#

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.

#

What happened? What did you expect to happen?

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 /...
vivid lintelBOT
#

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...

#

What is the issue?

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-...
vivid lintelBOT
#

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.

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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.

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

Hello, I am using the Dagger Python SDK to define custom dagger functions.

I found that when I create a function with an argument that uses the type annotation Platform, and provide it a default argument, the default argument is ignored, and an error will be raised when the argument is not provided.

Workaround
The only way to get dagger to respect the default argument, is to wrap the type annotation with typing.Optional.

platform: Optional[P...
vivid lintelBOT
#

Description

Currently cache volumes are being synchronized during engine startup. For organizations that have large cache volumes (or a large amount) 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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#
  • 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 ...

vivid lintelBOT
#

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...
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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...
vivid lintelBOT
#

Problem

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.

Solution

Implement a command-line equivalent of Daggerverse module docs & core API reference docs. Possibly make them call Daggerverse to reuse existing docs generation capabilities?

vivid lintelBOT
#

This is related to:

Summary

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.

Motivation

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 ...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

What is the issue?

Functions annoated with @func() on abstract classes are not visible when extended to a concrete class.

Dagger version

v0.12.7

Steps to reproduce

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...
#

What are you trying to do?

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...
#

Problem

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.

Solution

Disable the ability for a function to know its caller (if in fact it exists)...

vivid lintelBOT
#

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)

vivid lintelBOT
#

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 ...
#

What are you trying to do?

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

Why is this important to you?

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.

How are you currently working arou...

#

What are you trying to do?

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.

Why is this important to you?

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...

#

What is the issue?

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...
vivid lintelBOT
vivid lintelBOT
#

Problem

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 .

Solution

Apply the same "context access" model as for contextual directories:

  • Function can receive a `dagger.Platfor...
vivid lintelBOT
#

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...

vivid lintelBOT
#

[!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 ...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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...

#

What are you trying to do?

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 ...

little brook
vivid lintelBOT
#

This PR addresses issues with SSH_AUTH_SOCK handling and improves test coverage:

  1. Expands shell variables in SSH_AUTH_SOCK path
  2. Make SSH_AUTH_SOCK path absolute
  3. Adds integration tests for shell expansion handling and relative path calls

#1281294189463732244 message

Detailed explanation for not making SSH_AUTH_SOCK path relative:

The decision to avoid making the SSH_AUTH_SOCK path relative is based on several fa...

quaint umbra
vivid lintelBOT
#

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...
vivid lintelBOT
#

What is the issue?

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 version

dagger ...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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 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...
vivid lintelBOT
#

What are you trying to do?

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...

vivid lintelBOT
#

What are you trying to do?

I would like to make it easier to install a module from the root of a Git repository, especially useful for mono repositories.

Options

Override "root"

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

git+file

...

vivid lintelBOT
#

[!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.

vivid lintelBOT
#

Problem

One benefit of your CI pipelines being code, is that you can test them. Or at least, that's the theory. In practice, while it's possible to test Dagger pipelines, it's neither easy nor well documented.

Solution

Make it completely seamless to test Dagger modules, and document it well.

#

What are you trying to do?

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"
//  ]

Why is this important to you?

Single-line ignore is hard to read when t...

vivid lintelBOT
#

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.

vivid lintelBOT
#

Problem

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...
vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

When 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
# ...
`...
vivid lintelBOT
#

What is the issue?

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////...

vivid lintelBOT
vivid lintelBOT
#

Problem

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.

Solution

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...
vivid lintelBOT
#

What are you trying to do?

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.

############################

STEP 1 build executable binary

############################
FROM golang:alpine AS builder

Install git.

Git is required for fetching the dependencies.

RUN apk update && apk add --no-cache git
WORKDIR $GOPATH/src/mypackage/myapp/
COPY . .

Fetch dependencies.

Using go get.

RUN g...

vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
#

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:

  • Specify the version e...
vivid lintelBOT
#

What are you trying to do?

Problem

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

Why is this important to you?

Similarly to how other CI pipeline steps currently...

vivid lintelBOT
#

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.

vivid lintelBOT
#

[!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.

Motivation

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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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
    ...
ornate vigilBOT
#

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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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...
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

Problem

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.

Solution

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...

vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.0 (registry.dagger.io/engine:v0.13.0) windows/amd64

Steps to reproduce

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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

What are you trying to do?

There 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

Why is this important to you?

No response

How are you currently working around this?

No response

vivid lintelBOT
vivid lintelBOT
#

What are you trying to do?

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...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.0

Steps to reproduce

No response

Log output

No response

vivid lintelBOT
#

Problem

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.

Solution

I propose sandboxing SDKs. This would p...

vivid lintelBOT
vivid lintelBOT
#

What are you trying to do?

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...

vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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
- _...
vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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,...

vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
#

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.

vivid lintelBOT
#

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 ...

vivid lintelBOT
#

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...

vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

Problem

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...
vivid lintelBOT
#

Problem

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.

Solution

Make the above example work :)

vivid lintelBOT
vivid lintelBOT
ornate vigilBOT
#

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...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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...
vivid lintelBOT
#

What is the issue?

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"...
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

Summary

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).

Motivation

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...

vivid lintelBOT
#

TODO:

  • [ ] Create a deno.json to map all deps import
  • [ ] Add yarn test:deno command and making sure it works
  • [ ] Add Deno to the test list in ci/sdk/typescript
  • [ ] Update the runtime to use Deno if deno.json is detected
  • [ ] See how it reacts to deps install (Do we actually needs node_modules to run deno run?)
  • [ ] Add some tests in TestTypeScript suite
vivid lintelBOT
#

[!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...

vivid lintelBOT
#

Problem

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...

vivid lintelBOT
vivid lintelBOT
#

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.

Example

Consider these .gitignore files:

  • .gitignore
    • .venv
    • __pycache__
  • sdk/python/.gitignore
    • .*_cache
    • dist/
    • docs/_ build
  • `sdk/p...
vivid lintelBOT
#

What is the issue?

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...

ornate vigilBOT
vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.0 (registry.dagger.io/engine:v0.13.0) darwin/arm64

Steps to reproduce

First, create a new Rust cra...

vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
#

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.

Problem

SDKs have 2 conflicting requirements:

  1. Don't interfere with host project
  2. Make it easy to import code from the host project

This results in "wack-a-mole" situation where users encounter confusing errors when daggerizing, and require custom community suppor...

vivid lintelBOT
#

What are you trying to do?

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...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.1 (registry.dagger.io/engine:v0.13.1) darwin/arm64

Steps to reproduce

See the above PR.

##...

vivid lintelBOT
vivid lintelBOT
#

Follow-up to:

Problem

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...

ornate vigilBOT
vivid lintelBOT
#

Problem

Sometimes I need information about the current state of the git repository for my context. Things like:

  • What's the current commit?
  • What's the current branch?
  • What tags point to the current commit?
  • Is this a clean checkout? If not, what are the uncommitted changes?
  • What's the remote?

I can get some of this information indirectly with hacks, but it's not 100% reliable.

Solution

Add a core API to introspect git information about the context.

vivid lintelBOT
#

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...
vivid lintelBOT
#

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.

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.2 (registry.dagger.io/engine:v0.13.2) darwin/arm64

Steps to reproduce

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...

vivid lintelBOT
vivid lintelBOT
#

What are you trying to do?

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

Why is this important to you?

I want to simplify SDKs as much as pos...

vivid lintelBOT
#

What is the issue?

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 created
  • `dagger init -...
vivid lintelBOT
vivid lintelBOT
#

Problem

A module cannot return another module's type. This makes it harder to break down larger projects into several modules.

Solution

I'm not sure what the solution is.

  • On the one hand, the lack of this feature is becoming quite painful
  • On the other hand, I know that this has been considered, and the conclusion was: it would create intractable "dependency hell" problems.

I wonder if the dependency hell problems could be solved with name mangling?

For example:

...

vivid lintelBOT
#

What happened? What did you expect to happen?

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...
vivid lintelBOT
#

Summary

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.

Motivation

More control in monorepos

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:

vivid lintelBOT
#

Summary

Look for and resolve cache misses in Pythonโ€™s runtime module.

Motivation

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...

vivid lintelBOT
#

Summary

Create custom enumerations the same way theyโ€™re generated by codegen.

Motivation

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...
vivid lintelBOT
#

Summary

Generate a src/my-module package for new modules instead of the hardcoded src/main package.

Motivation

The entrypoint for Pythonโ€™s runtime container imports a moduleโ€™s source code via an hardcoded import main:

https://github.com/dagger/dagger/blob/5ec03a604d50b721aaa65ba7c4db8c875696ac72/sdk/python/src/dagger/mod/cli.py#L44-L48

This forces the moduleโ€™s layout to always be under src/main (unless otherwise configured for the build backend), so every module ...

vivid lintelBOT
#

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
...

vivid lintelBOT
#

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

Changes

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...

vivid lintelBOT
#

Problem

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.

Example

Suggesti...

vivid lintelBOT
vivid lintelBOT
ornate vigilBOT
#

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 ...

vivid lintelBOT
#

What is the issue?

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...

vivid lintelBOT
#

Problem

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...

vivid lintelBOT
#

Summary

Make include/exclude patterns dagger.json relative to the context directory if they start with a slash (/).

Motivation

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...

vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
#

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...

vivid lintelBOT
#

When using config from docs, got this error:

[31;1mFATAL: Could not handle configuration merging from template file error=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 "

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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:

  1. Typescript application with Typescript SDK inside roughly a 600MB git repo.
    ...
vivid lintelBOT
#

Problem

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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
#

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

vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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...

vivid lintelBOT
#

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...
vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.3 (registry.dagger.io/engine:v0.13.3) darwin/arm64

Steps to reproduce

Run this multiple times and you'll see that the rules listed each time accumulates.

func (m *Treasury) TestIptables(
	ctx context.Context,
) (string, error) ...
ornate vigilBOT
#

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?

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

Problem

The current services API on allows 1-to-1, one-way service dependencies. The following topologies are not allowed:

  1. Service A needs to connect to B, and vice-versa
  2. Service A, B, C all need to connect to each other

Solution

Expand the Dagger API to support a wider variety of network topologies, without losing the benefits of the current design.

vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.3 (registry.dagger.io/engine:v0.13.3) linux/amd64

Steps to reproduce

Given this function

``...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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:

vivid lintelBOT
#

This PR updates the dotnet-sdk from https://github.com/wingyplus/dagger-dotnet-sdk/
to the Dagger to make the SDK move forward.

Structure

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...
vivid lintelBOT
#

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...

vivid lintelBOT
#

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...
vivid lintelBOT
#

What is the issue?

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...

ornate vigilBOT
#

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:

Defining a repo-specific view in my module's dagger.json file to include the files I wanted

{
  "name": "package",
  "sdk": "go",
  "source": ".",
  "engineVersion": "v0.13.3",
  "views": [
    {
      "name":...
vivid lintelBOT
#

What is the issue?

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).

Context

  • dagger functions took 20-25s (after aggressive exclude and filtering in module) to finish
  • both TUI and --progress=plain tended to hang indefinitely
  • TUI often showed weird traces, omitted results or heavily delayed result output
  • simple test flow took 6 minutes and didn't finish where r...
ornate vigilBOT
#

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...

vivid lintelBOT
ornate vigilBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

What are you trying to do?

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.

##...

#

What is the issue?

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.

Dagger version

0.13.3

Steps to reproduce

No response

Log output

No response

ornate vigilBOT
#

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....

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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.

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

discord conversation

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...

vivid lintelBOT
#

What are you trying to do?

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...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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....

vivid lintelBOT
#

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.

vivid lintelBOT
#

What is the issue?

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 ...
vivid lintelBOT
#

What is the issue?

fetching a secret by its name seems not to be possible

Dagger version

v0.13.4-2928b54059e25c7fd275bdc537ea85ecd76a8968

Steps to reproduce

func (m *Lala) Test(ctx context.Context) (string, error) {
	dag.SetSecret("foo", "bar")
	return dag.Secret("foo").Plaintext(ctx)

}

Log output

โœ˜ Lala.test: String! 0.2s
! call function "Test": process "/runtime" did not complete successfully: exit code: 2
โ”ƒ invoke: input: secret.plaintext reso...
vivid lintelBOT
#

What is the issue?

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 ...
vivid lintelBOT
vivid lintelBOT
#

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...
vivid lintelBOT
#

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...

vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.1 (registry.dagger.io/engine:v0.13.1) linux/amd64

Steps to reproduce

Create a new module with dagger init --sdk=go modules/hello
Save it in a private repo which is accessible via SSH on a ...

vivid lintelBOT
#

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

vivid lintelBOT
#

This is a slightly cleaned up version of what I did at Dagger's recent team hackathon, differences being:

  1. Code is slightly improved from hackathon-quality (just so it can be easier to build off of and not complete throwaway)
  2. No exec metrics yet (like disk usage) since that PR is still pending merge
  3. It's controlled via hidden top-level dagger CLI flags now (instead of inlined consts):
    • --dot-output= will trigger writing a .dot formatted file to the given path
    • `--do...
vivid lintelBOT
vivid lintelBOT
#

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...
vivid lintelBOT
ornate vigilBOT
#

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:

vivid lintelBOT
#

What are you trying to do?

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

Why is this important to you?

No response

How are you currently worki...

vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
#

fixes #8573

I have many questions:

  1. I don't particularly like the structure of the test, adding a whole additional test that's 99% repeated code, but it seems hard to parameterize around optional params, and putting 2 WithMountedTemps in parallel creates a marshaling-into-struct ambiguity that's unresolvable.... should I be chaining or something?
  2. Is the "size" parameter in the appropriate place in the graphql schema? it can only be supplied for tmpfses, but it lives on the same lev...
#

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...

vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
#

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...

vivid lintelBOT
#

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)...
vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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).

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#
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.

vivid lintelBOT
#

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...
vivid lintelBOT
#

What are you trying to do?

The goal would be to import an image using dag.Container().Import(baseImage) and use that baseImage in a FROM statement in a Dockerfile.

Why is this important to you?

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.

How are you curr...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.5 (registry.dagger.io/engine:v0.13.5) linux/amd64

Steps to reproduce

I have a function that is just this:

func (m *InkyBuild) PythonSetup(ctx context.Context,
     ...
vivid lintelBOT
#

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/true value as an enum value, but ...

vivid lintelBOT
#

#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...
vivid lintelBOT
vivid lintelBOT
#

What are you trying to do?

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.

Why is this important to you?

The 'normal' way for these types of dependencies are for it to be installed via a package manager and live within...

#

Problem

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...

vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
#

What is the issue?

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...

vivid lintelBOT
#

What is the issue?

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 version

dagger v0.13.3 (registry.dagger.io/engine:v0.13.3) darwin/arm64

Steps to reproduce

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):
...

vivid lintelBOT
#

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...
ornate vigilBOT
vivid lintelBOT
#

What happened? What did you expect to happen?

$ 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...
vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
vivid lintelBOT
#

Fixes https://github.com/dagger/dagger/issues/8535

โš ๏ธ Stacked on top of https://github.com/dagger/dagger/pull/8708

What?

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
+โ”‚ ...
ornate vigilBOT
vivid lintelBOT
#

What happened? What did you expect to happen?

Does anybody have any examples of a monorepo? For example, I'm trying to learn how to:

  • Creating the buildEnv at the top level and leveraging this for all apps
  • Caching of node_modules in each projects (some node tooling we use forces us to use individual node_modules at the moment)
  • Supporting 2 source folders (apps/ and packages/ -- both of which are used)
#

What happened? What did you expect to happen?

Does anybody have any examples of a monorepo? For example, I'm trying to learn how to:

  • Creating the buildEnv at the top level and leveraging this for all apps
  • Caching of node_modules in each projects (some node tooling we use forces us to use individual node_modules at the moment)
  • Supporting 2 source folders (apps/ and packages/ -- both of which are used)
vivid lintelBOT
#

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.

vivid lintelBOT
vivid lintelBOT
#

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...

ornate vigilBOT
#

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...

vivid lintelBOT
#

What is the issue?

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...

vivid lintelBOT
vivid lintelBOT
#

What are you trying to do?

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

Why is this important to you?

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.

How are...

#

What are you trying to do?

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.

Why is this important to you?

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.

How are you currently working around this?

cc @vmaffet-fast @...

vivid lintelBOT
#

What is the issue?

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...

vivid lintelBOT
ornate vigilBOT
#

: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...

vivid lintelBOT
#

What are you trying to do?

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

Why is this important to you?

No response

How are you currently working around this?

No response

vivid lintelBOT
#

Problem

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...
vivid lintelBOT
vivid lintelBOT
#

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...

vivid lintelBOT
#
  • Change how secrets are managed so they are requested just in time by
    the Engine from the CLI whenever they're needed, rather than stored in plaintext from the get go.
  • New (still ugly) MapSecret API
    • Similar to AddSecret but instead of providing the plaintext value
      we map the URI of an external secret (e.g. vault://...) to a dagger.Secret
    • Need re-thinking
        1. we may only want the CLI to map a secret (e.g. avoid a module "jail breaking" by mapping more external...
vivid lintelBOT
vivid lintelBOT
vivid lintelBOT
#

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:

  • We weren't even getting telemetry for SDK module calls, now we do
  • We weren't caching SDK constructor calls, now we do

Tested by running dagger -m 'github.com/dagger/dagger@1adf268ec84693f6543d291083ee8b856a277be5' functions repeatedly and seeing how long initialize took when everything was cached and...

vivid lintelBOT
#

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...

vivid lintelBOT
#

Problem

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":

  • 100 different applications each have a Dagger module. They all implement the same interface: Build(), Test()
  • 1 module defines an App interface which includes Build and Test; and it implements a reusable Deploy method which takes an array of the Apps.
  • App teams can call the platf...
vivid lintelBOT
#

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...

vivid lintelBOT
#

add a dagger uninstall command. Following test scenarios are covered:

  • โœ… if dependency is not available in dagger.json? -
  • โœ… dependency is not used - works
  • โš ๏ธ local dependency is used - (The code gives compile error as the dependency usage is still there in module)
  • โœ… git dependency is not used - works
  • โš ๏ธ git dependency is used - (The code gives compile error as the dependency usage is still there in module)
  • โœ… git dependency uninstall by git repo url + version - wor...
vivid lintelBOT
#

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:

  • Manual setup of test contain client as using c.Container().From(golangImage).WithMountedFile(testCLIBinPath, daggerCliFile(t, c)), in other places as daggerCliBase.
  • Manual dagger init steps in...
vivid lintelBOT