Repository navigation
feat(sandbox): keep offices on the sandbox image of the running mikan - #175
Merged
Merged
Conversation
Upgrading mikan never updated its sandbox: the provisioner pulled only when no local image existed and compared containers with the local image, so deployments on :latest kept a weeks-old image and offices failed on tools only newer images had. --sandbox=oci now runs ghcr.io/geminixiang/mikan-sandbox:<version>. The daemon pulls its configured image in the background on start, so a moved tag is refreshed too, and a failed pull keeps the local image with a warning. Offices move at their next start after an idle stop, and the last container replaced away from a published image removes it; engines refuse rmi while a container still uses the image. onboarding and the pm2 template write --sandbox=oci, and no docs ask for a manual docker pull. ADR 0023 records the decision.
Deploying mikan with
|
| Latest commit: |
73ef570
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4e1afcb0.mikan-1wv.pages.dev |
| Branch Preview URL: | https://feat-versioned-sandbox-image.mikan-1wv.pages.dev |
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.
為什麼要改
升級 mikan 不會連帶更新 sandbox image,所以 container 一直停在舊版:
:latest,registry 上的latest更新了,本機也察覺不到。prod 的實際狀況(10/11 查證):
:latest卻是 9/23 pull 的,中間錯過了 7 個版本。研究紀錄在
docs/research/sandbox-image-versions-2026-10.md,決策記錄在 ADR 0023。改了什麼
--sandbox=oci(不指定 image)ghcr.io/geminixiang/mikan-sandbox:<目前 mikan 版號>,mikan 和 image 一起升級、一起回滾-f的rmi。還有 container 在用時引擎會拒絕刪除,所以最後一個換新的 office 才會刪掉它;你自己 build 或打 tag 的 image 不受影響oci:…:latest,並提示手動docker pull--sandbox=oci,不需要手動 pulldocker pull沒有改的部分:執行中的 container 絕不會被替換,要等它閒置停止後才換新(ADR 0014)。
另外把
getVersion從main.ts搬到src/package-version.ts,讓 sandbox 模組也能讀取版號。驗收 eval
eval 檔:
.workspace/versioned-image/upgrade.eval.ts。在本機用registry:2架一個測試 registry,放兩個只差在/sandbox-version內容的 image,用 nerdctl 實際跑:--sandbox=ocighcr.io/geminixiang/mikan-sandbox:1.3.0:latest、registry 上的 latest 已更新驗證
--sandbox=oci啟動 daemon,log 顯示Sandbox image ghcr.io/geminixiang/mikan-sandbox:1.3.0 is current,Slack 也正常連線。--sandbox=oci跑在 nerdctl 上,23 個測試檔、26 個測試全部通過;container 建自ghcr.io/geminixiang/mikan-sandbox:1.3.0。slack-e2e.yml。相容性與 release note
--sandbox=oci會自動使用和 mikan 版本對應的 sandbox image;升級 mikan 時,image 和 container 會自動跟著更新,不需要再手動docker pull。oci:<image>時,mikan 每次啟動也會 pull 一次那個 image。如果是只存在本機的 image,pull 會失敗並記錄一條訊息,但照常運作。--sandbox=oci:ghcr.io/geminixiang/mikan-sandbox:latest的部署,改成--sandbox=oci。不改也會在重啟時更新到 registry 上的latest。oci:<image>指定 image。