-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tftp deployment on BareMetal platform #3422
base: main
Are you sure you want to change the base?
Conversation
5bbbc1a
to
985e3a4
Compare
|
||
def __post_init__(self, *args: Any, **kwargs: Any) -> None: | ||
if self.connection: | ||
add_secret(self.connection.username, PATTERN_HEADTAIL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
username is not a secret.
else: | ||
self._log.debug("no copied source path specified, skip copy") | ||
|
||
def _process_cluster_elements(self, environment: Environment, log: Logger) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call it like _predeploy_environment
. It should be clearer than "process".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change is done, thanks
@@ -24,6 +26,28 @@ def __init__(self, runbook: BuildSchema) -> None: | |||
def type_schema(cls) -> Type[schema.TypedSchema]: | |||
return BuildSchema | |||
|
|||
@classmethod | |||
def find_matched_files( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move it to a private function in this file.
def copy(self, sources_path: List[Path], files_map: List[FileSchema]) -> None: | ||
assert self.pxe_runbook.connection, "The build server is not specified" | ||
|
||
server_address = self.pxe_runbook.connection.address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a lisa remotenode, and use the remote_copy tool to copy.
return match_files | ||
|
||
try: | ||
sftp.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above comment, it should use remote_copy tool. But the close pattern should like below to avoid leak resource.
try:
try:
transport = paramiko.Transport((server_address, server_port))
transport.connect(
username=server_username,
password=server_password,
)
except Exception as ex:
self._log.exception(
"failed to connect to {server_address}:{server_port}",
exc_info=ex,
)
...
final:
try:
if sftp:
sftp.close()
if transport:
transport.close()
except Exception as ex:
self._log.exception(
"failed to close the connection",
exc_info=ex,
)
985e3a4
to
733b52a
Compare
Added SOC support on BareMetal platform