Cache base image metadata to speed up GetBase#521
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves performance of the GetBase operation by implementing caching for base image metadata downloads. The LXD library already supports caching downloaded JSON metadata for 1 hour; this PR enables that feature by providing a cache directory path.
Key changes:
- Introduces a new
BaseDownloadscache directory for storing base image metadata - Passes the cache path to the LXD SimpleStreams connection
- Fixes the image type parameter in
GetImageAliasTypeto use the correct source field
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/dirs/dirs.go | Adds BaseDownloads directory variable and ensures it's created during initialization |
| internal/workshop/lxd/lxd_base_manager.go | Enables metadata caching by passing cache path to SimpleStreams connection and fixes image type parameter |
ae8b7f1 to
a1eed23
Compare
TICS Quality Gate✔️ PassedworkshopAll conditions passedSee the results in the TICS Viewer The following files have been checked for this project
|
dmitry-lyfar
approved these changes
Oct 24, 2025
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.
Description
The slow part of
GetBaseis downloading a big JSON file with all the images inside. LXD has a builtin mechanism to cache this download for 1 hour. We just need to give it a place to store the data.Self-review quick check
Docs
Or: