Community程式設計與開發github.com

從本機套件建構變體

使用發佈到本機開發登錄的套件建構完整的 Bottlerocket 變體映像檔,以便在開發中驗證套件變更。

從本機套件建構變體 是什麼?

這個技能讓開發者能夠從本機發佈的套件建構 Bottlerocket 變體映像檔,實現端到端的測試與驗證。當需要測試套件變更在完整變體建構中的效果時,這個技能特別有用。它支援所有 Bottlerocket 變體與架構,並與本機登錄整合,以確保套件在發佈到生產登錄前能夠正確運作。使用方式包括設定本機登錄、選擇要從本機擷取的套件、更新鎖定檔案,然後執行建構。完成後也可以輕鬆還原成上游設定。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cbgbt/bottlerocket-forest/tree/main/skills/build-variant-from-local-kits

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

技能:從本機套件建構變體

目的

使用發佈到本機開發登錄的套件建構完整的 Bottlerocket 變體映像檔。這能讓套件變更在發佈到生產登錄前,進行端到端的測試。

使用時機

  • 測試套件變更在完整變體建構中的效果
  • 建立可用於本機測試的可開機映像檔
  • 對套件修改進行端到端驗證

前置條件

  • 套件已建構完成並發佈到本機登錄(使用 build-kit-locally 技能)
  • 本機登錄正在執行
  • Bottlerocket 變體儲存庫

步驟

1. 設定使用本機登錄

cd ./bottlerocket
brdev twoliter use-local-deps

這會建立指向本機登錄的 Twoliter.override,以便從本機擷取套件。

2. 選擇要從本機擷取的套件

編輯 Twoliter.toml,並針對要從本機登錄取得的套件設定 vendor = "local":

[kit.bottlerocket-core-kit]
vendor = "local"  # 從本機登錄擷取
version = "2.0.0"

[kit.bottlerocket-kernel-6.1-kit]
# 未設定 vendor 覆寫 - 使用上游
version = "2.0.0"

只有 vendor = "local" 的套件會從本機登錄擷取;其他套件則使用上游。

3. 更新鎖定檔案

./tools/twoliter/twoliter update

4. 建構變體

cargo make

若指定特定變體:

cargo make -e BUILDSYS_VARIANT=aws-k8s-1.31

若指定特定架構:

cargo make -e BUILDSYS_ARCH=aarch64

5. 找到建構完成的映像檔

ls -lh build/images/*.img

驗證

建構應成功完成,並在 build/images/ 目錄下產生 .img 檔案。

清理

測試完成後,還原為上游設定:

brdev twoliter use-upstream-deps

這會移除 Twoliter.override。 別忘了也要將 Twoliter.toml 中的 vendor = "local" 變更還原。

常見問題

登錄中找不到套件:

Error: failed to pull kit

解決方案:使用 brdev registry list 確認套件已發佈

版本不符: 解決方案:確認 Twoliter.toml 中的版本與已發佈的套件版本一致

鎖定檔案不同步: 解決方案:再次執行 ./tools/twoliter/twoliter update

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

ad-hoc-implementation-plan

Transform a rough plan into implement-commit ready artifacts. Allows rigorous review while implementing.

build-kit-locally

Build a kit and publish it to a locally hosted registry for development testing

deep-research

Create educational documents that build understanding progressively with citations

edit-spec-file

Edit Bottlerocket RPM spec files following project style conventions

fact-find

Quick lookup of specific facts about Bottlerocket with citations

idea-honing

Clarify feature ideas through iterative Q&A, recording insights to guide concept development

implement-commit

Implement commits from an implementation plan using a TDD pipeline

local-registry

Start and manage a local OCI registry for Bottlerocket kit development

prepare-core-kit-release

Prepare bottlerocket-core-kit for release by bumping version and updating changelog

propose-feature-concept

Create a new feature concept document to pitch the idea and explain the problem/solution

propose-feature-design

Create or update feature technical design document with architecture and implementation guidance

propose-feature-requirements

Create or update feature requirements specification using EARS notation with examples and appendices

propose-feature-test-plan

Create a test plan mapping EARS requirements and Critical Constraints to specific tests

propose-implementation-plan

Create an implementation plan with atomic commits that build toward a complete feature

review-code

Deep code review generating PR comments via principled question-driven analysis

review-scope

Verify code changes match intended scope and requirements without exceeding boundaries

review-style

Verify code follows project style guides without providing improvement suggestions

test-local-twoliter

Build and test local changes to twoliter before releasing

update-twoliter

Update all Bottlerocket repositories to a new Twoliter version

相關技能