Repository navigation
#463 を実装する(スプリント m8d) - #485
Merged
Merged
Conversation
devbase_vscode-server-bin を ~/.vscode-server/bin に付け、コンテナごとの devbase_vscode_<project>_<index> を作らない・付けないようにする。 旧形式の名前を読むだけの find_legacy_vscode_volumes を足す。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
~/.vscode-server と bin を開発ユーザーが書ける形にし、bin/ の版を product.json の 更新時刻の新しい順に 5 版だけ残す。同時の展開で残った入れ子の本体と、60 分より 古い展開の途中のディレクトリも消す。消せないものは WARNING だけで起動を止めない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
建て直す前のイメージでは bin が root のまま残るため、docker exec -u 0 で ~/.vscode-server の所有者へ揃える。devbase up の最後に、旧形式の devbase_vscode_<project>_<index> の名前と消すコマンドを出す(消さない)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
VS Code Server の本体を全コンテナ共通の 1 本のボリュームに置き、本体だけを共有する構成にしました。コンテナの起動で bin を用意して古い版を片付け、起動の後の処理で bin の所有者を揃えます。
upは旧形式のボリュームが残っていると案内します。スプリント m8d のブランチへ集める変更です(#463)。利用者向けの変化
devbase upがそのことを案内します。移行の手順
変更の要点
lib/devbase/volume/compose.py・lib/devbase/volume/manager.pylib/devbase/editor/vscode_server.pylib/devbase/commands/container.pyupで旧形式のボリュームを案内します。docs/user/container-operations.mdに、本体だけを共有する構成と移り方を書きました。docs/specifications/post-start.mdの起動の後の処理の順を、今の振る舞いに合わせました。docs/user/troubleshooting.mdの VS Code Server の困りごとの節を、今の振る舞いに合わせました。テスト
設計と違う点
設計の決定と違えたところ
manager.pyのget_vscode_volume_forに加え、それだけが使っていたresolve_project_name・normalize_volume_component(と内部の定数)も消した。ほかに呼ぶところが無く、残すと使われないコードになるため。VolumeManager(project_name)とensure_volumes(project_name=…)の引数は呼び出し側との互換のために残した(名前には使わない)tests/commands/test_container_scale_order.py)の期待の並びに、baoと窓のタイトルの間のvscode_bin(binの所有者の直し)を足した。tests/commands/test_container_context.pyは docker の呼び出しの数を見るため、bin の直しと旧形式の案内を差し替えたdevbase_vscode-server-bin、残す版の数 5、product.jsonの更新時刻で並べる、60 分より古い展開の途中を消す、旧形式の案内はdevbase upのたびに最後に出す)手で確かめたこと(担当、2026-10-14)
手元の
devbase-base:latest(sha256:e66aeb95…、作成 2026-10-12T17:19:13Z、arm64、macOS の Docker Desktop。この課題より前の entrypoint を持つ)をdocker run --rmで、新しく作った空の作業用ボリューム(issue463f-bin・issue463f-bin2)を付けて打った。新しいentrypoint.shは読み取り専用で付けて関数を呼んだ。既存のdevbase_vscode_*は写さず・付けず・消していない。devbase upは打っていない。作業用のボリュームとコンテナは消した。bin/<commit>に置き、別のコンテナ B(新しいdevbase_setup_vscode_server_dirを通した)でbin/<commit>/bin/code-server --version1.141.1と commit が出たbin/に 40 桁の版を 8 つ(product.jsonを 1 か月ずつ古く、ディレクトリの更新時刻は逆向き)・実の版 1 つ・最も古く残る版に入れ子の本体・2 時間前と今の展開の途中のディレクトリを置き、新しい関数を 2 つのコンテナで同時に走らせた。5 回product.jsonの新しい 5 つ、入れ子の本体と 2 時間前の展開の途中は消え、今の展開の途中は残り、WARNING は 0 行、両方の終了コード 0~/.vscode-server/binだけに付け、関数を通してから開発ユーザーでtouch bin/xとmkdir data extensions~/.vscode-serverとbinがroot:root、後はubuntu:ubuntuになり、どちらも通ったDEVBASE_ACCOUNT_GROUP=team-a)し、prepare_bin_dirをホストから打ったbinがroot:rootでtouchがPermission denied。prepare_bin_dirの後はubuntu:ubuntuで書けた。2 回目も成功(何も変えない)containers/base/entrypoint.shはdevbase-base:latestの shellcheck で指摘 0 件env -u DEVBASE_ROOT uv run --locked pytest tests/ -qは 4385 件通過・32 件スキップ。uvx ruff check --select=E9,F63,F7,F82 libは通過手動確認
devbase upし、base と派生イメージを建て直す前のイメージのまま VS Code を attach する。2 つ目の attach が本体を取り直さず共通のdevbase_vscode-server-binのbin/<commit>で繋がる。両方の窓が使え、窓のタイトルがそれぞれのコンテナ名で始まり、片方の窓の「ウィンドウの再読み込み」で同じコンテナへ繋がり直す。片方のプロジェクトでdevbase upを打ち直した後に attach し直すと、Dev Containers の既定の拡張機能が入り直して使える(入り直しにかかった時間を記録する)。devbase upの最後に旧形式のdevbase_vscode_*の名前とdocker volume rmの行が出るbin/を使う。どちらも使え、起動の片付けがどちらの版も消さないbin/<新しい commit>/に入れ子の本体が残っていない残した事項
docs/user/troubleshooting.md(437〜457 行・487 行付近)に、コンテナごとのdevbase_vscode_{project}_{index}を前提にした記述(ボリュームが増える件の説明と、devbase_vscode_<project>_1 -> /home/ubuntu/.vscode-serverのマウントの確かめ方)が残っている。この作業の触る範囲の外のため直していない。別の課題か、この PR の範囲を広げて直すbin/に版が溜まる(1 本分)モード: standard / 通した工程: 実装 → 完了判定 → Pull Request
🤖 Generated with Claude Code