romtools.hpc.components.file_manager#
File operations for the dispatchers, in local and remote flavors.
Classes
|
Reads and writes files on whichever machine a dispatcher runs work on. |
|
Operates directly on the local filesystem. |
|
Operates on the remote filesystem over an SSH connection. |
- class romtools.hpc.components.file_manager.BaseFileManager(*, config=None, logger=None)[source]#
Bases:
Component,ABCReads and writes files on whichever machine a dispatcher runs work on.
- Parameters:
config (dict)
logger (Logger)
- class romtools.hpc.components.file_manager.LocalFileManager(*, config=None, logger=None)[source]#
Bases:
BaseFileManagerOperates directly on the local filesystem.
- Parameters:
config (dict)
logger (Logger)
- get(remote_path, local_path)[source]#
Local ‘get’ is just a copy from remote_path to local_path.
- Parameters:
remote_path (str)
local_path (str)
- Return type:
None
- np_savez(path, **arrays)[source]#
Write multiple arrays to a .npz file. The .npz file is written directly to the specified path.
- Parameters:
path (str)
- Return type:
None
- put(local_path, remote_path)[source]#
Local ‘put’ is just a copy from local_path to remote_path.
- Parameters:
local_path (str)
remote_path (str)
- Return type:
None
- read_text(path)[source]#
Return the contents of a text file.
- Parameters:
path (str)
- Return type:
str
- class romtools.hpc.components.file_manager.RemoteFileManager(connection, *, config=None, logger=None)[source]#
Bases:
BaseFileManagerOperates on the remote filesystem over an SSH connection.
Relative paths are resolved against the configured remote root.
- Parameters:
connection (Connection) – An established Connection to the remote host
config (dict) – The dispatcher’s configuration dictionary
logger (Logger) – An instance of the Logger class for logging
- np_savez(path, **arrays)[source]#
Write multiple arrays to a .npz file, staged locally then uploaded.
- Parameters:
path (str)
- Return type:
None
- read_text(path)[source]#
Return the contents of a remote text file.
- Parameters:
path (str)
- Return type:
str