-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Include instructions to set up with conda #50
Comments
Thank you for opening this issue! I have never isolated an R envionment using conda before so this is helpful! WRT to the http server, the # 127.0.0.1 and port 4321 are the defaults for servr
R -e 'servr::server_config(host = "127.0.0.1", port = "4321"); sandpaper::serve()' from there you can preview the lesson at http://127.0.0.1:4321 I admit that I never actually had a good grasp on how to deploy it with a server from the command line; my setup is vim with Nvim-R. |
Thanks @zkamvar! That is exactly what I was missing. I also updated my comment above to include the very important |
Wunderbar! So, if I'm correct, then the setup for conda is: Installationconda create -n workbench 'git>=2.28' 'r-base>=3.6' 'pandoc>=2.11' pkg-config libxslt
conda activate workbench
R -e 'install.packages(c("sandpaper", "varnish", "pegboard", "tinkr"), \
repos = list(carpentries="https://carpentries.r-universe.dev/", CRAN="https://cran.us.r-project.org"))' Build and Preview# 127.0.0.1 and port 4321 are the defaults for servr
R -e 'servr::server_config(host = "127.0.0.1", port = "4321"); sandpaper::serve()' |
Does The docs do warn about this, but on Linux this will need to compile a lot of things which took a fair bit of time. |
In an interactive session, it does launch a window, but because
Ah yes, if you are on a major linux platform (Ubuntu, CentOS, etc), you should be able to use the Posit Package Manager to get binaries: https://packagemanager.rstudio.com/client/#/ Otherwise, yes, we have inadvertently inverted the pain threshold for getting things installed so that now linux users have the most difficult time and Windows and Mac users are largely plug-and-play. The only consolance I have is that the long installation time is going to be a rare occurance. |
Unfortunately the |
😩 that's what I get for testing with just the default config. I will add an ellipses to the serve function in the next release so that you should be able to run For reference, this is the documentation of those options that will be available: https://yihui.r-universe.dev/servr/doc/manual.html#server_config |
I've added the feature and pushed it to the universe. It should be available within the hour. |
Thanks so much @zkamvar! I can confirm this works on my end. |
It seems https://cran.us.r-project.org is not accessible (permanently?), so I had to update the R install command: R -e 'install.packages(c("sandpaper", "varnish", "pegboard", "tinkr"), \
repos = list(carpentries="https://carpentries.r-universe.dev/", CRAN="https://cloud.r-project.org"))' |
Ah yes, sorry about that. CRAN is not yet an option because we need to ship quickly and the process for CRAN submission can get bogged down in very minor details. I'm going to add this to the installation page so that I can close this issue. Sorry for the delay! |
I just realised I misread your comment! Yes, "https://cloud.r-project.org" is likely going to return the best results as it will redirect your to the closest, most up-to-date server: https://cran.r-project.org/mirrors.html |
I don't use RStudio and have been building Workbench lessons from the command line. For isolation from the rest of my system packages I looked in to installing everything with Conda on Linux, since I couldn't find this in the documentation.
Creating the environment
Note:
python
is only for usinghttp.server
to serve the web pages locally later; if someone knows the magical incantation to serve HTTP from R thenpython
won't be needed in the environment.Building the repository
preview = FALSE
is needed when building on a headless server without a GUI/browser.Serving the lesson
I couldn't use
sandpaper::serve()
because I needed to bind to a specific IP and port, whichsandpaper::serve()
currently doesn't (seem to) support.The text was updated successfully, but these errors were encountered: