Skip to content

Add caching for images - #7

Merged
crschardt merged 35 commits into
PhotonVision:mainfrom
crschardt:cache-downloads
May 3, 2026
Merged

Add caching for images#7
crschardt merged 35 commits into
PhotonVision:mainfrom
crschardt:cache-downloads

Conversation

@crschardt

@crschardt crschardt commented Apr 25, 2026

Copy link
Copy Markdown
Collaborator

This PR enables storage of downloaded images in GitHub's cache action. This should reduce the build time for new images as well as making builds more robust to problems accessing the download source.

Control of the feature is through the use-cache parameter which defaults to "no".

This PR also makes sure that the shell script that contains commands is removed and it overwrites the commands.sh file if it exists. This prevents a problem that would cause the commands to be run a second time if an image that has been modified is re-used, as is the case when tests are run on the image in a separate step.

An implementation detail, which shouldn't alter behavior is that the root file system is now placed under the location specified by the GitHub $RUNNER_TEMP environment variable.

Finally, the tests have been reworked to include:

  1. Tests for the cache, including when two requests are made for the same artifact in one run
  2. Consolidation of the Raspberry Pi and Orange Pi tests into one workflow to reduce redundancy
  3. Use of zstandard for compression to speed up the generation of artifacts

mcm001
mcm001 previously approved these changes Apr 25, 2026
@samfreund

Copy link
Copy Markdown
Member

Since this is part of the runner, will it cache images in the monorepo?

@crschardt

Copy link
Copy Markdown
Collaborator Author

Since this is part of the runner, will it cache images in the monorepo?

I'm pretty sure it will cache the files in the repo that calls the runner. The free cache size for our repos is 10GB, so we may need to be selective about what we cache. The other twist is that cached artifacts aren't shared between branches. All branches have access to the artifacts cached by main, so I think we'll want to make sure we seed main quickly if we decide to use this on the monorepo.

@crschardt
crschardt marked this pull request as ready for review May 3, 2026 18:22
Comment thread .github/workflows/test-rubikpi.yml
@crschardt
crschardt requested a review from mcm001 May 3, 2026 18:48
@crschardt
crschardt merged commit 35e8e0e into PhotonVision:main May 3, 2026
10 checks passed
@crschardt
crschardt deleted the cache-downloads branch May 3, 2026 18:56
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