Product-Config 2.0
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- rust
- Área
- backend-api-design
Línea de trabajo
Comienza con la implementación existente de product-config y la propuesta relacionada stackabletech/issues#198; después, compáralas con los ejemplos de ProductConfig derive y ProductConfigFragment de este Issue. Se considera terminado cuando la precedencia tipada, los valores predeterminados, los errores de validación y el enfoque de serialización diferida estén suficientemente especificados para el reconciler y la jerarquía de overrides.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 167
- Forks
- 19
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 9
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stackabletech/operator-rs
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
stackabletech/operator-rs#1273 · 1 comentario ·
-
Improve label mechanisms Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
stackabletech/operator-rs#1077 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
stackabletech/operator-rs#1063 ·
-
stackable-versioned: Require inner module definitions to have the same visibility as the parent Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
stackabletech/operator-rs#1028 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
stackabletech/operator-rs#965 ·
Todos los issues de stackabletech/operator-rs
Issues similares
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
n0-computer/iroh#4550 ·
-
impl detach for native Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
paritytech/zombienet-sdk#591 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
farion1231/cc-switch#7638 · 1 comentario ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100