Skip to content

Commit 24d1df2

Browse files
khsraliagoscinski
authored andcommitted
Transport: support OpenSSH (aiidateam#6795)
fix conflicts fix tests fix copy function
1 parent 0e74a40 commit 24d1df2

File tree

10 files changed

+876
-274
lines changed

10 files changed

+876
-274
lines changed

src/aiida/engine/daemon/execmanager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from aiida.orm.utils.log import get_dblogger_extra
3535
from aiida.repository.common import FileType
3636
from aiida.schedulers.datastructures import JobState
37+
from aiida.transports import has_magic
3738

3839
if TYPE_CHECKING:
3940
from aiida.transports import Transport
@@ -465,7 +466,7 @@ async def stash_calculation(calculation: CalcJobNode, transport: Transport) -> N
465466
target_basepath = target_base / uuid[:2] / uuid[2:4] / uuid[4:]
466467

467468
for source_filename in source_list:
468-
if transport.has_magic(source_filename):
469+
if has_magic(source_filename):
469470
copy_instructions = []
470471
for globbed_filename in await transport.glob_async(source_basepath / source_filename):
471472
target_filepath = target_basepath / Path(globbed_filename).relative_to(source_basepath)
@@ -679,7 +680,7 @@ async def retrieve_files_from_list(
679680
if isinstance(item, (list, tuple)):
680681
tmp_rname, tmp_lname, depth = item
681682
# if there are more than one file I do something differently
682-
if transport.has_magic(tmp_rname):
683+
if has_magic(tmp_rname):
683684
remote_names = await transport.glob_async(workdir.joinpath(tmp_rname))
684685
local_names = []
685686
for rem in remote_names:
@@ -702,7 +703,7 @@ async def retrieve_files_from_list(
702703
else:
703704
abs_item = item if item.startswith('/') else str(workdir.joinpath(item))
704705

705-
if transport.has_magic(abs_item):
706+
if has_magic(abs_item):
706707
remote_names = await transport.glob_async(abs_item)
707708
local_names = [os.path.split(rem)[1] for rem in remote_names]
708709
else:

src/aiida/schedulers/plugins/bash.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def submit_job(self, working_directory: str, filename: str) -> str | ExitCode:
3232
result = self.transport.exec_command_wait(
3333
self._get_submit_command(escape_for_bash(filename)), workdir=working_directory
3434
)
35+
3536
return self._parse_submit_output(*result)
3637

3738
def get_jobs(

src/aiida/tools/pytest_fixtures/orm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def factory(label: str | None = None, configure: bool = True) -> 'Computer':
216216
computer = aiida_computer(label=label, hostname='localhost', transport_type='core.ssh_async')
217217

218218
if configure:
219-
computer.configure()
219+
computer.configure(backend='asyncssh')
220220

221221
return computer
222222

src/aiida/transports/plugins/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212

1313
# fmt: off
1414

15+
from .async_backend import *
1516
from .ssh import *
1617

1718
__all__ = (
19+
'AsyncSSH',
20+
'OpenSSH',
1821
'SshTransport',
1922
'convert_to_bool',
2023
'parse_sshconfig',

0 commit comments

Comments
 (0)