From a54ff4f6d6bd5a520d48a623a67ba743bcc2707a Mon Sep 17 00:00:00 2001 From: David Frank Date: Mon, 22 Jun 2026 19:06:32 +0200 Subject: [PATCH 1/2] fix: Fix nightly baremetal tests After upgrading Bazel to the latest version, the path `IdracRedfishSupport-0.0.8.data` was changed to `idracredfishsupport-0.0.8.data` and the scripts were no longer found. To be more flexible, the script now searches for the script under `*.data/scripts`. In addition, reuse the same bazel output base in all bazel tests in `Run Bazel Launch Bare Metal`. --- .github/workflows/schedule-daily.yml | 11 ++++++----- ic-os/dev-tools/bare_metal_deployment/deploy.py | 15 ++++++++++++--- ic-os/dev-tools/bare_metal_deployment/tools.bzl | 4 ++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/schedule-daily.yml b/.github/workflows/schedule-daily.yml index 2967915d04b9..371fd7d02256 100644 --- a/.github/workflows/schedule-daily.yml +++ b/.github/workflows/schedule-daily.yml @@ -89,10 +89,11 @@ jobs: echo "$ZH2_DLL01_INI_SECRET" > file1 echo "$ZH2_FILE_SHARE_KEY" > file2 && chmod 400 file2 + bazel_output_base=/var/tmp/bazel-output launch_bare_metal() { # shellcheck disable=SC2046,SC2086 - bazel --output_base=/var/tmp/bazel-output run \ + bazel --output_base="$bazel_output_base" run \ //ic-os/setupos/envs/dev:launch_bare_metal -- \ --config_path "$(realpath ./ic-os/dev-tools/bare_metal_deployment/zh2-dll01.yaml)" \ --ini_filename "$(realpath file1)" \ @@ -113,10 +114,10 @@ jobs: launch_bare_metal --check_hostos_metrics # Run SEV tests - bazel test //rs/tests/nested:guestos_upgrade_from_current_to_current_test_sev --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)" - bazel test //rs/tests/nested:guestos_upgrade_from_latest_release_to_current_sev --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)" - bazel test //rs/tests/nested:hostos_upgrade_from_latest_release_to_current_sev --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)" - bazel test //rs/tests/nested:sev_recovery --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)" + bazel --output_base="$bazel_output_base" test //rs/tests/nested:guestos_upgrade_from_current_to_current_test_sev --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)" + bazel --output_base="$bazel_output_base" test //rs/tests/nested:guestos_upgrade_from_latest_release_to_current_sev --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)" + bazel --output_base="$bazel_output_base" test //rs/tests/nested:hostos_upgrade_from_latest_release_to_current_sev --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)" + bazel --output_base="$bazel_output_base" test //rs/tests/nested:sev_recovery --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)" bazel clean env: diff --git a/ic-os/dev-tools/bare_metal_deployment/deploy.py b/ic-os/dev-tools/bare_metal_deployment/deploy.py index 5b19c413f3b0..84229a80ca08 100755 --- a/ic-os/dev-tools/bare_metal_deployment/deploy.py +++ b/ic-os/dev-tools/bare_metal_deployment/deploy.py @@ -116,7 +116,7 @@ class Args: parallel: int = 1 # Path to an idrac script, which we use to find the directory. If None, pip bin directory will be used. - idrac_script: Optional[str] = None + idrac_script_dir: Optional[str] = None # Disable progress bars if True ci_mode: bool = flag(default=False) @@ -431,7 +431,16 @@ def gen_failure(result: invoke.Result, bmc_info: BMCInfo) -> DeploymentError: def run_script(idrac_script_dir: Path, bmc_info: BMCInfo, script_and_args: str, permissive: bool = True) -> None: """Run a given script from the given bin dir and raise an exception if anything went wrong""" - command = f"{sys.executable} {idrac_script_dir}/{script_and_args}" + script_name, _, args = script_and_args.partition(" ") + + script_path = next(idrac_script_dir.glob(f"*.data/scripts/{script_name}"), None) + if not script_path: + raise FileNotFoundError( + f"Could not find '{script_name}' inside any *.data/scripts/ directory under {idrac_script_dir}") + + command = f"{sys.executable} {script_path} {args}".strip() + + log.info(f"Invoking subprocess command: {command}") result = invoke.run(command) if result and not result.ok: @@ -783,7 +792,7 @@ def main(): network_image_url: str = f"http://{args.file_share_url}/{args.file_share_image_filename}" log.info(f"Using network_image_url: {network_image_url}") - idrac_script_dir = Path(args.idrac_script).parent if args.idrac_script else Path(DEFAULT_IDRAC_SCRIPT_DIR) + idrac_script_dir = Path(args.idrac_script_dir) if args.idrac_script_dir else Path(DEFAULT_IDRAC_SCRIPT_DIR) log.info(f"Using idrac script dir: {idrac_script_dir}") ini_filename: str = args.ini_filename diff --git a/ic-os/dev-tools/bare_metal_deployment/tools.bzl b/ic-os/dev-tools/bare_metal_deployment/tools.bzl index 962fc47d4a0f..2e728bad383b 100644 --- a/ic-os/dev-tools/bare_metal_deployment/tools.bzl +++ b/ic-os/dev-tools/bare_metal_deployment/tools.bzl @@ -38,8 +38,8 @@ def launch_bare_metal(name, image_zst_file): "$(location " + image_zst_file + ")", "--deterministic_ips_tool", "$(location //rs/ic_os/networking/deterministic_ips:deterministic-ips)", - "--idrac_script", - "$(location //ic-os/dev-tools/bare_metal_deployment:redfish_scripts)" + "/IdracRedfishSupport-0.0.8.data/scripts/VirtualDiskExpansionREDFISH.py", + "--idrac_script_dir", + "$(location //ic-os/dev-tools/bare_metal_deployment:redfish_scripts)", "--benchmark_driver_script", "$(location //ic-os/dev-tools/bare_metal_deployment:benchmark_driver.sh)", "--benchmark_runner_script", From d6266a19fee50ab182ef6b2185fbcfca56f2bcd8 Mon Sep 17 00:00:00 2001 From: IDX GitHub Automation Date: Mon, 22 Jun 2026 17:13:09 +0000 Subject: [PATCH 2/2] Automatically fixing code for linting and formatting issues --- ic-os/dev-tools/bare_metal_deployment/deploy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ic-os/dev-tools/bare_metal_deployment/deploy.py b/ic-os/dev-tools/bare_metal_deployment/deploy.py index 84229a80ca08..143a851f5850 100755 --- a/ic-os/dev-tools/bare_metal_deployment/deploy.py +++ b/ic-os/dev-tools/bare_metal_deployment/deploy.py @@ -436,7 +436,8 @@ def run_script(idrac_script_dir: Path, bmc_info: BMCInfo, script_and_args: str, script_path = next(idrac_script_dir.glob(f"*.data/scripts/{script_name}"), None) if not script_path: raise FileNotFoundError( - f"Could not find '{script_name}' inside any *.data/scripts/ directory under {idrac_script_dir}") + f"Could not find '{script_name}' inside any *.data/scripts/ directory under {idrac_script_dir}" + ) command = f"{sys.executable} {script_path} {args}".strip()