Skip to content

Commit

Permalink
BM refactorring: add node initialize and create feature before deploy.
Browse files Browse the repository at this point in the history
1. PXE Create SerialConsole when deploying to capture all logs, So it needs to create Featues before it's used.
2. node.initialize is the right way to "initialize" a node, make it functional.
  • Loading branch information
squirrelsc committed Dec 31, 2024
1 parent 7719280 commit 6c4a50a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lisa/sut_orchestrator/baremetal/platform_.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,8 @@ def _deploy_environment(self, environment: Environment, log: Logger) -> None:

node_context.client.connection.address = ip_getter.get_ip()

assert isinstance(node, RemoteNode), f"actual: {type(node)}"
node.name = f"node_{index}"
try_connect(
node_context.client.connection.get_connection_info(is_public=False)
)
node.initialize()

self._log.debug(f"deploy environment {environment.name} successfully")

Expand Down Expand Up @@ -174,13 +171,13 @@ def _predeploy_environment(self, environment: Environment, log: Logger) -> None:
key_file = key_loader.load_key(self.local_artifacts_path)

assert environment.runbook.nodes_requirement, "no node is specified"
for node_space in environment.runbook.nodes_requirement:
for index, node_space in enumerate(environment.runbook.nodes_requirement):
assert isinstance(
node_space, schema.NodeSpace
), f"actual: {type(node_space)}"
environment.create_node_from_requirement(node_space)
node = environment.create_node_from_requirement(node_space)

for index, node in enumerate(environment.nodes.list()):
node.features = feature.Features(node, self)
node_context = get_node_context(node)

if (
Expand Down

0 comments on commit 6c4a50a

Please sign in to comment.