Add backup restore mode for assets init#2221
Merged
cb-github-robot merged 1 commit intocloud-barista:mainfrom Nov 24, 2025
Merged
Add backup restore mode for assets init#2221cb-github-robot merged 1 commit intocloud-barista:mainfrom
cb-github-robot merged 1 commit intocloud-barista:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a fast backup/restore mechanism for the assets database to accelerate initialization from ~20 minutes to ~1 minute. It also adds Azure image filtering controls, allowing users to exclude Azure images (which take 40+ minutes to fetch) for faster initialization, and implements CSP-specific basic image detection rules.
Key Changes:
- Added database backup/restore scripts and Makefile targets for quick initialization
- Implemented
includeAzurequery parameter in LoadAssets API to control Azure image fetching - Introduced CSP-specific pattern rules for identifying basic OS images with common/provider-specific overrides
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/restore-assets.sh |
New script to restore PostgreSQL database from compressed backup files |
scripts/backup-assets.sh |
New script to create compressed PostgreSQL database backups |
init/init.py |
Added interactive choice for backup restore vs fresh fetch with Azure inclusion control |
init/README.md |
Documented new fast initialization mode with backup restore option |
src/interface/rest/server/resource/common.go |
Added includeAzure query parameter to LoadAssets endpoint |
src/interface/rest/docs/swagger.yaml |
Updated API documentation for includeAzure parameter |
src/interface/rest/docs/docs.go |
Generated Swagger docs reflecting API changes |
src/core/resource/common.go |
Modified LoadAssets to accept includeAzure parameter and conditionally exclude Azure |
src/core/resource/image.go |
Updated CheckBasicOSImage call to pass provider name |
src/core/common/utility.go |
Enhanced CheckBasicOSImage with CSP-specific pattern support and exclude logic |
src/core/model/config.go |
Added BasicImageRules and PatternSet structures for flexible image filtering |
assets/extractionpatterns.yaml |
Restructured with basicImageRules supporting common and CSP-specific patterns |
docs/guide/assets-backup-restore.md |
Comprehensive guide for backup/restore functionality |
Makefile |
Added backup-assets and restore-assets targets with help documentation |
go.work.sum |
Updated Go workspace checksums |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Seokho Son <shsongist@gmail.com>
Member
Author
|
Codacy Static Code Analysis is not appropriate. Let me ignore it. |
Member
Author
|
/approve |
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.
This PR provides quick initialization based on pre-dumped assets database. Enjoy it.
a. ⏩ Restore from backup (~1 minute)
Location: ./assets/assets.dump.gz (78.4 MB, 0 days old)
Contains: Specs, Images, and Pricing data
→ Steps 2 & 3 will be skipped