Skip to content

Commit

Permalink
update dev-hub
Browse files Browse the repository at this point in the history
  • Loading branch information
haobibo committed Mar 12, 2024
1 parent 4836994 commit fddcbe5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 33 deletions.
7 changes: 3 additions & 4 deletions docker_dev_box/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ RUN source /opt/utils/script-devbox-vscode.sh \
# Clean up and display components version information...
RUN source /opt/utils/script-utils.sh && install__clean && list_installed_packages

WORKDIR $HOME_DIR
EXPOSE 8888

ENTRYPOINT ["tini", "-g", "--"]
CMD ["start-notebook.sh"]

# '-c' option make bash commands are read from string.
# If there are arguments after the string, they are assigned to the positional parameters, starting with $0.
Expand All @@ -46,3 +42,6 @@ CMD ["start-notebook.sh"]
# '--login': make bash first reads and executes commands from the file /etc/profile, if that file exists.
# After that, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
SHELL ["/bin/bash", "--login", "-o", "pipefail", "-c"]
CMD ["start-notebook.sh"]
WORKDIR $HOME_DIR
EXPOSE 8888
23 changes: 10 additions & 13 deletions docker_dev_box/hub.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@ COPY work /opt/utils/

# Setup JupyterHub
RUN source /opt/utils/script-devbox-jupyter.sh \
&& for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} || true ) ; done

# If not keeping NodeJS, remove NoedJS to reduce image size, and install Traefik instead
RUN ${ARG_KEEP_NODEJS:-true} || ( \
echo "Removing Node/NPM..." && rm -rf /usr/bin/node /usr/bin/npm /usr/bin/npx /opt/node \
&& echo "Installing Traefik to server as proxy:" && source /opt/utils/script-setup.sh && setup_traefik \
)

# Clean up and display components version information...
RUN source /opt/utils/script-utils.sh && install__clean && list_installed_packages

EXPOSE 8888
&& for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} || true ) ; done \
# If not keeping NodeJS, remove NoedJS to reduce image size, and install Traefik instead
&& ${ARG_KEEP_NODEJS:-true} || ( \
echo "Removing Node/NPM..." && rm -rf /usr/bin/node /usr/bin/npm /usr/bin/npx /opt/node \
&& echo "Installing Traefik to server as proxy:" && source /opt/utils/script-setup.sh && setup_traefik \
) \
# Clean up and display components version information...
&& source /opt/utils/script-utils.sh && install__clean && list_installed_packages

ENTRYPOINT ["tini", "-g", "--"]
CMD ["jupyterhub"]

# '-c' option make bash commands are read from string.
# If there are arguments after the string, they are assigned to the positional parameters, starting with $0.
Expand All @@ -38,4 +33,6 @@ CMD ["jupyterhub"]
# '--login': make bash first reads and executes commands from the file /etc/profile, if that file exists.
# After that, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
SHELL ["/bin/bash", "--login", "-o", "pipefail", "-c"]
CMD ["start-jupyterhub.sh"]
WORKDIR "/opt/jupyterhub"
EXPOSE 8000
6 changes: 4 additions & 2 deletions docker_dev_box/work/script-devbox-jupyter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ setup_jupyter_extensions() {
setup_jupyter_hub() {
# ref1: https://github.com/jupyterhub/jupyterhub
# ref2: https://github.com/jupyterhub/jupyterhub/blob/main/Dockerfile
npm install -g npm configurable-http-proxy \
&& pip install -Uq oauthenticator jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \
which npm && npm install -g npm configurable-http-proxy

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)"
}
4 changes: 4 additions & 0 deletions docker_dev_box/work/start-jupyterhub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

jupyterhub $*
14 changes: 0 additions & 14 deletions docker_dev_box/work/start-jupyterlab.sh

This file was deleted.

0 comments on commit fddcbe5

Please sign in to comment.