175 lines
5.5 KiB
Markdown
175 lines
5.5 KiB
Markdown
# Component Clarity / Dependency Findings
|
||
|
||
## 1. 設定契約ミスマッチ(IAM endpoint 系)
|
||
|
||
以下は「Nix module で値を注入しても、バイナリ側でそのキーを読まない」ケースです。
|
||
結果として IAM 接続先が意図値にならず、`127.0.0.1:50051` 既定に落ちる箇所が複数あります。
|
||
|
||
### 1-1. PrismNet
|
||
|
||
- module 側:
|
||
- `IAM_ENDPOINT` を設定
|
||
- `nix/modules/prismnet.nix:105`
|
||
- binary 側:
|
||
- `config.auth.iam_server_addr` を使用
|
||
- `prismnet/crates/prismnet-server/src/config.rs:83-89`
|
||
- `prismnet/crates/prismnet-server/src/main.rs:215-222`
|
||
- `IAM_ENDPOINT` 読み取りは存在しない
|
||
|
||
### 1-2. PlasmaVMC
|
||
|
||
- module 側:
|
||
- `IAM_ENDPOINT` を設定
|
||
- `nix/modules/plasmavmc.nix:97`
|
||
- binary 側:
|
||
- `config.auth.iam_server_addr` を使用
|
||
- `plasmavmc/crates/plasmavmc-server/src/config.rs:54-61`
|
||
- `plasmavmc/crates/plasmavmc-server/src/main.rs:137-141`
|
||
- `IAM_ENDPOINT` 読み取りは存在しない
|
||
|
||
### 1-3. FiberLB
|
||
|
||
- module 側:
|
||
- `FIBERLB_IAM_ADDR` を設定
|
||
- `nix/modules/fiberlb.nix:123`
|
||
- binary 側:
|
||
- IAM 接続先は `config.auth.iam_server_addr`
|
||
- `fiberlb/crates/fiberlb-server/src/config.rs:78-85`
|
||
- `fiberlb/crates/fiberlb-server/src/main.rs:180-184`
|
||
- CLI/env 引数に `FIBERLB_IAM_ADDR` はない(Args定義に未存在)
|
||
|
||
### 1-4. LightningStor
|
||
|
||
- module 側:
|
||
- `LIGHTNINGSTOR_IAM_ADDR` を設定
|
||
- `nix/modules/lightningstor.nix:128`
|
||
- binary 側:
|
||
- IAM 接続先は `config.auth.iam_server_addr`
|
||
- `lightningstor/crates/lightningstor-server/src/config.rs:84-91`
|
||
- `lightningstor/crates/lightningstor-server/src/main.rs:196-200`
|
||
- CLI/env 引数に `LIGHTNINGSTOR_IAM_ADDR` はない
|
||
|
||
### 1-5. FlashDNS
|
||
|
||
- module 側:
|
||
- IAM の option 自体がない(`iamAddr` なし)
|
||
- `nix/modules/flashdns.nix:7-79`
|
||
- binary 側:
|
||
- `auth.iam_server_addr` 既定 `127.0.0.1:50051`
|
||
- `flashdns/crates/flashdns-server/src/config.rs:67-74`
|
||
- `flashdns/crates/flashdns-server/src/main.rs:196-200`
|
||
- config-rs は `FLASHDNS` prefix + `__` separator
|
||
- `flashdns/crates/flashdns-server/src/main.rs:84-86`
|
||
|
||
### 1-6. CreditService
|
||
|
||
- module 側:
|
||
- `CREDITSERVICE_IAM_ADDR` を設定しない
|
||
- `nix/modules/creditservice.nix:80-96`
|
||
- binary 側:
|
||
- `CREDITSERVICE_IAM_ADDR` 既定 `127.0.0.1:50051`
|
||
- `creditservice/crates/creditservice-server/src/main.rs:61`
|
||
- `creditservice/crates/creditservice-server/src/main.rs:119-123`
|
||
|
||
補足:
|
||
|
||
- test-cluster の IAM は `50080` を採用している。
|
||
- `nix/test-cluster/node01.nix:48-52`
|
||
- このため上記ミスマッチは、実運用前に通信失敗へ直結しやすい。
|
||
|
||
---
|
||
|
||
## 2. 設定契約ミスマッチ(非 IAM)
|
||
|
||
### 2-1. FiberLB の PrismNet 参照
|
||
|
||
- module 側:
|
||
- `FIBERLB_PRISMNET_ADDR` を設定
|
||
- `nix/modules/fiberlb.nix:127`
|
||
- binary 側:
|
||
- `FIBERLB_PRISMNET_ADDR` 消費実装なし
|
||
- `rg` で `fiberlb/crates/fiberlb-server/src` に該当なし
|
||
|
||
### 2-2. FlashDNS の PrismNet 参照
|
||
|
||
- module 側:
|
||
- `PRISMNET_ENDPOINT` を設定
|
||
- `nix/modules/flashdns.nix:111`
|
||
- binary 側:
|
||
- `PRISMNET_ENDPOINT` 消費実装なし
|
||
- `rg` で `flashdns/crates/flashdns-server/src` に該当なし
|
||
|
||
### 2-3. FlareDB の IAM 参照
|
||
|
||
- module 側:
|
||
- `FLAREDB_IAM_ENDPOINT` を設定
|
||
- `nix/modules/flaredb.nix:108`
|
||
- binary 側:
|
||
- `flaredb-server` に IAM 設定処理なし(該当キー/型なし)
|
||
- `flaredb/crates/flaredb-server/src/config/mod.rs:79-103`
|
||
|
||
---
|
||
|
||
## 3. 依存関係宣言と実装の乖離
|
||
|
||
### 3-1. NightLight の gRPC ポート宣言と実行実態
|
||
|
||
- module 側:
|
||
- `grpcPort` option を持ち env 注入している
|
||
- `nix/modules/nightlight.nix:16-20`
|
||
- `nix/modules/nightlight.nix:90`
|
||
- 実装側:
|
||
- 現状 `main.rs` は HTTP サーバのみ起動 (`axum::serve`)
|
||
- `nightlight/crates/nightlight-server/src/main.rs:87`
|
||
- `nightlight/crates/nightlight-server/src/main.rs:102`
|
||
|
||
影響:
|
||
|
||
- module 利用者は gRPC も提供されると誤認しやすい。
|
||
|
||
---
|
||
|
||
## 4. first-boot automation の構造明確性
|
||
|
||
- module が helper script path を定義するが、実際に未使用:
|
||
- `nix/modules/first-boot-automation.nix:7-10`
|
||
- `services.first-boot-automation.enable` を有効化する明示設定が見当たらない:
|
||
- `rg -n "first-boot-automation\\.enable"` -> no explicit match
|
||
- それでも default imports には含まれている:
|
||
- `nix/modules/default.nix:15`
|
||
|
||
影響:
|
||
|
||
- 「有効運用中の機構なのか、未接続機構なのか」が判別しにくい。
|
||
|
||
---
|
||
|
||
## 5. テストクラスタでのコンポーネント組み合わせ破綻
|
||
|
||
- `node06` (gateway) は `creditservice` を有効化するが、`flaredb` module を import しない。
|
||
- `nix/test-cluster/node06.nix:8-13`
|
||
- `nix/test-cluster/node06.nix:70-74`
|
||
- `creditservice` module は `config.services.flaredb` を前提に評価する。
|
||
- `nix/modules/creditservice.nix:5`
|
||
|
||
実証:
|
||
|
||
- `nix eval ./nix/test-cluster#nixosConfigurations.node06...`
|
||
- `error: attribute 'flaredb' missing`
|
||
|
||
---
|
||
|
||
## 6. 役割と境界の明確化が必要な領域
|
||
|
||
- Deployer:
|
||
- 実装(`deployer/*`)は存在するが、Nix 配線が薄く運用境界が不明瞭。
|
||
- Cluster config generator:
|
||
- `plasmacloud-cluster` と `nix-nos` の責務境界が重複。
|
||
- first-boot:
|
||
- 生成される `cluster-config` 契約と join 実装の API 契約が一致していない。
|
||
|
||
推奨:
|
||
|
||
- サービスごとに「module contract(注入キー)/binary contract(消費キー)」を1つの表に集約し、
|
||
CIで diff 検証(未使用キー、未注入キー)を自動検知する。
|
||
|