Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dvc/fs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from urllib.parse import urlparse

from dvc_http import HTTPFileSystem, HTTPSFileSystem # noqa: F401
from dvc_ssh import DEFAULT_PORT as DEFAULT_SSH_PORT # noqa: F401
from dvc_ssh import SSHFileSystem # noqa: F401

# pylint: disable=unused-import
from dvc_objects.fs import utils # noqa: F401
Expand Down
3 changes: 2 additions & 1 deletion dvc/machine/backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from typing import TYPE_CHECKING, Iterator, Optional

if TYPE_CHECKING:
from dvc.fs import SSHFileSystem
from dvc_ssh import SSHFileSystem

from dvc.types import StrPath


Expand Down
5 changes: 3 additions & 2 deletions dvc/machine/backend/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from functools import partial, partialmethod
from typing import TYPE_CHECKING, Iterator, Optional

from dvc_ssh import DEFAULT_PORT, SSHFileSystem
Copy link
Contributor Author

@efiop efiop Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we don't even need dvc_ssh here, and could use sshfs directly. CC @pmrowla

Keeping as is for now, but this also means that we have (and had) a hidden dependency on sshfs (and now on dvc_ssh).


from dvc.exceptions import DvcException
from dvc.fs import DEFAULT_SSH_PORT, SSHFileSystem
from dvc.utils.fs import makedirs

from .base import BaseMachineBackend
Expand Down Expand Up @@ -68,7 +69,7 @@ def get_executor_kwargs(self, name: str, **config) -> dict:
resource = tpi.default_resource(name)
return {
"host": resource["instance_ip"],
"port": DEFAULT_SSH_PORT,
"port": DEFAULT_PORT,
"username": "ubuntu",
"fs_factory": partial(_sshfs, dict(resource)),
}
Expand Down
3 changes: 1 addition & 2 deletions dvc/repo/experiments/executor/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
from contextlib import contextmanager
from typing import TYPE_CHECKING, Callable, Iterable, Optional

from dvc_ssh import SSHFileSystem
from funcy import first

from dvc.fs import SSHFileSystem

from ..refs import (
EXEC_BRANCH,
EXEC_CHECKPOINT,
Expand Down
2 changes: 1 addition & 1 deletion tests/func/experiments/executor/test_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from urllib.parse import urlparse

import pytest
from dvc_ssh import SSHFileSystem
from dvc_ssh.tests.cloud import TEST_SSH_KEY_PATH, TEST_SSH_USER

from dvc.fs import SSHFileSystem
from dvc.repo.experiments.executor.base import ExecutorInfo, ExecutorResult
from dvc.repo.experiments.executor.ssh import SSHExecutor
from dvc.repo.experiments.refs import EXEC_HEAD, EXEC_MERGE
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/fs/test_fs.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import pytest
from dvc_http import HTTPFileSystem, HTTPSFileSystem
from dvc_ssh import SSHFileSystem

from dvc.config import RemoteNotFoundError
from dvc.fs import (
HDFSFileSystem,
HTTPFileSystem,
HTTPSFileSystem,
LocalFileSystem,
S3FileSystem,
SSHFileSystem,
get_fs_cls,
get_fs_config,
)
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/fs/test_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from unittest.mock import mock_open, patch

import pytest

from dvc.fs import DEFAULT_SSH_PORT, SSHFileSystem
from dvc_ssh import DEFAULT_PORT, SSHFileSystem


def test_get_kwargs_from_urls():
Expand Down Expand Up @@ -99,7 +98,7 @@ def test_ssh_user(mock_file, config, expected_user):
[
({"host": "example.com"}, 1234),
({"host": "example.com", "port": 4321}, 4321),
({"host": "not_in_ssh_config.com"}, DEFAULT_SSH_PORT),
({"host": "not_in_ssh_config.com"}, DEFAULT_PORT),
({"host": "not_in_ssh_config.com", "port": 2222}, 2222),
],
)
Expand Down