feat(labctl): add images download command#39
Merged
Conversation
Adds a new `labctl images download` command that downloads an image from the manifest to a local file. This separates the download step from upload, enabling CI workflows to download, test, and then upload. Changes: - Add FindImageByName() method to ImageManifest for lookup by name - Create download.go command with JSON output for CI integration - Update vyos-build.yml to use labctl instead of inline curl/grep The new command: - Looks up image by name in manifest - Downloads from source URL - Verifies checksum (source and decompressed if applicable) - Outputs JSON with path, checksum, size, name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add pre-upload hooks to the image sync process that gate publishing. Images must pass their configured hooks before being uploaded to e2. Key changes: - Add hooks schema to manifest (preUpload hooks with name, command, timeout) - Add hook result caching in e2 to skip re-testing unchanged images - Add hook executor that runs commands and caches results - Add --no-upload flag for PR testing (runs everything except upload) - Add --skip-hooks flag to bypass hook execution when needed - Remove vyos-build.yml (consolidated into images-sync.yml) - Update workflow to run full sync --no-upload on PRs This enables a pattern where testing gates publishing: 1. Download image and verify checksum 2. Run pre-upload hooks (e.g., VyOS integration tests) 3. Cache hook results keyed by image checksum 4. Upload to e2 only if hooks pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Stream hook stdout/stderr in real-time with a " │ " prefix to distinguish hook output from labctl's own output. This provides better visibility into hook execution progress. Example output: Running hook "vyos-integration-test"... │ Building container from ISO... │ Deploying containerlab topology... │ Running pytest tests... │ 5 passed in 45.2s Hook "vyos-integration-test": passed (2m30s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
labctl images downloadcommand that downloads an image from the manifest to a local fileChanges
FindImageByName()methodNew Command Usage
Output (JSON to stdout):
{ "path": "/tmp/vyos.iso", "checksum": "sha256:abc123...", "size": 123456789, "name": "vyos-stream" }Test plan
just allpasses in tools/labctl (format, lint, vet, test)🤖 Generated with Claude Code