#general

1 messages ยท Page 7 of 1

bitter sierra
#

@sand sierra I do export as well and it work's nice here, all files exists beforehand trough, just tested with another export directory /tmp/dagger_plugins all files are owned by me.

Now that I think about this, I'm a normal user I have no permission to write files as root so I think dagger as well.

sand sierra
#

You guys are absolutely right. I am trying to reproduce my issue but it works

#

Sorry for wasting your time

#

๐Ÿ˜”

sharp marsh
#

np! glad that worked!

tired moth
#

Which library dagger uses for tui?

sick monolith
# tired moth Which library dagger uses for tui?
GitHub

progress ui that rocks. Contribute to vito/progrock development by creating an account on GitHub.

GitHub

An engine to run your pipelines in containers. Contribute to dagger/dagger development by creating an account on GitHub.

#

Im not sure if the tui is progrock or... midterm, one relies on the other

elfin frigate
#

yeah now it's just bubbletea - no more progrock; if it's in the dependency tree still, it's probably from something silly. the TUI implementation lives under dagql/idtui (somewhat confusingly)

tired moth
#

@sick monolith @elfin frigate ok thanks a lot for clarifying.

analog raven
#

Community Call starting in a few minutes!

cunning jolt
#

Can you share a youtube link please? I don't see it in the channel

analog raven
cunning jolt
#

huh, interesting, not seeing it there either. I did get a notification since I'm subscribed but I can't find the actual live stream

analog raven
cunning jolt
#

is this on my side?

analog raven
cunning jolt
#

No acces to X ๐Ÿ˜ฆ

cunning jolt
#

ok I can see on linkedin ๐Ÿ™‚ Wonder what restricted mode on YT is. I don't have a problem seeing other streams

queen bramble
#

Any plans on daggerizing the internal steps that are currently referenced in the config file (e.g. the coverage run or even the generation step) as another module to be triggered?

slender star
#

@analog raven @chilly arch ๐Ÿ‘†

inland coral
#

@cunning jolt Did you try toggling the feature as is suggested here or is that locked down by your employer?

#

We'll look in to the Youtube studio to make sure it's not set as adult content etc.

queen bramble
#

@solomon I must have missed this interface thing. Does that mean a function can expose a structured input (interface definition) so that a different module can create a corresponding object and pass it over?! Is it this one?https://docs.dagger.io/manuals/developer/interfaces/ ? Cross-language?

The information on this page is only applicable to the Go SDK. Interfaces are not currently supported in the Python and TypeScript SDKs.

narrow nymph
#

exactly that

tired moth
#

does dagger cloud tracing coming to tui soon?

cunning jolt
narrow nymph
#

i know there's ongoing work to expand this support though ๐ŸŽ‰

elfin frigate
#

๐Ÿ‘พ

tired moth
cunning jolt
#

I agree, I don't use interfaces that way myself!

inland coral
winter linden
#

That was great @karmic sand ! <--- That's Kambui from the community call demo btw

split olive
#

Thank you all!

elfin frigate
# tired moth where i can track that work? and after this implementation dagger cloud tracing ...

most of it is in our private Linear or in my head, sorry - but yes, you can expect both the TUI and Cloud to have the same features, at least as close as possible, and hopefully with shorter turnaround time if this WebAssembly experiment pays off (looking good so far). That being said there may be features that are only in Cloud just because it's where historical data is kept, so it won't be 100% parity, but we want switching between them to feel as natural as possible

tired moth
slender charm
#

CI Env Abstraction

winter linden
#

(it's cool enough to deserve its own blog post tbh)

tired moth
cunning jolt
winter linden
cunning jolt
#

The TUI being close (or in parity) to what the Cloud traces are showing today. I think that will be a big selling point for Dagger.

winter linden
tired moth
#

dagger tracing ui in cloud is costom build or any library is used for that?

elfin frigate
#

here's the real feature parity you can expect in Cloud

elfin frigate
# tired moth dagger tracing ui in cloud is costom build or any library is used for that?

right now the Cloud UI is all custom TypeScript + React with a re-implementation of the TUI logic, but it's not 1:1 parity. with WebAssembly it'll import the same code as the TUI to cut out all the extra implementation effort, and use https://go-app.dev for the actual frontend parts

cunning jolt
coarse iris
#

Hello all. I have the following shell script that I run using dagger:

export MY_ENV="123456"
printenv MY_ENV
echo "MY ENV is " $MY_ENV

Which prints this output:

123456
MY ENV is    (blank)```
Is it possible to set your own env variables that are not exported to dagger inside the dagger container?
cunning jolt
#

Is it possible to set your own env variables that are not exported to dagger inside the dagger container?

Do you mean without using WithEnvVariable?

coarse iris
#

yes, right inside of the command / script I run

sharp marsh
coarse iris
#

and it doesn't work

sharp marsh
#
const script = `
export MY_ENV="123456"
printenv MY_ENV
echo "MY ENV is " $MY_ENV
`

func (m *Lala) Test(ctx context.Context) (string, error) {
    return dag.Container().From("alpine").
        WithNewFile("script.sh", script).
        WithExec([]string{"apk", "add", "bash"}).
        WithExec([]string{"bash", "-c", "sh script.sh"}).Stdout(ctx)

}

^ this worked

#
dagger call test
Full trace at https://dagger.cloud/marcos-test/traces/104e1dc1aa1323171345f3caebbf41f1

โœ” connect 1.1s
โœ” initialize 3.2s
โœ” prepare 0.0s
โœ” lala: Lala! 0.0s
โœ” Lala.test: String! 2.0s

123456
MY ENV is  123456
#

having said that, the bash -c is redundant. You can just call ["sh", "script.sh"]

coarse iris
#

thank you, will check my code, it has to be not connected with dagger then

candid gyro
#

It seems like the current behavior is that at default verbosity (without -s), fmt.Println (and equivalent) messages are going to be swallowed by the TTY progress output (unless the function errors out). They're visible if plain but tty is better UX. Are there perhaps any plans for introducing some kind of user output / log API for reporting back to users in a friendly way that would be visible during --progress=tty ? I could also see wanting to even show the ouput if -s , with -s being scoped specifically progress (dagger engine tracing). Any thoughts around this ?

sick monolith
#

dagger -h does not show dagger -m as an option, but the docs still show``dagger -m 'uri' call...`

dagger call -m is the correct way right?

sick monolith
#

Dagger Functions can return either basic types or objects. Objects can define their own functions (in the classic object-oriented model). When calling a Dagger Function that returns an object, the Dagger API lets you follow up by calling one of that object's functions, which itself can return another object, and so on. This is called "function c...

sick monolith
#

@winter linden you recently showed daggerverse docs with "examples", but theres nothing on the docs/daggerverse explaining how to do that. I had a look at your gha 'examples/go' but not sure how to do an example for 'shell' or something else. Tried to find daggerverse things in github but couldntr find anything to peak how i should go about that. if i make an examples/shell folder... does that even work?

sick monolith
#

ah, i think i know how it works, that shell tab wont ever do anything, since those examples are literally dagger module functions i nthe example folder.

sand sierra
#

What does exclude do in the dagger.json file? If i provide my root directory with --root . as a *dagger.Directory will it not copy the excludes?

sick monolith
#

i think it works like the docker ignore file

#

for example im using python sdk, but i wanted intellisense with pycharm and to use venv... that makes a folder like .venv and .idea, so you can add those to the exclude section

#

there's a TIP section which explains

sand sierra
#

I thought so also

#

But If i just share a directory

#

with --dir .

#

It also copies the exclude

sick monolith
#

your dagger module is usually in a folder like .dagger and your src might be in somehting like src

sand sierra
#

Yeah i've tried both

sick monolith
#

hmm

sand sierra
#

and using .dagger

#

and using the . dirctory

#

I can work around it

#

but its a little more tedious

#

Still love the expierience

#

but it has a few rough edges

sick monolith
#

there's something on this example about exclusions too, not sure if this helps you though.

winter linden
#

the excludes in dagger.json are only for the loading of the module itself. It's to avoid uploading unnecessary files when your module mixes dagger and non-dagger files

sand sierra
#

Ah ok tnx for the information

#

I've fixed it for now in my code ๐Ÿ™‚

sick monolith
#

something feels weird/off with trying to install a dependency module above (i.e using solomons gha examples folder approach. I am getting strange context / directory issues

#

something like : failed to collect local module source deps: failed to collect local module source dep: local module dep source path "../.." escapes context "/mnt/c/Users/patri/Documents/Projects/dagger-prompt/examples/python" not sure if its a windows/linux thing. Tried a bunch of different things

sick monolith
#

yeah, not sure how to actually make a subfolder of 'examples' and install a folder dir as a dependency module. I even tried making a folder outside of the main module, and couldnt get that to work either. So i thoguth mayube it was a bug introduced, downgraded to the same dagger version in solomans example 0.12.5 but still no luck. So im not sure whats going on there. ๐Ÿ˜ฆ

winter linden
#

@sick monolith here's what I did:

  1. mkdir -p examples/go
  2. cd examples/go
  3. dagger init --sdk=go --source=.
  4. dagger install ../..
  5. Implement the examples module (make sure to name your functions correctly so that Daggerverse picks them up)
sick monolith
#

step 4 fails

#

ok hold on, let me go back to 0.12.7

winter linden
#

did you mistakingly do the reverse before? Like dagger install ./examples/go from the main module?

sick monolith
#

i deffo did that too

#

failed to create module: select: failed to update module dependencies: module "examples" dependency "" with source root path "..\\.." does not exist or does not have a configuration file

#

hmmm

#

This is the 'main module'

{
  "name": "prompt",
  "sdk": "python",
  "exclude": [
    ".venv",
    ".idea"
  ],
  "source": ".",
  "engineVersion": "v0.12.7"
}
#

this is the 'python' example dagger.json

{
  "name": "examples",
  "sdk": "python",
  "exclude": [
    ".venv",
    ".idea"
  ],
  "source": ".",
  "engineVersion": "v0.12.7"
}
sharp marsh
sharp marsh
# sick monolith i deffo did that too

@sick monolith dagger-prompt needs to be a git repo. That's the only way dagger install will actually allow you install ../../ as it need to know what the scope of the project is

#

have you executed git init in the dagger-prompt foldear already?

sick monolith
#

I did not, because my thought was to get things running locally prior to doing any gitting!

#

This certainly needs documenting ๐Ÿ˜ฆ

#

I'm going to try what you mentioned shortly, hopefully that fixes it for me

sharp marsh
sick monolith
#

i even think the cli should somehow detect and report no git when trying to install dependencies

#

got it working on the mac after doing git init. However.. Windows is borked: ! failed to create module: select: failed to update module dependencies: module "examples" dependency "" with source root path "examples/python/..\\.." does not exist or does not have a configuration file

sharp marsh
sick monolith
swift inlet
sick monolith
#

there is a workaorund with WSL, open wsl, do what you need to do to get codegen done and then you can swap back to windows IDE

#

since wsl dagger (linux ) will use linux pathing and so you can kinda workaorund it for now, so not entirely blocking if users have wsl

sick monolith
winter linden
unreal latch
#

what port(s) does engine use? dafranThink
_EXPERIMENTAL_DAGGER_RUNNER_HOST=tcp://<address:port> if i want to run dagger container in another host.

modest oasis
#

hello im new in dagger, i would like to know if requires local setup for certain configurations like dagger.jsonif is possible generate the dagger.json without cloning the repo and dagger init --sdk=python --source=./dagger ?

sharp marsh
sharp marsh
modest oasis
# sharp marsh hey, Welcome! Not sure I understood what you're trying to achieve here ๐Ÿค”

heym thanks for reply i try to run a dagger pipeline on azure, i got an error "Error: failed to get configured module: no dagger.json found in directory . or any parents up to git root", i have set up all over azure devops direct on the repo, i wonder, do i need to clone the repo and run the "dagger init --sdk=python --source=./dagger" in order to create the .json i need or i can generated dynamically on the azure devops directly on the pipeline ? or is needed a local set up in order to generate this .jsonv?

sharp marsh
modest oasis
# sharp marsh ok, thx for clarifying. The idea is that you commit your `dagger.json` into your...

i got it, I still requires local setup for certain configurations like dagger.json. This contrasts with traditional CI/CD tools that allow pipelines to be defined entirely via YAML files directly in the repository. i need clone create this .jason and then push , how does dagger works in a cloud antive env where devs not allow to modify the pipeliens or other config files, for example generate this .json not allowed because of company policys? as i understood dagger function like terraform or pulumi where you need do a pre work locally, plese correct me if im wrong

sharp marsh
# modest oasis i got it, I still requires local setup for certain configurations like dagger.j...

ok, I see what you mean. The way that you can generally make this work in a more controlled environment is the following:

  1. Imaginate that you have two repositories, the github.com/app one and the github.com/ci one. The app repository is owned the application developers than should only commit code. The ci repo, is owned the the devops / infra team and they define their Dagger functions there so the rest of the organization can use them.

  2. You trigger a CI pipeline with the app repo context and then using the dagger CLI, you cand do dagger -m github.com/ci call my_function. What this does is to call a Dagger function that lives in the ci repo where your teams can have access to create the dagger.json file and the corresponding pipeline there.

modest oasis
winter linden
#

@modest oasis I think there may be a confusion. You mention dagger.json is different from traditional CI/CD yaml configs, but in terms of lifecycle, it's very similar. You commit a configuration to the repo, then your CI system can run it.

stoic knot
#

feedback: with new account and no builds, there is a spinning indicator that never goes away

sudden ocean
#

Does +ignore directive in Go SDK support multi-line list?

stoic knot
#

feedback: The link when there is no data to display is broken

#

feedback: after initial oauth login, I'm sent to the /<org>/runs endpoint, where there appear to be no builds

I noticed that the terminal output includes the /<org>/traces endpoint, and once I'm there I see the traces

From the initial login, there is no UI link to get to traces

narrow nymph
sudden ocean
narrow nymph
#

Yeah exactly, I love my little parsers ๐ŸŽ‰

sudden ocean
narrow nymph
#

Aside: have you ever read crafting interpreters? It's a favorite, all about making languages from scratch

sharp marsh
vague aspen
#

Good evening there, I would like to kindly ask you for help. I am developing POC pipeline in python, and it looks like everytime I make a change in the code, dagger calls uv and downloads/checks python dependencies again.
Is it possible to skip this step? I was looking in the documentation, github and in the #1030538312508776540 channel, without any sucess.
Thank you very much
Jozef

sudden ocean
stoic knot
sharp marsh
#

feedback: after initial oauth login, I'm

sharp marsh
#

feedback: with new account and no builds

stoic knot
#

We have concurrent yarn install commands that sometimes error in our CI workers. (conflict with the shared cache in the user home dir).

In our POC Dagger code, we have a mounted cache for dependencies per language. Should I expect this error to manifest in the same way if multiple Dagger builds (on the same worker) use the same mounted cache?

winter linden
stoic knot
sharp marsh
stoic knot
#

Do I need the -i if I'm using dagger run and doing the checks internal to our code? Like is that a requirement to use Terminal, or is -i something that opens a terminal an fail without code changes?

sharp marsh
vague aspen
worthy ivy
#

Hi i try to run the quickstart hello dagger. i got this error

#

tls: failed to verify certificate: x509: certificate signed by unknown authority

#

how can i ignore verify tls or to put ca as valid

vague aspen
# worthy ivy how can i ignore verify tls or to put ca as valid

hello, you have to build your own dagger engine image
for example

FROM ubuntu:jammy AS ubuntu
FROM registry.dagger.io/engine:v0.12.7 AS dagger-engine

# Add CA certificate
COPY --from=ubuntu /usr/share/ca-certificates/company-ca/* /usr/local/share/ca-certificates
RUN update-ca-certificates

ADD Dockerfile /Dockerfile

then export it via env variable before executing dagger

export _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-image://localhost/jj/dagger-custom-engine:v0.2.17
dagger call ...

more can be found in https://docs.dagger.io/manuals/administrator/engine

This section provides information to help you customize and adapt your usage of the Dagger Engine.

vague aspen
worthy ivy
#

ok, actually I run on mac with z-scaler (it from work)

#

if I do own dagger image i cant use with cli local computer. correct?

vague aspen
modest oasis
# sharp marsh sure, np! You too!

hi, hope your doing well, based on what you suggest i created a new repo and run the "dagger init --sdk=python --source=./dagger" this created a init.pu inside teh src/main directory, i try to call the function fro the default code is there "@object_type
class Pipelines:
@function
def container_echo(self, string_arg: str) -> dagger.Container:
"""Returns a container that echoes whatever string argument is provided"""
return dag.container().from_("alpine:latest").with_exec(["echo", string_arg])"

i run the following command :

dagger call container_echo --source=. -vv

got this error Error: unknown command "container_echo" for "dagger call"

lapis slate
modest oasis
# lapis slate Hello <@310785989754748928> ๐Ÿ‘‹ If you call the ``` dagger functions ``` command ...

in that example the function is "container_echo" correct me if im wrong, the i run the comand "dagger call container_echo --source=. -vv" i got this out put:

Error: unknown command "container_echo" for "dagger call", i followed the intruction on the documetnation i cant make it works i also created another .py file with a function called build same error
@object_type
class MyPipeline:
@function
def build

#

same error

lapis slate
#

in that example the function is "

slender charm
storm verge
#

has anyone investigated or tried using dagger in a harness pipeline ?

bitter sierra
#

Is there a +defaultSecret like +defaultPath ?

winter linden
#

it will probably have to be more restricted, because auth access is more dangerous than same-repository access

bitter sierra
#

Howto debug Publish() -- "invoke: input: container.from.withDirectory.withFile.withUser.withWorkdir.withFile.withFile.withDirectory.withEntrypoint.withRegistryAuth.publish resolve: failed to export: failed to push registry.example.com/project/container:2332 invalid reference format"

bitter sierra
bitter sierra
#

Ignore that, I have no use-case for defaultSecret, sorry.

#

I was thinking I need to provide a default but I don't luckily.

raven stag
#

Hey, dagger pins dependencies (dagger install xxx) to the SHA of the specific commit when the install was done. I've seen https://github.com/dagger/dagger/issues/7898 which talks around the dev experience on seeing the tag that initially was used to install the dependency.
Is it possible in any way, or considerable for the future, to allow pinning to a tag but not the SHA? (I've left a comment on that discussion with more context but feels that It wasn't the right place for the topic ๐Ÿ˜› )

GitHub

What are you trying to do? Right now if I add a tag to dagger.json, it will install the correct version of my module, but it will overwrite the dagger.json to show the whole git sha. It would be ni...

glacial hearth
#

Is it possible to call dagger modules and functions from code, or is it only from the dagger cli?

winter linden
#

@glacial hearth when developing your own module:

  • dagger install ADDRESS_OF_MODULE
  • This will automatically generated client bindings for your language, in your module
  • In your module implementation: dag.Foo() and all available functions should auto-complete, with the right types
  • This works regardless of your module's language, and of your dependency module's language
glacial hearth
#

Ahh, cool, so I can call the function via: client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
if err != nil {
panic(err)
}
defer client.Close()

client.Moduler().....
winter linden
# glacial hearth Ahh, cool, so I can call the function via: client, err := dagger.Connect(ctx...

At the moment the codegen for other modules is only available when developing a module yourself. If you're developing a custom client (which you seem to be) then unfortunately you won't get the generated bindings. That's something we plan on adding.

In your case, that would mean moving your client code from client-side code (probably a custom CLI?) to server-side code (a Dagger Module to extend the Dagger API)

glacial hearth
#

Ok, but if I do dagger install ADDRESS_OF_MODULE, how would you then call a function?

winter linden
glacial hearth
#

Ahh, ok.. so I need to be in the "dagger" folder, outside existing code. I have some automation code in golang, and was looking to call dagger module. It is still cool thogh it can be done from the dagger cli client... Maybe for now I could do something like "exec.Command(dagger...."

#

Thanks solomon, I will have a look and wrap my head around this cool daggerverse ๐Ÿ™‚

sand gorge
glacial hearth
#

dagger init --sdk=go --source=./dagger

in main.go:

type Projects struct{}

func (m *Projects) GetHello(ctx context.Context) (string, error) {
return dag.Container().
From("alpine:latest").
WithExec([]string{"sh", "-c", "echo hello"}).
Stdout(ctx)
}

This works:
dagger call get-hello

This remote does not work:
dagger call -m github.com/<user>/projects --get-hello

Any idears?

sharp marsh
sand gorge
#

Ok, someone's gotta add it to cookbook, because the natural way users are using the docs, is to open cookbook, and just search for things on that page.

You have the complex example (multiple) but are missing singular

sharp marsh
glacial hearth
#

Private, I did "export GITHUB_TOKEN=<token">

sharp marsh
sand gorge
sharp marsh
glacial hearth
#

dagger -m github.com/<user>/projects call --get-hello

Error: failed to get configured module: failed to get module ref kind: input: moduleSource resolve: failed to resolve git src to commit: failed to load cache key: error fetching default branch for repository https://github.com/<user>/projects: git error: exit status 128
stderr:
fatal: could not read Username for 'https://github.com': terminal prompts disabled

#

Create token:
Administration -> Access: Read-only
Contents -> Access: Read and write
Metadata -> Access: Read-only

glacial hearth
#

Hey, yes, I have done "export GITHUB_TOKEN=<token>" and created the token with these: Create token:
Administration -> Access: Read-only
Contents -> Access: Read and write
Metadata -> Access: Read-only

swift inlet
glacial hearth
sand gorge
#

Hey! Secret vs No Secret? ๐Ÿค”

This postgres module - the credentials for user/pass are defined as dagger.Secret

https://daggerverse.dev/mod/github.com/grouville/daggerverse-tom/postgres@2b30c86c46201e470748df42505da8e77af3bd54#Postgres.user

I actually don't want a secret, I just have Strings here, because this is a tutorial and I'm not wanting to over-complicate things right now ..

Shall I just ditch this plugin and manually put together my postgres Service?

Opinions?

UPDATE: I found another module, so I'll just use this one as it takes strings - https://daggerverse.dev/mod/github.com/kpenfound/dagger-modules/postgres@57352e06a1cfbcb5307c009d37c0201b2719b935#Postgres.client

But I was curious about the conversation in general, really.

sick monolith
#

what makes dagger.Secret complicated?

#

i'd personally keep secret, its a great feature and shows security is treated as a 1st class citizen

#

dagger call example --user=cmd:"echo user" --password=cmd:"echo password" - I think that might be good for an example

slender charm
# sand gorge btw, on our docs I don't think we have a way to set a SINGLE env var on a contai...

Nice catch, I am surprised to see this, I only ever use WithEnvVar, I didnt even know about the other option. Feels like the cookbook should show both ways

Added an issue here:https://github.com/dagger/dagger/issues/8439

GitHub

What is the issue? Right now we show you how to add multiple env var in container but not a single one. We should show both in the cookbook. https://docs.dagger.io/cookbook/#set-environment-variabl...

sand gorge
slender charm
glacial hearth
#

I can see errors in dagger.gen.go, should I re generate orsomething?

sick monolith
#

i suppose depends on what parts your demo is going to show

sand gorge
sick monolith
# sand gorge <@130061041580113920> that is an option .. and yes like you said .. it depends o...
func (m *Spikes) Secret(ctx context.Context, user dagger.Secret) (string, error) {
    val, _ := user.Plaintext(ctx)
    return dag.Container().
        From("alpine:latest").
        WithExec([]string{"echo", val}).
        Stdout(ctx)
}

seems concise to me, but maybe you can do your first steps "without secrets" then someone may say "heyy what about security" etc etc. then you can do a before/after showing the minor differences. Then its not too much info overload when theyre first presented dagger as a new tech

sand gorge
sharp marsh
sand gorge
#

I'm using AI to scan the dagger docs and find me what I wanna know ๐Ÿ˜›

sand gorge
#

Hey @wispy tapir I found a bug in your postgres module - this env var should be POSTGRES_DB not POSTGRES_DATABASE ๐Ÿ™‚

I just spend FAR to long debugging my code, trying to understand why my stuff doesn't work ๐Ÿ˜…

https://github.com/quartz-technology/daggerverse/blob/627fc4df7de8ce3bd8710fa08ea2db6cf16712b3/postgres/database.go#L23C30-L23C47

GitHub

Daggerverse modules made by Quartz. Contribute to quartz-technology/daggerverse development by creating an account on GitHub.

winter linden
#

@elfin frigate dagger --no-exit is guy_fieri_chef_kiss

#

We should have made that a topic in the 0.13 release post honestly

#

I didn't realize it was already merged!

#

dagger -E call ... -> if your pipeline fails, you stay in the TUI, and you can navigate the trace to inspect the failure

elfin frigate
#

glad ya like it! now we just need a keymap equivalent for when you realize too late haha

raven stag
#

Random question: Are there plans to add defaults to the socket type arguments? (Like Directory type has right now)

winter linden
#

Dagger 0.13 is out! we have lots of goodness in this release:

  • First-class support for monorepos, thanks to context directory access and pre-call filtering
  • Support for private modules! I know many of you have been asking for that!
  • A new CLI command: dagger core to call the core Dagger API directly from the command-line. Great for debugging, experimentation, and quick one-liners
  • dagger -no-exit (-E for short) which lets you stay in the TUI after the call is complete. Great for investigating an error!
  • A module called compatchecker, which helps you... check your module for compatibility (love a nice descriptive name)
  • Faster Typescript SDK, with more performance improvements coming soon
  • And more.

Check it out at https://dagger.io/blog/dagger-0-13

Please consider tweeting, posting, etc. etc. We appreciate your support!

Powerful, programmable CI/CD engine that runs your pipelines in
containers โ€” pre-push on your local machine and/or post-push in CI

glacial hearth
#

Do dagger keep some caches around, I have some errors that was for an older project with same name. I have tried: rm -rf ~/.dagger
and docker system prune -a

sick monolith
#

is it bad to admit i only just noticed now that the dagger logo is an impression of a rocket launch.

#

i was looking at the twitter post and it just clicked in my mind

sick monolith
sand gorge
#

-E is ๐Ÿ”ฅ so you can hang around in the daggerverse for just that bit longer, after pipeline completes

wispy tapir
#

daggerverse/postgres/database.go at 627f...

inland coral
bitter sierra
#

My PoC is done. Auto Deploy to Kubernetes with OSS only:

Software:

  • dagger
  • k3s + rancher
  • gitea
  • harbor (goharbor)
  • drone
  • argocd

I'll write step-by-step guide now.

sharp marsh
bitter sierra
#

Well it does what I wan't, I push to a specific branch and about 5 minutes later it's live ๐Ÿ™‚ I'm not happy about the complexity of the pipeline. Not sure there's an easier way to make that happen.

#
#!/usr/bin/env bash
IFS=',' read -r -a DOMAINS <<< "$1"
SHA=$2

if [[ ! -e ~/bin/yq ]]; then
    VERSION=v4.2.0 BINARY=yq_linux_amd64
    wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O ~/bin/yq
    chmod +x ~/bin/yq
fi

git -c credential.helper='!f() { echo "username=${GIT_USER}"; echo "password=${GIT_PASSWORD}"; }; f' clone https://git.example.com/Project/chart.git
pushd chart/Project

for DOMAIN in "${DOMAINS[@]}"
do
    ~/bin/yq e -i '.frontend.image.tag = "'${SHA}'"' ${DOMAIN}-values.yaml
    ~/bin/yq e -i '.backend.image.tag = "'${SHA}'"' ${DOMAIN}-values.yaml
    git add ${DOMAIN}-values.yaml
done

cd ..

git commit -m "${SHA}"
git -c credential.helper='!f() { echo "username=${GIT_USER}"; echo "password=${GIT_PASSWORD}"; }; f' push

popd
rm -rf chart

This little script is very important in my pipeline, it patches the example.com-values.yaml with the new image tag.

sick monolith
bitter sierra
#

This is my .drone.yml (the pipeline):

---
kind: pipeline
type: exec
name: default

platform:
  os: linux
  arch: amd64

steps:
steps:
- name: submodules
  commands:
    - git submodule update --init --recursive

- name: Install dagger
  commands:
    # Install dagger
    - curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=$HOME/bin DAGGER_VERSION=v0.12.7 sh

- name: Build and publish the backend image.
  environment:
    REGISTRY:
      from_secret: registry
    REGISTRY_IMAGE:
      from_secret: registry_image
    REGISTRY_USER:
      from_secret: registry_user
    REGISTRY_TOKEN:
      from_secret: registry_token
  commands:
    # Run dagger
    - $HOME/bin/dagger call publish --source=. --reg="$REGISTRY" --reg-image="$REGISTRY_IMAGE" --reg-user="$REGISTRY_USER" --reg-token="env:REGISTRY_TOKEN" --reg-tag="$(echo ${DRONE_COMMIT_SHA} | cut -b -7)"

- name: Build and publish the frontend image.
  environment:
    DOMAINS:
      from_secret: domains
    REGISTRY:
      from_secret: registry
    REGISTRY_IMAGE:
      from_secret: registry_frontend_image
    REGISTRY_USER:
      from_secret: registry_user
    REGISTRY_TOKEN:
      from_secret: registry_token
  commands:
    # Run dagger
    - /bin/bash ./.drone/dagger-publish.sh "$DOMAINS" "$(echo ${DRONE_COMMIT_SHA} | cut -b -7)"

- name: Stop dagger
  commands:
    # Stop dagger
    - docker stop -t 300 $$(docker ps --filter name="dagger-engine-*" -q)

- name: Update chart
  environment:
    DOMAINS:
      from_secret: domains
    GIT_USER: drone
    GIT_PASSWORD: 
      from_secret: git_password
  commands:
    - /bin/bash ./.drone/argocd.sh "$DOMAINS" "$(echo ${DRONE_COMMIT_SHA} | cut -b -7)"

trigger:
  branch:
    - drone
  event:
    - push
sick monolith
#

there' also a dag.Git which you can use in order to mount/extract files

bitter sierra
#

dagger-publish.sh

#!/usr/bin/env bash

IFS="," read -r -a DOMAINS <<< "$1"
SHA=$2

for DOMAIN in "${DOMAINS[@]}"; do
    $HOME/bin/dagger call frontend-publish --source=. --backend="$DOMAIN" --reg="$REGISTRY" --reg-image="$REGISTRY_IMAGE" --reg-user="$REGISTRY_USER" --reg-token="env:REGISTRY_TOKEN" --reg-tag="$SHA"
done
#

So... I have to write a complete Guide now, instead of spreading peaces around.

bitter sierra
bitter sierra
#

Tomorrow is another day so .... ๐Ÿ™‚

sick monolith
#

from an observation what I would say, and this more my gut feel, you could likely utilise some other core dagger primitives, if something is a file, dag.File, if you're writing loops - could that be written in the language sdk as a loop, as apposed to in the bash. You have some other CLI usage in that bash, some may or may not be available as dagger modules, like yq. - But a strong note that this is obsevations, and i think the more exposure to dagger you get, how you see/approach things will change over time, and i say that because that's what happened with me.

sharp marsh
bitter sierra
#

Maybe I gonna write a reusable gitops module that does:

  • git clone
  • patch values
  • git push

Without any external deps

sharp marsh
bitter sierra
rigid pebble
sand gorge
#

Last night I introduced my friend to Dagger. Gave him a little workshop.

He was mesmerized.

Today he sent me this.

We have another fan ๐Ÿ˜

bitter sierra
#

@rigid pebble thanks, I'll copy&paste some stuff for my helm + argocd approach ๐Ÿ™‚

#

@rigid pebble if you want I show you the whole approach via screen-sharing.

thick igloo
#

this is the only way we can get a failing github action ๐Ÿ˜… forgetting to align the dagger version of the action with the one in the code ๐Ÿ˜‚

pine crag
#

hey folks! does anyone here use Preview Environments part of their CI setup with (or without) dagger? We recently created a Dagger module which helps you to set up Preview environments pretty easily with Dagger. If this is something you're interested in, please let me know I can help you get started. More details can be found on #okteto

cerulean wraith
sand gorge
#

Hey. Can we take graphql calls and generate code out of them?

#

Like if you build it in Golang. And then can somehow convert that code to PHP because we know the graphql calls

sharp marsh
sand gorge
# sharp marsh you mean generate a GraphQL client out of the Dagger GraphQL API?

no. Not make the client, but the end-code ... if I have golang code here .. I could generate PHP code out of that golang code, if we can write a generator from the graphql spec.

It's similar to what we do currently, in the SDK's themselves, but generating ->withExec()'s and ->from()'s pertaining to each specific language

like python has @function, and PHP has [#DaggerFunction]

make sense? (i hope :D)

vestal creek
#

Why would you want to generate a module in another language when Dagger can consume modules in any language?

sand gorge
# vestal creek Why would you want to generate a module in another language when Dagger can cons...

I'm not generating a module, the context is for writing tutorials and documentation.

If there are code examples in one language and I want to generate the same code in another langugae .. then I need to convert it by hand .. whereas we can have a generator do the work for us, one that understands the language-specific implementation that we've built.

An AI tool won't work, as it doesn't understand all the little details about our SDK implementation.

The information is there, in the graphql already, and I'm wondering if someone has already implemented this yet?

winter linden
sand gorge
sand gorge
#

Apart from our homepage, is there a page that answers the question of "why dagger?"

sick monolith
#

And on the main site, i suppose also is a 'why' but not part of the docs: https://dagger.io/dagger-engine

80% Faster Build Times: Powerful, programmable CI/CD engine that runs your pipelines in containers โ€” pre-push on your local machine and/or post-push in CI

sharp marsh
winter linden
#

My guess is that with enough context, LLMs can solve this

#

With a dozen or so manually crafted multi-language examples, maybe the raw api reference in the context, I bet the new o1 model could get to 90% success rate

sand gorge
frozen basin
#

Back in the disc after a long time. Reading through this spec on caching and exploring the new dagger-engine local-cache API . Very cool stuff guys

#

Revisited some old build pipelines and revamped with cache vols, we've cut some of our build times from ~5-6hrs to 1.5 (which is about the min due to some other constraints).

Loving the progress! ๐Ÿ”ฅ

lime snow
#

Is there a way for me to export the generated /schema.json with --interactive? Basically I'm looking for an --on-fail-copy-this-file=schema.json

inland coral
sand gorge
sick monolith
#

export a dir. add the file if there was a failure. then you only need 1 dagger call. that could also work?

prisma magnet
#

I worked a bit with docker container testing using dagger. While checking e.g. files or envs was pretty straight forward I did not find a way to check out running processes. I.e. I want to check that a process inside is actually running. Is there a way to do this?

#

looking at services they did not look like they would solve that, since I can only interact with them via network, but cannot look inside

lime snow
sick monolith
#

function do-something -> dagger.Directory (.... do things, return a dir of the container) - grab a file out of a container in a dagger function, or a log file etc dependong on exit code, then add that file to a dag.directory and return the dir.

#

export exists on container, to tar the image, also on a dir to export a folder within the container or on an individual file

chilly arch
lime snow
# sick monolith function do-something -> dagger.Directory (.... do things, return a dir of the...

Hi Patrick, thank you for the help that would work on a custom function.

The issue is I am calling:dagger install <my-test-module>. So I cannot change it to return a directory or anything, it's a built in function.

I can get into the container with dagger install <my-test-module> --interactive but the /schema.json file is very long... It would just be handy to be able to export that file.

sick monolith
#

interesting... so the dagger install is only when you want to call that from another module. can you not provide a container result from that module and then do some wrapping in the consuming module to get the file out? also what's the use case here? is this simply debugging a module you are designing?

#

If the dagger install is failing... I feel like that's a dagger bug or issue not giving feedback on why it failed.

lime snow
chilly arch
#

๐Ÿš€ Dagger Community Call Tomorrow! ๐Ÿš€

Join us for our bi-weekly Dagger Community Call to explore exciting updates and connect with fellow Daggernauts!

๐Ÿ” Whatโ€™s on the agenda?

โ€ข Meet Devs Where They Are: Why IaC Must Be Real Code by @slender star
โ€ข Dagger 0.13 Recap by @winter linden and team

๐Ÿ“… Date: Thursday, September 19th
๐Ÿ•˜ Time: 9:00 am PT

You can join the live stream on LinkedIn or Twitter.

๐Ÿ‘‰ Add the series to your calendar: https://calendar.google.com/calendar/u/0?cid=Y19mZDEyYWRjOTI3ZTQ0MDVkMGY2NmUyZjA2Yjk0OTI3YzI4ZjA2YzJkMWQzZDFiOTRlNTIwMjZkNGU0MjMzNWQxQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20

See you there!

tired moth
tired moth
chilly arch
chilly arch
timber sphinx
#

renovate preset for dagger

chilly arch
#

AWS re:Invent 2024 - you going?

thick igloo
#

hi there, anyone with a templating utility module ready out there? pretty simple in my mind, just like File in File out and some way to pass values to fill in. What do think? Does it even make sense?

narrow nymph
thick igloo
wanton pumice
#

silly question:
If i use cacheVolume in dagger, does it automatically create a cache in the dagger cloud, or only on the host machine (where dagger engine container is running)?

winter linden
wanton pumice
winter linden
wanton pumice
#

okay, i understand.
thank you very much for taking the time to reply!

slender charm
# thick igloo hi there, anyone with a templating utility module ready out there? pretty simple...

No utility module but I have one that uses Jinja in case you need some inspiration on one approach to work with the generated file

I think this could use some more love/refactoring/abstraction but it works for me ๐Ÿ™‚

https://github.com/levlaz/daggerverse/blob/b247aafe6d2204c4bdd2568ad75dabc7cd2ddf9d/miniflux/dagger/src/main/__init__.py

GitHub

Personal Collection of Dagger Modules . Contribute to levlaz/daggerverse development by creating an account on GitHub.

thick igloo
winter linden
thick igloo
winter linden
#

graphql doesn't have dict/maps unfortunately. so yes that's what probably the closest equivalent

sharp marsh
fossil pine
sudden otter
#

Can I suggest having long commands in documentation in multiple lines, like this? They would be much more readable. I'm willing to send a PR, if you like the idea

#

The current one-line format forces to do a horizontal scrolling with the mouse, for each single example

sick monolith
#

those only work on bash.

#

can't copy paste into powershell since it uses backtick `

#

but I guess anyone using powershell like me gets karma for not running a Unix os I guess coolcrying

slender charm
sick monolith
#

yes and no

#

your windows users will not like it

#

your wsl users won't mind it

sick monolith
#

oh my god. its because of Windows file path being \ instead of the Unix /

#

but I have noticed and my opinion as a windows users, the docs are heavily Unix only samples. another example is piping strings into the dagger cmd like graphql. it's different in powershell/cmd

#

but most windows users know the story. it's common in the industry. we decide to walk on broken ice and windows users just don't want to admit it.

slender star
#

I think of backtick in powershell as "the littlest backslash"

sick monolith
#

haha

#

the cute shell trying to be like a proper shell like bash.

#

it is cross platform now though!!

slender star
#

no disrespect, since powershell is a powerful beast, but maybe we can have a view option that flips ` and \

sick monolith
#

balance between bloat and clean docs though

#

I think it will add too much noise but I wonder if there's other cli tools with docs that do similar with windows/Unix samples

#

unless you mean a bit like a dark/light mode button in the top right

slender charm
#

I was thinking about using window.navigator in JS to detect the OS and then show you something else by default haha

slender star
#

Could be a logged-in docs experience with preferences. Anything is possible! ๐Ÿคฉ

sick monolith
thick igloo
tawdry imp
#

Hello! So following the latest dagger release with support for private git repos, I spent some time playing with it again, and it's awesome to (finally) be able to use private dagger modules. A little voice on twitter told me to share my feedback with @swift inlet ๐Ÿ˜‰ so thanks for your work!
However, if you manage to make it work without the ssh-agent, it will be easier to use for us in the context of gitlab-ci jobs. it's not a big deal, but it requires a few more lines of YAML to prepare everything: install ssh-agent if needed, start it, add the key, etc. If we want to sell dagger as "1 cmd to do xyz", but you need 10 lines before for the setup...
anyway, thanks again, I've been waiting for this feature since last year, I'll be able to break down our monolith dagger pipeline into modules that are easier to re-use for different projects - and then spread some dagger love in other teams!

lethal escarp
#

Hello, I've been looking into using Dagger in my teams workflows. I'm mostly a golang dev and dagger was very straightforward for that but my team is co-joining into a bigger Java team and I have bit a of a knowledge gap I hope someone could fill in. That Java team uses some combination of maven and JIB, would there be any trouble trying to use JIB with Dagger?

slender star
#

Hello, I've been looking into using

slender charm
#

Hello! So following the latest dagger

sudden otter
#

Today I have introduced, for the first time, in an official productive .NET project, Dagger. I'm presenting it to the rest of the company in the next months.

winter linden
chilly arch
# sudden otter Today I have introduced, for the first time, in an official productive .NET proj...

That's great to hear @sudden otter ! Thank you for sharing. We look forward to hearing how your presentation goes.

If you need a Dagger intro deck to use for your company presentation, feel free to use any of these slides - https://docs.google.com/presentation/d/1q3pvstVED0i2zP5eNeHZcQWWFKUTZxOke4I2CMFY2dc/edit?usp=sharing

You can see an example of a Dagger pitch using similar slides here - https://youtu.be/Whp86W0afg0

fossil pine
#

I did a podcast episode with Kyle from Depot discussing how Dagger and Depot supercharged our CI pipelines: https://www.youtube.com/watch?v=4MNDCntVyq8

They did a follow up blog post: https://depot.dev/blog/comparing-github-actions-and-depot-runners-for-2x-faster-builds

And here is our original blog post: https://openmeter.io/blog/how-we-made-our-ci-pipeline-5x-faster

Interview with Sรกgi-Kazรกr Mรกrk from OpenMeter, discussing their recent blog post "How We Made Our CI Pipeline 5x Faster"

โ€ข Blog Post: https://openmeter.io/blog/how-we-made-our-ci-pipeline-5x-faster
โ€ข Depot follow-up: https://depot.dev/blog/comparing-github-actions-and-depot-runners-for-2x-faster-builds

๐Ÿ”— Connect with us
โ€ข Discord - https://dep...

โ–ถ Play video
Depot

We love GitHub Actions, but the default runners are slow and expensive. We benchmarked the performance of GitHub Actions runners against Depot runners and found that Depot runners are 2x faster and half the cost.

We accelerated our CI pipeline from 25 to 5 minutes and reduced costs by 50% using Dagger's caching mechanisms and Depot's custom runners.

dense gate
raven stag
#

Am I correct in assuming optional args are not supported in dagger interfaces?

#

(at least, not in the golang sdk?)

sharp marsh
elfin frigate
elfin galleon
#

Hi there, I'm trying to get my company to buy into this thing, but hitting a hurdle with large files in the github repository, impossible to get rid of them as our company has a culture of using github LFS and checking in binaries of 160mb~400mb in size. I see there's a lot of stuff going on in the dagger ignore space but I can't figure out what direction it's going or if there's something I can adopt right now. To make matters worse, I have to use windows here and docker on windows is an absolute klunker, performance wise, particularly with respect to file operations. Can anyone hit me with the clue stick please ๐Ÿ˜„ (engine version v0.13.3)

old lotus
#

is there a way to annotate/curate the spans in dagger UI? I have a lot of spans that I don't really care about, and others I'd like to make easier to see or filter. I thought the container labels would be a good use for this.

slender charm
#

Custom Spans

dense gate
golden cypress
#

I've used Dagger to build a couple of experimental pipelines, but Iโ€™m wondering if it can go beyond CI/CD. It seems to overlap with tools like Nix or devenv for setting up environments, and Docker Compose for running services. Is anyone working on using Dagger for these kinds of things, or is it better to focus on its strengths in CI/CD?

thick igloo
# golden cypress I've used Dagger to build a couple of experimental pipelines, but Iโ€™m wondering ...

your not alone! I think is a common symptom after a long exposure to the open Daggerverse ๐Ÿ˜… Joking aside, what I see very unique is the possibility to put together tests and dev environenment in a coherent way. Like, install dagger and you will have our suggested dev environment AND a test suite that is IDENTICAL to what runs on our CI pipelines. The next to next step is to say also "you can use it also as a CLI", that cannot apply all the times though

fossil pine
#

Here is what I did last: we are migrating from OpenAPI to TypeSpec (for obvious reasons). But we still generate SDKs from OpenAPI ๐Ÿ˜ฌ , so we need some backward compatibility. I wrote a function that runs openapi-changes (https://pb33f.io/openapi-changes/) to compare the old and the new OpenAPI, so we can discover breaking changes.

Source: https://github.com/openmeterio/openmeter/blob/main/.dagger/dev.go#L108
Module: https://daggerverse.dev/mod/github.com/sagikazarmark/daggerverse/openapi-changes

But I agree with @thick igloo : once you get hooked on Dagger, it's hard not try and pack everything in there.

Although watching for file changes and rerunning parts of the pipeline is really missing.

slender charm
#

Here is what I did last: we are

coarse hatch
#

On https://docs.dagger.io/manuals/developer/state-functions/ both the module fields and the module constructor's arguments are marked with pragmas but I don't see how the pragmas from the struct fields (Greeting in the example) would be taken into account since the New constructor already handles the pragmas. Is it a docs oversight or am I missing a subtlety ?

Object state can be exposed as a Dagger Function, without having to create a getter function explicitly. Depending on the language used, this state is exposed using struct fields (Go), object attributes (Python) or object properties (TypeScript).

slender charm
#

Im hacking on some random GNOME stuff and every time I see a README like this is makes me want to make a dagger module just to specify what the actual dependencies are ๐Ÿ™‚

https://gitlab.gnome.org/GNOME/evolution/-/wikis/Extensions

Got started on one here: https://github.com/levlaz/daggerverse/blob/main/evolution/src/main/main.py

I am on a mission to turn every complex README into a dagger module ๐Ÿ˜

GitHub

Personal Collection of Dagger Modules . Contribute to levlaz/daggerverse development by creating an account on GitHub.

celest grove
#

Hey @slender star ! by any chance do you have these slides that you used here https://www.youtube.com/watch?v=Whp86W0afg0&t=67s 'shareable' somehow?

Jeremy demonstrates Dagger's capabilities in building, testing, and deploying applications. He highlights the use of modern programming languages, containerization for isolation and caching, and seamless CI server integration.

In this video, he will also showcase Dagger's visualization tools and modular functions, which improve debugging and t...

โ–ถ Play video
slender star
#

Introduction to Dagger

winter linden
#

Hi everyone, the Dagger team is spending the week together at our annual team retreat in sunny San Diego, California. The bad news is that we'll be slower than usual in answering questions. The good news is that we'll be working hard to ship many more improvements to you ๐Ÿ™‚

ancient escarp
#

Do we know when 0.13.4 is planned for release?

narrow nymph
#

next week sometime, maybe tuesday? maybe wednesday?

chilly arch
#

Thanks to @high crystal , we have our latest Dagger Case Study published. Check it out here!

" Everybody's just happy to have the consistency problem solved. You can log on to that site or this site, or a cluster from a different customer, and all the deployment steps are always the same. Everything just works, thanks to Dagger."

https://dagger.io/blog/safespring-case-study

elfin galleon
#

I can't find a way (using dagger) to tag an image, but not push it. I want to be able to create an image, but I don't want to push it to a remote repository. This would be quite common when I'm working with just Docker locally, I haven't reached the stage of project development where I set up private repository + I'm itterating rapidly, I don't want to unnecessarily use up my (starlink) connection. Any suggestions? I could easily just run the docker build on it's own but it seems ugly to break out of the pattern of using dagger to interface with all container stuff.

tired moth
#

can anyone share a dagger powered monorepo example with typescript code and with TS SDK of dagger? PLEASE HELP

sick monolith
# tired moth can anyone share a dagger powered monorepo example with typescript code and with...

I dont know any but until someone can give you a good response i have an idea, though it would require some more searching to see...

Github advanced search

https://github.com/search?q=path%3A**%2Fdagger.json++typescript&type=code&ref=advsearch

GitHub

GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

#

this should give you all repos where there is a dagger.json file, and also typescript is found, hopefully sdk: "typescript", but this doesnt mean the entire repo is... but it might be a good way to find stuff out there on github that is public

stoic knot
#

I have a nice monorepo + Dagger TS setup, but it is

  1. private
  2. based on the SDK, not Dagger "functions", i.e. custom cli
#

I have a pattern of creating a single entrypoint at the root for all operations in my monorepos

So I can type ./dx build foo,bar or ./dx changeset start <name>, some of which is dagger, some of which is not, and we can do complex operations without devs having to remember a series of commands. The CLI aligns with the work tasks they perform

tired moth
#

@sick monolith ok thanks

tired moth
chilly arch
cunning jolt
#

wow what a backdrop!

winter linden
#

We're cooking up some good stuff for you all, more soon ๐Ÿ™‚

tired moth
ancient escarp
slender charm
#

Unexpected but delightful thing happened today when I noticed that the "w" link from the interactive terminal "just works" inside of CircleCI

stoic knot
slender charm
stoic knot
#

Dagger should join ;] Kelsey Hightower has said he tried to post to Bluesky first now (social proof?)

warm temple
slender charm
stoic knot
#

y'all be excited to hear I just got the green light for 2 weeks of daggerization

slender charm
stoic knot
#

sure, it might be more interesting for you to see how we handled a mega/poly repo by wrapping the SDK in a CLI. I have a pretty good handle on the Dagger aspects now, we worked through most of the IRL issues with the dev experience. I may end up writing something akin to Dagger functions (whereby I use Go introspection to find what commands can be run for a particular service (directory) in the repo)

#

The goal is to create something more end-to-end, so far we are mainly building binaries and then exporting them and then running docker build/tag/push on Dockerfiles. The aim is to run the full build/test/sonar/publish per service and then wrap the entire product in a single dagger call (which is where being able to separate out the services in the Dagger UI from a single connection would be helpful)

#

I have a feeling that building 20+ services in a single call is going to make the traces and logs pretty long (though that is how they look today in our current CI & Jenkins UI anyway...)

frozen basin
#

hey guys - wondering what ever happened to the graphql playground. Can I run that locally to see what modules I have loaded etc?

frozen basin
sharp marsh
frozen basin
#

ty

sharp marsh
old lotus
#

i like the recent release's (0.13.4) addition for services to have centrally defined hostnames. Would it make sense to also do something similar for mounts? Something like:

dag.CacheVolume("myvolume").WithPath("/shared/data")
sharp marsh
# old lotus i like the recent release's (0.13.4) addition for services to have centrally def...

you can kind achieve that today using the With helper method in the Container type. For example:

func WithCache(name string) func(*dagger.Container) *dagger.Container {
    return func(c *dagger.Container) *dagger.Container {
        return c.WithMountedCache("/tmp/cache", dag.CacheVolume(name))
    }
}

func (m *Lala) Test() *dagger.Container {
    return dag.Container().From("alpine").
        With(WithCache("cache")).
        WithExec([]string{"echo", "Hello, world!"})

old lotus
stray tendon
#

Hi!

I wanted to ask what is (if there's any) the current method to run and scale dagger pipelines?
I know there's currently a issue discussing it but I wanted to hear how everyone else is doing it

And I'm wondering if it would be possible to create a cluster of dagger nodes (each node running an engine) where I'll be able to run the dagger cli from anywhere and it would schedule a job on the cluster?

I know there's k8s and friends but one issue I faced there is that if I'm using k8s based CI system, where it would create a pod each time to run a dagger pipeline, I would quickly hit the pod per node limit (which its like 110~), so its not really scalable in that case...

fossil pine
#

Use Dagger to achieve isolation and reproducibility with Helm, including running linters, tests, and pushing to a registry.

GitHub

Demo: Testing and releasing Helm charts with Dagger - sagikazarmark/demo-dagger-helm

sharp marsh
#

btw, I recall we spoke about adding some features to the k3s module to simplify some of the part, right? I should open some issues so I don't forget about them ๐Ÿ™‚

fossil pine
#

It would also be nice if Container.Publish supported name resolution, so we can ditch the skopeo part.

sharp marsh
potent gate
smoky dock
#

hello everyone, quick question about Dagger phylosophy

i'm doing a POC for me neeed with dagger, but one question come in mind.
do i need to handle with dagger which file are changed between my PR and MAIN or i let the CI/CD orchestrator (gitlab CI/GithuAction/ARgoWorflows) handle this for me ?

slender star
#

hello everyone, quick question about

sturdy bluff
#

Any daggernautโ€™s at hashiconf today?

chilly arch
#

๐Ÿš€ Dagger Community Call Tomorrow! ๐Ÿš€

๐Ÿ” Whatโ€™s on the agenda?

โ€ข Deploying to Fly.io using Dagger and GitHub by @sage veldt
โ€ข PocketCI: end-to-end CI with no YAML in sight by @rigid pebble
โ€ข Scaling GenAI Inference with GPU-Optimized VMs on Shadeform by @thick igloo

Whether youโ€™re new to Dagger or a seasoned pro, this is the perfect opportunity to stay up-to-date and get inspired!

๐Ÿ“… Date: Thursday, October 19th
๐Ÿ•˜ Time: 9:00 am PT

๐Ÿ‘‰ Add the series to your calendar:https://calendar.google.com/calendar/u/0?cid=Y19mZDEyYWRjOTI3ZTQ0MDVkMGY2NmUyZjA2Yjk0OTI3YzI4ZjA2YzJkMWQzZDFiOTRlNTIwMjZkNGU0MjMzNWQxQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20

cunning jolt
#

Will there be a sneak peek of the cool stuff @winter linden teased us about from the offsite? ๐Ÿ™‚

winter linden
#

Ha ha, if there's time for it, we can certainly do that

#

Otherwise, we can do a separate demo ๐Ÿ˜›

stoic knot
#

@slender charm (or anyone else), I have an initial POC and some traces in the Cloud UI that I can show you. I noticed one thing for feedback (we have built,test,sonar steps, i.e. multiple WithExec, but only the last one shows up in the overview. I can see the logs in the details below). Can also give you an idea of how we are holding it and what our goals are. Monday would probably be ideal, want to get one more loop working to show you a bit more, and Tuesday is the POC deadline, and having your input for that will be helpful

cunning jolt
#

I'm on linkedin and I can't read the text on the screen at all. Very blurry.

chilly arch
#

shout out to @solar raptor 's Helix tool showing up at the Dagger demo. Love seeing Dagger and Helix together!

humble sage
#

Where is the community call chat ?

slender charm
#

Feedback Session

chilly arch
# humble sage Where is the community call chat ?

You can add comments here or on YouTube stream directly https://www.youtube.com/watch?v=mxFBOGh9jWg

Join the Dagger team and fellow Daggernauts for our bi-weekly Community Call! Stay up-to-date with the latest product enhancements, discover innovative use cases, and gain valuable insights from community demos.

Whether youโ€™re new to Dagger or a seasoned user, thereโ€™s something for everyone!

โ–ถ Play video
humble sage
#

@chilly arch Thanks, I misunderstood that the chat was somewhere in Discord...

sage veldt
#

Watching Diegos demo and the curl's he's making in the functions ... did anyone try coming up with tool that takes OpenAPI spec and turns it into a dagger module?

warm temple
#

I know @wraith niche has done a lot on this front too

sage veldt
#

oh, I actually meant OpenAPI (not OpenAI :)) -- so you take Swagger doc for example and it turns that into functions

warm temple
#

facepalm naming lol. I know that's been talked about a lot too but I don't know of any modules off the top of my head

chilly arch
#

GPUs, GPUs, GPUs :wink: :thread:

chilly arch
#

We should make a pre-requisite question for Dagger Community - Do you like Yaml or not?

warm temple
#

๐Ÿ‘† if you say yes

#

(just kidding, stay and we will show you the way โค๏ธ )

thick igloo
#

Diego's demo misc links

warm temple
chilly arch
cunning jolt
#

lol! I'm still here ๐Ÿ˜„ But can wait

#

love it!

sharp marsh
#

@chilly arch presenters video is overlapping with the terminal ๐Ÿ™

warm temple
#

I tried to sacrifice myself and it resized ๐Ÿ˜‚

#

Now it's good

chilly arch
cunning jolt
#

Thank you for doing that demo

#

I can see usage of the shell (repl?) for development. I still can't envision how it benefits consumption of modules. But you did mention that it will become the way it's called in CI etc, so I'm curious to see examples and try it out.

chilly arch
analog cape
#

@warm temple heya friend, hope you're doing well ๐Ÿ™‚
While I just passed by to say hi during today's community call, I heard part of discussion around GPU (GPU GPU ... did Solomon appear already? ๐Ÿ˜… ) and I quickly checked wolfi packages (image attached).
To potentially avoid moving to far off the current alpine image you use, wolfi could be a solution instead of going "bigger" image. (but really just an idea, didn't got the whole point and I might be really confused about what was talked about)

thick igloo
sage veldt
slender charm
#

Dagger really feels like magic sometimes!

I wrote a blog of how I ported my Bluesky module from python to typescript (because I am lazy and the bluesky typescript SDK is better) but ended up leaving the smoke test suite I wrote in python since its just another dagger module and just works ๐Ÿค“

https://levlaz.org/dagger-feels-like-magic/

proof -> https://bsky.app/profile/levlaz.bsky.social/post/3l6rakfi5wp2d

The old version of my module did not properly expand links and this one does! ๐Ÿ˜„

real kite
#

Is Dagger going to be present at Kubecon US 2024 next month?

wraith niche
chilly arch
naive leaf
# analog cape <@135620352201064448> heya friend, hope you're doing well ๐Ÿ™‚ While I just passe...

Depending on the context (and it goes somewhat contrary to the ethos of containers being... well self-contained) you might want to consider mounting some of the core libraries like CUDA, NCCL, MPI, etc from the host. Depending on how you're images are ultimately running on the machine (e.g. distributed filesystem) it can make a beneficial impact to startup stripping them down, and can eliminate issues related to subtle library differences.

golden cypress
slender star
#

cc @chilly arch ๐Ÿ‘†

chilly arch
raven stag
#

๐Ÿ‘‹ Is there a way to see closed/archived help posts?

#

I was participating in one yesterday that seems to be gone now.. And I wanted to re-read some replies ๐Ÿ˜…

sharp marsh
frail mulch
#

my humble Dagger promotion here at KCD UK

slender charm
daring mortar
#

OT: where can I get this beautiful wallpaper, which is used in the community calls, from? ๐Ÿ™‚

slender charm
chilly arch
cobalt crag
#

Hello. I am currently reading about Dagger and am considering using it at my company. However, I have a question.

  • The thing that I do not like about YAML pipelines is that it is not type-safe. (Meaning that you do not get red squiggly lines in your editor.)
  • I have a bunch of YAML files that call other YAML files (as "templates", which is the Azure DevOps terminology to call a child pipeline as a function). So when a variable is changed, is it painful to make everything work again.
  • I am reading this page on integrations with Azure DevOps: https://docs.dagger.io/integrations/azure-pipelines
  • The final example on that page makes it seem that Dagger is replacing the pipeline steps and is not replacing the pipeline itself. Meaning that that with Azure DevOps, I would still use YAML files to stich together all of my Dagger functions.
  • Is that the case? Do people typically use Dagger to replace all of their YAML files? Is the point of Dagger to solve the problem of making individual CI steps be able to run locally (and not solving the problem of having to use YAML)?
signal pivot
#

Can someone explain how dagger sdks and functions work?
Specifically, the "translation" process.
Let's say I write some function in golang, does it get compiled to a binary or translated into something else without compilation?
If so, Is there an sdk for kotlin?

rain oriole
#

Can someone explain how dagger sdks and

mystic citrus
#

Hello, can someone explain the Dagger caching mechanics to me? Specifically, in the context of a Golang project.
The concern I have is that with Dagger builds take 2-to 20 seconds, while natively go builds take 0.2 to 2 seconds.

So far, I was able to figure out the following:

  • WithMountedCache("/go/pkg/mod", dag.CacheVolume("dev-go-mod-"+GO_VERSION)). WithMountedCache("/go/build-cache", dag.CacheVolume("dev-go-build-"+GO_VERSION)) brings time down to 2 sec on subsequent run
  • after changing dagger/main.go the build takes 20 seconds. (seems that the cache breaks)
  • after changing my code, the build takes 20 seconds. subsequent runs 2.
  • if a wait 1-2 minutes without any change to code or in the repo, the build takes, 20 seconds.

How can I get consistent improved times?

sharp marsh
mystic citrus
#

its public

#

func (m *HarborCli) BuildDev(
ctx context.Context,
platform string,
) *dagger.File {

fmt.Println("๐Ÿ› ๏ธ  Building Harbor-Cli with Dagger...")
// Define the path for the binary output
os, arch, err := parsePlatform(platform)

if err != nil {
    log.Fatalf("Error parsing platform: %v", err)
}
builder := dag.Container().
    From("golang:"+GO_VERSION+"-alpine").
    WithMountedCache("/go/pkg/mod", dag.CacheVolume("dev-go-mod-"+GO_VERSION)).
    WithMountedCache("/go/build-cache", dag.CacheVolume("dev-go-build-"+GO_VERSION)).
    WithMountedDirectory("/src", m.Source). // Ensure the source directory with go.mod is mounted
    WithWorkdir("/src").
    WithEnvVariable("GOOS", os).
    WithEnvVariable("GOARCH", arch).
    WithExec([]string{"go", "build", "-o", "bin/harbor-dev", "cmd/harbor/main.go"})

return builder.File("bin/harbor-dev")

}

sharp marsh
mystic citrus
#

setting GOMODCACHE adn GOCACHE, did had no effect

sharp marsh
cunning jolt
#

What version of dagger are you on? Have you tried v0.13.6? There were some optimizations on the initialization whch may help.

sharp marsh
#

@mystic citrus so, I've changed the go-build cache mount path in your BuildDev function to /root/.cache/go-build and times seem much better now. Here's my numbers:

  1. First call, cold engine building for local architecture: dagger call build-dev --platform=linux/amd64 : 20s. #This time is very relative as it pulls dependencies, container images, etc
  2. Second call, without changing anything: 0.3s #Expected, everything's cached here
  3. Third call, modify /cmd/harbor/main.go: 1.2s #Using both build & mod cache
  4. Fourth call, modify dagger/main.go: 1.2s also
#

if you add -x to your go build command, you can check if it's effectively using the build cache or not. That's how I realized the build cache wasn't being effectively used

sharp marsh
chilly arch
chilly arch
mystic citrus
#

quick question

I have this code

    return dag.Container().
        From("cgr.dev/chainguard/cosign").
        WithSecretVariable("GITHUB_TOKEN", githubToken).
        WithEnvVariable("ACTIONS_ID_TOKEN_REQUEST_URL", actionsIdTokenRequestUrl).
        WithSecretVariable("ACTIONS_ID_TOKEN_REQUEST_TOKEN", actionsIdTokenRequestToken).
        WithSecretVariable("REGISTRY_PASSWORD", registryPassword).
        WithExec([]string{"cosign", "env"}).
        WithExec([]string{"echo", "Length of REGISTRY_PASSWORD: $(echo -n ${REGISTRY_PASSWORD} | wc -c)"}).
        WithExec([]string{"cosign", "sign", "--yes", "--recursive", "--registry-username", registryUsername,
            "--registry-password", "${REGISTRY_PASSWORD}", fmt.Sprintf("%s/%s", registry, imageName),
            "--verbose",
        }).
        Stdout(ctx)

somehow the REGISTRY_PASSWORD is not set, and cosign complains it is empty, I would like to avoid using plaintext. (unless it is as secure as referencing env vars)

winter linden
slender charm
mystic citrus
#

you mean from the gh action?

  - name: Sign Image
    uses: dagger/dagger-for-github@v6
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      REGISTRY_ADDRESS: ${{ vars.REGISTRY_ADDRESS }}
      REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME }}
      REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
      IMAGE: "library/harbor-cli@sha256:9183ba01537f21c44d2aba0ca8ad500ffe6d80baea748f52b72d75be1dd19a84"
    with:
      version: ${{ steps.dagger_version.outputs.version }}
      verb: call
      args: "sign --github-token=env:GITHUB_TOKEN \
      --actions-id-token-request-url=$ACTIONS_ID_TOKEN_REQUEST_URL \
      --actions-id-token-request-token=env:ACTIONS_ID_TOKEN_REQUEST_TOKEN \
      --registry='${{ env.REGISTRY_ADDRESS }}' \
      --registry-username='${{ env.REGISTRY_USERNAME }}' \
      --registry-password=env:REGISTRY_PASSWORD \
      --image-name='${{ env.IMAGE }}'"
rain oriole
mystic citrus
rain oriole
#

Or at least use the Expand option on WithExec. Not for a secret, disregard.

mystic citrus
#

I have it now like this

func (m *HarborCli) Sign(ctx context.Context,
githubToken *dagger.Secret, actionsIdTokenRequestUrl string, actionsIdTokenRequestToken *dagger.Secret,
registry, registryUsername, imageName string, registryPassword *dagger.Secret) (string, error) {
reg_password, _ := registryPassword.Plaintext(ctx)

return dag.Container().
    From("cgr.dev/chainguard/cosign").
    WithSecretVariable("GITHUB_TOKEN", githubToken).
    WithEnvVariable("ACTIONS_ID_TOKEN_REQUEST_URL", actionsIdTokenRequestUrl).
    WithSecretVariable("ACTIONS_ID_TOKEN_REQUEST_TOKEN", actionsIdTokenRequestToken).
    WithSecretVariable("REGISTRY_PASSWORD", registryPassword).
    WithExec([]string{"cosign", "env"}).
    WithExec([]string{"cosign", "sign", "--yes", "--recursive", "--registry-username", registryUsername,
        "--registry-password", **reg_password**, fmt.Sprintf("%s/%s", registry, imageName),
        "--verbose",
    }).
    Stdout(ctx)

}

mystic citrus
rain oriole
# mystic citrus in the GH Action or in WithExec?

In WithExec:

WithExec([]string{"sh", "-c", fmt.Sprintf("cosign sign --yes --recursive --registry-username %s --registry-password ${REGISTRY_PASSWORD} %s/%s --verbose", registryUsername, registry, imageName)})
mystic citrus
#

cosign is an image from scratch, there is no shto my knowledge

rain oriole
#

So there's no other binaries besides cosign?

mystic citrus
#

nope

#

distroless cgr.dev/chainguard/cosign

rain oriole
#

What if you copy/mount that binary into another image that has it? Even cat would be useful so you could put the secret in a file

#

Doesn't chainguard support adding additional packages?

mystic citrus
#

there is dev variant docker pull cgr.dev/chainguard/cosign:latest-dev. I assume it has an OS as its 20 MiBs bigger

#

does the effort make the setup more secure?

#

Dagger will mask the output, on the CLI and in GH action

opal mist
#

Did any ever manage to make a Dagger pipeline in Bitbucket cloud?

fallen onyx
#

Hey folks. Diving a bit into Dagger functions and trying to figure out how I can mount a directory for use with golang. For example I would like to use go-git to list git changes. What would I need to configure to use local directories within Dagger functions?

sharp marsh
slender star
#

Hey folks. Diving a bit into Dagger

opal mist
sharp marsh
opal mist
#

and before i have setup a self-hosted runner, by that time it is due to be migrated to Github anyways

slender star
#

Ah, right, no priv on on their cloud hosted, right, but you can set up your own self-hosted runner like this: https://community.atlassian.com/t5/Bitbucket-questions/How-to-run-anything-that-requires-privileged-flag-in-my-self/qaq-p/1982343

chilly arch
#

Hey everyone! Not only is tomorrow Halloween, but it's also the community call. ๐Ÿš€

Join @warm temple , @slender charm and the rest of the gang to learn about the latest Daggerverse updates, how we daggerized GoReleaser, and best practices for using Dagger & Harness CI.

Use the link below to add the series to your calendar! We'll be live streaming to YouTube, LinkedIn, and Twitter.

https://calendar.google.com/calendar/u/0?cid=Y19mZDEyYWRjOTI3ZTQ0MDVkMGY2NmUyZjA2Yjk0OTI3YzI4ZjA2YzJkMWQzZDFiOTRlNTIwMjZkNGU0MjMzNWQxQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20

*quality will be best on YouTube.

chilly arch
left thunder
#

Hi please any resources on canary deployment with dagger? Thanks

unreal latch
#

happy halloween all!

cunning jolt
#

Can someone post the links to the community call please?

sharp marsh
unreal latch
#

yt channel

cunning jolt
#

yt does not work in restricted more ๐Ÿ˜ฆ

#

*quality will be best on YouTube.
๐Ÿ˜ข

sharp marsh
cunning jolt
#

The experience on linkedin is pretty bad btw. It keeps disconnecting every few minutes, I have to refresh the page. I don't have access to X or yt streams.

slender star
#

Regarding Featured Modules in Daggerverse:
Yes! You can ping me if you have favorite modules that should be featured! ๐Ÿ™

chilly arch
#

It should look much better on YouTube this week

cunning jolt
#

I'm happy to help with testing if you want to try figuring out how to allow it on yt restricted mode

#

I don't see a reason for it to be restricted :/

inland coral
#

We're looking to bring more attention people's favorite modules. If there's a module you use a lot or one you wrote you think others should know about , please reach out. We're happy to collaborate on a blog post on your favorite module, have you present on our community call or highlight it in another way.

chilly arch
cunning jolt
#

I use Kyle's modules as inspiration for mine all the time!

#

Please document these patterns! There are so many and new ones keep coming up, I keep forgetting which one to use ๐Ÿ™‚

sharp marsh
cunning jolt
#

This should roughly work
-kpenfound

๐Ÿ˜‚

swift inlet
#

I use your docusaurus module all the time, feels so magical to run any PR's docs locally

cunning jolt
#

It's not .dagger ?? ๐Ÿ™€

slender star
chilly arch
winter linden
#

@warm temple I tried running tests from your demo, but it only prints metadata without runnign anything:

dagger -m github.com/goreleaser/goreleaser call test
slender star
warm temple
#

it would be cool to specify a 'default leaf' for structs like that kind of like what we have on core types

winter linden
#

FYI this might be because of a change in the latest Dagger release,- we changed how objects are auto-printed

#

(just realized this might the reason)

warm temple
#

yes I was demoing from 0.13.6

winter linden
#

Damn I literally just upgraded 2mn before the call

warm temple
#

I tried to but brew didn't get it apparently

narrow nymph
#

welcome to v0.13.7 โค๏ธ ๐Ÿ™‚

winter linden
#

(the new way to get something printed is to make it a field btw. cc @rain oriole for real-time feedback ๐Ÿ™‚

narrow nymph
warm temple
#

I'm using the tap but I must have done it before it got bumped

chilly arch
#

Thanks for joining everyone! You can find the recording here: https://youtube.com/live/wLornECeGEM

Reminder - We are moving the series up by one week, so we'll have another community call next week to kick off the new flow. You can add the series to your calendar with the link below: https://calendar.google.com/calendar/u/0?cid=Y19mZDEyYWRjOTI3ZTQ0MDVkMGY2NmUyZjA2Yjk0OTI3YzI4ZjA2YzJkMWQzZDFiOTRlNTIwMjZkNGU0MjMzNWQxQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20

Join the Dagger team and fellow Daggernauts for our bi-weekly Community Call! Stay up-to-date with the latest product enhancements, discover innovative use c...

โ–ถ Play video
winter linden
#

thoughts on this approach to gh issues & discussions? https://x.com/mitchellh/status/1852039089547309552?s=46

I'm doing something new (for me) with Ghostty: the issue tracker is only for actionable tasks. Features in the issue tracker are accepted and well-scoped. Bugs are reproducible. PRs must have an associated issue (no drive-by PRs). The issue tracker is not used for discussion.

slender charm
chilly arch
winter linden
#

We need a picture of @warm temple 's costume too!

winter linden
slender charm
slender star
winter linden
#

Yeah we tried, but didn't fully commit, so it petered out. The key is that Mitchell is being super restrictive on issues, with zero tolerance of open-ended discussions there. Plus you have to be very persistent in pushing people to GH discussions, to overcome inertia. It takes a lot of commitment, you can't to it half-way.

celest grove
#

I've seen the recent community call, and I love the featured mark for modules. Overall, I think it's a great idea. I'd like to ask to promote these two modules: GoToolbox https://daggerverse.dev/mod/github.com/Excoriate/daggerverse/gotoolbox@a83a220c71aba509a487067926b196a0c9c0b83a and Terragrunt: https://daggerverse.dev/mod/github.com/Excoriate/daggerverse/terragrunt@ff2e4f0fbe48f2790685e7feaa01b19caab9b48b
to the same level โ€”ย they're quite complete, battle-tested, with tests and even examples (recipes). They're used by many folks, including internally in the company where I work. If it's not feasible, I'd love to understand the requirements for making it featured since these (and mostly my modules) are actively maintained. ๐Ÿ™‚

cunning jolt
unreal leaf
#

Hi Dagger Community,

Iโ€™m setting up Dagger to run a live development server with Air for a Harbor Satellite project. In Docker, I would use a bind mount to sync my host directory with the container so that any changes in the host files are instantly reflected inside the container:

docker run -p 8080:8080 --rm -v $(pwd):/app --name my-go-docker-air my-go-docker

Currently, Iโ€™m using dagger.withMountedDirectory() to mount my local directory in Dagger, but changes in the host files arenโ€™t being reflected inside the container.

Is there a way to achieve a bind mount in Dagger similar to Docker, where updates on the host would dynamically sync with the container? Any guidance or alternative setup approaches would be greatly appreciated!

Thanks in advance!

raven stag
# unreal leaf Hi Dagger Community, Iโ€™m setting up Dagger to run a live development server wit...

Hey @unreal leaf , it is a known "limitation".
There's no workaround possible today for "live reloading'" using services AFAIK.
You can leave your use-case here to raise the awareness ๐Ÿ˜‰
https://github.com/dagger/dagger/issues/6990

GitHub

What are you trying to do? I want to be able to make changes to code locally and see them reflected in my running Dagger services similar to how docker-compose and docker run --v works. In particul...

unreal leaf
ancient escarp
# inland coral We're looking to bring more attention people's favorite modules. If there's a mo...

From my perspective, I find that finding good modules on daggerverse is HARD. A couple of examples, search for php -> a lot of the results are for forks of the php sdk; this seems somewhat pointless as it's built in as part of dagger already, but doubly so as these were only forks that people were using on a temporary basis to implement new features. Now search for helm; the top results include what looks to be a fairly specific setup for someone's pipeline; not a generic helm module; then you have one tagged partner which provides very limited functionality; the featured one is probably the best of the lot but even that doesn't include all the basic functions of helm (eg it's missing update as an option)

ancient escarp
# ancient escarp From my perspective, I find that finding good modules on daggerverse is HARD. A ...

I really think that the auto publish on use is a bad idea as it's putting a lot of poor quality results into the search, especially the forks of modules. I think explicit publishing should be required and also would be worth considering some deduplication based on module name (perhaps introducing a vendor/module naming convention could be useful here) and the ability to view the original module and any forks of it. Packagist does a really good job of this - pointing out potential existing packages and such when you submit a new one.

thick igloo
# ancient escarp I really think that the auto publish on use is a bad idea as it's putting a lot ...

Good points in general, just my 2c. I don't think the auto publish will have any effect on this, since you can't really avoid to have duplicates. if 5 or 20 it's not so big of a difference. While having featured/blessed modules can help a lot and to do that you need to understand what are the modules that are more widely adopted and start from there. I suppose that is the idea at least. Also, regarding missing functionalities, it looks normal at this stage where modules are community based - e.g. you can open a PR adding what is missing or an issue asking for it.

ancient escarp
# thick igloo Good points in general, just my 2c. I don't think the auto publish will have any...

I totally get the idea of a PR to address a missing feature but the problem can then become - to which module should I submit to? (It also creates another fork in the daggerverse, which will live on long after the PR is merged) I really do think the auto publish is compounding the issue here, so many scenarios where I wouldn't want a module published, a fork of an existing module to fix a bug which gets merged into the original, a quick dev experiment to prove a concept, a tailored module intended to be used across several pipelines in an open source project I maintain, a module for a private project that started out in a public repo while developing the poc, a dagger workshop where I get 25 participants to make their own example module and then install and use it as part of their pipeline.

winter linden
#

@ancient escarp yeah, the issue of "noise" in Daggerverse is something we're starting to address in layers.

  • Layer 1: manually feature modules that are known to be useful and up-to-date (please nominate your favorite modules for this)
  • Layer 2: fork awareness. We definitely should treat github & gitlab forks in a special way, to hide them by default
  • Layer 3: better ranking. We're iterating on the search rankings, to help high-quality results move to the top over time.
  • Layer 4: internal modules. We want to add a way to mark your modules as internal, so that they are hidden by default.
  • Layer 5: stdlib. We need a stable, trusted standard library. We've been wanting to do it for some time, but have been waiting for API patterns to stabilize, to avoid shipping a stdlib and immediately breaking it.

Note on "auto-publish". That term can be misleading because Daggerverse is not a registry: it's a search engine. Its job is to index every module you could find on your own, and help you find it better.
So when you search for "php" and are swamped by useless results, the solution is not to un-publish those registries (they are out there, and we don't want daggerverse to be blind to that fact), but to make the search results smarter. Which we intend to do!

Thanks for your patience ๐Ÿ™

cc @slender star @warm temple

ancient escarp
#

@Carnage yeah, the issue of "noise" in

robust lance
#

I tell you, as soon as I get this GHA workflow wrapped up I'll be hitting Dagger real hard. Pretty excited the more I look at it. I've spent the last several years in AWS so I'm currently getting my bearings with GCP, especially with IAM. I feel like I need a GCP IAM for AWS Dummies book.

stoic knot
#

Are there zig bindings for Dagger? (trying to convince someone to take Dagger for a spin)

slender charm
stoic knot
winter linden
#

Are there any updates on enabling remote

quiet tiger
#

How does one clean up/delete/remove a cache volume? https://docs.dagger.io/api/cache-volumes/ ?

Volume caching involves caching specific parts of the filesystem and reusing them on subsequent function calls if they are unchanged. This is especially useful when dealing with package managers such as npm, maven, pip and similar. Since these dependencies are usually locked to specific versions in the application's manifest, re-downloading them...

sharp marsh
raven stag
#

๐Ÿ‘‹ Does dagger core dagger-engine local-cache prune clear the volumeCaches generated? Asking for a friend... ๐Ÿ˜„

warm temple
# raven stag ๐Ÿ‘‹ Does `dagger core dagger-engine local-cache prune` clear the volumeCaches gen...

I don't believe so, but here's a 1 liner to clear out a volume:
dagger core container from --address=alpine with-env-variable --name bust --value $(date +%s) with-mounted-cache --path /cache --cache "my-cache-volume" with-exec --args "sh,-c,\"rm -rf /cache/*\"" stdout

(replace "my-cache-volume" with your volume's name)

or to delete all volumes, you can just nuke the engine container and it's volume
docker rm -fv $(docker ps --filter name="dagger-engine-*" -q)

chilly arch
#

Introducing Public Traces for Open Source Repositories

Weโ€™re excited to announce a new Dagger Cloud feature: Public Traces for Open Source Repositories. This functionality allows open source project teams to share trace data from Dagger pipelines publicly, helping communities collaborate more effectively and troubleshoot issues with greater transparency. Learn more in the blog post: https://dagger.io/blog/public-traces

If you have any questions, please feel free to ask here!

cunning jolt
winter linden
#

We're missing a builtin to produce a cache buster

#

and with-exec arg could use some polish

stoic knot
#

+1 for the vertical pipes that make the steps clear

winter linden
#

@stoic knot yeah I really enjoy it also ๐Ÿ™‚ Did you try playing with dagger shell yet?

#

It's missing some polish, but it does work

stoic knot
#

I have not, I'm working on moving our monorepo POC to a beta so we can build a full product with a one-liner

#

the process is certainly uncovering all the minor inconsistencies in Makefiles and Dockerfiles

cunning jolt
#

Should dagger shell be runnable outside of the context of a dagger module? I just noticed you can't.

stoic knot
#

Is it possible to construct a DAG in the shell? Maybe using some intermediate variables to store pipelines and then referencing them in others? or parentheses or backticks like bash?

winter linden
winter linden
#

You can try it now:

$ dagger shell
.container | from alpine | with-workdir /src | with-mounted-directory /src $(.directory | with-file dagger-readme.md $(.git https://github.com/dagger/dagger | file README.md)  |  with-new-file  'hello there' hello.txt) | terminal
cunning jolt
#

wow that was fast!

winter linden
#

Next up Helder is working on .doc for builtin API docs

#

foo | bar | .doc -> prints the full API doc for the type produced by bar

cunning jolt
#

Had to ctrl+D to exit. An exit command and a history command would be nice!

winter linden
#

it would be .exit with our builtin system but yeah, good point

cunning jolt
#

it actually does save history. so I can up arrow and find stuff. But an actual history command would be nice indeed

loud briar
#

Out of interest is the primary use of this intended to be something to do with dagger 'scripts'? Or is there some other use?

winter linden
#

For now, we haven't decided whether a module should have a standard entrypoint for exposing scripts

loud briar
#

So in your view it'd eventually replace pipelines that consist of multiple dagger call -m blahblah dagger call otherthing

winter linden
#

There's also an opportunity to use $foo as the universal interface for accessing contextual variables... We control how those variables are resolved, so we could map them to anything. For example pluggable secrets providers...

#

.env file support...

#

dagger shell --env-file .env.production -c 'deploy --token=$DEPLOY_TOKEN'

#

dagger shell --env-var DEPLOY_TOKEN=op://myvault/myproject/deploy/token -c 'deploy --token=$DEPLOY_TOKEN'

loud briar
#

Is some form of 'scripts' on the backburner whilst this work is ongoing? Primary pain point for now is the long chains of function variables, ends up in makefiles but then users start adding make 'magic' and what is old is new again ๐Ÿคฆโ€โ™‚๏ธ

winter linden
#

Even better: if we can rely on the fact that $DEPLOY_TOKEN is virtualized (and therefore portable), we can perhaps allow modules to set that as a default. So now you get:

func (m MyModule) Deploy(
  // +optional
  // +default=$DEPLOY_TOKEN
  deployToken *dagger.Secret,
) { }
dagger --env-file .env.production -c 'deploy'
#

Or if not defined, via static analysis we can prompt you on missing env:

dagger shell -c deploy
ENTER VALUE FOR deployment token: *******
loud briar
#

Think I saw a comment about dagger shell -> dagger, now you've described this a bit that seems like a good idea

winter linden
# loud briar Is some form of 'scripts' on the backburner whilst this work is ongoing? Primary...

Yeah we'll make our way to that I think. With a portable reproducable shell syntax, we're eating away at that problem. Sure you may still have a long-ish dagger script, but at least it's portable, and maps directly to Dagger API. From there it's trivial to move into a new function. So as the "glue scripting layer" gets too thick, much easier to keep it lean by moving the growing logic into code

cunning jolt
#

How will the shell work in non tty consoles like GHA or Jenkins? Would I have to create a separate script and run it?

winter linden
winter linden
#

If you look at the best practice for retrofitting Dagger into CI, there's always a shell command somewhere in the CI config, that resolves to dagger call. This would be a natural evolution of that. Just more powerful and more portable

#

Also I think we can make a really killer auto-complete in interactive mode ๐Ÿ™‚

loud briar
cunning jolt
#

same!

winter linden
#

Thank you for all the questions and feedback, it's super useful & motivating ๐Ÿ™‚

chilly arch
stable patrol
#

hi ๐Ÿ‘‹ who could i speak to about the 'bring your own cloud' for distributed caching?

slender charm
tired moth
#

Yooo...Dagger Rocks....

chilly arch
tired moth
#

FEEDBACK
Open-source projects often struggle with documentation. To avoid this with Dagger, we need a dedicated docs feedback channel. This will lower the barrier for contributions and help us create truly helpful docs.

chilly arch
slender star
tired moth
#

Do we have open roadmap with no ETA?

#

HTTPS auth support for dagger private modules? soon? Please ship it...we need it...

#

Can dagger support inbuilt/native encryption for security? OR through module? just a thought...

#

DOCKER runs slow everywhere...from the last few years...

#

We are also migrating from docker to nerdctl

chilly arch
#

KitOps Modules

thick igloo
#

Nice demo @crystal ore ! Just watched the recording, I love the OCI artifact decision!! In fact, with a colleague, we were discussing why oci artifacts weren't the go-to solution for model sharing already. I'm glad to see someone pushing this forward!

quiet tiger
#

Will it be "safe" to assume that I can use the engineVersion to decide which version of the dagger cli folks need? Or are those 2 divorced from each other enough that it doesn't make any sense?

#

I often run into issues with people not having the right version(s) of cli tools (hence wanting to move a lot of stuff to Dagger) ... but adding a new cli tools means trying to ensure folks have the right version of that too.

winter linden
#

yes engine and CLI version are very tightly coupled.

#

you can consider them to be one and the same

quiet tiger
#

Awesome

crystal ore
crystal ore
chilly arch
quiet tiger
#

Is there any comprehensive dagger.json documentation?

#

Also ... This looks like internal dagger stuff?

                    {
                        "description": "[internal] copy upload <A PATH I REMOVED> from v2kivfdxyndbzw4lphakmdxq7 (client id: iwbiyo2p4vfh6o1pj25iz9rs1, session id: xphvmvqy637amfnunlc7ztt3k) (include: dagger.json, dagger/**/*, **/go.mod, **/go.sum, **/go.work, **/go.work.sum, **/vendor/, **/*.go) (exclude: **/.git)",
                        "diskSpaceBytes": 382753520
                    },

If so, this looks like it's uploading stuff for dagger use (our module source is in ./dagger atm), why does it need **/vendor/ and **/*.go ? This is in a large repo and if this is for internal dagger usage I'd like to not include those.

tired moth
#

To the amazing Dagger team & specially @chilly arch @analog raven @heavy karma

Thank you so much for your support in making our recent Dagger meetup such a success! We all had a blast learning about Dagger and getting hands-on with the workshop. Your expertise and enthusiasm were truly inspiring.

We're already looking forward to the next one!

Best,
The Staytuned Team

chilly arch
tired moth
tired moth
#

@winter linden Thanks a lot for this git repository support for HTTP/HTTPS refs in the latest release.

loud briar
ancient escarp
#

PHPUK Speaker Announcement ๐Ÿšจ
Chris Riley (@giveupalready) will be joining the line-up for PHPUK Conference 2025! ๐Ÿ˜

Ready to supercharge your CI/CD pipelines! With his talk "Sharpen up your CI/CD pipelines with Dagger", Chris will show you how to do exactly that.

Buy a

raven stag
#

๐Ÿ‘‹ Are service bindings and cache volumes expected to be missing when you run dagger with --interactive flag and you get an error?

winter linden
narrow nymph
#

@raven stag mind opening an issue? I think it's probably not too tricky to get it working ๐Ÿ™‚

raven stag
#

Sure thing, tx

narrow nymph
#

Thank you thank you ๐Ÿ™

slender charm
#

We asked people to draw an emoji of CI at Cloud Native Rejekts and this is what we have so far ๐Ÿ™‚

narrow nymph
#

particularly in love with the swirly eyes one ๐Ÿ˜„

rigid pebble
#

The empty ones are ๐Ÿ’ฏ ๐Ÿ˜†

proper falcon
#

๐Ÿ‘‹ Do cache volume names need to be globally unique?

proper falcon
ionic plume
#

Hi, I just update dagger cli to v0.13.7 from v.0.12.3. But now my project no more working. I get rror: incompatible engine version v0.12.3. I have tested to delete de local container dagger-engine:v0.12.3. But when I run dagger call It create again container with bad version (0.12.3 instead 0.13.7). On dagger.json, I have set "engineVersion": "v0.13.7". You know what is the hell ?

ionic plume
slender star
#

cache volume names need to be unique

chilly arch
#

Dagger v0.14 is here! ๐Ÿš€

Check out all the new features in our latest blog post - https://dagger.io/blog/dagger-0-14

If you run into any issues with upgrading or have any questions, please let us know!

lyric turtle
#

on the docker website, there is an AI chatbot trained on the documentation that can answer questions which I've found extremely helpful. does dagger website have a similar concept?

slender star
charred helm
#

Hey, I'm wondering, is WebAssembly v3 on Dagger.cloud UI some things coming out later or am I having a configuration issue somewhere? The page returns input: trace unauthorized.

winter linden
charred helm
tired moth
#

Why are we not having a separate repo for docs?

slender star
#

Why are we not having a separate repo

opal mist
#

What would be an argument for one that is promoting Bazel to try out Dagger.io?

tired moth
#

Who is working on dagger cloud UI/UX?

sharp marsh
tired moth
loud briar
#

I wouldn't hold your breath on Dagger open-sourcing the only revenue-generating product they have ๐Ÿ˜‰

tired moth
sharp marsh
tired moth
sharp marsh
quiet tiger
#

is it possible to declare a default equivalent to --arg cmd:"path/to/some/program" ? --arg is a string and I can assign a string default with
// +default="TheDefault" in go (and equivalent in other languages), but I'd like to be able to specify a default command to use to fetch the secret this way commands are easier for folks in this internal repo.

quiet tiger
quiet tiger
winter linden
#

default host command

sly wharf
#

Hello, is there a self hosted version of dagger cloud ?

stable patrol
#

hey! how do i configure the port that the dagger engine is exposed on?

slender charm
#

Private Dagger Cloud

sick monolith
# stable patrol hey! how do i configure the port that the dagger engine is exposed on?

Some docs here talk about the port, but its session based. https://docs.dagger.io/reference/cli/#dagger-run. You shouldn't need to worry about the port. the bullet points under the diagram explain a bit https://docs.dagger.io/api/internals/#dynamic-api-extension.
There is some customisation but not sure if its needed for your use case: try dagger listen -h there's something about a custom port being set here for when you want to run a pipeline, https://github.com/dagger/dagger/issues/7568. This is not the same as 'setting the port the dagger engine uses'.

GitHub

An engine to run your pipelines in containers. Contribute to dagger/dagger development by creating an account on GitHub.

If you're interested in how Dagger uses GraphQL, this page provides additional information on the Dagger API's internals.

jagged shoal
#

Hi,
Does anyone have a slide deck for pitching Dagger for a developer team that they'd be willing to share? ๐Ÿ™

chilly arch
#

Weโ€™ve got an exciting lineup for tomorrowโ€™s Dagger Community Call, and we canโ€™t wait to see you there! ๐ŸŽ‰

@tawdry imp from Ubisoft and @ashen stirrup from marimo will share some incredible insights and projects.

๐Ÿ“บ Catch the livestream on YouTube and X โ€”donโ€™t miss it! ๐Ÿš€ You can add the series to your calendar here: https://calendar.google.com/calendar/u/0?cid=Y19mZDEyYWRjOTI3ZTQ0MDVkMGY2NmUyZjA2Yjk0OTI3YzI4ZjA2YzJkMWQzZDFiOTRlNTIwMjZkNGU0MjMzNWQxQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20

mystic citrus
#

I have the use case that might be quite common, we are chaining dagger functions buildBinary, BuildBinary, buildBinairies, BuildBinariesetc...

No matter how I twist it, I can't up with a better approach.
At the KubeCon @slender charm and @winter linden mentioned some other options, that might be however more complicated.

I am not so happy with my current setup but I also don't know what I can improve instead of creating each function twice for internal user and CLI
https://github.com/container-registry/harbor/blob/build/daggerize/.dagger/main.go

Any ideas?

austere maple
#

I am deeply distressed that Dagger Cloud went away after I explicitly asked it to stick around, expressed my interest in what it has to offer, told it to speak freely, and politely requested it never stop.

slender star
austere maple
#

guys it didn't work

slender star
#

Must be Friday somewhere

austere maple
#

yeah and to make matters worse I managed to evaluate the whole value of ฯ€ but I didn't print it in time ๐Ÿ˜ฆ

there goes my Fields Medal. I guess I'll try again on Friday when it's Wednesday somewhere

austere maple
#

If you want to add functionality for building binaries, I'd suggest a function that wraps BuildImages and pulls the files from containers. Can use the same setup of a default value that retrieves all by default

can't comment on if the build actually works, i seem to be missing a step somewhere

#

the argument parsing section seems to work at least

fossil pine
# mystic citrus I have the use case that might be quite common, we are chaining dagger functions...

That is exactly what I did for OpenMeter: https://github.com/openmeterio/openmeter/blob/main/.dagger/build.go

I don't think it's the end of the world.

It may become somewhat easier eventually with an improved platform API:

You could take a look at the new range function feature in Go in the meantime. That may yield (no pun intended) slightly nicer code. But as I said, I don't think this is bad at all.

analog raven
cunning jolt
#

hey from Fort Worth, Texas!

chilly arch
#
GitHub

A reactive notebook for Python โ€” run reproducible experiments, execute as a script, deploy as an app, and version with git. - marimo-team/marimo

GitHub

A reactive notebook for Python โ€” run reproducible experiments, execute as a script, deploy as an app, and version with git. - marimo-team/marimo

chilly arch
#

Thank you to everyone that attended the Community Call, and shout out to our speakers @ashen stirrup , @tawdry imp , Thomas (not on Discord yet ;), and @swift inlet !

You can find the recording here:
https://youtube.com/live/uhZjZ8Ezfy0

Join the Dagger team and fellow Daggernauts for our bi-weekly Community Call! Stay up-to-date with the latest product enhancements, discover innovative use c...

โ–ถ Play video
tawdry imp
chilly arch
#

**Have a great Dagger demo? **

If anyone would like to demo on December 5th Community call, please DM me! I have an extra slot ๐Ÿ™‚

orchid lion
sharp marsh
quiet tiger
#

Is there no way to get annotations on a container?

quiet tiger
orchid lion
#

Yes, I put it to to this path /usr/local/share/ca-certificates/, but it still has x509 error , when I pulling image from private harbor

orchid lion
#

11 : Container.from(address: "10.10.10.240/library/metis:50fd547"): Container!
12 : resolving 10.10.10.240/library/metis:50fd547
13 : remotes.docker.resolver.HTTPRequest
14 : HTTP HEAD
14 : HTTP HEAD ERROR [0.0s]
14 : ! tls: failed to verify certificate: x509: certificate signed by unknown authority
13 : remotes.docker.resolver.HTTPRequest ERROR [0.0s]
13 : ! tls: failed to verify certificate: x509: certificate signed by unknown authority
12 : resolving 10.10.10.240/library/metis:50fd547 ERROR [0.0s]
12 : ! failed to do request: Head "https://10.10.10.240/v2/library/metis/manifests/50fd547": tls: failed to verify certificate: x509: certificate signed by unknown authority
11 : Container.from ERROR [0.0s]
11 : ! failed to resolve image 10.10.10.240/library/metis:50fd547: failed to resolve source metadata for 10.10.10.240/library/metis:50fd547: failed to do request: Head "https://10.10.10.240/v2/library/metis/manifests/50fd547": tls: failed to verify certificate: x509: certificate signed by unknown authority

#

the error message is like this

cunning jolt
sharp marsh
#

I was about to send you a message on Friday about this Nipuna but ran out of time. Will ping you in Monday morning

#

cc @swift inlet

winter plank
#

Hi folks, not sure if this is the right place for this question but i'm trying to wrap my head around how to work with Dagger. My team currently has some custom scripts that pull content from our CMS that get run with npm run build:content -- they're simple node scripts that make API calls and write the data into the working tree. In Dagger, would I rewrite these scripts into a dagger function? Would I just call npm run build:content from a container? It's kind of unclear to me which is the idiomatic way to migrate this workflow

winter plank
warm temple
#

daggerizing an npm application

cunning jolt
frozen basin
#

Is there a way to copy files from an currently running dagger terminal session to the host dir?

tired moth
#

Why we are not supporting LXC?

frozen basin
#

Is there a way to copy files from an

limber gyro
#

Is there a way for "dagger core container from --address alpine:latest" to succeed if I have container cached but are in air plane mode or have something broken on my internal registry?

sharp marsh
#

11 : Container.from(address: "10.10.10.

sharp marsh
#

i.e: dagger core container from --address alpine:latest@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a terminal

#

^ that works if after running it the first time you turn off your internet connection

limber gyro
quiet tiger
patent slate
#

Wonder were you all got this FAQ from? ๐Ÿค” ๐Ÿ˜„ daggerfire ๐Ÿ˜Š ๐Ÿ˜˜

jagged shoal
#

When building multi-architecture images using Dagger (following the example at docs.dagger.io/cookbook/#build-multi-arch-image), we end up with a list of containers that get pushed as a single multi-arch image. For security scanning purposes, should we scan each architecture-specific container separately, or is it sufficient to scan just one of them? What's the recommended approach for integrating security scanning into this multi-arch build process?

narrow nymph
#

The way we do image scanning in our own process is by having a ScanEngine function that builds for each release container, and scans each of them

ionic plume
#

hi, there are a way to chain terminal with directory. It seems to lost on directory all change made from terminal ?

narrow nymph
ionic plume
#

There are a way to look / zoom on logs (stdout) of services. When run dagger call, I can look some line of logs after increase the verbosity, but it seems not possible to display int in full screen ... I look only 5 or 6 last line

narrow nymph
#

are you viewing the logs in the terminal tui - they should be there? you should also be able to view the full logs easily using dagger cloud

#

i think you can focus a single service using the keyboard, up-down-enter, etc (in the tui)

ionic plume
#

yep, I use the tui

humble sage
#

When developing/debugging dagger, is there another way to get experimental version than checking out and running dagger engine container ?

sharp marsh
old lotus
#

i want to run multiple pipelines in a single step context in my CI. Basically I want to run these commands in parallel:

  • dagger call test1
  • dagger call test2
    I only need the trace URL's from each to see the output, rather then look at mixed output from both.
    Is there a way that dagger can do this natively? Otherwise I'm stuck doing some bash hackery
sharp marsh
sick monolith
#

Can anyone else on a Windows OS confirm if dagger core container from --address IMAGE terminal fails for you? I've created a bug report, im pretty sure it's a bug but another windows user to make sure its not just me would be good. https://github.com/dagger/dagger/issues/9096 Ive created this for now, but if we find out it's something quirky, I'll close it.

GitHub

What is the issue? It's been a long while since I have used the terminal feature, but I know it did work for sure around the v0.10. There's a chance a bug was introduced a while back and I ...

lapis slate
#

terminal fails on Dagger windows distribution

stoic knot
#

Would/could sudo rm -rf /var/log/containers/* cause issue for Dagger while it is running or doing things?

narrow nymph
stoic knot
narrow nymph
#

it shouldn't cause an issue - docker doesn't write to those log files, and neither does dagger

stoic knot
#

I'm having an issue where some runs start failing to push images, getting 401/404 with GCR. My best guess is that I'm getting hit by cache cleanup. Wanted to double check this rm -rf wasn't the issue here

sharp marsh
stoic knot
sharp marsh
stoic knot
fossil pine
#

I've been thinking about the layer cache vs cache volume approach in the context of how tools (in this case vulnerability scanning tools) manage their databases...and how that works (or doesn't) with Dagger.

The two examples in mind:

  • Trivy (see recent ghcr rate limit drama)
  • OSV

Trivy distributes its database as an OCI artifact (not an image though, so dag.Container doesn't work). It's really-really hard to cache, because it's updated regularly (every 6 hours I believe), but it's essentially a moving tag in the registry. A good alternative would be a timestamp trimmed to every 6 hours of the day, so you can consistently calculate the last tag. Also, arbitrary OCI artifact support would be nice in Dagger (not sure how that would work in practice). But combining those two would maximize caching (layer cache in this case).

How to do it today? Use cache volume, bust the layer cache for each run and let Trivy update the database: https://github.com/sagikazarmark/daggerverse/blob/5b826062b6bc1bfbd619aa5d0fba117190c85aba/trivy/main.go#L84-L88

OSV distributes its database as files available from a GCS bucket. That itself wouldn't be a problem, using gsutil in a container could be cacheable, but there is no timestamp either to "automatically" bust the cache from time to time. You could use a little trick and bust the cache every X hours.

Offline database access is still experimental though: https://google.github.io/osv-scanner/experimental/offline-mode/

Lessons for me:

  • There is no "standard" or set of best practices on distributing databases in a cacheable way, even though we have such a mechanism for other types of artifacts (container images)
  • Besides container images, Dagger can't effectively work with other types of OCI artifacts (could potentially improved by userland modules for OCI (oras?) and object stores)
  • Caching is key for performant pipelines, so this situation needs to improve

Any thoughts? How do you solve this with other tools?

quiet tiger
#

Is there a way to return stdout and stderr ?

#

And specifically as stdout and stderr

sick monolith
quiet tiger
#

I don't want to mix the streams

sick monolith
#

so you want something like .StdOutErr()

#

hmm.

quiet tiger
#

As long as that would return the strings to stdout and stderr to the caller sure

#

i.e. stdout -> dagger's stdout and stderr -> dagger's stderr ... so dagger commands can be better used in scripts with dagger call -s

#

One potential way to do this, thinking from the go api perspective anyway, is any function that returns (string,string) will map the first string to dagger's stdout and the second to dagger's stderr.

#

@sick monolith does that make sense ?

#

or is there already a way to do this that I haven't found?

sick monolith
#

yeah, i think if you could give an example it might help

#

i still dont quite get you, theres so many ways people have done things

#

i guess right now, the only option is checking if sync or a ctr returned without an err, and if it did, then you need to call ctr.StdErr()

quiet tiger
#

I run a command in a container. it can produce output it's stdout AND it's stderr.
How do I map that back to dagger's stdout and dagger's stderr?

sick monolith
#

those functions already do that for you, from the last cmd that was executed right?

quiet tiger
#

so that dagger call -s <something> > output 2> errors works

queen bramble
#

I'm looking for examples on how to make my modules more modular by leveraging chaining patterns (with optional steps). My feeling is that I'm missing something obvious or just using dagger in a suboptimal way. I appreciate any support/hint/examples on this. Thanks!

The problem I want to solve: My module has several functions that all rely on the same base but with slightly different configurations. Assume two functions can work on an unmodified base but three other functions can (but don't need to) apply the same modifications to the base. Basically I'm looking for some kind of builder pattern.

Currently I solve this case by passing through (a) base arguments (b) shared add-on config and (c) the specific arguments function in each of the "terminating" functions. I'm looking for ways to remove some of the repetition while still providing some guidance/support on what the correct order of calling them is. I've seen examples where these intermediates are fields of the module and the intermediate functions always return the module itself (see https://docs.dagger.io/api/return-values#chaining). But I think those also have issues guiding the user on what can be called at which point in the chain.

--> continues...

quiet tiger
sharp marsh
#

I've been thinking about the layer cache

queen bramble
#

Chaining patterns with modular add-on

sand gorge
#

Sorry I've been a bit quiet recently, folks. Family stuff and preparing to present Dagger to the PHP community at SymfonyCon Vienna.

People are absolutely buzzing about DaggerPHP and excited to start using it in their projects. Here are some photos and such from today's event

#

They are not just applauding me, they're applauding the Dagger team for all the awesome work ๐Ÿ‘ ๐Ÿ˜Ž

chilly arch
#

Community call starting now! See you on youtube or X!

chilly arch
chilly arch
split olive
#

Thank you @chilly arch โค๏ธ

chilly arch
stoic knot
#

@sharp marsh did you find out any more about the oauth expiration during long builds? From what I can tell, Google has a hard 1 hour limit on the tokens, though in testing it seems to expire in less time.

ionic plume
sharp marsh
stoic knot
#

Is it possible to run two versions of Dagger at the same time on the same host? We have an issue that one of our release branches is now out of date, but we need to make a hotfix for a customer. The SDK in that version of the code no longer aligns with the engine we run.

sharp marsh
stoic knot
opal mist
slender charm
#

azure-for-dagger/main.go at ce1d338fffd5...

opal mist
slender star
opal mist
#

i made it work actually, though since i am running dagger engine in docker you must use the host.docker.internal:1778 to access the temporal server on the host deving locally

frozen basin
#

has the Pipeline("foo") call been replaced somehow?

#

seems like things are getting fairly mature with the project but I still dont see a straightforward way to name my pipeline runs or groups of steps

slender star
frozen basin
#

yup

slender star
#

ah, okay, you still need better grouping or custom names?

#

Are you using the GitHub app too?

#

Sorry will go into thread ๐Ÿ™‚

frozen basin
#

๐Ÿ‘

ocean karma
#

Updating Dagger is quite a headache at the moment.

I try moving from 0.13 to 0.15 and the new changes with the service bindings just throw me.
It was a mistake nesting services like i did

svc ReverseProxy > svc Application [ svc php-fpm, svc db1, svc db2, svc redis ]

  • WithServiceBinding fails with "! no command has been set"
  • ok modify AsService(dagger.ContainerAsServiceOpts{UseEntrypoint: true}) since all have proper entrypoints, but I am unsure if this is the correct resolution
  • now it gets stuck when the Service is getting "bound"

I try running with the debugging flag, but this yields no hint.

At the moment I can not produce a simple example of my (mess) solution, but maybe someone has pointers how to proceed?

sharp marsh
ocean karma
ocean karma
sharp marsh
ocean karma
ocean karma
sharp marsh
ocean karma
sharp marsh
#

are you using custom built images for services?

ocean karma
# sharp marsh are you using custom built images for services?

They as partially custom based on common images like redis, mariadb, php-fpm, we just added some configuration.

These changes hit me pretty hard due to the current structure I've built.

I am considering throwing it all out and starting from scratch, even though I am unsure how to avoid the same pitfalls.

sharp marsh
ocean karma
vital rapids
#

is my DNS stale?

Resolving dl.dagger.io (dl.dagger.io)... 18.160.200.72, 18.160.200.90, 18.160.200.79, ...
% sha256sum dagger_v0.15.1_linux_amd64.tar.gz
228c046ecaaa5a1cb5bc8dea12b8341f34e1128cc834f2dcd921bcbe6e72d10c  dagger_v0.15.1_linux_amd64.tar.gz

vs

wget https://dl.dagger.io/dagger/releases/0.15.1/dagger_v0.15.1_linux_amd64.tar.gz
--2024-12-12 14:23:11--  https://dl.dagger.io/dagger/releases/0.15.1/dagger_v0.15.1_linux_amd64.tar.gz
Resolving dl.dagger.io (dl.dagger.io)... 3.171.85.102, 3.171.85.83, 3.171.85.49, ...
% sha256sum dagger_v0.15.1_linux_amd64.tar.gz
5230bfd932ecaa02266efd830c5cf793367433242aec2ff6b3c133238bf8d266  dagger_v0.15.1_linux_amd64.tar.gz

checksums.txt from both of those are the same, the 5230

sharp marsh
vital rapids
sharp marsh
vital rapids
#

makes sense.. then your ISP is probably

stray valve
#

What happened to the Dagger VSCode extension? I can't find it anymore

sharp marsh
sand gorge
#

V0.15 release is looking soooooo good. I posted it on my socials

potent lagoon
#

I'm running containerd and buildkit inside a dagger container and I'm noticing that traces from OTEL traces from those tools themselves are showing up in the dagger output. I assume that's because dagger is driving itself via OTEL, but it's super weird. Thoughts on how to disable it?

#

the dagger.cloud UI shows them as "orphaned traces" and the github actions out shows them inline in the log

slender charm
# potent lagoon I'm running containerd and buildkit inside a dagger container and I'm noticing t...

I think this is a feature ๐Ÿ˜… but seems like could use some more polish to address all cases.

For example a lot of folks instruments their test suites with OTEL and this shows up in the log output and cloud

Agree would be nice to have more control but I don't know of a simple way at the moment.

Could you please file a GH issue and include an example trace URL (if its public great! if its private only dagger team can see it but would be very helpful to help us debug and polish)

potent lagoon
#

trace url on dagger.cloud?

#

it's really the github actions output that is annoying, the traces show up and absolutely flood the output

#

here is an example

potent lagoon
#

I'll just unset the OTEL env vars I think.

#

inside the container.

winter linden
#

@potent lagoon maybe dagger -q will keep the output less crazy verbose?

potent lagoon
#

in the terminal locally it does

#

but the github actions output using the dagger/github-actions thing is verbose AF

warm temple
#

I wonder if you could set the OTEL_ variables in the container running containerd/buildkit

stoic knot
#

Are there some docs or examples on using tools like Snyk or Sysdig for container vuln scanning? It occured to me many of them expect the image to scan to be available in the local container runtime. How does this work in the Dagger paradigm where images don't end up in the local runtime?

potent lagoon
slender star
old lotus
#

is there a pragma for default secret ref? E.g. // +defaultSecret="env:MY_API_KEY"

slender star
# old lotus is there a pragma for default secret ref? E.g. `// +defaultSecret="env:MY_API_KE...

No there isn't, in keeping with the security model (scenario where if that worked and someone didn't realize it was there, and their secret got scraped and sent to pastebin), but there is a lot of discussion/thinking happening around secrets, where to get them from, and how to safely handle them: https://github.com/dagger/dagger/pull/8730 (for one). cc @cloud canyon

GitHub

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

old lotus
winter linden
ancient escarp
#

Question: is there a way to emulate a volume mount in dagger similar to docker run -v /local/dir:/app container->withMountedDirectory() isn't it. Do we need to add a ->withMountedDirectory() to the service primative as well?

winter linden
tired moth
ancient escarp
stoic knot
#

Should attached services persist when we drop into an interactive terminal after an error?

chrome vessel
#

Can you use multiple modules with dagger shell?

winter linden
#

for example:

github.com/dagger/dagger/modules/wolfi | container | with-file /bin/dagger $(github.com/dagger/dagger/cmd/dagger | binary) | terminal
cerulean wraith
dusty kestrel
#

Hey team,

I am working on integrating dagger with our existing CI/CD (gitlab) using k8 setup
and have notice few issue

  1. We have a large mono repo, due to which directory copying operation itself take more then 1 min
    further, we have implemented the recommendation mentioned here https://docs.dagger.io/api/filters
  2. We have some large jobs and this has lead to scaling issues at our end. The recommended approach is to use dind with dagger cloud. Unfortunately can not go with this option due to lengthy compliance process at our end.

Is there any other option or recommendation that I can try. Is it possible to bring my own backend for dagger cloud ?

When you pass a directory to a Dagger Function as argument, Dagger uploads everything in that directory tree to the Dagger Engine. For large monorepos or directories containing large-sized files, this can significantly slow down your Dagger Function while filesystem contents are transferred. To mitigate this problem, Dagger lets you apply filter...

slender star
#

Directory Filters | Dagger

ocean karma
ocean karma
cerulean wraith
#

that kind of makes things quite obvious IMO for someone looking at your code e.g.

ocean karma
ocean karma
cerulean wraith
#

yes, that should be fine. except that there are some discussions going around in dev channel on how future of Entrypoint should look like in dagger ecosystem.

ocean karma
#

If there where a way to see the active "step", and possibly where it is stuck, would be amazing.

the dagger run output is nice but this is missing for me.

ocean karma
#

Did anything change regarding Caching Volumes?

I've used them in the past to store logs and other data from containers and then mount the volume to export data.

cerulean wraith
#

Did anything change regarding Caching

sand gorge
#

Fresh machine - I just installed docker and dagger latest (0.15.1) ๐Ÿ”ฅ

#

๐Ÿง‘โ€๐Ÿณ I'm cooking some fresh modules right now ๐Ÿ™‚ let's see how quickly I can do it

sand gorge
#

I wanna copy some source code from a Git repo - and load it into a Directory object .. what's best practise here ? I'm seeing some fancy behavior of CLI arg --source=<github.com URL> is this a good plan? what about writing it all in Code and making it a Directory object? any good examples of this?

sand gorge
#

UPDATE: It's kinda neat how the "Directory" type can be a path or a git url ๐Ÿ˜Ž I'm digging it - kudos to whoever's idea this was ๐Ÿซก

..

#

New module - for PHP developers to run compiler like (static analysis) checks on their project

Works first time daggerfire off to the daggerverse now

sand gorge
#

Thanks to @slender star - we had a sweet video call and pairing session on some funky things I was attempting and he taught me dagger shell kung fu ๐Ÿฅ‹

#

....
Symfony project can now use the phpstan module to analyze its own source code

๐Ÿš€

slender star
chrome vessel
#

Is there a way to configure the location of /var/lib/dagger ?

sand gorge
sand gorge
# chrome vessel i think thats the cache

Okay, I'm not sure (yet) but there is definitely going to be an environment variable .. kind of like $DOCKER_HOST or whatnot

I wonder where my dagger cache is located? ๐Ÿค” curious to learn too

chrome vessel
sand gorge
chrome vessel
slender star
chrome vessel
chrome vessel
chrome vessel
sand gorge
chrome vessel
#

How is with-default-args used?

sand gorge
#

New daggerverse module exists - for psalm "php static analyzer" - here is the Symfony project now using it with their own custom psalm ruleset

๐Ÿ™‚

slender star
ancient escarp
#

Quick Q. If I have function A(Directory $dir) which calls function B(File $file) with a file from the directory; function A will be rerun if the contents of the directory changes between runs (eg the cache can't be used) however if the parameter to function B is the same file(s) and they haven't changed since the last run will it be able to use the cached result from the previous run?

ancient escarp
#

that's what I hoped; going to go build something which will look quite convoluted but will take advantage of this ๐Ÿ˜„

ancient escarp
#

hmm, would the cache still work if the function call was internal to the module. I'm assuming so, as the API calls will eventually do something like $container->withFile()->withExec() which would be cached; so not as efficient but still cacheable

winter linden
# ancient escarp hmm, would the cache still work if the function call was internal to the module....
  • calls to dagger functions themselves are never cached, although we plan to change that (see https://github.com/dagger/dagger/issues/7428)
  • calls to core dagger API are always cached (unless you intentionally bust the cache by changing an input). Cache is shared by all modules, so if module A calls a particular core function, module B can get a cache hit if it makes the same call
GitHub

An engine to run your pipelines in containers. Contribute to dagger/dagger development by creating an account on GitHub.

chrome moss
#

Hey all! I've been stuck on this for a while and hoping you had suggestions. Is there a way to both print out file contents and return a file at the same time/function call? I'm trying to write a wrapper that runs a bunch of lint tests, then returns a directory of result files, but I want someone to see the content of those files while the tests run. If I try something like fmt.PrintLn you can't see that output unless you increase verbosity in dagger which leads to seeing a lot of extra things I don't want

analog raven
#

Community Calll starting now! Whether youโ€™re just starting with Dagger or youโ€™re already an expert, thereโ€™s something for everyone.

๐Ÿ” Whatโ€™s on the agenda?

  • How CivoCloud + Dagger simplify Kubernetes and caching with Terraform by Dinesh and @warm temple

  • Letโ€™s teach an AI to use Dagger by @winter linden

Youtube: https://youtube.com/live/zULzUoWHDK8
X: https://x.com/dagger_io/live

split olive
#

Hello from Switzerland ๐Ÿ‘‹

winter linden
chilly arch
chilly arch
ancient escarp
round cradle
#

Is it possible to nest directory filters? Doesn't seem to work but figured it would be convenient when calling functions from another function, that can also be called from the CLI, if that makes sense.

round cradle
#

When you pass a directory to a Dagger Function as argument, Dagger uploads everything in that directory tree to the Dagger Engine. For large monorepos or directories containing large-sized files, this can significantly slow down your Dagger Function while filesystem contents are transferred. To mitigate this problem, Dagger lets you apply filter...

slender star
#

Hey all! I've been stuck on this for a

sand gorge
#

So I'm having some "timeout" issues with my dagger Service classes, some are just not "booting up"

https://github.com/dragoonis/symfony/blob/7.3/.dagger/src/Symfony.php#L104-L117

Port 8091 is couchbase() - https://github.com/dragoonis/symfony/blob/7.3/.dagger/src/Symfony.php#L221

Port 27017 is mongodb() - https://github.com/dragoonis/symfony/blob/7.3/.dagger/src/Symfony.php#L213

What's going on here?

PS: It happens every single time .. the same thing each time.

GitHub

The Symfony PHP framework. Contribute to dragoonis/symfony development by creating an account on GitHub.

slender star
cunning idol
#

Hi there!

I'm just starting to learn Dagger, experimenting with the Rust SDK.

One thing that I'm struggling to wrap my head around is how to structure my repo so I can access all files from within my Dagger context.

As far as I can tell, a Directory cannot access relative paths above where my dagger program runs from, so if I run cargo run from within the foo/ci/ directory, then I cannot access files in foo/bar. If I use ../bar, it complains that I'm escaping the current directory.

Can I reference the repo root, somehow, or do I have to put my Dagger program in the repo root?

Merry Christmas! ๐ŸŽ„

glad jolt
#

Hi there!

sick monolith
#

Grok got it wrong so many times before, this is the best one, but you all get the point ๐Ÿ˜†

high seal
#

Hello everyone, I am new to Dagger and I was wondering if following would be possible:

  1. I have a Java project built with Gradle
  2. Test for the App are written using Testcontainers
  3. I want to build the JAR using gradle build in Dagger function

I am unable to get this working,because testcontainers can not start the needed containers.

Up to now I have tried running Dagger engine using the module provides by @winter linden, and mounting it as a service, but with no success.

Is there a template where something like this can work?

#

Second thread from me: I find the Dagger technology very interesting. I would like to learn more about how it works internally, and maybe try contributing something back during next year. Can someone recommend where to start learning about internals of Dagger, and things I should be acqauinted with to work on it productively?

I assume learning Buildkit and Linux container technologies is a must, but I am currently unable to find exhaustive and well written resources for learning

plucky pawn
high seal
#

Not at hand, but I can supplement with code in few hours. I am simply starting the dag.docker().engine() then I bind it as a service into eclipse temurin container and set DOCKER_HOST env var to point to tcp://docker.2375, where I have bound Docker service to name "docker", I mount the directory with source code and lastly run gradle build with gradle wrapper

#

I can provide the error messages as well in few hours

#

I am using Python SDK and running in Windows against Rancher Desktop

#

Gradle Testcontainers

#

Learning Dagger internals

humble sage
#

I am trying to container.publish() to a registry ran as a dagger service. Is there something that would avoid it to work ?

sharp marsh
modest pier
sharp marsh
modest pier
#

lol yeah that's what i was referring to

the issue marcos linked has a workaround that's ugly but at least functional.

winter linden
#

Ugly on the outside, functional on the inside

high seal
#

Hello, a question here, if I bind some services into container, and then call build to build from Dockerfile, can I access the services in Dockerfile steps?

high seal
sharp marsh
high seal
#

Hello everyone! In my Dockerfile I would like to access the "host.docker.internal", basically the host container, and then I would like to build that container using the build command. This does not seem to work in any way. Here is some example code to demonstrate the failure:

    @function
    async def echoserver(self, context: dagger.Directory) -> str:
        echoserver = (dag.container()
                      .from_("ealen/echo-server")
                      .with_exposed_port(80)
                      .as_service(use_entrypoint=True))
        return await (dag.docker()
                .cli()
                .container()
                .with_service_binding("echoserver", echoserver)
                .with_directory("/src", context)
                .with_workdir("/src")
                .with_entrypoint(["/bin/sh", "-c"])
                .with_exec(["apk update && apk add curl bind-tools socat"], use_entrypoint=True)
                .with_exec(["socat tcp-listen:80,reuseaddr,fork tcp:echoserver:80 & curl localhost:80/params?query=mode && docker build --add-host=host.docker.internal:host-gateway ."], use_entrypoint=True)
                .stdout())

Dockerfile:

FROM alpine:latest
RUN apk update
RUN apk add bind-tools
RUN apk add netcat-openbsd
RUN nc -v host.docker.internal 80

Note that the curl command before docker command currently succeeds, meaning that socat is working, but docker build command fails.

stuck wyvern
#

Working on updating my dagger version.
There used to be a client.Pipeline function (and similar on other objects, IIRC), was there something that replaced this?

sick monolith
sharp marsh
sharp marsh
# sharp marsh <@500451181911343105> since a few revisions ago we switched all the event syste...

there's a helper function we use in our tests to create a span for each Go test https://github.com/dagger/dagger/blob/44356172c3443c9fa58b69a689d101affaa0252f/testctx/testctx.go#L55-L73

and here's how that is being displayed in cloud: https://dagger.cloud/dagger/traces/be8282f86f3caa164ec16c7708adbf9e?span=6d1cbd51d99c4335

GitHub

An engine to run your pipelines in containers. Contribute to dagger/dagger development by creating an account on GitHub.

tired moth
stuck wyvern
winter linden
#

A very happy new year to all Daggernauts!

We are thankful for this amazing community, and for everything we built together in 2024.

We have big plans for 2025, I can't wait to show you what we have in store.

This year I'm celebrating with my family in beautiful Lake Tahoe, California. How about you?

heavy karma
tired moth
heavy karma
tired moth
cerulean wraith
split olive
marsh timber
#

Hey all,

I was hoping to be able to export a list of dirs from dagger.Directory, essentially I'd like to loop a folder and build each dir. If not via dagger.Directory then I guess I can use a regular go package but thought id ask if theres an inbuilt function first ๐Ÿ™‚

Im sure someone has had to do something similar before.

narrow nymph
#

you can loop the directories, and then just assemble them together in one output directory - doing something like dag.Directory().WithDirectory("build1", ...).WithDirectory("build2", ...)

#

or even something like this: where we iterate over a bunch of directories and look lint each of them

marsh timber
#

Thanks Jed ๐Ÿ™‚