This article demonstrates how to upgrade RStudio to version 1.4.x in Domino Analytics Distribution (DAD) environments that come with an older version of RStudio. Please note that many of our newer Domino Standard Environments already come with RStudio version 1.4+. Unless you have a specific need to use an older image and upgrade RStudio, we recommend simply choosing a newer base image. You can check out the latest offerings in our Compute Environment Catalog (be sure to check the dropdown for your Domino version).
To upgrade RStudio to 1.4.x in older images
The following has a Dockerfile component, a Pluggable Workspace and a PreRun script which should Build against a DAD image.
Please read carefully that there is a difference in implementing this on 4.2/4.3 and 4.4.X (more stuff needed on 4.2.2 configMaps). This should also work on Domino 4.6.X and 5.0.X (this needs no configMap changes on 5.0.0!!!)
This is a draft version of the updates needed, and you may already have built some of the needed parts.
Dockerfile build this with DAD image as base (and yes, some redundancy going on):
# Cleanup old rstudio-server
RUN apt install -y gnupg
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
RUN apt-get remove rstudio-server -y && \
rm -rf /usr/local/lib/rstudio-server && \
rm /usr/local/bin/pandoc && \
rm /usr/local/bin/pandoc-citeproc
# Install rstudio-server 1.4
RUN mkdir -p /tmp/rstudio-temp && \
cd /tmp/rstudio-temp && \
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1103-amd64.deb && \
# (https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1103-amd64.deb) && \
gdebi --non-interactive rstudio-server-1.4.1103-amd64.deb && \
ln -s /usr/lib/rstudio-server /usr/local/lib/rstudio-server
RUN cd ~ && \
rm -rf /tmp/rstudio-temp && \
#Make rmarkdown::render work outside of rstudio. https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md
ln -s /usr/lib/rstudio-server/bin/pandoc/pandoc /usr/local/bin && \
ln -s /usr/lib/rstudio-server/bin/pandoc/pandoc-citeproc /usr/local/bin && \
rm -rf /var/lib/apt/lists/*
RUN echo "export DISABLE_AUTH=true" > /home/ubuntu/.bashrc
RUN echo "export DISABLE_AUTH=true" > /etc/profile.d/rstudio.conf
RUN chown -R ubuntu /var/lib/rstudio-server && rm -rf /tmp/rstudio-server && chown -R ubuntu /usr/lib/rstudio-server
# Version 1
RUN echo "export DISABLE_AUTH=true" > /etc/rc.local.script && \
echo "/usr/lib/rstudio-server/bin/rserver --server-data-dir=/home/ubuntu/rstudio-server --server-daemonize=0 --auth-none=1" >> /etc/rc.local.script
RUN echo "www-port=8888" >> /etc/rstudio/rserver.conf
RUN sudo chown -R ubuntu ~ubuntu
RUN chmod +x /etc/rc.local.script
Pluggable Workspace Tools (careful about indentation):
jupyter:
title: "Jupyter (Python, R, Julia)"
iconUrl: "/assets/images/workspace-logos/Jupyter.svg"
start: [ "/var/opt/workspaces/jupyter/start" ]
httpProxy:
port: 8888
rewrite: false
internalPath: "/{{ownerUsername}}/{{projectName}}/{{sessionPathComponent}}/{{runId}}/{{#if pathToOpen}}tree/{{pathToOpen}}{{/if}}"
requireSubdomain: false
supportedFileExtensions: [ ".ipynb" ]
jupyterlab:
title: "JupyterLab"
iconUrl: "/assets/images/workspace-logos/jupyterlab.svg"
start: [ /var/opt/workspaces/Jupyterlab/start.sh ]
httpProxy:
internalPath: "/{{ownerUsername}}/{{projectName}}/{{sessionPathComponent}}/{{runId}}/{{#if pathToOpen}}tree/{{pathToOpen}}{{/if}}"
port: 8888
rewrite: false
requireSubdomain: false
vscode:
title: "vscode"
iconUrl: "/assets/images/workspace-logos/vscode.svg"
start: [ "/var/opt/workspaces/vscode/start" ]
httpProxy:
port: 8888
requireSubdomain: false
rstudio:
title: "RStudio"
iconUrl: "/assets/images/workspace-logos/Rstudio.svg"
start: [ "/etc/rc.local.script" ]
httpProxy:
port: 8888
requireSubdomain: false
Run Setup Script/Pre (optional, likely to end up in a more appropriate folder in R Terminal):
[ -d /mnt/projects ] && echo 'setwd("/mnt/projects")' >> ~ubuntu/.Rprofile
[ -d /mnt/projects ] || echo 'setwd("/mnt")' >> ~ubuntu/.Rprofile
Inside your Central Node, run :
kubectl edit cm nucleus-nginx-conf -n $NAMESPACE
Got to line 150 or close to it:
:150 or :151 Should be within # Reverse proxying for workspaces without subdomains.
IF YOU HAVE 4.4.X add:
proxy_set_header X-RStudio-Root-Path "/$dominoprefix";
IF YOU HAVE 4.2.X/4.3.X add:
set $current_scheme https;
set $fqdn <YOUR DOMINO FQDN>; # <<< Insert the FQDN from your Domino URL it is in the surrounding lines. Don't loose the ; at the end here!!!
# i.e.: set $fqdn domino-test.vmware.com;
proxy_redirect /$dominoprefix https://$fqdn/$dominoprefix;
proxy_redirect / https://$fqdn/$dominoprefix/;
proxy_redirect $upstream_base_url/$dominoprefix https://$fqdn/$dominoprefix;
proxy_redirect $upstream_base_url/ https://$fqdn/;
proxy_redirect $upstream_base_url https://$fqdn/;
proxy_set_header X-RStudio-Root-Path "/$dominoprefix";
proxy_set_header X-RStudio-Request $current_scheme://$host:443$request_uri;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $current_scheme;
proxy_set_header Forwarded "by=nucleus-nginx;for=whatever;host=$fqdn;proto=$current_scheme";
Then you need kubectl delete frontend-nucleus-<id> to re-read config. Please allow for the time required to restart frontend pods (may be different for each deployment)
kubectl get po -A |grep nucleus-frontend | awk '{print $2}' | xargs -I{} kubectl delete po {} -n $NAMESPACE
Comments
0 comments
Please sign in to leave a comment.