feat(spark): check control plane version ConfigMap (#221) #846
All Vouch review confidence checks passed
Residual risk 0.40 = Change Risk (0.73) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 386 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.073
Real PR Conversation Timeline
1 comments
"Review active on #846"
general
weight: 0.35
tariq-hasan
What this PR does / why we need it
Implements control-plane version check during Spark backend/client initialization, validating the
kubeflow-spark-publicConfigMap in the control-plane namespace.To support modular namespace overrides across Kubeflow components, this PR introduces a shared
get_component_namespaceutility inkubeflow/common. The helper resolves namespaces by prioritizing component-specific variables (KUBEFLOW_SPARK_NAMESPACE/KUBEFLOW_TRAINER_NAMESPACE), falling back to the deprecatedKUBEFLOW_SYSTEM_NAMESPACEwith aUserWarning, and defaulting tokubeflow-system. Both Spark and Trainer backends have been aligned to this shared resolution pattern.Fixes #221
Changes
kubeflow/commonget_component_namespace(component_env_var: str, default: str = "kubeflow-system") -> strinkubeflow/common/utils.pywith fallback and deprecation warning handling.kubeflow/common/utils_test.pycovering precedence hierarchy, environment overrides, and warning assertions.kubeflow/sparkverify_backend()toKubernetesBackendinkubeflow/spark/backends/kubernetes/backend.pyand invoked it during backend__init__.kubeflow-spark-publicConfigMap forkubeflow_spark_versionwithout blocking initialization or raising unhandled exceptions on read failure.docs/source/spark/index.rstto documentKUBEFLOW_SPARK_NAMESPACEand fallback order.kubeflow/spark/backends/kubernetes/backend_test.pyenforcing strict mock assertions (assert_called_withfor name and namespace) and verifying env-var wiring.kubeflow/trainerverify_backend()inkubeflow/trainer/backends/kubernetes/backend.pyto usecommon_utils.get_component_namespacewithKUBEFLOW_TRAINER_NAMESPACE_ENV_VAR.test_verify_backend_respects_trainer_namespace_env_varinkubeflow/trainer/backends/kubernetes/backend_test.pyto assert custom trainer namespace resolution and mock arguments.Verification
pre-commit run --all-files).<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Spark and Trainer control-plane namespaces can now be configured independently. If a component-specific namespace is not set, the system namespace is used; otherwise, the default is
kubeflow-system.Spark checks for installed operator version metadata in the configured control-plane namespace. If the metadata cannot be read, a warning is logged.
Documentation
* Added guidance on Spark version discovery and ConfigMap placement, including how to select a custom operator namespace.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->