Skip to content

feat(labctl): add caching for image downloads and hooks#40

Merged
jmgilman merged 1 commit intomasterfrom
feat/labctl-caching
Dec 29, 2025
Merged

feat(labctl): add caching for image downloads and hooks#40
jmgilman merged 1 commit intomasterfrom
feat/labctl-caching

Conversation

@jmgilman
Copy link
Collaborator

Summary

  • Add --cache-dir flag to labctl images sync for local download caching
  • Create internal/cache package for managing cached files by checksum
  • Pass LABCTL_HOOK_CACHE environment variable to hooks for artifact caching
  • Update iso-to-container.sh to cache rootfs.tar by ISO hash
  • Add actions/cache step to images-sync.yml workflow

Cache Structure

~/.cache/labctl/
├── downloads/     # Cached ISOs by checksum hash (12-char key)
└── hooks/
    └── vyos-integration-test/
        └── rootfs-{iso-hash}.tar

Expected CI Time Savings

Phase Without Cache With Cache
ISO Download (~400MB) ~60s ~0s
sqfs2tar (~2GB rootfs) ~90s ~5s
Total per image ~3 min ~45s

Test plan

  • CI workflow runs successfully on this PR
  • First run downloads and caches the ISO
  • Second run uses cached ISO (look for "Using cached:" in logs)
  • Hook caching works (look for "Using cached rootfs.tar:" in iso-to-container.sh output)

🤖 Generated with Claude Code

Add local caching support to reduce CI time for image sync operations:

- Add --cache-dir flag to labctl images sync command
- Create cache package for managing downloaded files by checksum
- Pass LABCTL_HOOK_CACHE env var to hooks for artifact caching
- Update iso-to-container.sh to cache rootfs.tar by ISO hash
- Add actions/cache step to images-sync.yml workflow

Expected CI time savings: ~3 min → ~45s per image (on cache hit)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jmgilman jmgilman merged commit a07ff79 into master Dec 29, 2025
2 checks passed
@jmgilman jmgilman deleted the feat/labctl-caching branch December 29, 2025 03:34
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.

1 participant