Add initial feature for resource template and replay with the template#2352
Merged
cb-github-robot merged 4 commits intocloud-barista:mainfrom Mar 10, 2026
Merged
Add initial feature for resource template and replay with the template#2352cb-github-robot merged 4 commits intocloud-barista:mainfrom
cb-github-robot merged 4 commits intocloud-barista:mainfrom
Conversation
Signed-off-by: Seokho Son <shsongist@gmail.com>
Signed-off-by: Seokho Son <shsongist@gmail.com>
Signed-off-by: Seokho Son <shsongist@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an initial resource template feature for CB-Tumblebug, enabling users to create, manage, and replay (apply) reusable templates for MCI, vNet, and SecurityGroup resources. Templates are stored in ETCD and can be created manually or extracted from existing MCI configurations. The PR also includes an init script integration for loading template files from disk, example template JSON files, and a cb-spider version bump.
Changes:
- Add template CRUD model types (
MciDynamicTemplateInfo,VNetTemplateInfo,SecurityGroupTemplateInfo, etc.) and backend logic for template create/read/update/delete operations via ETCD - Register new REST API routes for template management (CRUD) and template-based resource provisioning for MCI, vNet, and SecurityGroup, along with corresponding Swagger documentation
- Add init script support for loading template JSON files from
init/templates/directory, with example templates for MCI, vNet, and SecurityGroup
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/core/model/template.go |
New model types for template Info, Req, ApplyReq, and ListResponse for MCI, vNet, and SecurityGroup |
src/core/common/template.go |
CRUD functions for all three template types, storing/retrieving from ETCD |
src/core/common/utility.go |
New GenTemplateKey function for generating ETCD key paths for templates |
src/core/infra/template.go |
CreateMciDynamicFromTemplate (apply template) and ExtractAndCreateTemplate (extract from existing MCI) |
src/interface/rest/server/server.go |
Route registrations for template CRUD and template-based provisioning endpoints |
src/interface/rest/server/infra/manageInfo.go |
Extended configCopy endpoint to optionally save extracted config as template |
src/core/model/common.go |
Added StrTemplate constant; formatting change in ResourceTypeRegistry |
src/core/model/label.go |
Whitespace-only change (blank line added) |
src/interface/rest/docs/swagger.yaml |
Swagger spec for new template API endpoints and schemas |
src/interface/rest/docs/docs.go |
Go-embedded Swagger doc template with new API definitions |
init/init.py |
New --load-templates CLI option for loading template files from init/templates/ |
init/templates/global-mci-template.json |
Example MCI template (extracted from real deployment) |
init/templates/aws-small-web.json |
Example small AWS MCI template |
init/templates/aws-web-sg.json |
Example SecurityGroup template |
init/templates/aws-standard-vpc.json |
Example vNet template |
docker-compose.yaml |
Bumps cb-spider image from 0.12.6 to 0.12.7 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Seokho Son <shsongist@gmail.com>
Member
Author
|
/approve |
This was referenced Mar 10, 2026
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.
Now, we can support user's custom resource template, default resource template, example resource template, and so on. ;)
Currently, It is an initial version that covers MCI, vNet, SG. Will add template types for the other resource types, once the feature is stable.