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
rstudio-server: Initial commit for rstudio-server and associated wrapper #95831
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/adding-rstudio-server-r/8644/6 |
Thank you for adding the server! Are you planning to add a corresponding NixOS module for the service? |
Hi @alexvorobiev, I've actually never used NixOS so I wouldn't know where to start with adding a module. My colleague @bcdarwin has offered to help creating a module if this PR goes through. |
Any update on this PR? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/adding-rstudio-server-r/8644/7 |
If |
ffff180
to
c57d0c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please format your code with nixpkgs-fmt
I marked this as stale due to inactivity. → More info |
This is still important |
What is pending for this update to be released? |
@cfhammill, are you available to make the review edits? I am in need of this as well. |
sorry for the delay, I'm back looking at this now and will hopefully have a chance to make the requested revisions soon |
It's worth revisiting the rstudio derivation as it has changed considerably
with the latest version bump: `$NIX_QT5_TMP` is no-longer used and qmake
is referred to as an explicit input.
|
thanks @jbedo I was wondering if redoing this PR off the updated rstudio/default.nix, this was the push I needed. |
I have the new version of rstudio-server building based on the updated rstudio derivation. A couple of pain points The rstudio-server service doesn't work, you have to use the rserver binary directly. This is probably the best we can do for non-nixOS systems. rserver as far as I can tell requires a few system directories that need to be writeable. I never noticed this before because my systems had those directories around from non-nix installs of rstudio server. the directories in question are
so a user wanting to run rstudio-server would run once, and then to launch the server the user would run
possibly in the background. If anyone has any clever ideas to avoid the global directories I'd welcome a contribution. We could probably patch the CMake files or the c++ source code to override these default locations and point them elsewhere, not sure where, I think write perms within the nix store is a no-go, if we can't think of a sensible default, an upstream PR to add an argument to move the /var/lib/rstudio-server location might be possible. |
Systemd will create them for you, use RunTimeDirectory= and StateDirectory=
options, along with DynamicUser. You can ripgrep nixos/modules/services
for some examples.
|
@bcdarwin has offered to help turn this into a module, do you mean this would work for a non-nixOS system? If so can you give me more detail on what to do? |
All sounds good to me, I didn't test myself, booted in to a nixos vm, tried a few things couldn't get basic stuff going and gave up, but if you both are giving thumbs up I'm sure it's fine. Shall I squash in prep for merge or @jbedo will you squash merge? |
It would be better if you could squash this down to a couple of commits, one adding the rstudio-server expression and another adding the module + tests. There's now a conflict with the ids to resolve, just needs to be bumped. |
ba879c1
to
c1deac9
Compare
Squashed, uid/gid updated, and rebased onto master. |
c1deac9
to
a627b3a
Compare
0eba6cf
to
544bd86
Compare
Added the new module to the release notes as per updated contributing guidelines. @jbedo should be ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise diff LGTM at a glance.
Would like for a rstudio user to verify
|
||
desktopItems = [ | ||
(makeDesktopItem { | ||
name = "${pname}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = "${pname}"; | |
name = pname; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
544bd86
to
0b9cb84
Compare
LGTM too, I'll see if I can find an rstudio-server user to test this more but pretty confident in the basic functionality as @bcdarwin has also verified it. |
The example value for
However, I don't have time to look into it this week. |
0b9cb84
to
a6d327e
Compare
Resolved. Added a crappy test for it too.
|
Works now, thanks. |
a6d327e
to
d05cda5
Compare
Rebased and resolved merge conflicts again. |
Co-authored-by: Justin Bedo <cu@cua0.org> Co-authored-by: Jonathan Ringer <jonringer@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Benjamin Darwin <bcdarwin@gmail.com>
d05cda5
to
43047ec
Compare
We can merge this once the checks have passed, hopefully before we have to deal with further conflicts. @jonringer I think further issues are likely to be more fundamental problems with the underlying R/RStudio expressions rather than the rstudio-server module, which we can deal with separately. |
I'm fine with incremental improvement. And I'm not familiar with r to really guide to the desired end state. Thanks for reviewing it |
Motivation for this change
Documented in more detail at https://discourse.nixos.org/t/adding-rstudio-server-r/8644/4, but in short, I wanted to be able to run rstudio-server inside a nix-shell so that I could get plots faster than using X-forwarding.
Things done
Modified the rstudio build code to build the server version, with some more tweaks.
Coarse diff between rstudio and rstudio-server:
rstudio-server
readline6
andpam
dependencies for buildingCoarse diff between rstudioWrapper and rstudioServerWrapper
libPath
wrapping on thersession
binaryfontconfig
dependency and wrapping to fix the plot fonts issue noted hererserver
to point to the wrappedrsession
Potential To-Do's
rstudio-server
build could be refactored into the same nix file as therstudio
build, adding an argument to toggle between the two.rserver
as the--auth-pam-helper
argument if memory serves.)rstudioWrapper
andrWrapper
should be given the samefontconfig
fix asrstudioServerWrapper
but perhaps that's best for another PR.CC @ehmry @changlinli @ciil
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)