Skip to content
Snippets Groups Projects
Commit 82afa865 authored by Peng Lian's avatar Peng Lian
Browse files

Add Dynamics ports to RStudio

parent ac24b3c8
Branches
No related merge requests found
...@@ -15,6 +15,13 @@ ENV http_proxy="${http_proxy}" \ ...@@ -15,6 +15,13 @@ ENV http_proxy="${http_proxy}" \
RUN mkdir /vizapp RUN mkdir /vizapp
# Config the Rstudio
# Allow root login. Ref. Section 3.2. https://s3.amazonaws.com/rstudio-server/rstudio-server-pro-0.99.903-admin-guide.pdf # Allow root login. Ref. Section 3.2. https://s3.amazonaws.com/rstudio-server/rstudio-server-pro-0.99.903-admin-guide.pdf
# Usefull for fakeroot function of singularity # Usefull for fakeroot function of singularity
RUN /usr/bin/bash -c "sed -i 's/^UID_MIN.*/UID_MIN 0/g' /etc/login.defs" RUN /usr/bin/bash -c "sed -i 's/^UID_MIN.*/UID_MIN 0/g' /etc/login.defs"
ARG ARG_VIZAPP_PORT=8123
ENV VIZAPP_PORT=${ARG_VIZAPP_PORT:-8123}
# Change the default port to 8123, which is the one used by Astrocyte
RUN /usr/bin/bash -c "sed -i 's/--server-daemonize 0/--server-daemonize 0 --www-port=\${VIZAPP_PORT}/g' /etc/services.d/rstudio/run"
...@@ -15,6 +15,13 @@ ENV http_proxy="${http_proxy}" \ ...@@ -15,6 +15,13 @@ ENV http_proxy="${http_proxy}" \
RUN mkdir /vizapp RUN mkdir /vizapp
# Config the Rstudio
# Allow root login. Ref. Section 3.2. https://s3.amazonaws.com/rstudio-server/rstudio-server-pro-0.99.903-admin-guide.pdf # Allow root login. Ref. Section 3.2. https://s3.amazonaws.com/rstudio-server/rstudio-server-pro-0.99.903-admin-guide.pdf
# Usefull for fakeroot function of singularity # Usefull for fakeroot function of singularity
RUN /usr/bin/bash -c "sed -i 's/^UID_MIN.*/UID_MIN 0/g' /etc/login.defs" RUN /usr/bin/bash -c "sed -i 's/^UID_MIN.*/UID_MIN 0/g' /etc/login.defs"
ARG ARG_VIZAPP_PORT=8123
ENV VIZAPP_PORT=${ARG_VIZAPP_PORT:-8123}
# Change the default port to 8123, which is the one used by Astrocyte
RUN /usr/bin/bash -c "sed -i 's/--server-daemonize 0/--server-daemonize 0 --www-port=\${VIZAPP_PORT}/g' /etc/services.d/rstudio/run"
...@@ -15,7 +15,7 @@ tmpDir=/tmp/$USER/rstudio ...@@ -15,7 +15,7 @@ tmpDir=/tmp/$USER/rstudio
VIZAPP_HOME="$tmpDir/vizapp/" VIZAPP_HOME="$tmpDir/vizapp/"
# dependencies libs of vizapp, space seperated # dependencies libs of vizapp, space seperated
VIZAPP_LIBS="rmarkdown" #VIZAPP_LIBS="rmarkdown"
# user specified path to install the vizapp libs inside the container # user specified path to install the vizapp libs inside the container
R_LIBS_USER="/vizapp/rlibrary" R_LIBS_USER="/vizapp/rlibrary"
...@@ -36,7 +36,7 @@ ln -s /mnt $tmpDir/home/outputDir ...@@ -36,7 +36,7 @@ ln -s /mnt $tmpDir/home/outputDir
# version and the image to use # version and the image to use
PACKAGE="rstudio" PACKAGE="rstudio"
VERSION="4.2.2" VERSION="4.1.1"
IMAGE_NAME="git.biohpc.swmed.edu:5050/astrocyte/container/${PACKAGE}:${VERSION}" IMAGE_NAME="git.biohpc.swmed.edu:5050/astrocyte/container/${PACKAGE}:${VERSION}"
# name of the local image # name of the local image
...@@ -51,6 +51,7 @@ fi ...@@ -51,6 +51,7 @@ fi
DISABLE_AUTH=true DISABLE_AUTH=true
PASSWORD=BioHPC PASSWORD=BioHPC
DEFAULT_USER=root DEFAULT_USER=root
VIZAPP_PORT=8123
# install vizapp libs to customize folder # install vizapp libs to customize folder
for lib in $VIZAPP_LIBS; do for lib in $VIZAPP_LIBS; do
...@@ -58,22 +59,24 @@ for lib in $VIZAPP_LIBS; do ...@@ -58,22 +59,24 @@ for lib in $VIZAPP_LIBS; do
SINGULARITYENV_DISABLE_AUTH=$DISABLE_AUTH \ SINGULARITYENV_DISABLE_AUTH=$DISABLE_AUTH \
SINGULARITYENV_PASSWORD=$PASSWORD \ SINGULARITYENV_PASSWORD=$PASSWORD \
SINGULARITYENV_DEFAULT_USER=$DEFAULT_USER \ SINGULARITYENV_DEFAULT_USER=$DEFAULT_USER \
SINGULARITYENV_VIZAPP_PORT=$VIZAPP_PORT \
singularity exec -f -C -w -e \ singularity exec -f -C -w -e \
-H $tmpDir/home:/root \ -H $tmpDir/home:/root \
-B $outputDir:/mnt,$VIZAPP_HOME:/vizapp,$tmpDir/tmp:/tmp ${singularity_image} \ -B $outputDir:/mnt,$VIZAPP_HOME:/vizapp,$tmpDir/tmp:/tmp ${singularity_image} \
R -e "if (!require('$lib', character.only=TRUE)) {install.packages('$lib', dependencies=TRUE, lib='$R_LIBS_USER')}" R -e "if (!require('$lib', character.only=TRUE)) {install.packages('$lib', dependencies=TRUE, lib='$R_LIBS_USER')}"
done done
echo -e "\nPlease visit http://localhost:8787 to connect to the RStudio server ...\n" echo -e "\nPlease visit http://localhost:${VIZAPP_PORT} to connect to the RStudio server ...\n"
# run vizapp on localhost # run vizapp on localhost
SINGULARITYENV_R_LIBS_USER=${R_LIBS_USER} \ SINGULARITYENV_R_LIBS_USER=${R_LIBS_USER} \
SINGULARITYENV_DISABLE_AUTH=$DISABLE_AUTH \ SINGULARITYENV_DISABLE_AUTH=$DISABLE_AUTH \
SINGULARITYENV_PASSWORD=$PASSWORD \ SINGULARITYENV_PASSWORD=$PASSWORD \
SINGULARITYENV_DEFAULT_USER=$DEFAULT_USER \ SINGULARITYENV_DEFAULT_USER=$DEFAULT_USER \
SINGULARITYENV_VIZAPP_PORT=$VIZAPP_PORT \
singularity run -f -C -w -e \ singularity run -f -C -w -e \
-H $tmpDir/home:/root \ -H $tmpDir/home:/root \
-B $outputDir:/mnt,$VIZAPP_HOME:/vizapp,$tmpDir/tmp:/tmp ${singularity_image} -B $outputDir:/mnt,$VIZAPP_HOME:/vizapp,$tmpDir/tmp:/tmp ${singularity_image}
## Enable this section if run as non-root user inside the container ## Enable this section if run as non-root user inside the container
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment