Skip to content

Add backup restore mode for assets init#2221

Merged
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main
Nov 24, 2025
Merged

Add backup restore mode for assets init#2221
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main

Conversation

@seokho-son
Copy link
Copy Markdown
Member

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

image

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 includeAzure query 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>
@seokho-son
Copy link
Copy Markdown
Member Author

Codacy Static Code Analysis is not appropriate. Let me ignore it.

@seokho-son
Copy link
Copy Markdown
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Nov 24, 2025
@cb-github-robot cb-github-robot merged commit b5d9aa3 into cloud-barista:main Nov 24, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon. asset script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants