Skip to content

ci test: split each dagger do to own test name - #2406

Merged
sipsma merged 1 commit into
dagger:mainfrom
sipsma:better-cache
May 5, 2022
Merged

sipsma merged 1 commit into
dagger:mainfrom
sipsma:better-cache

Conversation

@sipsma

@sipsma sipsma commented May 5, 2022

Copy link
Copy Markdown
Contributor

Even though we export to GHA using per-test scopes, there are often
multiple invocations of dagger do within a single test, each of which
will use the same export target and thus overwrite each other's cache
manifests.

This meant that we would pay the price to export cache (quite expensive
for large blobs), eat up our bandwidth limit uploading that cache
(causing more throttles) and then never actually reuse the cache
because the manifest got overwritten.

For one example, the ./container.cue test in the go universe package
would take ~8 seconds to execute w/out cache hits, but then spend ~30
seconds exporting cache. If you run the test on its own in GHA so that
the cache manifest doesn't get overwritten, it will only take 3 seconds
to run. So in this single test case we were wasting ~37 seconds most
runs. There are many other test cases in the same boat.

This immediately solves the problem in order to stop our CI from taking
forever and getting so many throttles from GHA cache. In general, we
need a better way of configuring cache that's easy to turn on and off
per-plan.

Signed-off-by: Erik Sipsma [email protected]

Related to #2140 and #2365

Also, another lesson from this is that it was very difficult to find out any of this; our current observability into cache performance is next to nothing. I hacked together in my fork a bunch of stuff for collecting Jaeger traces in GHA that can be exported and orchestrating tests that let you more easily compare multiple test runs with different cache settings. I will prioritize productionizing this so we can more quickly diagnose these types of issues in the future.

Even though we export to GHA using per-test scopes, there are often
multiple invocations of dagger do within a single test, each of which
will use the same export target and thus overwrite each other's cache
manifests.

This meant that we would pay the price to export cache (quite expensive
for large blobs), eat up our bandwidth limit uploading that cache
(causing more throttles) and then never actually reuse the cache
because the manifest got overwritten.

For one example, the ./container.cue test in the go universe package
would take ~8 seconds to execute w/out cache hits, but then spend ~30
seconds exporting cache. If you run the test on its own in GHA so that
the cache manifest doesn't get overwritten, it will only take 3 seconds
to run. So in this single test case we were wasting ~37 seconds most
runs. There are many other test cases in the same boat.

This immediately solves the problem in order to stop our CI from taking
forever and getting so many throttles from GHA cache. In general, we
need a better way of configuring cache that's easy to turn on and off
per-plan.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma requested review from a team, helderco, jpadams and shykes as code owners May 5, 2022 20:43

@helderco helderco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've wanted the 1 assert per test for a while, not aware of caching issues though. 🙂

@sipsma

sipsma commented May 5, 2022 •

Copy link
Copy Markdown
Contributor Author

Just as an example, after letting the universe tests run once to upload the cache w/out manifest overwrites, I re-ran them and the execution time went from 15m30s -> 6m37s.

cc @TomChv @aluzzardi

@sipsma
sipsma merged commit a0a5f18 into dagger:main May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants