#maintainers

1 messages ยท Page 6 of 1

wet mason
#

Try to put a much longer time out, see what happens?

#

@wild zephyr Hey, I don't know it's not triggered by CI, but I just ran golangci-lint locally and got a few CLI warnings:

WARN [linters context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649. 
cmd/dagger/exec.go:45:3: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
                http.Serve(l, nil)
#

no idea why CI isn't picking this up

wild zephyr
#

@wet mason maybe warnings are not making the linter to exit with an error?

#

I can check tomorrow ๐Ÿ™

wild zephyr
hasty basin
tepid nova
#

I hope not, for their sake

hasty basin
#

They always show that if you try to run them

#

Def seems like suboptimal, but if Go devs all know that it's not the "real" Go way to try things, then we're good, I suppose. I don't have the cultural frame of reference.

tepid nova
#

That seems more like a go.dev problem, we're probably not the only Go library with examples that don't magically run in their sandbox, because of external side effects

tawny flicker
#

Yes, any network connection attempt is stopped to avoid ddos attack from some go.dev runner going wild.
And even imports of external modules/packages is not allowed.

tepid nova
#

@wet mason @civic yacht re: small wins. I remember we discussed simplifications of 1) how to pass argument to exec, and 2) stdout/stderr (skip the contents field). Do you remember what issue that was in by any chance?

hasty basin
tawny flicker
civic yacht
wet mason
#

making it "weird" for the 1% (e.g. Exec with no args needing to pass empty args) looks appealing to me

tepid nova
#

Yeah definitely

#

Not even that weird

wet mason
#

yeah yeah

wet mason
civic yacht
wet mason
#

uhhh that's neat

#

@tepid nova if you think of any other small win, send them my way

tepid nova
#

I would actually use redirect to a file for this

#

which should be an exec opt anyway

wet mason
#

which IS an exec opt

#

actually

tepid nova
#

wat

wet mason
#

so nevermind my comment

#

@tepid nova you added it to the spec, at some point it just got implemented

wet mason
#

I think when Alex was going through the whole spec he just added whatever didn't exist yet

tepid nova
#

new feature: both clients AND server implementation are generated from the graphql schema

wet mason
#

love the new @deprecated graphql annotation, codegen, and docs linting working together

#

My @deprecated host().workdir PR is failing CI because:

docs/current/sdk/go/snippets/get-started/step4/main.go:29:9: SA1019: client.Host().Workdir is deprecated: Use Directory with path set to "." instead (staticcheck)
        src := client.Host().Workdir()
tepid nova
#

is it emitted by the generated client? Or the engine / session helper?

wet mason
#

@deprecated is standard graphql -- codegen is transforming that in native deprecation warnings in each language

#

and then the go linter does the usual linting, complains about using deprecated functions

#

so the generated client is not doing anything special, this is regular Go tooling we integrate with by following standard deprecation warnings

tepid nova
#

@cosmic cove @hybrid widget : we should add this to the queue as an engineer blog topic ๐Ÿ™‚ โ˜๏ธ

wet mason
#

So basically, my PR just added the @deprecated symbol:

  workdir(exclude: [String!], include: [String!]): Directory!
     @deprecated(reason: "Use `directory` with path set to '.' instead.")

codegen converted that in the 3 SDKs to native deprecations

#

it's pretty cool now to change our mind and rename fields

tepid nova
#

be careful what you wish for

wet mason
#

@civic yacht (:radar: since you're working around those parts) just noticed a problem ... WithDevEngine doesn't bust the cache

For instance, with python:generate, if the API changes but nothing in sdk/python, then the generation doesn't happen

#

not seeing that in go and ts since we generate using the cloak binary, so if that changes, the other stuff changes to

#

I have a workaround so not a blocker or anything

civic yacht
wet mason
#

Not WithDevEngine specifically, just the overall pattern. Making changes to the engine doesn't alter pipelines that "use" the engine as input to produce their output

civic yacht
# wet mason Not `WithDevEngine` specifically, just the overall pattern. Making changes to th...

I see, yeah that's interesting. I have an issue open somewhere about possibly including versioning information in the cache so it can be invalidated if we change an API changes implementation in a meaningful way, but that's a pretty big project.

For this specifically I guess the schema is a "remote resource" and we want to only run something when that changes. Similar to (in an abstract way) exec ops that run deployment (deploy my site not only if my code changed, but also if the remote resource changed). So in that sense "no-cache" would be one solution.

#

But not ideal of course

civic yacht
#

Got the oci runtime hook of the shim working: https://github.com/dagger/dagger/pull/3913 Really excited by all the possibilities it unlocks actually, besides just fixing the immediate problem of the shim being built on the fly (now it's just bind mounted in from the engine image). Among other things, I think it might let us take dagger-in-dagger out of experimental mode in combination with my other PR for the fully isolated nested sessions

wet mason
#

Just reviewed, LGTM, just a general question

#

@civic yacht that's so cool. Super excited about everything we can do now

#

That plus the networking changes Alex mentioned in bass (container-to-service networking) and we'll have a really awesome "runner" setup

tepid nova
#

I donโ€™t understand it, but Iโ€™m excited too ๐Ÿ˜

tepid nova
#

lol dagger taking the driverโ€™s seat

wet mason
#

Rather than tweaking our llb.Run calls to prefix everything with our shim we injected separately, we're the OCI runner now and part of the buildkit image

#

well, the engine image

#

So we wrap runc, and runc makes sure the shim is shimming

civic yacht
#

Coincidentally containerd has its own thing called shims which are pretty much exactly what we have now (just without needing to also setup a full containerd daemon yet)

#

But yeah, basically we can completely customize each container now. With great power comes great responsibility and all that, but it's extremely nice to have as an option going forward

tepid nova
#

Very secondary benefit butโ€ฆ this will make IDs slightly less monstrous right?

civic yacht
#

Shims don't exist as far as they know

tepid nova
#

Awesome

#

I actually discovered the embedded Dockerfile earlier today while debugging a pipeline. base64decode -> jq -> waaa?

#

Thought it was picking up a dockerfile on my repo somewhere somehow ๐Ÿ˜…

remote jetty
#

๐Ÿ‘‹ Is there any instructions for contributing e.g. running the dagger engine locally? I'd like to tinker around with it for a pull request, but I can only find what looks like an out of date contributing doc

obsidian rover
#

run engine locally

civic yacht
#

@wet mason when you have a min can you take another look at the fully nested sessions pr: https://github.com/dagger/dagger/pull/3787

Should be good to go now. I'm working right now on a follow up that combines it with the oci runtime wrapper update, which I think will let us take dagger-in-dagger out of experimental mode and simplify even more. Should be doable today barring unforeseen roadblocks. But would prefer that's a separate PR as the nested session one has stuff relevent to @wild zephyr work (DAGGER_RUNNER_HOST) so don't want to over entangle it

wet mason
#

sure!

rancid turret
wet mason
#

@civic yacht note for our future selves: That mount of .docker got me thinking: dedicated sessions are a double edged sword

  • When we'll do something fancier for logs rather than just dumping to stderr (e.g. stream over API and have a nice display), we'll only see the "outer" session logs (currently it works just because all sessions are dumping to stderr in cascade)

  • If we had a cloud integration that provides visibility into the graph (timing, cache status, ...) we'd only see the outer layer

  • OpenTracing would also stop at the outer layer

I don't know what the future holds. Either going back to "virtual sessions" with proper support in the session manager for nesting/sandboxing, or have some continuity between session managers

civic yacht
# wet mason <@949034677610643507> note for our future selves: That mount of `.docker` got me...

It's hard to say since our future plans for logging are vague but I would imagine that no matter what there's a good chance we'll need some way of "aggregating log streams", which makes me think that we can just use that to combine log streams from different sessions. And for tracing we'll definitely need a way to pass "context", so if we make the tracing and log stream target both passed through that context and context passed between nested sessions, that seems like it should do it (without requiring we rearchitect other stuff around it).

But yeah, there's about 10 layers of hypotheticals there so not sure yet either. Think we at least have plenty of options

wet mason
#

@civic yacht Yup. And the process is the same, we'd have to pass some "sub-session" ID to the nested (or extended) dagger, whether it's via a binary or header doesn't make much difference

For logs, even though they're far away, I was thinking we could experiment pretty fast. Even without "streaming", currently it's trivial to switch logging to json and parse outside to do some nice visualizations

tidal spire
#

I vaguely remember this mentioned somewhere at some point, but want to verify:
is .git/ automatically excluded from Host().Directory()?

civic yacht
tidal spire
cosmic cove
wet mason
strong coral
#

Should a query be encased in query{} ? The graphiql web app seems to want it, but dagger query does not.

wet mason
#

@strong coral No need, it's the default. Not sure why graphiql would want it

#

it's query{} vs mutation{}, defaults to query

strong coral
#

Ah, it's not the query keyword it wants, just the extra curlys

wet mason
#

Oh yeah, that's needed

strong coral
#

But dagger query throws Error: input: Unknown operation named "query{container{from(address:mcr.microsoft.com/powershell){exec(args:[echo,hello]){stdout{contents,size}}}}}"

wet mason
#

address, each element of args needs to be encased in double quotes. Not sure why the error is different than graphiql? I suspect because graphiql parses the query client side whereas dagger query just sends it verbatim to the server /cc @wild zephyr

strong coral
#

No, it's a stdin synax difference. This works for me.

$query.Build() | c:\source\github\dagger\bin\dagger.exe query
{
    "container": {
        "from": {
            "exec": {
                "stdout": {
                    "contents": "hello\n",
                    "size": 6
                }
            }
        }
    }
}
wild zephyr
strong coral
#

I was trying to pass the query as a string argument

#

Pipe to stdin works

wild zephyr
# strong coral I was trying to pass the query as a string argument

that makes sense, if you check the query help, the only argument that it accepts is a graphql query operation name.

This way, if you have multiple queries in a single file you can select which to run. i.e:

./dagger query <<EOF foo
query foo {
  container {
    from(address:"hello-world") {
      exec(args:["/hello"]) {
        stdout {
          contents
        }
      }
    }
  }
}

query bar {
  container {
    from(address:"hello-world") {
      exec(args:["/hello"]) {
        stdout {
          contents
        }
      }
    }
  }
}
EOF

if you don't specify an operation name, this fails since it doesn't know which one to run

strong coral
#
PS > $results = $query.Build() | dagger.exe query | ConvertFrom-Json
PS > $results.container.from.exec.stdout

contents size
-------- ----
helloโ€ฆ      6
#

Are there any functional or performance differences between using dagger query and dagger-engine-session?

tepid nova
#
  • dagger is a user-facing client tool which uses dagger-engine-session under the hood like all other clients.
  • dagger-engine-session is a low-level tool which should not be used directly

There should be no performance difference (same code path under the hood)

wet mason
tepid nova
#

@wet mason should we schedule a combined release to flush all those pending changes to users?

wet mason
#

Python has a pending big change (hiding IDs) that needs releasing soon, I figured might as well jump on that train

wild zephyr
#

TIL to get VCS information in the go binary you actually need the git CLI to be present in the PATH from where you're building facepalm. Just having the .git folder is not enough cc @tawny flicker since we had some experiences with this in the past

tidal spire
wet mason
wet mason
#

Working on WithExec + mandatory args. So far, all changes combined together are much nicer:

        // List files
-       out, err := container.Exec(dagger.ContainerExecOpts{
-               Args: []string{"ls", "-lR", "/embed/"},
-       }).Stdout().Contents(ctx)
+       out, err := container.WithExec([]string{"ls", "-lR", "/embed/"}).Stdout(ctx)
ancient kettle
dapper tinsel
wet mason
#

@dapper tinsel Already doable! The syntax is a bit longer but it's rarer case than just grabbing stdout

ctr.WithExec([]string{...}, dagger.ContainerWithExecOpts{
  RedirectStdout: "/mysecret",
}).File("/mysecret").Secret()
dapper tinsel
#

I see. I misunderstood and thought you completely removed dagger.ContainerWithExecOpts with a args slice. ๐Ÿ˜„

#

@wet mason Another suggestion: should the contents parameter be of type []byte instead of string? It's weird having to cast a binary to string.

wet mason
#

so I made args required to move it to positional

wet mason
wet mason
dapper tinsel
oak sandal
#

It looks like I can't really import dagger.io/dagger (main branch, not the latest tag) on a mac. It complains about build constraints. Am I missing something obvious?

oak sandal
remote jetty
#

@tepid nova @civic yacht I've made a draft pull request to support private registries.

https://github.com/dagger/dagger/pull/3943

I suspect things have changed since last week so if someone else has already looked into this that's fine, we can ๐Ÿšฎ ๐Ÿ™‚

GitHub

Problem
Dagger used to support private registries via a custom buildkit instance. This made use of docker bind mounts. Here's an example:
docker run --net=host -d --restart always -v /private/...

tepid nova
#

Should we remove the #github-feed channel? Does anyone rely on it?

#

(I'm looking for opportunities to reduce discord noise incrementally)

rancid turret
#

I use it ๐Ÿ™‚

#

Helps me reduce github notifications noise.

rancid turret
#

@civic yacht How can I test outside of dagger-in-dagger with dev version of engine? I've run engine:dev, docker cp the binary from test-dagger-engine and run tests with DAGGER_HOST=bin://.

#

Error: failed to run container: Unable to find image 'ghcr.io/dagger/engine:10f4c5bea6c524575157116d3acc6ffd6fc3a526'

civic yacht
civic yacht
#

I'll go look at that and see what other short term fixes there are before the cli stuff is done

rancid turret
#

I'll add a docker-container connector to make this easier.

tepid nova
#

I worry that weโ€™re losing control of the env variable matrix

civic yacht
tepid nova
#

For now can we agree on a freeze to more environment variables until we agree on an overall plan?

civic yacht
tepid nova
#

I would like to kill DAGGER_HOST as soon as possible, and add a prefix for those that we know/suspect will be deprecated

#

like maybe a leading _ or something like that

rancid turret
#

What do you have in mind to replace DAGGER_HOST? I have no context on that.

tepid nova
#

the problem with DAGGER_HOST is that many users are looking for a way to run remote engines and are confused by how. This var name adds to the confusion

rancid turret
#

I see

tepid nova
#

that + the format of the variable value itself (complex)

#

meanwhile There is pressure to offer an alternative to BUILDKIT_HOST (or bring it back)

civic yacht
tepid nova
#

@civic yacht feel free to open a new issue if the proposal is broader

#

Whatever helps clarify context

wet mason
#

@wild zephyr Any reason this is needed at all?

    if err := parseRef(refName); err != nil {
        return err
    }

vs doing nothing?

civic yacht
wet mason
rancid turret
#

Are these changes for next release?

#

Sounds like after, right?

civic yacht
rancid turret
#

Ok. For now what do I do with the new image ids? The digest based one doesnโ€™t work on main so I suppose I should update now to assume git sha tags right? Support for main tag?

civic yacht
wet mason
rancid turret
#

Need to mirror go, right?

civic yacht
rancid turret
#

That's not what I'm seeing, hang on... let me take a closer look.

wet mason
#

[chatting about this at the same time]

rancid turret
#
EngineImageRef = "ghcr.io/dagger/engine"
...
engineImageRef := fmt.Sprintf("%s:%s", EngineImageRef, commitSHA)
...
sdks.Bump(ctx, engineImageRef);
#

What am I missing?

wet mason
#

@rancid turret missing nothing

#

figuring this out, one sec

tepid nova
civic yacht
# rancid turret ```go EngineImageRef = "ghcr.io/dagger/engine" ... engineImageRef := fmt.Sprintf...

Okay yeah we need to do some reconciliation with that change over the weekend. Talked w/ @wet mason about this:

  1. Have engine:publish go back to publishing using the git tag (w/ fallback to main), same as before
  2. The CLI will switch to burning in just the git tag (same as before), with a fallback to main for dev builds and use that to pull the engine image
    • This is based on the assumption that for now any use of non-released images/cli builds will just use our local dev tooling (./hack/make ...)
  3. SDKs will need to automatically set DAGGER_RUNNER_HOST when not set already to replace the previous use of --remote that got removed
    cc @wild zephyr
wet mason
tepid nova
#

I just spent 15mn on that follow-up comment @wet mason @civic yacht and it's unclear to me what we agree on and what we don't. Because "URL" could mean many different things. That in itself is reason enough to not use it.

wild zephyr
#

marcosnils3545 Any reason this is needed

still garnet
#

vacation catch-upreading list

civic yacht
wild zephyr
wet mason
#

I'm going to be offline for the next 30-ish minutes (need to move somewhere else)

wet mason
#

(almost done prepping the pipeline PR)

#

(testing a few times)

civic yacht
#

@strong coral Hey Chris, if you have a free moment sometime I have a Windows question (starting thread)

wet mason
#

@civic yacht @wild zephyr re: CLI release

If we do nothing, we're good to go with the CLI release

  1. Publish engine
  2. PR gets opened to bump Go SDK's engine dependency. Merge
  3. Build CLI from source. CLI uses correct version of the Engine

So long as we merge step 2, the CLI using the Go SDK will use the right version (e.g. we don't need to switch to engine.Start next week)

#

We have to at some point, but it's not a hard requirement for next week

#

Was pretty tired yesterday and didn't realize this

wild zephyr
#

so once the engine:publish is called, the CLI release pipelines also trigger

wet mason
#

@wild zephyr Great! Yeah it might have been obvious but was tired and couldn't brain yesterday afternoon

wild zephyr
#

haha, np! quick question: we can force push ghcr tags, right? Since it could happen that the ghcr push works but goreleaser fails for some reason. In that case we'd have to re-run the release pipeline

wet mason
# wild zephyr so once the `engine:publish` is called, the CLI release pipelines also trigger

Makes a lot of sense

Eventually:

  • CLI will use engine.Start etc (basically it will do whatever the session binary is doing)
  • CLI is built using -X main.Version=<tag> (already the case)
  • CLI uses that version to pull the engine (which gets published with the tag as well)
  • SDKs download CLI using that same version, from the S3 bucket (e.g. where goreleaser is already putting the binaries)
#

So it's going to be much simpler. Push the engine to the registry, push CLI to s3, done

#

SDK grabs CLI vX, CLI grabs engine vX

wet mason
wild zephyr
#

@wet mason does it make sense to add some README instructions on how to use the latest main engine with the dagger CLI now? Since if users clone the repo, build the engine and do a dagger listen they'll be using the latest released engine image which is a bit confusing. They currently need to do engine:dev and export the variables to get the "dev" one.

#

I know this will change with the upcoming changes. Just wondering if it's worth to document somewhere in the meantime

wet mason
#

Yeah I think so. That document should always exist, upcoming changes will just make it shorter

wild zephyr
#

๐Ÿ‘ will send a PR with a brief README in cmd/dagger shortly

wet mason
#

@civic yacht @wild zephyr main CI is almost green -- should I go ahead and tag an engine release? Anything else blocking?

civic yacht
wet mason
civic yacht
wet mason
#

Oh, nope, manual on purpose

#

they would be super broken right now otherwise (WithExec, etc)

wet mason
civic yacht
#

Makes sense, shipit!

wet mason
#

ah crap. linter broken because of bump

#

@civic yacht running all tests manually locally for provisioning ...

civic yacht
wet mason
#

Haha ๐Ÿ™‚

#

which ones did you do?

civic yacht
#

nodejs so far

wet mason
#

cool

#

i did everything EXCEPT node

#

python is finishing up

#

python passed

#

Go did work but I don't have anything in ~/.cache/dagger

#

I'm re-running go test from sdk/go

#

Pass

#

But still nothing in the cache

civic yacht
wet mason
#

yeah

#

oh btw -- go clean -testcache. go test was itself cached

#

so tests are passing, the right engine is provisioned

#

but ~/.cache/dagger is still empty

civic yacht
#

Hm yeah I get the same behavior... the provisioning test in the go sdk override XDG_CACHE_HOME so it's expected for that, but it should get cached from the other tests

wet mason
#

ah!

#

~/Library/Caches/dagger

#

I think?

civic yacht
#

Haha I was just about to paste that!

#
sipsma           73092   0.0  0.1 409239120  79008 s001  S+    3:41PM   0:00.73 /Users/sipsma/Library/Caches/dagger/dagger-engine-session-41f71f0036167fcc
wet mason
#

So just a different behavior between languages -- in Go it's the "correct one"

civic yacht
#

Ok yeah we use an actual xdg library in Go whereas the other SDKs just check XDG_CACHE_HOME and default to ~/.cache/. So I'm guessing that ~/.cache is the default value of XDG_CACHE_HOME on linux but that library must set it to something else on macos

wet mason
#

Maybe we should do the non-Go thing in Go as well

civic yacht
wet mason
#

Cool so everything works

#

ready to ๐Ÿšข

hasty basin
#

earlier today my pipelines on my mac were using ghcr.io/dagger/engine:v0.3.4 I think and now they're using moby/buildkit:v0.10.5. Expected?

civic yacht
hasty basin
#

the getting started code

civic yacht
hasty basin
#

golang

#

will try to repro again. noticed it while trying to troubleshoot someone

civic yacht
# hasty basin golang

I think if you ran it including go get dagger.io/dagger@latest then you'd end up with the latest released go sdk, which is the older code that still used moby/buildkit

civic yacht
hasty basin
#

so no PR needed, just let it propagate?

civic yacht
wet mason
#

Docs are live

wet mason
#

@tepid nova @ancient kettle @stray heron We should consider retiring / renaming the dagger GHA, I've seen a few occurrences where someone tried to use it with non-CUE

wild zephyr
#

FWIW playground also upgraded accordingly daggercloak

hasty basin
#

Dagger GitHub action

tidal spire
#

will have the same for python and nodejs shortly. Are we publishing any sort of official announcement for the new versions?

hasty basin
stuck bloom
tepid nova
#

@wet mason @civic yacht follow-up on DSI, followed by a change of heart ๐Ÿ˜‰

civic yacht
tepid nova
#

Yes. We are cool!

#

You get it

#

They say you can make a thrilling, award-winning manga series about anything. I'm confident our time will come.

civic yacht
tepid nova
#

@civic yacht one fun hack, with the DAGGER_SESSION_PORT approach, you can replace dagger listen advantageously with dagger run sh -c 'echo "http://localhost:$DAGGER_SESSION_PORT/$DAGGER_SESSION_PATH" ; read'

civic yacht
#

Erik Sipsma3294 one fun hack with the

wild zephyr
#

@still garnet around? I thought Host.Directory didn't allow referencing any arbitrary dirs in the host and was only scoped to the cwd? Just checked with @hybrid widget and seems like it's not the case.

still garnet
#

it's not restrictive, you can pass absolute paths - you just can't do ../

#

for non-security-related reasons

wild zephyr
still garnet
#

correct, to my knowledge those safeguards haven't been implemented yet; it hasn't been a priority as we haven't focused on extensions yet

wild zephyr
tepid nova
#

@wild zephyr same security profile as any other go library you might import

#

extensions will improve the security model

wild zephyr
tepid nova
#

We can definitely do better - with extensions ๐Ÿ™‚ But at least for now weโ€™re not making things worse

slate hawk
#

Update multibuild concurrency by kpenfou...

flat heart
#

Hi there, how can I push to an insecure registry whith go sdk ?

wild zephyr
flat heart
#

ok thanks !

tepid nova
#

Starting a thread of OX (operator experience) requests and issues, Iโ€™m seeing more and more pop up

civic yacht
#

@rancid turret Quick question, did switching to httpx enable the python sdk to connect to the engine over unix sockets? Or is it that going to require some more effort on top of that PR?

rancid turret
civic yacht
rancid turret
civic yacht
rancid turret
ancient kettle
#

I was looking over the buildkit v0.11.0-rc1 release notes: https://github.com/moby/buildkit/releases/tag/v0.11.0-rc1

A couple of things stood out as interesting:

@civic yacht @wet mason @still garnet Any others that I missed? Will the build history APIs change anything big for us?

still garnet
#

build history is interesting! hadn't heard of that before

civic yacht
still garnet
#

i'm just glad to see a new minor release, it's been quite a while. (also the provenance stuff is really interesting)

civic yacht
#

Yeah if anyone asks for SBOM support on dagger it should be a relatively clear path now I think

ancient kettle
#

Glad to hear some of it might be useful for us. SBOM stuff definitely seems like something we could leverage. ๐Ÿ™‚

#

@civic yacht Do you know how BuildHistory is different than SolveStatus?

civic yacht
# ancient kettle <@949034677610643507> Do you know how BuildHistory is different than SolveStatus...

It lets you retrieve the information after the build has completed and also seems like it will support more information (like the cache summary). It actually almost invalidates the need for the shim to collect stdout/stderr, but not quite because the way buildhistory is implemented looks to be a separate boltdb history.db, so I think that'd mean that the stdout/stderr isn't cached (which breaks remote cache imports/exports) and isn't always guaranteed accessible, so it doesn't quite work for our particular use case

#

I did just realize it might be a relatively straightforward path to supporting retrieval of the stdout/stderr when an exec op fails. Technically there's another existing way we could do that already but it's ugly as heck so this might make that easier

ancient kettle
tepid nova
#

FYI @charred lotus discussion of build history โ˜๏ธ๐Ÿ˜

wild zephyr
tepid nova
#

Will the upcoming CLI release coincide with an engine release? And if so, will that new engine release finally supersede the "0.2.36" release which is still listed as the "latest" release on the github repo summary view?

tepid nova
#

Random crazy / stupid idea of the day: dagger run eventually adds built-in adapters for Docker Engine and Buildkit, and injects a valid DOCKER_HOST and BUILDKIT_HOST so that all buildkit and docker clients work out of the box ๐Ÿ™‚.

Of course this is then picked up recursively by container { WithExec }

mellow bolt
#

Hey ๐Ÿ‘‹ . When I try to go build ./cmd/dagger I've got the following error:

go: -mod may only be set to readonly when in workspace mode, but it is set to "mod"
        Remove the -mod flag to use the default readonly value,
        or set GOWORK=off to disable workspace mode.

Does anyone had the same issue ?

civic yacht
#

Hey ๐Ÿ‘‹ When I try to `go build

tepid nova
#

As of today's releases, what environment variables are used by the different client libraries to bypass auto-install? /cc @civic yacht

Context: we're trying to determine if dagger run is worth releasing at the moment, or if we should wait for everyone to align on the same variables so that it actually has the intended effect

civic yacht
civic yacht
#

I also think that DAGGER_SESSION_SOCKET should be coming very soon, it's working on all 3 platforms (including named pipes on windows), biggest thing left is to get my terrible nodejs+python code reviewed by those who know what they're doing in those languages ๐Ÿ™‚ https://github.com/dagger/dagger/pull/3983

tepid nova
#

Ok ๐Ÿ‘

#

BTW I still have a round of bikeshedding in me about unix vs tcp @civic yacht unless you told me you're too far along in the implementation and the waste of engineering time would be too great

civic yacht
#

So my vote is unchanged on that front

#

Also, I know I keep bringing this up, but I think it's extremely relevant. We have these two features planned independent of all the above:

  1. Dagger-in-dagger (without being hidden behind the scary flag)
  2. Proxying of sockets from containers to host (i.e. container unix sock to host tcp)

With those two combined, we'll get a localhost dagger api listener that's safe. You'll still be able to include local dirs and env from the host (by mounting them into the dagger-in-dagger exec) but it will be on an opt-in basis.

tepid nova
#

@civic yacht re: dagger run, we're going to move forward and ship it with $DAGGER_SESSION_URL because it's the only way available way for developers to program Dagger with a vanilla GraphQL client. @hybrid widget is going to write a guide explaining how to wire $DAGGER_SESSION_URL into their graphql client, and wrap their code with dagger run.

#

@wild zephyr is going to add the random path element to remove the main security issue with that (local port scanning)

#

Ideally we would have waited for everything to be aligned (including SDKs), but we want to get the GraphQL API out, and we can't do that with at least some way for developers to actually write clients for it.

#

That means in the very short term, vanilla graphql clients will use a different method from SDKs to establish a session. Obviously we need to resolve soon, but those are pretty distinct development tracks, so the impact on DX is pretty small.

The main downside is that if you try dagger run to wrap a tool using an official SDK, it won't hijack the session as you would expect. But nobody uses dagger run yet, so that's OK

#

The expectation is that eventually (soon) we'll finalize the design discussion on DSI, dagger run will adopt it, and we'll change the docs for client developers to use it. Ideally we'd keep $DAGGER_SESSION_URL around as a convenience, to avoid breaking early adopters (adding random path now helps make that possible). But if it turns out to be impossible for security or other reasons, breaking it remains an option.

#

However, I'm still not convinced by the unix socket route, because IMO the DX downsides are not worth it.

civic yacht
#

Okay, my inner paranoia is still hung up on making the URL path include a secret, but as long as it's just dagger run I'll be able to sleep at night.

still garnet
#

context: i'm wiring up the unix socket forwarding now, and deciding how to change/replace MergedSocketProviders

civic yacht
tepid nova
still garnet
wild zephyr
tepid nova
#

@wild zephyr how to you avoid host filesystem access?

still garnet
#

We could put it behind the same disable-host-rw flag (do we use that for playground?)

#

Or add another flag

wild zephyr
tepid nova
#

@wild zephyr do you use cloak dev today?

wild zephyr
tepid nova
#

Great use case for sandboxing then ๐Ÿ™‚ Which is what @still garnet was saying I guess

tawny flicker
#

has anyone encountered:

$ ./hack/make sdk:go:generate
+++ dirname ./hack/make
++ cd ./hack/..
++ pwd
+ DAGGER_SRC_ROOT=/home/dolanor/src/dagger.new
+ MAGEDIR=/home/dolanor/src/dagger.new/internal/mage
+ cd /home/dolanor/src/dagger.new/internal/mage
+ exec /home/dolanor/src/dagger.new/hack/dev go run main.go -w /home/dolanor/src/dagger.new sdk:go:generate
+++ dirname /home/dolanor/src/dagger.new/hack/dev
++ cd /home/dolanor/src/dagger.new/hack/..
++ pwd
+ DAGGER_SRC_ROOT=/home/dolanor/src/dagger.new
+ MAGEDIR=/home/dolanor/src/dagger.new/internal/mage
+ pushd /home/dolanor/src/dagger.new/internal/mage
~/src/dagger.new/internal/mage ~/src/dagger.new/internal/mage
+ GOWORK=off
+ go run main.go -w /home/dolanor/src/dagger.new engine:dev
Error parsing magefiles: failed to parse directory: /home/dolanor/src/dagger.new/internal/mage/sdk/all.go:35:1: expected declaration, found func
exit status 1

??

obsidian rover
#

declaration not found

still garnet
#

bonus: written entirely in a moving car with rain + wind. glad i don't get carsick

still garnet
#

@civic yacht merged the sockets PR, just pinging since you seemed to have a couple of things waiting on it ๐Ÿซก

ancient kettle
civic yacht
civic yacht
ancient kettle
tepid nova
#

dagger listen is hidden right?

civic yacht
tepid nova
#

And dagger session also clearly

#

That's good ๐Ÿ™‚

obsidian rover
#

@civic yacht @still garnet @stray heron could it be possible that we are on a version mismatch between SDKs and engine ? I don't seem to have the socket primitive on latest engine release v0.3.6. I see the primitive on the sdk, but not on graphql API

#

I can see the withUnixSocket, but cannot use it

civic yacht
mellow bolt
obsidian rover
civic yacht
#

Oh okay I didnโ€™t know we were doing it so soon. Whenever we do an SDK release we should also do an engine release right before it, otherwise we end up in situations like this

mellow bolt
#

That's probably something that we need to add into the RELEASING.md (cc @stray heron )

civic yacht
mellow bolt
#

Thanks @civic yacht ๐Ÿ™‚

civic yacht
white pilot
civic yacht
white pilot
#

What's the release plan for the 0.3.7 engine release btw? Is it waiting for these linting changes to make it in?

civic yacht
wet mason
wet mason
#

(someone just complained about it ~1hr ago)

still garnet
#

squash+merging it now!

#

stepping away for lunch

white pilot
#

Thanks for all your work in getting 0.3.7 out folks โค๏ธ I assume based on the prior messages that a node SDK bump is also needed to make it all work?

civic yacht
white pilot
#

No worries, just checking that I'm not doing anything wrong on my end ๐Ÿ˜„

#

Massive thanks for getting 0.3.7 out, I'll be the first to break it!

white pilot
civic yacht
white pilot
#

Right, given that I'm supposed to be in a meeting in 9 hours, I should probably call it a night and sort it tomorrow then ๐Ÿ˜‚

#

though I did just realise I can set DAGGER_HOST in the env and get the node SDK to use that so... maybe just a small experiment

tepid nova
white pilot
#

I'm just using it now so I can try the 0.3.7 release to see if my unix socket mount works, without waiting for the SDK release

tepid nova
white pilot
#

just use the image from the to-be-released SDK

#

it's a super easy way for me to try out what'll be the 0.2.1 SDK (which just bumps image version) without pulling it down and building on local

#

it's very much an edge case though, given that this is only happening because of the release issues ๐Ÿ˜…

tepid nova
#

@civic yacht I got interrupted by lunch & childcare, but working on a reply in the DSI issue.

Short version:

  • Agree with summary
  • Remaining concern: _PORT vs _URL
  • How does dagger session send information to the client (2 values now: json? envfile format? extensibility?)
  • I think we may be able to fold dagger listen into dagger session but out of scope for DSI issue, and no rush
tepid nova
white pilot
tepid nova
#

Thanks! Did you see the GraphQL announcement earlier today?

white pilot
#

I did ๐Ÿ˜„ but you have SDKs in all my favourite languages so presumably I don't need to care much about it? Unless it opens up some cool new opportunities I don't know about yet. Any plans to expose experimental functionality on GQL API and not SDKs (and somehow allow params to the GQL query through the SDK)?

ancient kettle
tepid nova
#

Correct, all SDKs have feature parity with the API. The only gap is if you want to take advantage of cleverness in the GraphQL query language. And of course the playground is fun regardless of what language you use ๐Ÿ™‚

#

That + shell scripts

civic yacht
white pilot
#

Not sure I'm doing anything wrong, and I suspect this might not be a dagger engine issue, but rather a macOS or (more likely) me issue. When using the mounted socket, the connection to the SSH Agent is refusing. Currently just trying to run ssh-add -L to test it. Probably missing something stupid about mounting the socket. Just getting Could not open a connection to your authentication agent.. Mounting my $SSH_AUTH_SOCK to /default.ssh and setting that in the env

civic yacht
#

If you have some node code to share I can try to reproduce too on my mac

white pilot
#

well, my first issue is that my env is messed up

#

sec, trying one thing here, let's see if it's just my typing that's failed me again

#

Right, ssh-add working now ๐Ÿ‘

#

let's see if my git push works

#

Right, at this point it's non-mount things for sure, just me being silly about something and not able to get ssh-add to write to known_hosts properly. I'll pick it up tomorrow in the brief moments between meetings. Trying to run mkdir -p ~/.ssh and then write to it with ssh-keyscan but somehow that's a nonexistent directory. But this is 100% me forgetting something about buildkit

#

Unix socket mount seems to work well as the ssh-add -L worked well

civic yacht
white pilot
#

If you want to give it a try yourself, here's a generic function for git push

export default async (client: Client, repo: DirectoryID) => {
    
    let container = client.container()
        .from('alpine/git')
        .withMountedDirectory('/git', repo)
    
    const sshSocketPath = process.env.SSH_AUTH_SOCK

    if (! sshSocketPath) {
        console.log('No SSH socket path was found, you may not have an ssh-agent running')
    } else {
        const sshSocket = await client.host().unixSocket(sshSocketPath).id()
        container = container
            .withUnixSocket('/default.ssh', sshSocket)
            .withEnvVariable('SSH_AUTH_SOCK', '/default.ssh')
    }
    
    return await container
        .withEntrypoint([])
        .withExec(['mkdir', '-p', '~/.ssh'])
        .withExec(['ash', '-c', 'ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts'])
        .withExec(['cat', '~/.ssh/known_hosts'])
        // .withExec(['git', 'push', '-u', 'origin'])
        .stdout()
}

The ash -c is just there because I have too few braincells at this hour to remember how I should modify the exec to redirect the output (>> doesn't work as it'd get treated as an argument to ssh-keyscan rather than stdout redirection). I suspect the directory madness is due to a similar thing.

tepid nova
wet mason
wet mason
#

(so glad we added those helpers to container directly, @still garnet @tepid nova)

tepid nova
#

๐Ÿ™‚

still garnet
#

awesome, thanks for organizing this, the table is super useful

oak sandal
#

Does Dagger API internally rely on Dockerfile frontend to interact with Buildkit?
I was looking at attesting resulting artifacts , looks like buildkit supports it now but if I understand correctly, it only supports Dockerfile frontend https://github.com/moby/buildkit/pull/3240

tepid nova
#

@oak sandal no

civic yacht
tepid nova
#

Except for the Container.Build action which does use the standard dockerfile frontend

ancient kettle
#

Extensions

wet mason
#

@civic yacht @still garnet Hey ... let's say I want to share some context between graphql resolvers. Any idea on how to do that? I can't stash things in context since child solves won't see that

civic yacht
wet mason
#

@civic yacht Thanks! I remember that. The catch is I'd like that to be additive (basically what you'd be able to do with context), I believe the solution you had was a global reference table?

#

But yeah would love to take a look at that code, might be the solution with some extra things on top

civic yacht
# wet mason <@949034677610643507> Thanks! I remember that. The catch is I'd like that to be ...

It is additive, it uses a global reference table because that's all we are given by graphql go, but it creates the end effect of being additive by tracking the state of each path through the graphql queries. Main part is here: https://github.com/sipsma/dagger/blob/da649ddf324bf14800f1863d62453a66b751b651/router/schema.go#L153-L207

Then there's some initialization at the start of the query here: https://github.com/sipsma/dagger/blob/da649ddf324bf14800f1863d62453a66b751b651/router/router.go#L114-L125

wet mason
#

amazing

civic yacht
#

(this is me remembering from a few months ago, so take with grain of salt, but hopefully it's helpful to start ideas if nothing else)

wild zephyr
still garnet
#

ah, our old friend the scratch panic

#

not sure if this is the same one that we've investigated, it keeps popping up in new places, and some of them are possibly fixed upstream already, but it kind of feels like whack-a-mole

simple lily
#

Would a new Go SDK function to provide an io.Writer be complicated to implement? like func (c Container) WithStdout(w io.Writer) Container

At first I thought it might be fairly easy but then I realized that the Go client isn't actually what's creating the containers so it's quickly sounding a lot more difficult than I originally thought ๐Ÿ˜‚

#

And since it's generated I'm not sure where I'd begin with that one.

tepid nova
simple lily
#

My motivation would be to make it easier / cleaner to work with a logger like logrus , as I'd be able to do container = container.WithStdout(logger.WithField("stream", "stdout").Writer()). I figured if it's easy to do then it'd be a nice to have quick change I could push upstream.

it's also be nice to just be able to use stuff like an io.MultiWriter and all the niceties that come with io.Writer.

If not then I can make an issue for it and look at it later

simple lily
#

Also, just noticed this, it seems like whenever a container fails, container.Stdout fails with an error. I'm assuming that's because whenever the container has exited, the stdout file is no longer available. I think using io.Writers here would help since it'd give the caller more ways to handle the stderr / stdout.

I see that I could use WithLogOutput when calling dagger.Connect but that also has a lot of dagger-specific logs I think.

white pilot
#

Q about the execution graph: does Dagger somehow calculate the entire DAG before execution, or is it built out as the execution progresses?

still garnet
tepid nova
#

But for a given pipeline itโ€™s all built ahead

white pilot
tepid nova
white pilot
#

(I realise previous runs might not be persisted so you'd need a persistence layer on top for anything but current jobs)

tepid nova
#

We are at the design phase of solving for this problem, so very interested in understanding your use case & requirements

#

Would you mind starting a thread in #help for easier linking?

white pilot
#

Sure thing, will do once I get home ๐Ÿ‘

tepid nova
#

Actually I can do it for you now to save you time ๐Ÿ™‚ will tag you

tepid nova
#

Heads up, doing some issue & label cleanup

ancient kettle
#

Did you have any thoughts/opinions on how you might represent permissions in that API?

still garnet
#

hmm initial thought: stick to Int at the API level so people can use octal syntax in each SDK

#

octal isn't exactly the most user friendly option but I don't know that we need to reinvent the wheel here, since people are used to it

ancient kettle
tepid nova
#

Some labels made sense in theory, but just weren't used diligently enough to be accurate. My approach: better to have no label than a misleading or confusing label. We can always add one later.

regal fable
#

Hello all ! I want to make a PR on the dagger-cue installation script (to fix what I describe in the last lines of this issue: https://github.com/dagger/dagger/issues/4093#issue-1476924855)

But I don't find where is versioned this script. Is it in the dagger repo ?

GitHub

What is the issue? The getting started for Dagger CUE on GitLab CI doesn't work. In the before_script the dagger CLI is installed instead of dagger-cue CLI: before_script: - | # install dag...

obsidian rover
obsidian rover
regal fable
# obsidian rover Oh ok, vikram merged a bump of one of our dependencies. I believe that the PR's ...

Yes I didn't describe the context ๐Ÿ˜ . So I found 2 issues :

First, a documentation issue here: https://github.com/dagger/dagger/issues/4093

  • I've done a PR to fix it
  • It was reviewed and merged, so it's done, the GitLab CI example in the doc is now working

But, I noticed as well 2 update/improvements to do in the dagger-cue installation script. This is linked to the issue #4093 but not dependent. So I want to open an issue and a PR about it but I don't know where dagger-cue installation script is stored, so it's my question: where can I find it, what repo?

GitHub

What is the issue? The getting started for Dagger CUE on GitLab CI doesn't work. In the before_script the dagger CLI is installed instead of dagger-cue CLI: before_script: - | # install dag...

obsidian rover
regal fable
#

Cannot do it right now, will do in a few hours ๐Ÿ˜‰

obsidian rover
regal fable
rancid turret
tepid nova
civic yacht
tepid nova
#

Sorry if I caused confusion, it felt kind of like cleaning a messy fridge in a place with 10 roommates ๐Ÿ˜› You know some stuff definitely was forgotten weeks ago, but sometimes it's hard to tell ๐Ÿ™‚

rancid turret
tepid nova
#

I think I might have done that, a few weeks ago (can't remember)

rancid turret
#

All the issues I saw it was Miranda but she might have taken the cue from you ๐Ÿ™‚

#

We'll sort it out, but I feel we need some guidelines on which labels to use. There's a area/sdk and sdk/xxx, when should the first one be used? Then there's some inconsistencies between some area/ and kind/. Things like that.

tepid nova
#

I removed area/sdk it's redundant

#

In some specific cases, if an issue applies to all SDKs, it's easy enough to just add 3-4 labels

rancid turret
#

Yes, I feel the same way.

rancid turret
tepid nova
#

Oh my mistake. I didn't remove it because of all the codegen-related stuff

#

Maybe area/codegen?

rancid turret
#

I think we can just remove it. There's two with needs/discussion which means there's no plan of action yet. If there was we could then add the sdk labels that are a part of that plan.

#

For the others there's already an sdk or engine assigned.

rancid turret
rancid turret
#

I cleaned up area/sdk quite a bit. There's 6 remaining issues with it assigned.

wet mason
#

@civic yacht Hey -- there's no way to run a Go SDK app using the dagger CLI yet (e..g through env variables), right?

civic yacht
wet mason
#

neat

#

@civic yacht any workaround if I want to take over stdout from the engine?

civic yacht
wet mason
#

Trying something with logs, I need to take over stdout. Ideally dagger run --> engine.Start --> pass engine address over to the SDK, and the CLI controls stdout

But since it's not doable right now, trying to find a workaround for that

#

I could tweak engine session, but it's using stdout for the port

civic yacht
wet mason
#

@civic yacht trying something

wet mason
#

@civic yacht (btw unrelated -- I don't know how much it's worth trying to figure out what's up with our build cache vs just waiting to simplify the engine/cli/build process. Right now it takes a big minute to build a one line change)

civic yacht
wet mason
#

even with no changes it's still pretty slow here, weird

civic yacht
wet mason
#

Mac?

civic yacht
#

Linux

#

(vm on mac, but my client is in Linux too so mac shouldn't be involved)

wet mason
#

twice in a row (so obvs no changes on second run):

./hack/make engine:dev  2.40s user 2.14s system 10% cpu 43.380 total
./hack/make engine:dev  2.76s user 2.19s system 11% cpu 43.568 total
#

stashing that into "to be checked at some point" ๐Ÿ™‚

civic yacht
#

./hack/dev accepts arbitrary args which it will exec (i.e. ./hack/dev go test ... or ./hack/dev bash). It's essentially like a stripped down dagger run but usable by ci without creating chicken-egg loops

tawny flicker
mellow bolt
#

If I try to run node.js SDK v.0.1.1 (latest is 0.3.0), related to this PR (https://github.com/dagger/dagger/issues/3984).

I've got the following error:

yarn run v1.22.19
$ node --loader ts-node/esm ./deploy.ts
(node:22498) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could 
change at any time                                                                                     (Use `node --trace-warnings ...` to show where the warning was created)
file:///Users/slumbering/forks/demo-nodejs-sdk/node_modules/@dagger.io/dagger/dist/provisioning/docker-
provision/image.js:256                                                                                             throw new Error("failed to read port from engine session");
                  ^
Error: failed to read port from engine session
    at DockerImage.<anonymous> (file:///Users/slumbering/forks/demo-nodejs-sdk/node_modules/@dagger.io/
dagger/dist/provisioning/docker-provision/image.js:256:19)                                                 at Generator.next (<anonymous>)
    at fulfilled (file:///Users/slumbering/forks/demo-nodejs-sdk/node_modules/@dagger.io/dagger/dist/pr
ovisioning/docker-provision/image.js:4:58)                                                                 at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Do I also need to downgrade my engine version ?

#

Another question pop up on my mind. As SDKs are evolving side by side with the engine, do we need to warn users that a specific SDK version require a minimum engine version ?

civic yacht
civic yacht
mellow bolt
civic yacht
mellow bolt
#

the log output doesn't give me much infos

wet mason
#

@civic yacht ๐Ÿ‘‹ hey, do you happen to know why resolve image config for ... is its own vertex?

civic yacht
# wet mason <@949034677610643507> ๐Ÿ‘‹ hey, do you happen to know why `resolve image config fo...

Yeah it's this line: https://github.com/sipsma/dagger/blob/c2f2ce13cee98f00c4826dccfbe083bf375ee3de/core/container.go#L211-L211

Essentially when we hit the resolver for From we need to grab the image config. Then on the buildkit level I guess it considers that to be a "vertex" too since it's technically doing actual work which can fail and thus show up as an error in progress (hitting a registry to get the config)

#

It is sort of a pattern breaker in that it's a vertex in the progress but not actual LLB, just a gateway api, but I think most of that buildkit progress code is full of exceptions like that

wet mason
#

dang, yeah

#

any way to "shove" that into from? I guess progressgroup would be the only way

civic yacht
wet mason
civic yacht
civic yacht
wet mason
#

ok cool, I can jump on dev audio

#

if now is a good time

still garnet
#

gonna eavesdrop

civic yacht
wet mason
#

@civic yacht @still garnet Oh, actually, forgot one thing: statuses. Those are basically "logs" for non-loggy vertices? Like, they contain started/completed info, but the vertices already have that.

#

Also -- there's a current and total field. Any idea on what uses total? Image and Local don't

still garnet
#

i believe that's used for downloading individual image layers

still garnet
#

also feel free to steal the spotify integration ๐Ÿ™ƒ

wet mason
#

@still garnet @civic yacht thoughts on interactive navigation vs displaying a few lines alongside every vertex (a la bk/bass)? I was thinking interactive because of the sheer number of vertices, but inlined is a simpler ui

civic yacht
still garnet
#

+1 - imagining a long test suite that keeps going after the first failure, it'll be nice to be able to scroll up and investigate before the full suite finishes

ancient kettle
#

@wet mason @tepid nova @tawny flicker @civic yacht @still garnet I'd appreciate any thoughts, ideas, feedback on this proposal for a new secrets API: https://github.com/dagger/dagger/issues/3442#issuecomment-1341762993

GitHub

I need the ability to create new Secrets in the v0.3 API for dagger-classic. I suggest this change (or similar) to the API: query { secret { // make the id: SecretID optional new(contents: String!)...

wet mason
ancient kettle
#

I was just noticed that

type Container {
  withNewDirectory(path: String!): Container!
}

doesn't exist. Should it?

#

@wet mason @civic yacht @still garnet Thoughts? ๐Ÿ‘†๐Ÿป

civic yacht
ancient kettle
still garnet
#

huh. so apparently if you try to return an int that's > 2147483647 (max int32) you'll get this:

input:1: directory.withNewFile.stat.mode Cannot return null for non-nullable field FileInfo.mode.
#

which is technically correct behavior per the spec: https://graphql.org/learn/schema/#scalar-types (Int: A signed 32โ€bit integer.)

#

hmm

ancient kettle
#

Huh. That's interesting, @still garnet.

#

I was wondering about custom scalars with the file/folder permissions work I'm doing.

#

Because... I'd prefer a uint32 or similar for that.

#

These two cases have me wonder if we should look into creating custom types for them.

still garnet
#

yup, I ran into this error because of bit flags on 'mode' so we'll need some other representation for that at least. alternatively I could extract those bit flags into separate bool fields, at that point mode should be small enough (0777 max I suppose?)

oak sandal
#

I was wondering if it is possible for Dagger to set a QOS on a build as in- this build job is assured/restricted to get a 1cpu, 2GB RAM

#

Assuming there's a Dagger/Buildkit cluster running and the request is remote

oak sandal
#

I was wondering if it is possible for

ancient kettle
#

@civic yacht @still garnet @wet mason Any tips for reducing the round trip time for running engine tests? ./hack/make engine:test takes a while...

civic yacht
ancient kettle
civic yacht
ancient kettle
#

Thank you! ๐Ÿ™๐Ÿป

#

Side note, @still garnet, I'd love to have Stat right about now... I'm testing the permissions code by loading a directory/file I've created with permissions into a container and running ls -l (file|directory name) and checking for substrings like... require.Contains(t, stdout, "rwxrwxrwx")

#

๐Ÿ™‚

still garnet
#

Lol, I did the same for testing WithTimestamps

wet mason
#

Yeah, it's pretty slow generally speaking. Hopefully good opportunity to get some visualization on top and figure out what's going on

#

I have random cache misses I think, but it's hard to spot with everything going on at the same time

ancient kettle
#

@wet mason Yeah, that'd be nice. I know some of it is that I'm asking it to re-run a bunch of stuff that I've already done... some of which probably should be cached... and some of which is totally already cached. But it's still a bit slow to run that whole loop when I just want to check a single test. the ./hack/dev zsh trick worked well.

ancient kettle
tepid nova
#

@wet mason is there a rough consensus on certain parts of the service API? So that we can rebase our proposals on top of it & not reinvent the wheel.

For example how to actually start it. Something like this?

extend type Container {
  start(...): Service!
}
wet mason
#

this is how far I got -- API design what not really a goal of that PR, so take it with a grain of salt

wet mason
tepid nova
#

@wet mason is it useful if I refresh that schema to fit in the current schema (filesystem -> container etc), and incorporate that in my API proposal for container networking?

#

(currently I just assume service is solved elsewhere, and just "extend type Service")

tepid nova
#

I am completely brainwashed by @still garnet 's design in bass, now that I am caught up on it. Trying to rebase all networking on top of it, including c2h ๐Ÿ™‚

wet mason
#

there's some considerations around cache bust, network endpoints need to be "stable" across runs, and bass solved that through some networking in BK stuff

tepid nova
#

Basically the trick is to keep hostnames stable (by making them hashes of llb), and be careful to keep IPs out of llb.

#

as I understand it

#

If we managed to rebase everything on top of that, the main benefit is that we operate almost entirely at the IP layer, and anything related to tcp/udp ports is lightweight convenience

tepid nova
civic yacht
still garnet
#

super nice to see that land!

ancient kettle
still garnet
#

on it!

ancient kettle
ancient kettle
# still garnet on it!

Trying to answer your question about llb.CopyInfo.Mode... and it's not acting how I'd expect. So, I'll probably need to dig in more.

ancient kettle
#

Hmm... I did
./hack/dev zsh
then

$ go test -v -count=1 -run TestDirectoryWithDirectory $(pwd)/core/integration/
=== RUN   TestDirectoryWithDirectory
=== PAUSE TestDirectoryWithDirectory
=== RUN   TestDirectoryWithDirectoryIncludeExclude
=== PAUSE TestDirectoryWithDirectoryIncludeExclude
=== CONT  TestDirectoryWithDirectory
=== CONT  TestDirectoryWithDirectoryIncludeExclude
    suite_test.go:21:
            Error Trace:    /Users/joel/src/dagger-main/core/integration/suite_test.go:21
                                        /Users/joel/src/dagger-main/core/integration/directory_test.go:241
            Error:          Received unexpected error:
                            fork/exec /Users/joel/src/dagger-main/bin/dagger: exec format error
                            Please visit https://dagger.io/help#go for troubleshooting guidance.
            Test:           TestDirectoryWithDirectoryIncludeExclude
=== CONT  TestDirectoryWithDirectory
    suite_test.go:21:
            Error Trace:    /Users/joel/src/dagger-main/core/integration/suite_test.go:21
                                        /Users/joel/src/dagger-main/core/integration/directory_test.go:188
            Error:          Received unexpected error:
                            fork/exec /Users/joel/src/dagger-main/bin/dagger: exec format error
                            Please visit https://dagger.io/help#go for troubleshooting guidance.
            Test:           TestDirectoryWithDirectory
--- FAIL: TestDirectoryWithDirectoryIncludeExclude (0.00s)
--- FAIL: TestDirectoryWithDirectory (0.00s)
FAIL
FAIL    github.com/dagger/dagger/core/integration    0.239s
FAIL
#

Looks like I've got the linux binary...

/Users/joel/src/dagger-main/bin/dagger: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=0ZejYqOeuUKaRoC5c0cY/o0S2tEBd6KxpJbq3rCAP/0fTD3xurVvL4nR6IsOPC/T4LK84drh5ktgVzQ4W5_, stripped```
#

I just rebased on main, and I'm still getting this error. @civic yacht @still garnet. Any ideas why that'd be happening for me?

#

I removed that binary, redid the ./hack/dev zsh, and got the same binary back.

civic yacht
ancient kettle
#
$ /Users/joel/src/dagger-main/bin/dagger
zsh: exec format error: /Users/joel/src/dagger-main/bin/dagger
#

I rebuilt it on my local machine: go build -o ./bin/dagger -ldflags -s ./cmd/dagger

#
$ file /Users/joel/src/dagger-main/bin/dagger
/Users/joel/src/dagger-main/bin/dagger: Mach-O 64-bit executable arm64
#

And it's working just fine now.

civic yacht
#

Ohhh I see, youโ€™re on macos, I missed that

ancient kettle
#

Yeah

#

I'm guessing that engine:dev isn't copying the correct binary over (or something similar).

#

I'm looking at that now.

civic yacht
#

Yeah I think so, Iโ€™ll be at my computer in a few to look too

ancient kettle
#

๐Ÿ‘๐Ÿป

#

And that works (on my machine)

#

But I'm a bit worried/unsure if that will break in other contexts.

civic yacht
#

I can go do that, sorry about the hassle, my devenv is Linux but I normally double check everything on my macos host directly, I just straight up forgot to with that one

ancient kettle
#

No worries!

#

๐Ÿ™๐Ÿป

tepid nova
#

Is this a known issue? Getting lots of "failed run" emails on github actions for the last couple days:

civic yacht
# tepid nova Is this a known issue? Getting lots of "failed run" emails on github actions for...

Oh I guess those must get triggered on every push to main since we push an engine image on every push to main... So in that case the failure is expected temporarily while the SDKs are incompatible with the previously released engine (these tests are meant to run against their default engine dependency, no mocks or local builds). There's a follow up issue for improving these tests here: https://github.com/dagger/dagger/issues/4038

obsidian rover
#

We can de-activate it temporarly, until the follow-up gets in if you want

civic yacht
tepid nova
#

I'm happy to ignore the emails, I just wanted to make sure it was a known issue

tepid nova
#

Do we really need the hack/make wrapper shell script? It kind of makes it harder to sell the simplicity of "develop your CI as code". See #general where I'm trying to sell it

#

Also could we move it to a less obscure directory name? Like ./ci instead of ./internal/mage ?

#

Lastly: the lack of a standardized "loader" is definitely hurting our overall UX. I know our official answer is "wait for extensions", but if there are possible shortcuts to relieve the pain earlier, I'm interested. It's a major gap that is clearly confusing people.

ancient kettle
#

There's a decent bit of complexity in that, though...

tepid nova
#

I think for a unified loader to be useful it would need to work at the directory + pipeline name level:

dagger do build --workdir ./frontend

Something like that.

Basically we're talking about bringing back "dagger do" somehow

ancient kettle
#

What would be in ./frontend?

tepid nova
#

If you have to specify main.py, you might as well just run it with python directly, dagger doing that part would just get in the way

tepid nova
ancient kettle
tepid nova
#

Yeah I have no idea

#

All I know is that 1) people are confused by the lack of a standard entrypoint, 2) it makes sense that extensions will solve this, but 3) if we can relieve the pain earlier somehow without compromising the long term design, users would probably be very happy

civic yacht
# tepid nova Do we really need the `hack/make` wrapper shell script? It kind of makes it hard...

It's hard to avoid right now because you need to call go run in the exact right way so that we use the right go.mod (we have a separate one for our ci steps so that we can bootstrap dagger from a stable version). Basically, our CI inherently has to deal with some extra complication of bootstrapping that most users wouldn't have to deal with.

For the loader stuff, I think even a compromise solution from "full-blown extensions" will need some way of turning source code into an invokable API. Don't see any way of avoiding that. We already have the ability to do that with Go+Python from the previous work on extensions. If we backfill nodejs and add the ability to convert the derived API into flags for dagger do, then I think we'd have something usable.

The part of extensions that would be missing is the ability for the code you load to invoke other APIs seamlessly; that requires extension version control (dagger.json) among other things. But for a first step that's okay.

#

But the two missing pieces of A) code-first schema support for nodejs and B) generating cli flags from derived schema aren't exactly trivial. However they both are things we likely want for full-blown extensions anyways, so they wouldn't be throwaway effort if we're careful

tepid nova
white pilot
#

Is it a known limitation/bug that it's possible to get too long file names from the encoded directories/containers? Get an error from lstat with file name too long

#

ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long

#

happy to report bug if this is new

civic yacht
#

No that's a new one, a bug report would be great ๐Ÿ™

white pilot
#

unfortunately I have very little information atm, not entirely sure how to reproduce it

civic yacht
white pilot
#

I'm also really confused because this code is doing almost the same thing as another one, mounting a similar directory, running the same command...

#

any reference on how those content-addressed IDs are created/is there a way for me to verify?

tepid nova
#

Buildkit supports mounting regular files, right? If so, should we expose that? Container { withMountedFile } ?

tepid nova
#

Let me screw on my eyeballs correctly then ๐Ÿ˜‰

#

of course it was right there in the middle of my screen

#

sorry

civic yacht
#

No worries, I'm sure I've lost cumulative years of my life missing various lines of code sitting right in front of me ๐Ÿ™‚

tepid nova
#

I was looking for cleverness ie. Secret { file } to simplify the API and get rid of withMountedSecret but decided against it, no time for cleverness this week

tawny flicker
wild zephyr
tawny flicker
#

@wild zephyr In the playground, when we click share, we should select the generated URL directly (for CTRL+C), and have a copy/paste button as well.

dense dust
obsidian rover
#

@wild zephyr, I think dagger listen doesn't work for me with current main branch. Is it just me?

obsidian rover
#

My bad, wrong url: it needs /query at the end ๐Ÿ˜‡ ๐Ÿ™

tepid nova
#

The CLI should be printing the full URL, so you can just copy-paste it

#

Easy to fix

ancient kettle
civic yacht
#

That's all you get though, no documentation

ancient kettle
ancient kettle
#

๐Ÿ˜‚

civic yacht
ancient kettle
#

@wet mason @still garnet @civic yacht I think the answer to this question is "no"... but is there any way to create something like map[string]string{} in GraphQL?

Seems like the closest option will be something like:

type BuildArg {
  name: String!
  value: String!
}
type Container {
  build(context: DirectoryID!, dockerfile: String, buildArgs: [BuildArg!]): Container!
}
civic yacht
ancient kettle
hasty basin
civic yacht
bronze hollow
#

Will we be able to set a TTL on specific cache layers / containers?

tepid nova
bronze hollow
#

Will we be able to set a TTL on specific cache layers / containers?

#

Does BuildKit support this?

#

Thatโ€™s a neat idea

#

For my Pulumi, I want it to drift detect each day

#

So I can use that trick quite well too force one rebuild per day

#

Thanks!

#

Not that I have caching on GHA yet though ๐Ÿ˜…

#

But due to no secrets, Iโ€™m mostly running locally a few times a day; so this will be very helpful

tepid nova
bronze hollow
#

๐Ÿ’ฏ

#

The Node SDK is fantastic

#

Using import.meta.url allows me to grab source dirs like CUE

#

I donโ€™t think thatโ€™s possible with Go

tepid nova
#

? can you show an example? Should all have feature parity

#

Hope that you can share your experience in a guest blog post soon ๐Ÿ˜

bronze hollow
#

Go canโ€™t do it because it doesnโ€™t provide any info for where a bit of code is (to my knowledge)

#

I have this utility function I can call from anywhere and get the local path

#

Definitely a video or blog coming soon

#

I use it here

bronze hollow
#

Because JS is interpreted, I can use that information to understand where I am in the context of the mono repo

#

Though if it can work in Go, Iโ€™d love to see it

wild zephyr
bronze hollow
#

Depends if you use go run or go build I guess

#

I guess with go run itโ€™s fine

#

That maybe makes Go a little more appealing to me, actually

#

But Iโ€™m sticking with TS for now

wild zephyr
bronze hollow
#

The multi arch example suggested otherwise, the docs show it off as a binary

#

I wonโ€™t be surprised if someone builds a DSL and a generic Dagger go tool, or perhaps CUE will become this

#

It probably wouldnโ€™t be difficult to write adapters for GHA and GL pipelines

tepid nova
#

@bronze hollow donโ€™t forget Dagger can be embedded in a third party tool, like for example bass-lang.org . If you want to write a tool for others to use in their repo, the tricks above donโ€™t work at all

bronze hollow
#

Does Bass use Dagger?

tepid nova
bronze hollow
#

I love the Lisp/Clojure influence. Very cool that itโ€™s got a Dagger runtime now

civic yacht
bronze hollow
#

Can't embed if the build definitions aren't there until runtime though

tepid nova
#

@bronze hollow is this in the context of working out the root of a monorepo from workdir?

bronze hollow
#

No, that's all working rather nicely

#

I'm now building an interactive CLI to execute tasks that are dynamically defined within each project within the monorepo

#

Once I have something working a bit nicer, I'll record a demo

tepid nova
#

That sounds cool ๐Ÿ™‚ I guess Iโ€™m trying to understand your constraints so I can look for more solutions for your file access problem, potentially in a language agnostic way

bronze hollow
#

All I want for Christmas is client.makeSecret ๐Ÿฅฐ

civic yacht
bronze hollow
#

Iโ€™m using my Doppler action to fetch secrets, I write them to JSON in a container and decide them

#

I need a way to mark it as a secret in the engine.

ancient kettle
#

With a couple big caveats.

#
  1. The id you'll get back includes the plaintext of the secret.
  2. Your secret will be in the buildkit cache, not encrypted.
bronze hollow
#

Iโ€™ll wait for the next iteration ๐Ÿ˜…

ancient kettle
tepid nova
#

@bronze hollow forgetting dagger, whatโ€™s your go-to method for getting doppler vars? I know they offer a few different available methods.

Fun fact: we are the same YC batch ๐Ÿ™‚

wild zephyr
bronze hollow
bronze hollow
#

I toyed with Teller, but itโ€™s too much config

#

I also write a Pulumi provider to get and write Doppler secrets, as well as my Dagger step

#

So Iโ€™m all Dopplered up

bronze hollow
wild zephyr
# bronze hollow

nice! liked the flow. wondering what's the main reason behind using your own task runner vs using scripts in package.json? Is that something you saw other projects also adopting or you came up with it?

bronze hollow
#

I donโ€™t want to have to configure scripts for every package

#

I just wanna put tasks in a dagger folder and auto discover

#

Using a scripts approach Iโ€™d need the same connect call in each package

#

Seems a bit redundant. Now Iโ€™ve got one connect in my entire mono repo

wild zephyr
bronze hollow
#

My approach works well ๐Ÿ˜€

#

My biggest problem now is Dagger printing my Google credentials in a GHA runner when it crashes

#

Iโ€™ll need to add some comments to that MakeSecret issue, but thatโ€™s definitely my biggest challenge atm

wild zephyr
bronze hollow
#

I canโ€™t use that because Iโ€™m fetching the secret in a dagger action

ancient kettle
bronze hollow
#

I mean, if Dagger supports Doppler out the box and I can provide a project and config for each layer, that would be nice

#

but for now it's all I've got

#

I think it's maybe inevitable that Dagger needs to support runtime secrets though, within layers. Whether it's SSM/SecretManager/Pulumi&Terraform outputs - we need a way to mark them as sensitive as early as we can and dynamically

bronze hollow
#

Are Dagger builds reproducible? If I delete the BuildKit container, will the same content addressable layers be created with no changes to local file system and no new remote pulls?

ancient kettle
bronze hollow
#

I actually donโ€™t need to run it in a container.

ancient kettle
#

Unless you set every secret you'd need as an environment variable before initializing your dagger connection.

#

And using the host { envVariable ...} API:

query {
  host {
    envVariable(name: "mydopplersecret") {
      secret {
        id
      }
    }
  }
}
bronze hollow
#

I still have the problem that I pull secrets from Pulumi stack outputs, but those are less dangerous if I like them

#

Iโ€™ve leaked my GCP creds like 9 times now ๐Ÿ˜…

ancient kettle
bronze hollow
#

At the bottom of this Pulumi up, we export all the outputs as JSON, including secrets.

bronze hollow
#

Yeah

#

Is there a better way to do this atm?

ancient kettle
#

I'm working on it... ๐Ÿ™‚

bronze hollow
#

๐Ÿ˜„

#

Let me know when you need a guinea pig

ancient kettle
#

You'll be one of the first to know!

#

Our new architecture makes some of these things trickier...

bronze hollow
#

I guess withSecretVariable doesn't make things secret?

ancient kettle
#

It should if it's a host env variable. But, no, otherwise.

bronze hollow
#

Why does that matter?

#

I do prefer this happening on the host now, but still have the same leaky problem.

bronze hollow
ancient kettle
ancient kettle
bronze hollow
wild zephyr
bronze hollow
#

Iโ€™ll just wait for proper support, I donโ€™t want to bake in any more workarounds atm

wild zephyr
wild zephyr
civic yacht
fair ermine
civic yacht
fair ermine
#

Should I open an issue to track this?

civic yacht
tepid nova
#

Is there a canonical issue for the "push to private registry" problem?

civic yacht
wet mason
#

@civic yacht Ever tried to return a Query from a schema by any chance when you were working on platforms?

Getting some errors on the stitching side: failed to resolve all type definitions: [Query]

extend type Query {
  group(name: String!): Query!
}
civic yacht
#

Don't recall doing anything too special, i'll dig up that branch though

wet mason
#

Yeah I thought so. Weird

wet mason
civic yacht
wet mason
#

@civic yacht Tried that with no succeess

civic yacht
wet mason
#

Nope yeah it works

#

Just wanted to see if you managed to get it working without extend, to narrow down the problem

#

thank you!

wet mason
#

@civic yacht Think I found an easier workaround than sessions to pass stuff around

wet mason
#

@civic yacht Same workaround we've been using all along for "IDs" -- we're free to return whatever we want from a resolver, even if it wasn't requested, sub-solvers will get it

type Query struct {
    Context QueryContext
}

type QueryContext struct {
    // Group
    Group Group `json:"group"`
}

For instance, Query.group can do this:

func (s *groupSchema) group(ctx *router.Context, parent *core.Query, args groupArgs) (*core.Query, error) {
    if parent == nil {
        parent = &core.Query{}
    }
    parent.Context.Group = parent.Context.Group.Add(args.Name)
    return parent, nil
}

Then in container(), if you look into parent as a *core.Query, you can get the QueryContext back

#

I do need top-level solvers directly under Query to deal with QueryContext and shove it into the container/directory ID, it won't work magically on non-direct-solvers

#

But it's pretty simple -- query can add context and return another query, top-level solvers use the context to forge a container/directory/whatever ID to "burn" the context into the ID so it's sticky

civic yacht
wet mason
#

Yeah, because of lazy execution, we need to remember the group when we do LLB ops

#

[group is here].Container().From("alpine").[group is lost because not in container ID].Exec(...)[no group in llb.Run]

#

that could have happened over multiple calls (1 / from alpine, get the id 2/ exec). I'm not aware of a better way than ID encoding to remember things

#

same class of problem as the ID itself, right? if there was a better way, then we wouldn't use LLB itself as a container ID but some ID mapping instead

civic yacht
#

I see yeah that makes sense. We will need to figure something out with extensions so that only parts of the IDs end up being part of the extension cache key. Plenty of options, all ugly, but can make it work.

wet mason
bronze hollow
#

Does Dagger still DAG? Iโ€™m looking at all my imperative code with awaits and I donโ€™t really know if Dagger still builds a graph

obsidian rover
bronze hollow
#

Is it safe to say the majority of build pipelines will never be a graph then, with the new SDKs

#

This explains why caching is rather broken atm too then?

obsidian rover
#

My (personal) guess is that people will rely on smaller DAGs, without noticing.
As people get more educated, they will be able to construct (willingly) bigger graphs, to fully benefit from parallelization. It's the tradeoff to have a much better DX, and more control at the language level

obsidian rover
bronze hollow
#

If I run the same task twice, itโ€™s fine

#

If I use a task as a depdendency, it doesnโ€™t cache

tepid nova
#

All that stuff should work the same as it did before, and as you expect, ie: it should cache

bronze hollow
#

Example. This deploy task depends on the DNS task and the DNS task is cached if I run it on its own but not here

#

Perhaps itโ€™s some weird issue with my setup

tepid nova
#

Itโ€™s a very common problem to not know why things donโ€™t cache. Or more generally what the DAG is. The good news is that we have sweet tooling coming to help solve this ๐Ÿ™‚

bronze hollow
#

Iโ€™ve been missing the community calls, since working for myself Iโ€™ve been slammed. Thatโ€™s why I posted a CLI demo in this channel with my progress. Hopefully catch the calls again in Jan

#

Iโ€™ll check out that demo. Thank you

obsidian rover
#

I'm currently dreaming of a dagger command to init a "scaffold" of a project, in any of the SDK language. I'm about to make my own tooling for that, not sure if it may fit in Dagger's CLI, but by jumping between languages, there is friction to remember how to init in each language a project

cosmic cove
cosmic cove
tepid nova
#

@civic yacht maybe a silly question. Has anyone tried using firecracker as a buildkit runner via oci hooks?

civic yacht
# tepid nova <@949034677610643507> maybe a silly question. Has anyone tried using firecracker...

Not a silly question, that's always been something I've wanted to try. I think the best route would be to have buildkit use its containerd executor backend (instead of the runc backend we use right now). Then you could setup containerd to use either kata containers or firecracker-containerd as the default runtime and that should result in buildkit running containers in firecracker VMs.

I'm not totally sure if it would completely work out of the box. It requires use of the devmapper snapshotter rather than overlayfs, which would result in some overlay-specific optimizations not being available, so it would be slower in some cases. Can't immediately think of anything that would completely break, but there's so many details I'd bet something wouldn't quite work.

#

In theory it's totally possible though, just might require some upstream tweaks

wild zephyr
#

@civic yacht @tepid nova I recall docker acquiring a runtime company called nestybox which are the ones behind sysbox (https://github.com/nestybox/sysbox) which claims to provide a secure runc compatible runtime which allows running privileged workloads. They specifically advertise a secure sandbox without using VM's. That could be an alternative for a faster integration. Solomon we could ask Justin about it

wild zephyr
#

there's still yet no support for buildkit's cache exports / imports in Dagger SDK's, correct?

rancid turret
civic yacht
rancid turret
#

Yeah, I think that would be better.

#

I meant for ConnectParams to reflect the JSON returned there.

#

Makes things simpler.

civic yacht
rancid turret
#

Just running tests locally, I'll push in a bit.

rancid turret
#

@civic yacht What's the engine failures in CI?

civic yacht
rancid turret
#

By the way, any idea when next engine release?

#

Needed for releasing new sdk version.

civic yacht
#

Main blocker is the session related stuff, but PRs are out for everything there, should be merged in next few days. It would also be nice to wait for a v0.11 buildkit release since there's a ton of fixes we've made upstream to various issues, but technically not a blocker. I was just testing out a rebase on their v0.11-rc3 branch to make sure there's no surprises.

I'll make a milestone for v0.3.8 engine release and put stuff in it.

civic yacht
rancid turret
bronze hollow
#

Welcome back Dagger team. Happy New Year.

#

@ancient kettle I'm assuming you finished secrets support instead of taking time off, right ? ๐Ÿ˜„

ancient kettle
obsidian rover
#

Any idea/hints on why the error message returned from waitBuildkit is being printed several times, when manually running the dagger session? Is it an expected behavior ?

I presume it is in the startCLISession function, but not sure ๐Ÿ˜•

 _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-container://test-dagger-engine-toto bin/dagger session
Error: buildkit failed to respond
Usage:
  dagger session [flags]

Flags:
  -h, --help   help for session

Global Flags:
      --debug            show buildkit debug logs
      --workdir string   The host workdir loaded into dagger (default ".")

Error: buildkit failed to respond

With the potential forward of stderr from SDKs, I also realized that the usage printing (due to cobra) this might polute the output ? ๐Ÿ˜•

civic yacht
# obsidian rover Any idea/hints on why the error message returned from `waitBuildkit` is being pr...

If you're manually running the session you won't be going through the SDK so startCLISession won't be executed. Not sure immediately why the Error: ... is printed twice, could be something with cobra? Agree that we should skip the usage printing for the session subcommand, I'd suspect there's a way of disabling that in the struct where we configure that subcommand. Maybe try disabling that usage output and see if that also happens to fix the double print of the error message

obsidian rover
civic yacht
ancient kettle
# civic yacht Okay cool, you could try wrapping the `error` type returned to have an `Error` m...

Ok. We figured it out. cobra is printing the error when the subcommand session fails: https://github.com/dagger/dagger/blob/main/cmd/dagger/main.go#L47, then we print it again https://github.com/dagger/dagger/blob/main/cmd/dagger/main.go#L48

@obsidian rover and I verified by silencing errors in the session subcommand changing our printing of line 48 to be Dagger Error:, which caused only Dagger Error: buildkit failed to respond to print.

#

Any reason we shouldn't just pull our printing of the error?

civic yacht
tepid nova
#

Do we currently support catching exit status of a process? Or is it one of those "harder than it looks" issues? And if the latter: is there an issue tracking it?

ancient kettle
tepid nova
obsidian rover
obsidian rover
bronze hollow
#

Is it possible with container().from() to publish an amd64 image on an M1 mac?

hasty basin
bronze hollow
#

Search on docs is pretty poor. I was searching for "platform" and got some Go stuff to print the platform and some really old CUE stuff

#

I didn't find my answer on the docs, I found it on Discord by searching for amd64 ๐Ÿ˜‚

#

Then found the docs when I had enough context to search

tepid nova
bronze hollow
#

hahaha

#

I feel a bit less silly now ๐Ÿ˜„

tepid nova
#

btw @bronze hollow could I trouble you for a +1 on that issue? ๐Ÿ™

bronze hollow
#

Done

#
    const secrets = await getSecrets("website", "production", ["FIREBASE_TOKEN"]);

    // Set in the environment to consume as a secret below
    // Required until Dagger can protect me
    process.env["FIREBASE_TOKEN"] = secrets["FIREBASE_TOKEN"];

My latest attempt to stop printing secrets out in GitHub Actions logs, force set them to the environment and use client.host().envVariable().secret().plaintext() further down the task.

Is this going to work? ๐Ÿ˜…

ancient kettle
bronze hollow
#

Bah

ancient kettle
bronze hollow
#

I'll just need to disable Dagger on GHA for now. Too risky

#

Hopefully not for too much longer though, right? ๐Ÿ˜„

ancient kettle
ancient kettle
#

Wow. Now I have to do it.

#

That GIF is powerful. Please be responsible with it. ๐Ÿ˜†

bronze hollow
#

๐Ÿ˜‚

#

Who's working on caching? I need to send it to them too, then I can retire it

bronze hollow
#

GHA caching

#

Does that still work as intended?

ancient kettle
#

I'm not quite sure what the status of that is... @wet mason @civic yacht @still garnet Can you refresh my memory here?

civic yacht
tepid nova
#

@bronze hollow could you describe your use case & requirements for secrets in a standalone issue please?

#

Specifically why creating a secret either a) from a container or b) from a static host env variable isn't sufficient?

bronze hollow
#

I tried creating secrets from containers, that isn't supported

tepid nova
bronze hollow
#

My issue explains why that won't work, @tepid nova

#

I COULD make that work, but I'd need to fetch each secret individually and mark it as sensitive, it would be rather cumbersome.

#

I also prefer the host based approach, after discussing this with @ancient kettle

#

I need the line "NOT_EXISTS" to work ๐Ÿ™‚

const getSecrets = async (
            project: string,
            config: string,
            secrets: string[],
        ): Promise<Record<string, string>> => {
            const queryString = qs.stringify({
                project,
                config,
                include_dynamic_secrets: false,
                secrets: secrets.join(","),
            });

            const dopplerToken = await client
                .host()
                .envVariable("DOPPLER_TOKEN")
                .secret()
                .plaintext();

            const response = await axios.default.get(
                `https://api.doppler.com/v3/configs/config/secrets?${queryString}`,
                {
                    headers: {
                        "Content-Type": "application/json",
                        Accepts: "application/json",
                        authorization: `Bearer ${dopplerToken}`,
                    },
                },
            );

            const fetchedSecrets = response.data as SecretsResponse;
            const records: Record<string, string> = {};

            const secretKeys = Object.keys(fetchedSecrets.secrets);
            secretKeys.forEach((secretKey) => {
                // CURRENT CODE: records[secretKey] = fetchedSecrets.secrets[secretKey].computed;
                //__NOT__EXISTS
                records[secretKey] = dagger.markSensitive(fetchedSecrets.secrets[secretKey].computed);
            });

            return records;
        };

tepid nova
#

@bronze hollow thanks for the issue, that's very helpful. I'll use that as my main channel to discuss your problem, we'll make sure to get you unstuck

#

However I can't promise that we'll unblock you by fast-tracking the design proposal that you happen to like.

bronze hollow
#

I just share opinions, I trust y'all to build the right APIs

#

Don't rush anything on my behalf ... but if you can unblock me within the next 5-6 minutes, that would be swell

tepid nova
#

๐Ÿ˜„

#

In general I have an overwhelming urge to unblock users as fast as possible. I also have an overwhelming urge to make irreversible API changes as slowly as we can get away with. So as you can imagine I am conflicted right now ๐Ÿ™‚

If we can find a way to decouple those two things, it almost certainly will be a better outcome for everyone involved.

bronze hollow
#

Shared some extra context in issue

#

If I can mark environment variables as secret already, would it be a huge api decision to allow me to call client.makeSecret(โ€œsomeidโ€, โ€œsecret thing โ€œ);?

I guess I donโ€™t understand why this is a large decision atm

tepid nova
bronze hollow
#

Ah

tepid nova
#

So the decision on one is effectively a decision on the other. Which prompts a design debate, which is slow because we are not all aligned on this matter.

#

This in itself is normal and not a bad thing necessarily. What is bad however is having you stuck on your project. So we want to get you unstuck asap.

bronze hollow
#

Go and Node and the other supported languages already have great support to speak to Vault and secrets backends. Thatโ€™s an advantage over Earthly

#

But I guess that comes back to your DX OX chat

tepid nova
#

Yes precisely

bronze hollow
#

Who do we need to put in the wrestling ring to make this decision?

tepid nova
#

btw @bronze hollow have you tried earthly "cloud secrets"? I just saw that's a thing, while browsing their docs prompted by your issue

bronze hollow
#

No. I already trust a company with my secrets. I donโ€™t wanna throw some to another

#

I like that I can provide my own helper in bash. Itโ€™s pretty easy going

tepid nova
#

Yeah it's pretty cool I agree. Where do you store the helpers? Does Earthly specify a directory layout?

bronze hollow
#

No

#

Let me show you the PR because itโ€™s an undocumented feature

#

You specify any arbitrary binary or script that runs in the host and they handle the BuildKit mount

tepid nova
#

Ah cool, it relies on the PATH

#

you specify it with this?

global:
    secret_provider: my-thing
#

which appear to be here: ~/.earthly/config.yml

#

This is a great feature and almost identical to what I want to do fwiw ๐Ÿ™‚

bronze hollow
#

This config works for me. Ship it ๐Ÿš€

#

Bonus points if it can be configured in code as a string path or closure

#

Instead of a random config file

tepid nova
#

(I think you can guess what I'm about to answer ๐Ÿ˜› )

bronze hollow
#

secretProvider: string | function(string): string ๐Ÿฅฐ

bronze hollow
tepid nova
#

Basically moving that config into the code would defeat the purpose of a secrets provider feature, for the same reason Earthly moved it to the config rather than the Earthfile (their equivalent of the pipeline "code")

wild zephyr
bronze hollow
#

@tepid nova just to be clear about how their secret provider works: itโ€™s called dynamically every time a job requests access to a secret. Itโ€™s not executed once at client build. So Dagger would still need a makeSecret api from host execution.

tepid nova
bronze hollow
#

Ah

#

Iโ€™m learning ๐Ÿ˜€

tepid nova
#

Technically you're right there would still be a makeSecret, but you wouldn't provide the plaintext value, just the key (like studio:mypassword) in your earthly example

#

in my draft I just put that in a modified secret() query: https://github.com/dagger/dagger/pull/4193/files#diff-2510ad189bb216008f90b8da9ca7086e140ff2691add672fa68ab67c1f92279eR9

bronze hollow
#

Sweet. Hopefully my public builds wonโ€™t be too far away ๐Ÿ˜€

ancient kettle
civic yacht
ancient kettle
tepid nova
#

FYI we have a private channel with buildkit devs, if it helps to coordinate

civic yacht
rancid turret
#

New Build History API allows listening to events about builds starting and completing, and streaming progress of active builds. New commands buildctl debug monitor, buildctl debug logs and buildctl debug get have been added to use this API. Build records also keep OpenTelemetry traces, provenance attestations, and image manifests if they were created by the build. #3294 #3339 #3440

Is this being used in the new Group API?

wet mason
civic yacht
#

I'm not sure if they would be useful for the logging use case you're working on or not

wet mason
#

The first bits look interesting but not very helpful for us, I think

Build records also keep OpenTelemetry traces,

This one could be useful though

civic yacht
wet mason
#

Yeah. I think if weโ€™re collecting the events as they happen and ship them to cloud then we donโ€™t need to access the ones stores locally in buildkit

wet mason
#

@civic yacht Hey, got some time to chat about our CI within the next hour? Need a sanity check on engine versions (stable/dev) /cc @stray heron

wet mason
#

thank you! finishing a call

wet mason
#

ok ready now. @stray heron do you want to join as well?

wet mason
#

@civic yacht Can you remind me the latest format to pin to a particular version now that we have S3?

civic yacht
wet mason
#

I mean, in addition to the image sha as a runner, I also need to pass a custom binary?