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

Slim down docker cache size #3190

Merged
merged 9 commits into from
Sep 9, 2024
Merged

Slim down docker cache size #3190

merged 9 commits into from
Sep 9, 2024

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Sep 3, 2024

Fixes #3181

We use docker images and other ephemeral data as a basis for test fixtures in unit/integration/cli tests...

...but we have over `5 GB` in cache!

There is what is listed below + a few-hundred MB centos 7 image that was removed.

$  find . | grep cache | grep tar | xargs du -ch | sort -hr

4.9G	total
832M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-test-java-purls-a3aba7fe8ca58ea9586ae8752d939cc72a8a2d6fc965b8eed99ace498c867f94.tar
704M	./syft/pkg/cataloger/binary/test-fixtures/cache/stereoscope-fixture-elf-test-fixtures-72a1400c46a4f03cc0bedce1d8112feecfaddceff6f6bb665edb1a652b4757fc.tar
704M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-elf-test-fixtures-72a1400c46a4f03cc0bedce1d8112feecfaddceff6f6bb665edb1a652b4757fc.tar
576M	./syft/pkg/cataloger/python/test-fixtures/cache/stereoscope-fixture-image-multi-site-package-fa8e416407542939f6a73562f19526d99a27f21d3daa5ac5c723063173cd9a1e.tar
576M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-java-no-main-package-78384bbaa3076afc5904db77a8650aa4183c5900e1bb7cd392a0d2b47c27a438.tar
336M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-golang-compiler-b855ba45f2a2de7d0b38fa66a62341448fdee022775ae0f05496fb90ac8ac510.tar
242M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-large-apk-data-f05f8d9a0458190967d606a8c554d00630af9ea158aa1a1cbbcbbf25e03c2c0c.tar
192M	./syft/pkg/cataloger/redhat/test-fixtures/cache/stereoscope-fixture-image-minimal-f3f6a85ded073b94e1903b04b544746767ad151046f69e8598c0acef5846ae06.tar
156M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-suse-all-layers-f8101dbd0c925a4047fc4e9e7f063dff573a2a2684190b1d356466589fa08af8.tar
151M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-sqlite-rpmdb-6fc8883e06451f15fc5d95d68855853d1e5a08234389977b2841b91ce26a24f4.tar
150M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-owning-package-cb9c5a34e5384d459e90cbda4c6cf6ec504ac44e515165fde1f1ac0b8bcfe0c6.tar
130M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-java-virtualpath-regression-403640234a6db23e3edc22153cb6ec392ae921bece553de1393238d235e6736a.tar
 66M	./test/install/cache/alpine-env.tar
 42M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-photon-all-layers-269ee0bc42e6fce89119393d31b4bb32d22efaf21bb91cec3d012ffef552295a.tar
 28M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-mariner-distroless-7b407103df373d6b59c9bf5f07b276b5f446c9e4c1aad5a51b2eb925c4acd899.tar
 19M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-pkg-coverage-15beece6248f7b4b3db06c2691d0558d1fd76e72590afb3479a64ac40547c5c9.tar
 12M	./syft/pkg/cataloger/kernel/test-fixtures/cache/stereoscope-fixture-image-kernel-and-modules-98078891e3ea0107d3cd8d06d0e9bb1e7287ec75249d6958278fd1efd85defe9.tar
9.4M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-os-binary-overlap-015777d781a73df6a3881163f87e292f40576662ed19e0369d3a8eb0ae2c0ab1.tar
7.3M	./syft/format/syftjson/test-fixtures/cache/stereoscope-fixture-image-alpine-5bbdfebb94b6923efd76f9dc9063011c5e90c719e599a09299b1c7aa78315dca.tar
6.0M	./syft/internal/fileresolver/test-fixtures/cache/stereoscope-fixture-image-files-deleted-cafbcd15d157e33f46f6523e7c80ed6da71b03bfa6722e8442064d611b3a9e3a.tar
5.9M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-go-bin-arch-coverage-7d28dcd4527432d8cb41a1239fd7b2dce212a4445711706d72247dcb0cb3cc74.tar
5.2M	./syft/pkg/cataloger/golang/test-fixtures/cache/stereoscope-fixture-image-small-6435a8518ecff812e5df1e183c231bc4a44795dd7e114b6098efa4746d70d3b9.tar
5.2M	./syft/pkg/cataloger/golang/test-fixtures/cache/stereoscope-fixture-image-not-a-module-2c7a60fde549021a93bca9d3fe336450d7f13a15c057f8fbf6d2301ab5af581e.tar
4.1M	./test/install/cache/busybox-env.tar
4.1M	./syft/pkg/cataloger/binary/test-fixtures/cache/stereoscope-fixture-image-busybox-8b99240387a1d960aab6206fa829ca7bd735d3da85024be351935b98be9430c7.tar
3.7M	./syft/pkg/cataloger/rust/test-fixtures/cache/stereoscope-fixture-image-audit-aa03f2446b715a3ccd04e4c9f470fe8b739138b21655595af19885c985d52f41.tar
3.7M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-rust-auditable-c38569700498cfca9cceab99b5f11fa1a588271a99f3c79ed36fe8f2c586c228.tar
1.6M	./syft/internal/fileresolver/test-fixtures/cache/stereoscope-fixture-image-symlinks-1c3c314784bb8a107e4dec9e37be146b458fefe8f15e57511bc398a8fffebe4e.tar
1.6M	./syft/file/cataloger/internal/test-fixtures/cache/stereoscope-fixture-image-file-type-mix-e634da40d0d75da0a1327770cd90b16bf02ce1063bbdb0920523b96581bd0e2b.tar
1.6M	./syft/file/cataloger/filemetadata/test-fixtures/cache/stereoscope-fixture-image-file-type-mix-e634da40d0d75da0a1327770cd90b16bf02ce1063bbdb0920523b96581bd0e2b.tar
1.6M	./syft/file/cataloger/filedigest/test-fixtures/cache/stereoscope-fixture-image-file-type-mix-e634da40d0d75da0a1327770cd90b16bf02ce1063bbdb0920523b96581bd0e2b.tar
1.5M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-distro-id-ef5f25b7a60637dcdcacec6a3e69a80edee019ac9c34866cbf2ab1f1ed308bb3.tar
104K	./syft/pkg/cataloger/binary/test-fixtures/cache/stereoscope-fixture-image-fedora-64bit-12afa801adb43ed77340a8ed051770f6dcb6bd60471fcb7c0c4fd72e0cc75c7f.tar
 80K	./syft/pkg/cataloger/binary/test-fixtures/cache/stereoscope-fixture-image-fedora-32bit-b8b754d9586ce848107398d1c29783b67b50d09dc2cff5bd50cf3fceb59d0ca2.tar
 24K	./syft/source/test-fixtures/cache/stereoscope-fixture-image-simple-04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7.tar
 24K	./syft/pkg/cataloger/debian/test-fixtures/cache/stereoscope-fixture-image-dpkg-5d87fb83193e020ef47572ce96186ead9be6e9a698871dd81d2e108c10a6329f.tar
 24K	./syft/pkg/cataloger/debian/test-fixtures/cache/stereoscope-fixture-image-distroless-deb-b4154260fc37ca0d1e6b57f1c59a2e5019fe6ea79eba5d99ae32d3d3ddcc99a4.tar
 24K	./syft/internal/fileresolver/test-fixtures/cache/stereoscope-fixture-image-simple-04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7.tar
 20K	./syft/internal/fileresolver/test-fixtures/cache/stereoscope-fixture-image-duplicate-path-7e31bdad84ffe928c47e24cfb3d0641aa56fd67809f71193fe14a847e97fec9e.tar
 20K	./syft/format/internal/testutil/test-fixtures/cache/stereoscope-fixture-image-simple-85066c51088bdd274f7a89e99e00490f666c49e72ffc955707cd6e18f0e22c5b.tar
 20K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-sbom-cataloger-a4aa0752985a578a8b34fe3a2e09aca3100c38a96ebb5cee6eeb4eddbc4ff8ed.tar
 16K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-sbom-metadata-component-8fd41042784d0d58f34a8b951b00847d471c7f4abd9f4e11e6ee668a92e6da71.tar

In CI today we fetch and load the caches directly so we don't need to re pull all images. However, as mentioned in #3181 , without those caches, forks begin to see issues with the default runner space.

This PR makes our existing image caches smaller, a step in the right direction here...

... down to ~ `300 MB`
$ find . | grep cache | grep tar | xargs du -ch | sort -hr

294M	total
 66M	./test/install/cache/alpine-env.tar
 49M	./syft/pkg/cataloger/binary/test-fixtures/cache/stereoscope-fixture-elf-test-fixtures-ec21698b6912c0407049b27118bc9909be6575e851985b2aa22c9c223f00cfff.tar
 49M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-elf-test-fixtures-ec21698b6912c0407049b27118bc9909be6575e851985b2aa22c9c223f00cfff.tar
 19M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-pkg-coverage-15beece6248f7b4b3db06c2691d0558d1fd76e72590afb3479a64ac40547c5c9.tar
 12M	./syft/pkg/cataloger/kernel/test-fixtures/cache/stereoscope-fixture-image-kernel-and-modules-98078891e3ea0107d3cd8d06d0e9bb1e7287ec75249d6958278fd1efd85defe9.tar
9.4M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-os-binary-overlap-015777d781a73df6a3881163f87e292f40576662ed19e0369d3a8eb0ae2c0ab1.tar
9.3M	./syft/pkg/cataloger/redhat/test-fixtures/cache/stereoscope-fixture-image-minimal-8206f00cc9a5d127ed3648ed3f46021bee54c20252549f45435085a49b35989b.tar
8.3M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-suse-all-layers-f6542aa9040ba383c18224351efd19978ec1a4ba7f814955f08fd3db6bf6349e.tar
7.3M	./syft/format/syftjson/test-fixtures/cache/stereoscope-fixture-image-alpine-5bbdfebb94b6923efd76f9dc9063011c5e90c719e599a09299b1c7aa78315dca.tar
6.3M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-sqlite-rpmdb-fefcd2d7670e5205b7cabcee6e1e5d7ad69ae8f925ab578b74524c0a1da49024.tar
6.0M	./syft/internal/fileresolver/test-fixtures/cache/stereoscope-fixture-image-files-deleted-cafbcd15d157e33f46f6523e7c80ed6da71b03bfa6722e8442064d611b3a9e3a.tar
5.9M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-go-bin-arch-coverage-7d28dcd4527432d8cb41a1239fd7b2dce212a4445711706d72247dcb0cb3cc74.tar
5.2M	./syft/pkg/cataloger/golang/test-fixtures/cache/stereoscope-fixture-image-small-6435a8518ecff812e5df1e183c231bc4a44795dd7e114b6098efa4746d70d3b9.tar
5.2M	./syft/pkg/cataloger/golang/test-fixtures/cache/stereoscope-fixture-image-not-a-module-2c7a60fde549021a93bca9d3fe336450d7f13a15c057f8fbf6d2301ab5af581e.tar
4.1M	./test/install/cache/busybox-env.tar
4.1M	./syft/pkg/cataloger/binary/test-fixtures/cache/stereoscope-fixture-image-busybox-8b99240387a1d960aab6206fa829ca7bd735d3da85024be351935b98be9430c7.tar
3.9M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-java-no-main-package-2589efa3b70e17991b16b6b4682e7f34f703fe816831838dd5e5a221ce67d44e.tar
3.7M	./syft/pkg/cataloger/rust/test-fixtures/cache/stereoscope-fixture-image-audit-aa03f2446b715a3ccd04e4c9f470fe8b739138b21655595af19885c985d52f41.tar
3.7M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-rust-auditable-c38569700498cfca9cceab99b5f11fa1a588271a99f3c79ed36fe8f2c586c228.tar
3.2M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-golang-compiler-3bf703a025153b670a2b979c8f57d900d6f251d2992f9f308acb8987387078be.tar
2.6M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-test-java-purls-c7b3a12d3b0bd4d5b47d53183a5e22551b6e7ad2b5a4dfdb9e55c4c4e419efa7.tar
1.6M	./syft/internal/fileresolver/test-fixtures/cache/stereoscope-fixture-image-symlinks-1c3c314784bb8a107e4dec9e37be146b458fefe8f15e57511bc398a8fffebe4e.tar
1.6M	./syft/file/cataloger/internal/test-fixtures/cache/stereoscope-fixture-image-file-type-mix-e634da40d0d75da0a1327770cd90b16bf02ce1063bbdb0920523b96581bd0e2b.tar
1.6M	./syft/file/cataloger/filemetadata/test-fixtures/cache/stereoscope-fixture-image-file-type-mix-e634da40d0d75da0a1327770cd90b16bf02ce1063bbdb0920523b96581bd0e2b.tar
1.6M	./syft/file/cataloger/filedigest/test-fixtures/cache/stereoscope-fixture-image-file-type-mix-e634da40d0d75da0a1327770cd90b16bf02ce1063bbdb0920523b96581bd0e2b.tar
1.5M	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-distro-id-ef5f25b7a60637dcdcacec6a3e69a80edee019ac9c34866cbf2ab1f1ed308bb3.tar
1.4M	./syft/pkg/cataloger/python/test-fixtures/cache/stereoscope-fixture-image-multi-site-package-d0c1b4e06bf9ea98f2ba146e25e318f896f08a74e39d55d258c8e1c0f0a31e1e.tar
892K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-mariner-distroless-ebdc28e9886ed805a7020fb6c711cf58c74ccfc610854114ada7391475efb630.tar
764K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-photon-all-layers-ab52996898050a61b81e9c363e27e3e39d44c86b561f21fd5efbd380cd044609.tar
732K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-java-virtualpath-regression-92fbbd8ec32d8371a91c421c3469987fe2fca8794adb0bc67d62cb655bbf806c.tar
284K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-large-apk-data-771e270e8b2239f89b1e5b1f5008cd8e90f1ccf85285e75b047b8837a42900e2.tar
128K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-owning-package-564f047562d72d322e1edec01e2874dcbadc003ed5fe115a1c66bee227deac2f.tar
104K	./syft/pkg/cataloger/binary/test-fixtures/cache/stereoscope-fixture-image-fedora-64bit-689fa6cc6c301efdda0762a050949923a4dfd19e885affa8a2cfb71fb9e8ae56.tar
 80K	./syft/pkg/cataloger/binary/test-fixtures/cache/stereoscope-fixture-image-fedora-32bit-1a7302e4194807b0b853d1cbed38b9a3cd013fe8f1560492344c49579cc7cfe7.tar
 24K	./syft/source/test-fixtures/cache/stereoscope-fixture-image-simple-04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7.tar
 24K	./syft/pkg/cataloger/debian/test-fixtures/cache/stereoscope-fixture-image-dpkg-5d87fb83193e020ef47572ce96186ead9be6e9a698871dd81d2e108c10a6329f.tar
 24K	./syft/pkg/cataloger/debian/test-fixtures/cache/stereoscope-fixture-image-distroless-deb-b4154260fc37ca0d1e6b57f1c59a2e5019fe6ea79eba5d99ae32d3d3ddcc99a4.tar
 24K	./syft/internal/fileresolver/test-fixtures/cache/stereoscope-fixture-image-simple-04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7.tar
 20K	./syft/internal/fileresolver/test-fixtures/cache/stereoscope-fixture-image-duplicate-path-7e31bdad84ffe928c47e24cfb3d0641aa56fd67809f71193fe14a847e97fec9e.tar
 20K	./syft/format/internal/testutil/test-fixtures/cache/stereoscope-fixture-image-simple-85066c51088bdd274f7a89e99e00490f666c49e72ffc955707cd6e18f0e22c5b.tar
 20K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-sbom-cataloger-a4aa0752985a578a8b34fe3a2e09aca3100c38a96ebb5cee6eeb4eddbc4ff8ed.tar
 16K	./cmd/syft/internal/test/integration/test-fixtures/cache/stereoscope-fixture-image-sbom-metadata-component-8fd41042784d0d58f34a8b951b00847d471c7f4abd9f4e11e6ee668a92e6da71.tar

Overall changes:

  • I went through all of the large images and added multistage build steps that copy the important test material into scratch images. This was the trick that saved the most space.
  • I've also added a small check to CI to make certain that we don't go above an arbitrary 1GB threshold again to prevent regression here (causing forks to fail in CI due to out of disk space).
  • refactored the caching mechanisms to have the same pattern: test-fixtures/place with gitignored data should have an accompanying test-fixtures/place.fingerprint file with checksums of the input material used to build the fixtures in that directory. This is all governed by the newly refactored make fingerprints target.
  • building fixtures no longer requires Taskfile additions + wiring up in github actions CI cache. Instead there is a single make build-fixtures that knows how to find **/test-fixtures/Makefile files and run the fixtures and clean targets to manage creating/purging test fixtures. This makes it much easier to simply add new fixtures and not need to remember all of the places to add references too (there were some fixtures that we never had wired up into CI actions/cache calls, which means we never leveraged them in CI -- we continually rebuilt them! 😮‍💨 )
  • added the ability to upload/download docker image tar and other ephemeral cache data to/from a new ghcr.io/anchore/syft/test-fixture-cache image. This is periodically refreshed (pushed) based off of the a 4am cron job running from the main branch -- no previous fixture state is used when building/pushing a new test fixture image.
  • Since oras is used to deal with pushing/pulling fixtures from an OCI registry, we additionally keep ORAS_CACHE pointed to .tmp/oras_cache to prevent the need to pull the same data again and again. This also self-purges itself when it gets larger than 4 GB.
  • added top-level make refresh-fixtures that dynamically figures if cache should be pulled or rebuilt manually
  • ported the traefik@3.0.4 for riscv64 dynamic binary fixture to a snippet -- this saves 10 seconds when running unit tests (not when creating fixtures... when actually running tests)
  • automatically deletes snapshot build cache at the end of a PR validations run (instead of waiting for eviction days later, even though these are used only once)
  • found multiple broken test fixtures that were being masked by caches. With this new approach we should be able to see these issues earlier

This has resulted in improved performance in CI:

  • integration step is down from 6 minute runs to 1.5 minute runs 🎉
  • unit step is down from 15 minute runs to 3 minute runs 🍰
  • cli step is down from 3 minutes to 2 minute runs 🌮
  • way less verbose output in all three test steps 🕺

Caveats:

  • Since we're keeping both the oras cache locally (to save on unnecessary network transfers) as well as the installed fixtures, we're storing all test fixtures twice! (three times if you count the potentially larger container images when built from scratch. However, these changes aggressively clear any existing cache when downloading, so we shouldn't be accumulating unused cache like we had been before. This also includes deleting stereoscope images from the docker daemon, so it shouldn't be all that common to have the duplicate docker image except for one-off instances when you're adding that image during development. All this being said... I think we're making better tradeoffs in this PR than we are today.

From a developer perspective this should be transparent, no action should be needed. The next time you run make unit the fixture cache should be downloaded and installed in the right spots.

For the future:

  • this will cause some headache when making breaking changes to the repo layout on a branch and attempting to us the cache (which is built from main and automatically incorporated). I'm saving this for a future development effort.
  • there is no lifecycle cleanup of the cache images -- this can be added later
  • when the nightly cache builder pipeline runs... if it fails it notifies no one -- in the future we should probably shout out on slack to the team to address failures

@wagoodman wagoodman force-pushed the slim-down-cache branch 2 times, most recently from b427837 to 4d56f0a Compare September 3, 2024 21:32
@wagoodman wagoodman added the changelog-ignore Don't include this issue in the release changelog label Sep 3, 2024
Comment on lines +46 to +66
// TODO: ignoring the `ref` field though does create stable results to compare, but the SBOM is fundamentally gutted and not worth comparing (find a better redaction or compare method)
//{
// name: cyclonedxjson.ID.String(),
// redactor: func(in []byte) []byte {
// // unstable values
// in = regexp.MustCompile(`"(timestamp|serialNumber|bom-ref|ref)":\s*"(\n|[^"])+"`).ReplaceAll(in, []byte(`"$1": "redacted"`))
// in = regexp.MustCompile(`"(dependsOn)":\s*\[(?:\s|[^]])+]`).ReplaceAll(in, []byte(`"$1": []`))
// return in
// },
// json: true,
//},
//{
// name: cyclonedxxml.ID.String(),
// redactor: func(in []byte) []byte {
// // unstable values
// in = regexp.MustCompile(`(serialNumber|bom-ref|ref)="[^"]+"`).ReplaceAll(in, []byte{})
// in = regexp.MustCompile(`<timestamp>[^<]+</timestamp>`).ReplaceAll(in, []byte{})
//
// return in
// },
//},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is worth calling out -- I noticed that when redacting the ref field the SBOM generated is ultimately wrong (several empty dependency fields created). This makes the test fundamentally wrong, and needs to be rethought for this format.

Why was this dealt with on this PR? Changing the image test fixture lead to test breakage, which is how I found the problem.

@wagoodman wagoodman marked this pull request as ready for review September 3, 2024 22:01
@@ -1,4 +1,4 @@
FROM centos:7.9.2009@sha256:dead07b4d8ed7e29e98de0f4504d87e8880d4347859d839686a31da35a3b532f
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this image was so old that I was having a hard time replicating the state, so I updated the test fixture + test

@@ -1,6 +1,27 @@
FROM centos:7.9.2009@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this image was so old that I was having a hard time replicating the state, so I updated the test fixture + test

Taskfile.yaml Outdated
@@ -493,4 +506,4 @@ tasks:
desc: Remove all docker cache and local image tar cache
cmds:
- 'find . -type f -wholename "**/test-fixtures/cache/stereoscope-fixture-*.tar" -delete'
- "docker images --format '{{`{{.ID}}`}} {{`{{.Repository}}`}}' | grep stereoscope-fixture- | awk '{print $$1}' | uniq | xargs -r docker rmi --force"
- "docker images --format '{{`{{.ID}}`}} {{`{{.Repository}}`}}' | grep stereoscope-fixture- | awk '{print $1}' | uniq | xargs -r docker rmi --force"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was broken when ported from Makefile to Taskfile

@@ -313,6 +314,18 @@ tasks:
- "echo '\nTar cache:'"
- 'find . -type f -wholename "**/test-fixtures/snapshot/*" | sort'

check-docker-cache:
Copy link
Contributor Author

@wagoodman wagoodman Sep 5, 2024

Choose a reason for hiding this comment

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

this is to help regress in terms of how large our docker image fixture caches are collectively

@@ -1,13 +1,10 @@
//go:build !arm64
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was able to make this cross-platform, which makes the fixture build/sync logic a little simpler (it's the same for all platforms)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman marked this pull request as ready for review September 6, 2024 19:17
@wagoodman wagoodman requested a review from a team September 6, 2024 19:17
@@ -85,6 +85,7 @@ from-images:
paths:
- /usr/local/go/bin/go

# TODO: this is no longer available from dockerhub! (the snippet is vital)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

calling this out, but I have no action to take here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this file is in the PR twice, because there are unrelated test fixtures that use this. Since I didn't want the docker contexts to overlap, it was easier to copy/paste the code than to orchestrate reusing it

@spiffcs spiffcs self-assigned this Sep 6, 2024
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit 0a3f513 into main Sep 9, 2024
12 checks passed
@wagoodman wagoodman deleted the slim-down-cache branch September 9, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-ignore Don't include this issue in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no space left and Could not retrieve mirrorlist in test
2 participants