Settings → Storage: choose where Kiri keeps images, containers and volumes (for example an external drive)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
Start with crates/kiri-image/src/store.rs at Store::default_root() and the referenced Linux agent and Windows WSL setup paths to map how each platform locates its data. The issue also points to daemon/mod.rs, setup.rs, and the related issues #122, #123, and #345. Before implementation, the five open design questions need decisions; done means a cross-platform settings flow can safely move existing data, handle unavailable storage, and preserve current defaults.
索引モデルが issue の本文から書いたものです。
説明
What you're trying to do
My Mac's internal disk is small, and images, build layers and volumes add up quickly. I'd like to keep Kiri's data on an external SSD, for example /Volumes/External/kiri, without losing what I already have. OrbStack and Docker Desktop both have a setting for this.
Today the only way is KIRI_DATA_DIR, which is undocumented for users, has to reach the LaunchAgent somehow, and doesn't move anything: Kiri starts empty in the new folder.
What you'd like Kiri to do
An optional Settings → Storage tab, the same on macOS, Windows and Linux:
- Shows where the data is, how much it uses and how much is free there.
- Change… picks a folder, checks it, moves the data, and restarts the engine. Reset to default moves it back.
- Users who never open it see no change at all: no new file, same paths.
What I'd propose (open to any of it)
Where the choice is kept. A small ~/.kiri/storage.json with the folder. It goes beside vm.json and never inside the data folder itself. Store::default_root() (crates/kiri-image/src/store.rs:133) would look at KIRI_DATA_DIR first, then this file, then today's default, so Kiri Dev and anyone using the variable are unaffected. ~/.kiri itself stays in the home folder, as daemon/mod.rs:49 intends.
Checks before moving. The path must be absolute and not inside the current folder, or the other way round. The folder must be empty or already hold Kiri data, and writable (a probe file is written and removed). The free space must cover what the data actually uses, plus a margin. FAT and exFAT are refused, because they can't hold a sparse 64 GiB data.img.
The move.
- Stop containers, noting which were running, and retire the VM.
- Copy into
<target>/.kiri-moving. - Verify the copy: blobs by their digest, everything else by size and content.
- Rename into place and write a marker file.
- Write
storage.jsonatomically. That write is the commit point. - Restart the engine and start the containers that were running.
If anything fails before step 5, only .kiri-moving is removed and Kiri carries on where it was. The old data is kept until Kiri has started from the new place; then the tab offers Remove old data. Progress is polled the way Settings → Import does it.
A drive that isn't there. If the configured folder has no marker (the drive isn't mounted), the daemon doesn't create a fresh tree there. It stays up with a clear "storage unavailable" error and a banner (Retry, Choose another folder, Use default), rather than exiting.
Things I found while looking into it (main at 260cf66, macOS 27.2, Apple silicon)
std::fs::copyfills in sparse files across volumes. A 2 GiB sparse file using 16 KB took 2 GiB at the destination when copied to another volume. On the same volume, and with macOScp, it stayed at 16 KB. A naive move ofvm/data.imgwould therefore write all 64 GiB, so the copy needs to skip holes (SEEK_DATA/SEEK_HOLE).- A missing folder gives an unhelpful error. With
KIRI_DATA_DIRon a volume that isn't mounted,kiri daemonexits 1 with onlyPermission denied (os error 13). The LaunchAgent'sKeepAlive {SuccessfulExit=false}would restart it over and over. - Nothing stops two daemons sharing a data folder. If they use different sockets, both can open the same
data.img; there is no lock. A lock file held by the daemon would close that gap. - Kiri Lite's links need repointing.
~/.kiri/bin/dockerandcliPluginsExtraDirshold absolute paths into the data folder (setup.rs:523-546), so a move would have to update them. - Linux keeps data in two places. The agent's
/var/lib/kiriis fixed (kiri-init/src/linux/mod.rs:34and three other places), and the host-side metadata followsdefault_root(). Both would have to move. - Windows keeps the WSL distro in
%LOCALAPPDATA%\Kiri\wsl(kiri-win/src/setup.rs:532). Moving it would mean moving the distro's VHDX. - Related: #122/#123 (trim) decide how much a move has to copy, and #345 is why the move stops containers before copying.
I ran a source build with KIRI_DATA_DIR on an external APFS drive (USB, ownership disabled). The VM, pulls, volumes, networks and amd64 images all worked, and tests/e2e.sh passed apart from the Finder checks, which I had turned off.
Questions before I write anything
- Is
~/.kiri/storage.jsonthe right place, or would you rather have a key in an existing settings file? - Linux: should the agent's data root become configurable, or would you prefer another way, such as a systemd mount?
- Windows: is moving the WSL distro's VHDX acceptable, and does it belong in the first version? CONTRIBUTING asks for all three systems in one PR, so I'd plan for it unless you say otherwise.
- Keep the old data until the user removes it (my preference), or remove it once the copy is verified?
- Is refusing FAT and exFAT targets OK?
Would you like to build it?
Yes, once we've agreed on the approach
- 主要言語
- Rust
- スター
- 7.5k
- フォーク
- 329
- 平均マージ
- 7時間 48分
- マージ済み PR(30日)
- 105
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libracoder/kiri のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
libracoder/kiri#364 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
libracoder/kiri#289 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
libracoder/kiri#365 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
libracoder/kiri#362 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 47/100
libracoder/kiri#359 ·
メンテナーはふだん 1 日以内に返信
libracoder/kiri の issue をすべて見る
似ている issue
-
benchmark-review
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
area:filesystem bug need-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Captions panel does not offer to show an existing transcript対応中かも @thedavidweng が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
CapSoftware/Cap#4276 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
matrix-org/matrix-rust-sdk#7495 ·
メンテナーはふだん 1 日以内に返信