Skip to content
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

ssh: support different backends (CLI ssh, paramiko, libssh, etc) #5395

Closed
jrollins opened this issue Feb 3, 2021 · 4 comments
Closed

ssh: support different backends (CLI ssh, paramiko, libssh, etc) #5395

jrollins opened this issue Feb 3, 2021 · 4 comments
Labels
fs: ssh Related to the SSH filesystem p2-medium Medium priority, should be done, but less important research

Comments

@jrollins
Copy link

jrollins commented Feb 3, 2021

I've been trying to test dvc with ssh remotes, but have yet to get it to work. I keep getting paramiko exceptions that seem to indicate that it (or dvc's usage of it) is unable to handle a lot of common ssh use cases (proxy commands, cert-authorities, etc.). I think paramiko's ssh model is fundamentally flawed, since it seems to require the user to re-implement a lot of the connection/authentication logic that the ssh CLI interface handles. That puts a huge burden on it's users, given how many use cases they'll have to try to figure out and support, and will lead to a support nightmare for products that use it, since you'll never be able to rely on the ssh CLI as a means for debugging.

I strongly suggest you try to abstract the remote backend to allow for swapping out the use of paramiko with direct calls to the ssh CLI. I think any backend abstraction will be time well spent since it will probably also allow you to support other remotes more easily.

I suggest looking at what git-annex is doing, since they support SSH remotes out-of-the-box with no issues whatsoever (even with my peculiar ssh config). They appear to just be exec'ing the ssh client directly (you can see the ssh commands in their verbose logging output). They also support a wide variety of special remotes.

Good luck!

Discord context: https://discord.com/channels/485586884165107732/485596304961962003/806310490589757450

@pmrowla
Copy link
Contributor

pmrowla commented Feb 3, 2021

For reference, this is the underlying paramiko issue: paramiko/paramiko#771

@efiop
Copy link
Member

efiop commented Feb 3, 2021

For the record: we've discussed before that we might support different backends as we do with git https://github.com/iterative/dvc/tree/master/dvc/scm/git/backend . Likely it will be a similar situation here too: CLI ssh, pure python paramiko and libssh. Or maybe we could use CLI ssh for auth and then reuse the channel with another library, since that's where majority of the problems usually occur.

A very long time ago we used to use ssh CLI in dvc, but switched to paramiko because it was much easier to use programmatically and it works just fine in the majority of (simple)cases.

@efiop efiop added the research label Feb 3, 2021
@efiop efiop changed the title many problems with ssh remotes, suggest replacing paramiko with direct usage of ssh ssh: support different backends (CLI ssh, paramiko, libssh, etc) Feb 3, 2021
@efiop efiop added the p2-medium Medium priority, should be done, but less important label Feb 3, 2021
@efiop
Copy link
Member

efiop commented May 4, 2021

Maybe we could use https://github.com/ParallelSSH/parallel-ssh instead of raw libssh

@pmrowla pmrowla added the fs: ssh Related to the SSH filesystem label Jul 27, 2021
@isidentical
Copy link
Contributor

We've now migrated to asyncssh, so please test again on the master and let us know if you see any missing features!

@isidentical isidentical added this to To do in DVC 27 Jul - 10 Aug via automation Jul 28, 2021
@isidentical isidentical moved this from To do to Done in DVC 27 Jul - 10 Aug Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs: ssh Related to the SSH filesystem p2-medium Medium priority, should be done, but less important research
Projects
No open projects
Development

No branches or pull requests

4 participants