2023 Datascience remote server
Libraries and programs for a generic datascience remote server to test data-science-related topics and setups.
1.1. How to use it
1.1.1. User credentials
All people will have their own credentials, sent to their email addresses.
Users will be in the sudoers group, so that you can run commands as root if your prepend those commands with sudo, as usual.
1.1.2. R & RStudio
Open the browser, and it will launch RStudio server in it by default ( http://datascience.seeds4c.org:8787
).
You have R 4.x installed.
1.2. How it has been developed
1.2.1. Operating System
Ubuntu GNU/Linux 20.04 (64 bits) lxc container + LXQt desktop.
1.3. Afegir repositoris extra
Ara ja podem llençar les següents instruccions sobre la finestra de terminal (copiar tot i enganxar sobre la finestra del terminal, amb botó dret del ratolí i Enganxa
, o bé amb la drecera per enganxar a les finestres de terminal Control + Shift + V
)
Seguim:
1.4. Configuració del mailer (postfix)
1.5. Altres paquets de sistema necessaris
1.6. Afegim Rstudio Server - Posit Server
Afegim RStudio server, després d'afegir els paquets de sistema extres necessaris. Info treta de:
https://posit.co/download/rstudio-server/
Les versions posteriors, com les de 2022.12.*, 2023.03.*, semblen tenir algun problema amb la connexió des de les màquines del Consorci d'Educació de Barcelona (CEB): potser algun tipus de connexió blocada des del firewall de la infraestructura informàtica del CEB/CTTI/Generalitat de Catalunya, potser. El que hem vist és que la versió 2022.07.2* si que permet les connexions com de costum.
I cal tenir present que per a R 4.3.x, la versió de Rstudio-server 2022.07.2* sembla ser massa vella, i reporta un warning:
Les versions anteriors a la darrera disponible, es poden consultar i descarregar des de:
https://docs.posit.co/previous-versions/rstudio/
1.6.1. Afegim SSL letsencrypt per permetre connexions https a Rstudio
Tret de:
https://adisarid.github.io/post/2020-03-06-setup_rstudio_server_with_ssl/
1.6.1.1. Install Let’s Encrypt and get certficates
Install the following software on your linux server
Update your nginx configuration as preperation for obtaining the let’s encrypt certificate. This step is needed because when requesting a certificate from let’s encrypt, the let’s encrypt server will try to authenticate your server.
Use
And add the following (replace datascience.seeds4c.org with your domain):
Get your SSL certificates using the following line, just replace datascience.seeds4c.org with your subdomain.
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/datascience.seeds4c.org/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/datascience.seeds4c.org/privkey.pem
Your cert will expire on 2023-08-14. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
Update your nginx settings again
To have the following setup (remember to replace datascience.seeds4c.org with your domain):
We restart nginx server
Go ahead and browse to your domain (e.g., https://datascience.seeds4c.org ). Check that you’re able to login properly and that all pages are secure on https.
1.6.1.2. Renew letsencrypt automatically
Your server should be working now, but since Let’s Encrypt certificates only last 90 days, lets put an automatically renewal process in place.
Paste the following text:
Make sure the script is owned and executable by root:
Add it to cron for auto execution:
Add
All should be set!
Go ahead and browse to your domain (e.g., https://datascience.seeds4c.org ). Check that you’re able to login properly and that all pages are secure on https.
1.6.2. Allow GUI connections
With X2Go (https://wiki.x2go.org) you can do so, from computers using GNU/Linux, Mac OSX or MS Windows
Connect with X2Go client to server datascience.seeds4c.org
, choosing as a session:
-
LXQt
Launch parcellite and kupfer. Change parcellite to store 250 entries. And set kupfer to launch automatically on user login.
For demostration purposes, a full lubuntu desktop can be added in this virtual machine for hgiher usability when connecting through X2go and to have usual default programs there as if it was a desktop computer.
1.6.3. R 4.x
We add these repos to use the latest R versions released
Obrim un terminal de sistema, i iniciem una consola de R a dins escrivint R<enter>
Comandes i paquets lubuntu 22.04:
Paquets de CRAN: posar dins de la comanda:
Rstudio Addins: CRANsearcher, addinslist
1.6.4. Allow installing packages or upgrade in R system packages
1.7. Set default locale as UTF-8
He escollit els locales UTF-8 i ISO-8859-1 i ISO-8859-15 per a català i castellà, posant com a locale per omissió a es_ES.UTF-8
1.8. Shiny
Shiny apps are exposed at
http://datascience.seeds4c.org:3838/
Example shiny app in development:
http://datascience.seeds4c.org:3838/climate-shelters/
See also:
- Shiny Server
- Installation: https://posit.co/download/shiny-server/
- Documentation: https://docs.posit.co/shiny-server/
- Shiny Apps:
https://shiny.posit.co/r/
Alias names for this page:
datascience remote server 2023 | data science remote server | datascience remote server | datascienceremoteserver | 2023 datascience server