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

Adds support for unix_socket #151

Closed
wants to merge 8 commits into from

Conversation

jhgoebbert
Copy link
Contributor

This PR enables RStudio connections via sockets in combination with this PR for RStudio rstudio/rstudio#14938

@jhgoebbert
Copy link
Contributor Author

jhgoebbert commented Jul 8, 2024

This PR also

  • adds www-thread-pool-size as a possible option which can be set via the environment variable RSERVER_THREAD_POOL_SIZE
  • calls rserver just once to get all supported arguments in _support_args(). This is useful as rserver might be only available through modules which takes some time to load. Therefore, this loading can be reduced.

@yuvipanda
Copy link
Contributor

yay, thank you for your contribution both here and upstream to rstudio! This is going to unlock a lot of non-containerized use cases - I'm super excited for that to land :)

If you could split the PR into a unix socket one and one with everything else, that would make this easier to review and merge. I would like to hold off on merging the unix socket one until that upstream PR gets merged, but the others should be easier. Would you be open to splitting it up like that?

Thanks!

@jhgoebbert
Copy link
Contributor Author

jhgoebbert commented Jul 23, 2024

Thanks @yuvipanda . I will split the PR.

The PR for unix-socket support in RStudio is now merged and will be part of the official "Kousa Dogwood" builds expected in 2024.10 : rstudio/rstudio#14938 (comment)

@benz0li
Copy link

benz0li commented Dec 17, 2024

RStudio v2024.12.0+467 is out: https://github.com/rstudio/rstudio/releases/tag/v2024.12.0%2B467

@benz0li
Copy link

benz0li commented Dec 17, 2024

I would like to hold off on merging the unix socket one until that upstream PR gets merged, but the others should be easier. Would you be open to splitting it up like that?

@jhgoebbert Could you split the PR into a unix socket one and one with everything else?

Thank you.

@benz0li
Copy link

benz0li commented Dec 19, 2024

@yuvipanda Or could this be merged as is?

@consideRatio Any objections?

@benz0li
Copy link

benz0li commented Dec 19, 2024

I tested this PR successfully with RStudio v2024.12.0+467 and

pip install git+https://github.com/jhgoebbert/jupyter-rsession-proxy@feature/sockets

plus setting environment variable RSERVER_USE_SOCKET=1.

@benz0li
Copy link

benz0li commented Dec 21, 2024

@jhgoebbert @yuvipanda @consideRatio Happy Holidays!

@consideRatio
Copy link
Member

Happy holidays @benz0li!! ❤️

Sorry for not helping out here now. I'm currently less available for open-source contributions than I've been for many years.

@ryanlovett
Copy link
Collaborator

ryanlovett commented Dec 22, 2024

Thanks for testing @benz0li ! I also think it'd be good to split the PR per @yuvipanda's comments. (the unix socket support and the reduction in subprocess invocation)

I agree that it would be great to have this functionality.

Copy link
Collaborator

@ryanlovett ryanlovett left a comment

Choose a reason for hiding this comment

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

This functionality would be great to have! I added some specific suggestions, and am also in favor of @yuvipanda's suggestion to split the PR.

jupyter_rsession_proxy/__init__.py Show resolved Hide resolved
jupyter_rsession_proxy/__init__.py Show resolved Hide resolved
@@ -127,6 +150,9 @@ def _get_timeout(default=15):
'icon_path': get_icon_path()
}
}
if os.getenv('RSERVER_USE_SOCKET', "") != "":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to the above, could this please beJUPYTER_RSESSION_PROXY_USE_SOCKET instead?

Also, since you check for unix_socket != "" above, I think this can be reduced to if os.getenv("JUPYTER_RSESSION_PROXY_USE_SOCKET") ?

Copy link
Contributor Author

@jhgoebbert jhgoebbert Jan 1, 2025

Choose a reason for hiding this comment

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

I realized that there is already RSERVER_TIMEOUT and RSESSION_TIMEOUT. So I did not want to introduce a new naming schema and named the variables also RSERVER_*.
Wouldn't it be better to change all variable names at once in a separate PR?

@jhgoebbert
Copy link
Contributor Author

jhgoebbert commented Jan 1, 2025

This PR gets closed as I have splitted the PR like @yuvipanda asked for in #151 (comment)

I will create a PR for the other features as soon as the unix-socket-support is merged.

@jhgoebbert jhgoebbert closed this Jan 1, 2025
@jhgoebbert
Copy link
Contributor Author

The second part of this PR can now be found here

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.

5 participants