Skip to content

Commit

Permalink
Updated support for Pxe cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
paull committed Feb 4, 2025
1 parent 7f14064 commit d85591f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 6 additions & 0 deletions lisa/sut_orchestrator/baremetal/cluster/pxe.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def write(self, data: str) -> None:
self._process.input(f"{data}\n")

def _get_console_log(self, saved_path: Optional[Path]) -> bytes:
self._process.wait_output(
"",
timeout=1,
error_on_missing=False,
interval=0.1,
)
return self._process.log_buffer.getvalue().encode("utf-8")

def _initialize(self, *args: Any, **kwargs: Any) -> None:
Expand Down
18 changes: 10 additions & 8 deletions lisa/sut_orchestrator/baremetal/readychecker.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

from logging import Logger
import os
from dataclasses import dataclass
from typing import Type, cast
from typing import Any, Type, cast

import requests
from dataclasses_json import dataclass_json
Expand All @@ -22,10 +23,11 @@ class ReadyChecker(subclasses.BaseClassWithRunbookMixin, InitializableMixin):
def __init__(
self,
runbook: ReadyCheckerSchema,
parent_logger: Logger,
) -> None:
super().__init__(runbook=runbook)
self.ready_checker_runbook: ReadyCheckerSchema = self.runbook
self._log = get_logger("ready_checker", self.__class__.__name__)
self._log = get_logger("ready_checker", self.__class__.__name__, parent=parent_logger)

@classmethod
def type_schema(cls) -> Type[schema.TypedSchema]:
Expand All @@ -48,10 +50,10 @@ class FileSingleChecker(ReadyChecker):
def __init__(
self,
runbook: FileSingleSchema,
**kwargs: Any,
) -> None:
super().__init__(runbook=runbook)
super().__init__(runbook=runbook, **kwargs)
self.file_single_runbook: FileSingleSchema = self.runbook
self._log = get_logger("file_single", self.__class__.__name__)

@classmethod
def type_name(cls) -> str:
Expand Down Expand Up @@ -86,10 +88,10 @@ class SshChecker(ReadyChecker):
def __init__(
self,
runbook: ReadyCheckerSchema,
**kwargs: Any,
) -> None:
super().__init__(runbook=runbook)
super().__init__(runbook=runbook, **kwargs)
self.ssh_runbook: ReadyCheckerSchema = self.runbook
self._log = get_logger("ssh", self.__class__.__name__)

@classmethod
def type_name(cls) -> str:
Expand Down Expand Up @@ -135,10 +137,10 @@ class HttpChecker(ReadyChecker):
def __init__(
self,
runbook: HttpSchema,
**kwargs: Any,
) -> None:
super().__init__(runbook=runbook)
super().__init__(runbook=runbook, **kwargs)
self.http_check_runbook: HttpSchema = self.runbook
self._log = get_logger("http", self.__class__.__name__)

@classmethod
def type_name(cls) -> str:
Expand Down

0 comments on commit d85591f

Please sign in to comment.