Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Fixing the requested changes in the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinkhalifa committed Dec 4, 2023
1 parent cbe27d6 commit 9f28ee5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 36 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ post](https://opendreamkit.org/2018/10/17/jupyterhub-docker/).
## Customizations made to the original deployment to fit our JupyterHub needs at the CRC:

### Jupyterlab container customizations
- Starting by the configuration of jupyterlab container ([Dockerfile](./jupyterlab/Dockerfile)), we used a recent docker image (jupyter/tensorflow-notebook:python-3.10) that includes Python3.10 and the commonly used packages in machine and deep learning.
- Starting by the configuration of jupyterlab container ([Dockerfile](./jupyterlab/Dockerfile)), we used a recent docker image (jupyter/tensorflow-notebook:python-3.11.5) that includes Python3.10 and the commonly used packages in machine and deep learning.
- Install linux packages that might be need for running the image (via ```apt install```).
- Install python packages that might be need for running the image including ([nb_conda_kernels](https://github.com/Anaconda-Platform/nb_conda_kernels)) which is used to manage kernels for JupyterLab/Jupyter Notebook.
- Prepare a configuration file for jupyter named "jupyter_config.json" with following contents:
Expand Down Expand Up @@ -62,7 +62,7 @@ and visit the generated tokenized link (looks like: http://127.0.0.1:8888/?toke
c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
c.LDAPAuthenticator.server_address = os.environ['LDAP_SERVER']
c.LDAPAuthenticator.bind_dn_template = [
"cn={username},ou=person,ou=people,dc=frank,dc=sam,dc=pitt,dc=edu"
os.environ['LDAP_BIND_DN_TEMPLATE']
]
```

Expand Down Expand Up @@ -118,6 +118,8 @@ and visit the generated tokenized link (looks like: http://127.0.0.1:8888/?toke
- DOCKER_NETWORK_NAME is the name of the Docker network used by the services; normally, this network gets an automatic name from Docker Compose, but the Hub needs to know this name to connect the single-user servers to it.
- DOCKER_NOTEBOOK_DIR is the directory inside the single-user server containers where the user's home directory will be mounted.
- HUB_IP is the IP address of the Hub service within the docker network. By using the container_name Compose directive, we can set an alias for the IP, and use the same for HUB_IP.
- LDAP_SERVER is the IP address of the LDAP server needed for the LDAP authentication.
- LDAP_BIND_DN_TEMPLATE is the LDAP bind DN template needed for the LDAP authentication.
- Set the restart policy to always, so that the Hub container will be restarted automatically if it crashes.
- Set the network name to the same name as the one used in the Hub configuration env variable above.
- JupyterLab configuration:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
- DOCKER_NETWORK_NAME=jupyterhub_network
- HUB_IP=jupyterhub
- LDAP_SERVER=ldap://sam-ldap-prod-01.cssd.pitt.edu
- LDAP_BIND_DN_TEMPLATE=cn={username},ou=person,ou=people,dc=frank,dc=sam,dc=pitt,dc=edu
restart: on-failure
networks:
- jupyterhub_network
Expand Down
37 changes: 4 additions & 33 deletions jupyterhub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,6 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
python3 \
freeipmi \
libfreeipmi-dev \
libhdf5-dev \
hwloc \
libhwloc-dev \
libibmad5 \
libibumad-dev \
numactl \
libnuma-dev \
perl \
libswitch-perl \
rrdtool \
librrd-dev \
libhttp-parser-dev \
libhttp-parser2.9 \
libjwt-dev \
libjwt0 \
libyaml-dev \
libyaml-0-2 \
libjson-c5 \
libjson-c-dev \
bzip2 \
libbz2-dev \
libffi-dev \
libssl-dev \
bats \
grep \
make \
Expand All @@ -44,15 +19,8 @@ RUN apt-get update && \
# Add config file required for using Slurm
COPY --chmod=600 sssd_config/sssd.conf /etc/sssd/sssd.conf

# Get example files and copy to corresponding directories

# The entrypoint script starts the DB and defines necessary DB constructs
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

RUN chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

COPY --chmod=755 entrypoint.sh /usr/local/bin/entrypoint.sh

ENV PIP_ROOT_USER_ACTION=ignore
RUN pip install --upgrade pip && \
Expand All @@ -63,3 +31,6 @@ RUN pip install --upgrade pip && \

# Configure environment so containers are managed by podman instead of docker
ENV DOCKER_HOST=unix:///var/run/docker.sock

# Specifying the entrypoint script
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
2 changes: 1 addition & 1 deletion jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
c.LDAPAuthenticator.server_address = os.environ['LDAP_SERVER']
c.LDAPAuthenticator.bind_dn_template = [
"cn={username},ou=person,ou=people,dc=frank,dc=sam,dc=pitt,dc=edu"
os.environ['LDAP_BIND_DN_TEMPLATE']
]
c.Authenticator.admin_users = {'djp81', 'yak73', 'leb140'}

Expand Down

0 comments on commit 9f28ee5

Please sign in to comment.