#failed to wait

1 messages Β· Page 1 of 1 (latest)

earnest bridge
#

What does this error mean? Docker is up and running, so I would expect that creating and connecting to a buildkit daemon would work -- but I'm also not sure if that's actually what's failing

green tide
#

cc @midnight sparrow

stuck spruce
#

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

midnight sparrow
#

But yeah, what vito said, that should only happen once. If it keeps happening then there's an issue

earnest bridge
#

Ah, yeah -- I wasn't running a pipeline. I thought I was, but I wasn't actually

earnest bridge
#

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?

green tide
#

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.

earnest bridge
#

What makes it execute?

green tide
#

You querying for data that requires execution. For example stdout, stderr, or exporting the resulting rootfs

earnest bridge
#

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

green tide
#

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

earnest bridge
#

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"

green tide
#

mmm πŸ€”

earnest bridge
#

this is the line in question:

#

anything look out of place?

green tide
#

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 πŸ™‚

earnest bridge
#

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

green tide
#

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?

earnest bridge
#

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?

river jay
#

@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)
earnest bridge
#

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

river jay
earnest bridge
stuck spruce
#

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