-
Notifications
You must be signed in to change notification settings - Fork 2
Add caching for images #7
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
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
2464c4c
add cache action
crschardt 9dbed46
image_path is in env
crschardt 6f8b363
try putting it in outputs
crschardt a7b215a
deal with undefined
crschardt 177e8d3
not allowed to assign like that
crschardt f92eb44
don't modify files in the cached location
crschardt 22b9972
recursive
crschardt fe5a18e
only copy the files
crschardt be95bcb
try not to use sudo
crschardt 319b501
need sudo here
crschardt 2df01df
add option to control caching
crschardt 919d0da
test disabling cache
crschardt c595024
use caching as default
crschardt 2d308b9
fix the name of the test opi image
crschardt b9e5c7d
test zstd for speed
crschardt fe5a0d8
wow
crschardt 2445a4e
try -19 to approximate default xz compression
crschardt 7482d47
try compression level 10
crschardt 9029f80
try compression level 15
crschardt 50312e2
Revert "try compression level 15"
crschardt 452f3ac
clean up test workflows
crschardt ba667a9
needed the checkout action
crschardt 428b853
place rootdir in same filesystem as image
crschardt f950a8c
fix bugs in workflows
crschardt 003651b
nicer action log messages
crschardt 86a509c
clean up build script
crschardt 0379434
wrong directory refernce
crschardt 002e9fe
image should include the full path
crschardt f4c816d
make sure to extract the tar file in the right place
crschardt a58d308
image_path should be in outputs
crschardt e5df5e0
do these need to be sudo?
crschardt 5ab92c5
Revert "do these need to be sudo?"
crschardt af55128
Revert "image_path should be in outputs" and fix the problem that I w…
crschardt 389c36c
tweak comments
crschardt cf0c910
clean up get_image.sh
crschardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: 'Test modifying standard images' | ||
| on: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| - 'releases/**' | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-24.04-arm | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: RaspberryPi_1 | ||
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2025-05-13/2025-05-13-raspios-bookworm-arm64-lite.img.xz | ||
| - name: RaspberryPi_2 | ||
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2025-05-13/2025-05-13-raspios-bookworm-arm64-lite.img.xz | ||
| - name: OrangePi | ||
| base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.4.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5.img.xz | ||
|
|
||
| name: Test ${{ matrix.name }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Test using downloaded (cached) image | ||
| id: test_download_image | ||
| uses: ./ # photonvision/photon-image-runner@HEAD | ||
| with: | ||
| image_url: "${{ matrix.base_image }}" | ||
| additional_mb: 200 | ||
| minimum_free_mb: 500 | ||
| boot_partition: "" | ||
| use_cache: "yes" | ||
| commands: | | ||
| echo "Testing $(basename ${{ matrix.base_image }}) image" | ||
| uname -a | ||
| lsblk | ||
| echo "${loopdev}" | ||
| touch /photon-image-modifier-was-here | ||
| ls / | ||
|
|
||
| - name: Test using image file | ||
| id: test_file_image | ||
| uses: ./ # photonvision/photon-image-runner@HEAD | ||
| with: | ||
| image_url: "file://${{ steps.test_download_image.outputs.image }}" | ||
| minimum_free_mb: 500 | ||
| boot_partition: "" | ||
| use_cache: "yes" | ||
| commands: | | ||
| echo "Testing file access to ${{ steps.test_download_image.outputs.image }} image" | ||
| uname -a | ||
| lsblk | ||
| touch /photon-image-modifier-file-was-here | ||
| ls / | ||
|
|
||
| - name: Compress image | ||
| run: | | ||
| sudo zstdmt -10 -v -k ${{ steps.test_download_image.outputs.image }} | ||
|
|
||
| - uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: ${{ matrix.name }}.img.zst | ||
| path: ${{ steps.test_download_image.outputs.image }}.zst | ||
| compression-level: 0 | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.