-
Notifications
You must be signed in to change notification settings - Fork 7
fix: stop passing --kernel-build-id when the image derives it #2791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -307,6 +307,8 @@ class FeaturesFlags: | |
| ssd_proxy_includes_dpdk_memory: Union[bool, int] = 9 | ||
| # flags 10, 11 are not used by the operator | ||
| weka_manages_non_ionode_affinity: Union[bool, int] = 12 | ||
| # flags 13, 14 are not used by the operator | ||
| auto_build_ids: Union[bool, int] = 15 | ||
|
|
||
| def __init__(self, b64_flags: Optional[str]) -> None: | ||
| active: Set[int] = set(parse_feature_bitmap(b64_flags or "")) | ||
|
|
@@ -1513,10 +1515,22 @@ class ReleaseSpec: | |
|
|
||
|
|
||
| async def get_release_spec() -> ReleaseSpec: | ||
| release_dir = "/opt/weka/dist/release" | ||
| files = os.listdir(release_dir) | ||
| assert len(files) == 1, Exception(f"Expected one release spec file, found: {files}") | ||
| spec_file_path = os.path.join(release_dir, files[0]) | ||
| # same candidates as get_weka_version: in pods that stage the target version the | ||
| # local release dir is absent, and the shared copy is the one describing the | ||
| # version actually being installed | ||
| release_dirs = ["/opt/weka/dist/release", "/shared-weka-version/opt-weka/dist/release"] | ||
| spec_file_path = None | ||
| for release_dir in release_dirs: | ||
| if not os.path.isdir(release_dir): | ||
| continue | ||
| files = os.listdir(release_dir) | ||
| if not files: | ||
| continue | ||
| assert len(files) == 1, Exception(f"Expected one release spec file, found: {files}") | ||
| spec_file_path = os.path.join(release_dir, files[0]) | ||
| break | ||
| if spec_file_path is None: | ||
| raise Exception(f"No release spec found in any of: {release_dirs}") | ||
|
|
||
| with open(spec_file_path, 'r') as f: | ||
| data = json.load(f) | ||
|
|
@@ -1616,7 +1630,10 @@ def should_skip_igb_uio(): | |
| elif is_google_cos(): | ||
| kernelBuildIdArg = f"--kernel-build-id {OS_BUILD_ID}" | ||
| elif is_ubuntu_24() and weka_dist_service(): | ||
| kernelBuildIdArg = f"--kernel-build-id {UBUNTU24_BUILD_ID}" | ||
| # weka derives the build id itself when AutoBuildIds is set | ||
| feature_flags = await get_feature_flags() | ||
| if not feature_flags.auto_build_ids: | ||
| kernelBuildIdArg = f"--kernel-build-id {UBUNTU24_BUILD_ID}" | ||
|
Comment on lines
+1633
to
+1636
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The lazy placement resolves my earlier concern — The one thing still open is the asymmetry with the override, which this PR's own rationale now reaches: on an |
||
|
|
||
| # When TARGET_IMAGE_NAME differs from IMAGE_NAME, weka files are copied | ||
| # from cluster image to /shared-weka-version/ via init container | ||
|
|
@@ -4370,9 +4387,11 @@ async def main(): | |
| raise Exception(f"Failed to get weka version {version}: {stderr}") | ||
| logging.info(f"Successfully got weka version {version}") | ||
|
|
||
| build_feature_flags = await get_feature_flags() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Placement here is right — it's after the One residual risk: this assumes try:
build_feature_flags = await get_feature_flags()
except Exception as e:
logging.warning(f"Could not read feature flags, assuming no auto build ids: {e}")
build_feature_flags = FeaturesFlags(None)The description says this was verified on Ubuntu 24.04 and RHEL 9.7, so this is about the untested-image case, not the happy path. |
||
| kernel_build_id = "" | ||
| kernel_arg = "" | ||
| if is_ubuntu_24(): | ||
| if is_ubuntu_24() and not build_feature_flags.auto_build_ids: | ||
| # weka derives the build id itself when AutoBuildIds is set | ||
| kernel_build_id = UBUNTU24_BUILD_ID | ||
| kernel_arg = f"--kernel-build-id {kernel_build_id}" | ||
| stdout, stderr, ec = await run_command(f"weka driver pack --without-agent --version {version} {kernel_arg}") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The operator-side mirror of this bitmap,
domain.FeatureFlagsininternal/pkg/domain/feature_flags.go, doesn't get the new flag. Not a bug —json.Unmarshalignores the extraauto_build_idskey thatwrite_feature_flags_json()now emits — but the two lists are maintained in lockstep today (they even carry the same "flags N are not used by the operator" comments), and the operator already resolves flags per-image viaservices.GetFeatureFlags. Adding the field keeps parity and leaves the door open for the operator to make this decision itself, which would side-step the loader having to find a release spec at all.