#failed to wait
1 messages Β· Page 1 of 1 (latest)
cc @midnight sparrow
Those are a red herring, just noise, I think it only happens on first run when it sets up the buildkitd container. It could probably be silenced
Did you expect actual pipelines to execute that aren't executing? Or is your main func only calling dagger.Connect so far?
But yeah, what vito said, that should only happen once. If it keeps happening then there's an issue
Ah, yeah -- I wasn't running a pipeline. I thought I was, but I wasn't actually
Hm... maybe I am running a pipeline. But I don't think it's doing everything I expected it to do. I could use some clarification on the execution model: if I just start doing e.g. client.Container().WithFS().Exec() does that eagerly begin execution? Or is that just building the graph and then I have to specify the node I want to compute to?
Generally everything is made as lazy as possible
So I believe client.Container().WithFS().Exec() does not actually execute. You're still crafting a query.
What makes it execute?
You querying for data that requires execution. For example stdout, stderr, or exporting the resulting rootfs
Got it! So, I'm querying stdout now, and that does seem to be executing things. I've got this error about file permissions on my local system...
You're not the only one asking this π
Yeah workdir is like a docker build context, you can't move up higher from it (ie. ..)
ohhhhhh
OK, I changed it to run from that parent directory instead, and I'm still getting input:1: container.from.withFS.exec.stdout.contents NotFound: no access allowed to dir "./gorilla"
mmm π€
I'm not familiar with the current host directory access API (have been immersed in design of the final one)
so kind of confused by the dagger.HostDirectoryID being a path rather than, well, an ID π
I did that because when I passed those contents to that function, the typechecker complained. Which was confusing to me, too
It's fine with just a string. But as soon as I do "./" + otherThing it freaks out
Maybe try Host().Directory(".").Read() then use regular Directory methods from there?
so:
workdir := client.Host().Directory(".").Read()
gorilla := workdir.Directory("./gorilla")
Does that work better?
new error now π
#8 local://.
#8 transferring .: done
#8 ERROR: rpc error: code = NotFound desc = no access allowed to dir "."
Is the client itself running in a different context that would have different permissions?
@earnest bridge this should work:
workdir, err := client.Host().Workdir().Read().Directory("gorilla/").ID(ctx)
if err != nil {
return err
}
out, err := client.Container().From("alpine").WithMountedDirectory("/gorilla", workdir).Exec(dagger.ContainerExecOpts{Args: []string{"ls", "-l", "/gorilla"}}).Stdout().Contents(ctx)
if err != nil {
return err
}
fmt.Println(out)
@river jay or anybody else -- a question about this solution: is there any way to read in the contents of an arbitrary absolute path, anywhere on the host? Right now the code I'm writing depends on the directory from which the tool was invoked, which feels wrong (I might be running it from a subdir in my repo)
π not that I know of currently. But with @stuck spruce 's change here: https://github.com/dagger/dagger/pull/3560 that should be possible soon. This is mostly for security reasons since potentially any lib that you're including could be reading arbitrary data from your host. Reason why it's currently scoped to your code workdir
makes sense! I'll just wrap the directory access in a helper function so it's easy to change when the new API drops
you should already be able to configure arbitrary local dirs in dagger.Connect(ctx, dagger.WithLocalDir("some-name", "/absolute/path")) and then doing Host().Directory("some-name").Read()- but that'll be replaced when the linked PR lands