calypso.dispatchers.orchestrator.executor.ssh module
- class calypso.dispatchers.orchestrator.executor.ssh.SSHClient(host, username, port=22, password=None, key_filename=None)
Bases:
object
SSHClient class for managing SSH connections and file transfers.
- Parameters:
- connect()
Establishes an SSH connection and SFTP session.
- disconnect()
Closes the SSH and SFTP connections.
- download_file(remote_file, local_file)
Downloads a file from the SSH server.
- execute_command(command, timeout=3600)
Executes a command on the SSH server.
- file_exist(filename)
- files_exist(remote_path, filenames)
Checks if files exist on the SSH server.
- get_file_obj(remote_file_name, mode='r')
- mkdir(remote_path)
Creates a directory on the SSH server.
- Parameters:
remote_path (str) – Path to the remote directory.
- read_file(remote_file_name)
- remote_rglob(remote_dir, pattern)
- upload_file(local_file, remote_file)
Uploads a file to the SSH server.
- write_file(data, remote_file_name)
- class calypso.dispatchers.orchestrator.executor.ssh.SSHExecutor(name, host=None, port=None, username=None, password=None, key_filename=None, **kwargs)
Bases:
BaseExecutor
SSHExecutor class for managing job execution and file transfers over SSH.
- Parameters:
- download_job(job: Job)
Downloads job files from the SSH server.
- Parameters:
job (dict) – Dictionary containing job details.
- execute(command, timeout=3600, log_file=None)
Executes a command on the SSH server.
- files_exist(base_path, filenames, remote=True)
- locally_files_exist(base_path, filenames)
Checks if files exist locally.
- locally_rglob(remote_dir, pattern)
- rglob(remote_dir, pattern, remote=True)