Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI cache poisoning #959

Closed
vroldanbet opened this issue Oct 28, 2022 · 2 comments · Fixed by #960 or #961
Closed

CI cache poisoning #959

vroldanbet opened this issue Oct 28, 2022 · 2 comments · Fixed by #960 or #961
Labels
area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)

Comments

@vroldanbet
Copy link
Contributor

vroldanbet commented Oct 28, 2022

Our CI jobs running tests rely on caching to skip the whole go mod download phase, which usually eats a lot of time. Caching was introduced recently in #950, which can shove up to 2m in the best case.

Unfortunately, given we run multiple tests as individual jobs, and due to go's toolchain only downloading the modules needed as of recent versions, sometimes our CI my end up caching a version that has a small subset of modules, and as a consequence we lose the boost in CI time.

We should investigate why this happens, which job is doing this, and how can we make sure it does not write the local go empty module cache to CI cache.

@vroldanbet vroldanbet changed the title CI caching poisoning CI cache poisoning Oct 28, 2022
@vroldanbet vroldanbet added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Oct 28, 2022
@vroldanbet
Copy link
Contributor Author

The Analyzer CI build seems to be the culprit:

Post job cleanup.
/opt/hostedtoolcache/go/1.19.[2](https://github.com/authzed/spicedb/actions/runs/3347243555/jobs/5545015920#step:7:2)/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.19.2/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
/usr/bin/tar --posix --use-compress-program zstd -T0 -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/spicedb/spicedb --files-from manifest.txt
Cache Size: ~12 MB (12648049 B)
Cache saved successfully
Cache saved with the key: setup-go-Linux-go-~1.19.2-ee46[3](https://github.com/authzed/spicedb/actions/runs/3347243555/jobs/5545015920#step:7:3)255313e88769c6[4](https://github.com/authzed/spicedb/actions/runs/3347243555/jobs/5545015920#step:7:4)1f1b16cb6f[5](https://github.com/authzed/spicedb/actions/runs/3347243555/jobs/5545015920#step:7:5)4cac77c811a33f2a2f952[6](https://github.com/authzed/spicedb/actions/runs/3347243555/jobs/5545015920#step:7:6)9153a1315[7](https://github.com/authzed/spicedb/actions/runs/3347243555/jobs/5545015920#step:7:7)e

@vroldanbet
Copy link
Contributor Author

vroldanbet commented Oct 28, 2022

The change worked, but reopening because we still have poisoning between builds doing go build and builds doing go test, which use the same path. It's a difference of 200MB of dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
1 participant