diff --git a/charts/weka-operator/resources/weka_runtime.py b/charts/weka-operator/resources/weka_runtime.py index 58839a2f3..889c7670e 100644 --- a/charts/weka-operator/resources/weka_runtime.py +++ b/charts/weka-operator/resources/weka_runtime.py @@ -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}" # 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() 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}") diff --git a/internal/pkg/domain/feature_flags.go b/internal/pkg/domain/feature_flags.go index f0136f535..9899bf8e6 100644 --- a/internal/pkg/domain/feature_flags.go +++ b/internal/pkg/domain/feature_flags.go @@ -16,4 +16,6 @@ type FeatureFlags struct { SsdProxyIncludesDpdkMemory bool `json:"ssd_proxy_includes_dpdk_memory"` // 9 // flags 10, 11 are not used by the operator WekaManagesNonIonodeAffinity bool `json:"weka_manages_non_ionode_affinity"` // 12 + // flags 13, 14 are not used by the operator + AutoBuildIds bool `json:"auto_build_ids"` // 15 }