Product-Config 2.0
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- rust
調査の方向性
既存の product-config 実装と関連する stackabletech/issues#198 の提案から始め、その後、この Issue にある ProductConfig derive と ProductConfigFragment の例と比較します。reconciler と override 階層に対して、型付きの優先順位、デフォルト値、バリデーションエラー、遅延シリアライゼーションのアプローチが十分に仕様化されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The current product-config architecture has a few issues that we keep bumping into:
- It's confusing to understand what values come from where
- Validation error messages are produced in the context of the product's configuration format, which is confusing to users who configure it in term of our
ProductClusterabstraction - PC only works on unstructured key/value maps that correspond directly to the product's configuration structure, making it difficult to feed config back from PC to the operator itself (for example: port values need to match between the configuration's listen option and the generated discovery configmaps)
- This often leads us to bypass P-C for these options
- We have no solid way to get back typed Rust values when using the
Configurationmechanism to allow fields to be overridden across theProductCluster/Role/RoleGrouphierarchy (without implementing the same precedence mechanism in the operator itself)
- There is a lot of repetitive boilerplate when linking Rust structs up to the PC machinery
To work this out I propose reorient PC so that the Rust structs are the source of truth for the structure, and so that precedence rules and validations are applied while still working with typed Rust values. We would still need to serialize to the product's native configuration format (and apply overrides to that) eventually, but this would be delayed until it is required.
From the definition side, the API is currently expected to look something like this:
#[derive(ProductConfig)]
struct ZookeeperConfig {
#[pc(default = 1000)]
#[pc(file("hdfs-site.xml", "tick.limit.ms"))]
tick_limit_ms: i32,
}
This would expand to something like the following:
struct ZookeeperConfigFragment {
tick_limit_ms: Option<i32>,
}
enum ZookeeperConfigValidationError {
NoTickLimitMs,
}
impl ProductConfigFragment for ZookeeperConfigFragment {
type Validated = ZookeeperConfig;
type ValidationError = ZookeeperConfigValidationError;
fn merge(self, other: &Self) -> Self {
Self {
tick_limit_ms: self.tick_limit_ms.or_else(other.tick_limit_ms),
...
}
}
fn default() -> Self {
Self {
tick_limit_ms: Some(1000),
}
}
fn validate(self) -> Result<ZookeeperConfig, ZookeeperConfigValidationError> {
match self {
ZookeeperConfigFragment { tick_limit_ms: Some(tick_limit_ms) } => Ok(ZookeeperConfig {tick_limit_ms}),
ZookeeperConfigFragment { tick_limit_ms: None, .. } => Err(ZookeeperConfigValidationError::NoTickLimitMs),
}
}
}
This would allow the reconciler to process already fully merged and validated ZookeeperConfig objects, while still preserving the flexibility of the override hierarchy.
Product-config YAMLs would be relegated to serving as progressive enhancements and overrides to the metadata. For example, this could be used to improve backwards compatibility with older product versions, or to supply more thorough documentation. The current proposal for these looks like this, but this part is still fairly up in the air:
mixins:
- appliesTo:
product:
- kafka
versionRange:
- product: ">=1.0.0"
properties:
- tick_limit_ms
apply:
description: |
The maximum allowed clock skew between cluster members
default: foo
This is a part of https://github.com/stackabletech/issues/issues/198.
- 主要言語
- Rust
- スター
- 167
- フォーク
- 19
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 9
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stackabletech/operator-rs のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
stackabletech/operator-rs#1273 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
stackabletech/operator-rs#1077 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
stackabletech/operator-rs#1063 ·
-
stackable-versioned: Require inner module definitions to have the same visibility as the parent オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
stackabletech/operator-rs#1028 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
stackabletech/operator-rs#965 ·
stackabletech/operator-rs の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
web-infra-dev/rspack#15847 ·