Skip to content

Mux transport for client (rebased) - #1857

Closed
takluyver wants to merge 7 commits into
paramiko:mainfrom
takluyver:Mux-transport-for-client
Closed

takluyver wants to merge 7 commits into
paramiko:mainfrom
takluyver:Mux-transport-for-client

Conversation

@takluyver

Copy link
Copy Markdown

This is a straight rebase of #1341, which no longer merges cleanly. So far, I've not attempted to make any changes to it.

I wonder if it would be better, rather than adding another parameter to Client.connect() which causes it to take a completely different code path, to add a separate method, called something like connect_multiplex() or connect_master(), which just does this. Then it can be up to the caller whether to fall back to standard connection if using the multiplexing socket fails (whereas the current implementation silences errors and always tries to fall back).

(In principle, I'd also like to disentangle the code in Transport in a similar way, but it's less clear how to do that)

radssh and others added 7 commits May 25, 2021 10:13
Basic support - Transport connect via Unix domain socket, and bypass the protocol/kex/userauth stages, and just use proxy. Some jiggling of the packetizer pad byte calculations
ControlMaster proxy seems to forward global_request messages, but swallows the global_response, so the proxied client should never wait for the response. For tcpip-forward, the client can't distinguish between success and failure.
kex_init is even more borky, it seems. The proxy forwards the initial kex_init, but fields the server reply as a server initiated kex_init, so the ContolMaster sends another kex_init in response. The server, upon getting a kex_init message while already processing the proxied one, boots the connection altogether (per RFC4253 7.1)
Rather than complicate the retry logic, have Transport raise exception, and allow retry only within SSHClient.
Change mux_path to controlpath, to be more consistent with OpenSSH terminology
flake8 & black format issues
plus a typo I'm just going to attribute to spellcheck
@oferchen

Copy link
Copy Markdown

what is the delay with merging this pull?

thank you!

@bskinn

bskinn commented Jun 21, 2021

Copy link
Copy Markdown
Contributor

The failing CI, for one -- if I'm looking at the Travis run output correctly, there are some things that need to be fixed in the CI infrastructure/config first.

@oferchen

oferchen commented Jun 21, 2021 •

Copy link
Copy Markdown

The failing CI, for one -- if I'm looking at the Travis run output correctly, there are some things that need to be fixed in the CI infrastructure/config first.

Yeah I saw the failure log as well, Can you share who's responsible for the CI configuration?

@bskinn

bskinn commented Jun 21, 2021

Copy link
Copy Markdown
Contributor

I believe all of that is still on @bitprophet's shoulders -- he's dividing his weekly OSS time among all of paramiko, fabric and invoke, so it can sometimes take a while for any given thing to get addressed.

It looks to me like there's more than one problem underlying this CI failure -- partly, Python 3.4 might need to be dropped; partly, there have been some ongoing issues with getting setuptools_rust and cryptography to play well again within CI. I know he's already aware of the setuptools_rust and cryptography problems, at least.

@oferchen

oferchen commented Jun 21, 2021 •

Copy link
Copy Markdown

I believe all of that is still on @bitprophet's shoulders -- he's dividing his weekly OSS time among all of paramiko, fabric and invoke, so it can sometimes take a while for any given thing to get addressed.

It looks to me like there's more than one problem underlying this CI failure -- partly, Python 3.4 might need to be dropped; partly, there have been some ongoing issues with getting setuptools_rust and cryptography to play well again within CI. I know he's already aware of the setuptools_rust and cryptography problems, at least.

Hi @bitprophet ,
I don't mean to bother you but this feature was initially requested in 2016 and there are multiple issues open across paramiko, fabric and several other libraries. If I can assist with pushing this issue forward due to limited time you have to spend on it please let me know.

Thank you for your efforts,
Ofer

FYI if anyone want to test this pull request you can use the following,
paramiko-controlmaster-16062021.tar.gz
paramiko-controlmaster-21072021.tar.gz
update: I rebased the previous release with a more recent master branch.
paramiko-controlmaster
update: I keep an updated repository with the latest patch and latest paramiko if you like to test this feature

@bitprophet bitprophet added this to the p1 milestone Jun 25, 2021
@bitprophet

Copy link
Copy Markdown
Member

Either during or after the CI work, 3.4 and 3.5 will be dropped along with 2: http://bitprophet.org/blog/2021/02/25/byethon2/#how-exactly

I've put this ticket in a milestone so that ideally I'll revisit it once I'm ready to push forwards with feature work. Thanks!

@ltalirz

ltalirz commented Nov 23, 2021 •

Copy link
Copy Markdown

Hey guys, another highly interested party here :-)

As I notice that CI on PRs that came after this one is passing, may I suggest to simply try rebasing once more @takluyver ?

If there's anything others can do to help get this merged, please let us know!

Edit: rebased in #1931 (happy to close this PR if you prefer to continue here)

@ltalirz

ltalirz commented Nov 24, 2021 •

Copy link
Copy Markdown

After a simple style fix, tests are passing.

Note: I had to do the fix manually, since the black installed in my python 3.9 environment ended up making more changes and I was unable to reproduce the python 3.6 environment in which the CI runs.

Given that python 3.6 is EOL end of this year, I'll open another PR that moves the style checking etc. to python 3.7.

@bskinn

bskinn commented Nov 24, 2021

Copy link
Copy Markdown
Contributor

Perhaps updating to an even more recent version would be better?

Thoughts, @bitprophet?

@bitprophet

bitprophet commented Nov 24, 2021 •

Copy link
Copy Markdown
Member

God, I didn't even realize 3.6 was that close to EOL. I'll be over here growing moss...

But no, the point in my mind of the "baseline CI" tasks are to use the oldest supported version since usually things that work ok on version N will work identically well on N+1, N+2 etc. So bumping up to 3.7 seems like the correct choice right now.

With the downside that someone has to submit a version of that 2nd PR every year or so - tho I'm hoping to eventually leverage Circle's templatey junk so the pipeline definitions are more DRY (esp given I have one of those for every project).


Unless my US Thanksgiving goes very sour this year, I'm planning to work on Paramiko this Friday and some of the following week - hopefully I'll get to this ticket in the milestone. Thanks all for continuing to keep it going.

@bitprophet

bitprophet commented Nov 27, 2021 •

Copy link
Copy Markdown
Member

A bit later: actually, my dayjob (which pays me to work on the OSS a day a week) has a /lot/ of users on Python 3.6, which undoubtedly means a large number of the greater ecosystem does too. So I'm curious what specifically the problem was for @ltalirz re:

I was unable to reproduce the python 3.6 environment in which the CI runs.

since my general thinking is that I'm fine with dropping interpreter versions after they reach EOL, but only when the pain of supporting them outweighs some arbitrary userbase-% (I haven't looked at the download stats lately).

In my own personal and dayjob environments, 3.6 is still trivially accessible & so far the libraries/tools I use haven't themselves become 3.6-incompatible. (with the caveat that a lot of said dependencies tend to get pinned & will shortly need re-examination…)


Also! CircleCI has tooling that makes it easy to run local containers matching what they run, which can be a big help with this kind of thing. I'm still getting my NixOS system stood up with containers & such but on my Mac, it was basically "install circleci's CLI tool, make sure Docker or Podman-aliased-to-Docker exist, and run circleci local name-of-job or similar.


All that aside, I'd like to add that for now, I expect to do work on my end when merging (true 'click & done' PRs are rare), and a submitter/contributor's inability to reproduce CI locally isn't a roadblock - if I'm intending to merge/release a ticket, I'll just get it done regardless.

@ltalirz

ltalirz commented Nov 27, 2021

Copy link
Copy Markdown

So I'm curious what specifically the problem was for @ltalirz re:

I first installed the dev dependencies in a python 3.9 conda environment. That worked fine, but the version of black I got was probably slightly different from the one you have on CI under python 3.6, so it ended up making more changes than those requested on CI (which is a bit weird now that I see that the version is quite locked down... maybe some black dependency that differs?).

I then created a python 3.6 conda env, and here installing the dev dependencies didn't work because it was trying to change the version of some "system-level package" (don't remember which one) which it could not.

Anyhow, I guess you're right that I could have tried using a container - to me the update to python3.7 is up to you, I care much more about the SSH multiplexing support in this PR (or #1932).

Cheers!

@bitprophet bitprophet removed this from the Subsequent feature release milestone Feb 4, 2022
@bitprophet

Copy link
Copy Markdown
Member

Rolling into #1931 and its chat.

@bitprophet bitprophet closed this Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants