Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/schedule-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)" \
Expand All @@ -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:
Expand Down
16 changes: 13 additions & 3 deletions ic-os/dev-tools/bare_metal_deployment/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -431,7 +431,17 @@ 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:
Expand Down Expand Up @@ -783,7 +793,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
Expand Down
4 changes: 2 additions & 2 deletions ic-os/dev-tools/bare_metal_deployment/tools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading