#`ExperimentalPrivilagedNesting` doesn't honor cache

1 messages Β· Page 1 of 1 (latest)

brave arrow
#

Hey, I have the ExperimentalPrivilegedNesting: true as I am invoking the underlying dagger engine for my unit tests. It looks like when I have this flag enabled, it never caches the tests. As soon as I remove the dagger dependent tests and remove ExperimentalPrivilegedNesting flag, buildkit starts caching that step. Could this be a bug? I validated that it's not something my test is doing by disabling the test and keepin the flag on, it still didnt' cache. I had to remove the flag for it to cache again.

round plinth
#

it shouldn't be the case @brave arrow.. since we're using ExperimentalPrivilegedNesting heavily in Dagger tests and we haven't observed that behavior. It'd be great if you could send us a repro case so we can look beter

brave arrow
#

Alright, let me put something together πŸ™‚

brave arrow
#

Here it is. Apologies if it's too big. I'm re-using the same repro we had on another question I asked.

#

Notice that every run re-runs the tests. I tried

  1. Commenting out the test logic (empty test) - didn't cache
  2. Removing ExperimentalPrivilegedNesting - cached
sharp yarrow
#

@brave arrow using the comments in the rtf file, it looks like this is the directory structure (??)

#

maybe you could send a tar or zip file πŸ™‚

How should I run your project?

From the root with dagger run go run ci/main.go or from ci dir with dagger run go run main.go?

brave arrow
#

Hey @sharp yarrow , this is how it looks like. You can do go run main.go from the ci folder.

brave arrow
#

LMK if you want a zip or a tar also πŸ™‚

sharp yarrow
#

@brave arrow I ran your pipeline three times πŸ‘†

#

I saw what looked like caching on the second two.
Might be just caching of go build and not go test, is that what you mean? Everything finishing quickly in this example so a little tough to know what you're seeing.

#

I'm using Dagger Engine v0.6.2 and Go SDK v0.7.2

#

With ExperimentalPrivilegedNesting: false I can't run the pipeline

brave arrow
#

In the above video, I am seeing the behavior I'm referring to. In your subsequent runs, you can see the tests are being run again and again. I am expecting buildkit to be caching that WithExec and not re-run the test

#

With ExperimentalPrivilegedNesting: false I see that WithExec test step as CACHED

#

In your video, the subsequent test steps run fast because it's go caching them.

sharp yarrow
#

@brave arrow I'm thinking the thing that might be changing in your tests and thus invalidating cache is the tempfile name?

Error:          Not equal:
┃                               expected: "./settings3124339281.
┃   xml"
┃                               actual  : ""
#

ts, err := os.CreateTemp(".", "settings*.xml")

brave arrow
#

I thought the same. But this even happens if you change that test to print hello world

#

As long as I have ExperimentalPrivilegedNesting: true, I have not been able to get that Exec to cache. Even with simplifying the test.

high shell
#

@brave arrow what version of Dagger is this? we found an issue with cache busting due to host paths recently, but I think that's only in main. cc @grizzled bough

sharp yarrow
#

@high shell I'm on engine v0.6.2 and am seeing same issue (see video above) where everything is cached except for the go test ...

#

though for me, that's with ExperimentalPrivilegedNesting: true

#

(doesn't run at all for me with ExperimentalPrivilegedNesting: false from my laptop, I think Nipuna is running in a Docker agent in Jenkins)

#

@brave arrow if you can share that tarball now, would prob be ideal πŸ™‚

brave arrow
#

Sure! I am running the same version as @sharp yarrow . And I am seeing this on my local laptop. Our Jenkins instance doesn't have local cache so this isn't relevant there yet.

high shell
brave arrow
#

That means your engine tests aren't actually caching either right? Fixing this could speed up your CI πŸ˜ƒ

high shell
#

true! it would probably allow the tests to skip for non-code changes.

serene cloak
#

@coral fable ^^

coral fable
high shell
#

the socket path itself should probably remain as-is; it's like that to avoid conflicts, since it's ephemeral and created by every Dagger session

coral fable
#

πŸ‘πŸ»

sharp yarrow
#

Thanks again for reporting this @brave arrow looks like its going to be a great improvement for everyone! πŸ”

high shell