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

Add Windows support to SSHLauncher #842

Merged
merged 120 commits into from
Oct 28, 2024
Merged

Conversation

ottointhesky
Copy link
Contributor

As discussed in the issue 837 I have implemented an abstraction layer (ipyparallel.cluster.shellcmd.ShellCommandSend and ...ShellCommandReceive) for sending shell commands in a platform independent manner. The API provides a variety of different standard shell commands (start, running, kill, mkdir, rmdir, exists and remove) and some generic shell/python code command execution features which encapsulates necessary quoting and different handling of different platforms and shells. Currently, Linux (bash, ssh) and Windows (cmd, powershell, ssh) are supported but it should be easy to support MacOS as well (I will have a look after sending the pull request).

The abstraction layer was mainly developed to send shell command through an ssh connection but it works equally for sending commands to a local shell. All possible types of shell connections are test in the corresponding pytest script (test_shellcmd.py)

I have extended the ssh-cluster-test that it also runs under Windows, BUT unfortunately there is an issue that prevents the ssh-cluster-test (and test_shellcmd) to run successfully in Github Actions. Everything works perfectly in a local environment, but with Github Runners it is not possible to start a process with the CREATE_BREAKAWAY_FROM_JOB flag set (the flag is absolute necessary, otherwise the started process gets kill when the ssh connection is closed). I’m not the first one that came across this issue, but obviously there is no easy work-a-round or solution to this (Have a look at win-start_issue.py which shows the Github behaviour in the corresponding test )

I will keep trying to find a trick or work-a-round to that issue, but I fear there isn’t. Not testing ssh-cluster under Windows isn’t an option (from my point of view), so maybe a self-hosted Windows runner could be the solution. Do you have experience with that? How should we proceed?

By the way, shellcmd implementation also has a cli ipyparallel.shellcmd which is NOT used. Hence, it could be safely dropped…

@minrk
Copy link
Member

minrk commented Oct 28, 2024

Finally landing this one. Thank you so much, @ottointhesky!

@minrk minrk changed the title Windows ssh support by ipcluster Add Windows support to SSHLauncher Oct 28, 2024
@minrk minrk added the new label Oct 28, 2024
@minrk minrk merged commit 5390f49 into ipython:main Oct 28, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants