Skip to content

Commit

Permalink
update devbox scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
haobibo committed Nov 11, 2024
1 parent 442a42b commit 4bacbb5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docker_devbox/work/script-devbox-jupyter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ setup_jupyter_hub() {
&& pip install -Uq oauthenticator jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \
&& pip install -Uq dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \
&& pip install -Uq psutil pycurl jupyter_client jupyterhub \
&& pip install -Uq jupyterhub-traefik-proxy \
&& echo "@ JupyterHub version: $(jupyterhub --version)"
&& pip install -Uq jupyterhub-traefik-proxy

type jupyterhub && echo "@ JupyterHub version: $(jupyterhub --version)" || return -1 ;
}
2 changes: 1 addition & 1 deletion docker_devbox/work/script-devbox-rstudio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ setup_R_rshiny() {
&& dpkg -i /tmp/rshiny.deb \
&& sed -i "s/run_as shiny;/run_as root;/g" /etc/shiny-server/shiny-server.conf \
&& sed -i "s/3838/8888/g" /etc/shiny-server/shiny-server.conf \
&& printf "USER=root shiny-server" > /usr/local/bin/start-shiny-server.sh \
&& printf "USER=root exec shiny-server" > /usr/local/bin/start-shiny-server.sh \
&& chmod u+x /usr/local/bin/start-shiny-server.sh

# Remove shiny's pandoc and pandoc-proc to reduce size if they are already installed in the jpy-latex step.
Expand Down
2 changes: 1 addition & 1 deletion docker_devbox/work/start-jupyterhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# echo "DIR=${DIR}"
# ls -alh

python -m jupyterhub $*
exec python -m jupyterhub $*
5 changes: 4 additions & 1 deletion docker_devbox/work/start-jupyterlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ if [[ ! -z "${JUPYTERHUB_API_TOKEN}" ]]; then
# launched by JupyterHub, use single-user entrypoint
exec $DIR/start-singleuser.sh $*
else
jupyter ${JUPYTER_CMD:-lab} ${JUPYTER_ARGS} $*
if [ ! -z "$JUPYTERHUB_SERVICE_PREFIX" ]; then
JUPYTER_ARGS=" --NotebookApp.base_url=$JUPYTERHUB_SERVICE_PREFIX $JUPYTER_ARGS"
fi
exec jupyter ${JUPYTER_CMD:-lab} ${JUPYTER_ARGS} $*
fi
5 changes: 4 additions & 1 deletion docker_devbox/work/start-rserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ fi
if [[ "$RSTUDIO_ARGS $@" != *"--auth-none="* ]]; then
RSTUDIO_ARGS="--auth-none 1 $RSTUDIO_ARGS"
fi
if [[ "$RSTUDIO_ARGS $@" != *"--log-dir="* ]]; then
RSTUDIO_ARGS="--log-dir /var/log $RSTUDIO_ARGS"
fi
if [[ "$RSTUDIO_ARGS $@" != *"--www-root-path="* ]]; then
WWW_ROOT_PATH=$(echo "${JUPYTERHUB_SERVICE_PREFIX%/}/rserver/" || echo "/rserver/")
RSTUDIO_ARGS="--www-root-path $WWW_ROOT_PATH $RSTUDIO_ARGS"
fi


USER=root /opt/rstudio-server/bin/rserver ${RSTUDIO_ARGS} $@
USER=root exec /opt/rstudio-server/bin/rserver ${RSTUDIO_ARGS} $@

0 comments on commit 4bacbb5

Please sign in to comment.