Skip to content

Commit

Permalink
Merge branch 'jupyterhub:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hungdinhxuan authored Nov 22, 2023
2 parents 923ae0a + bf76362 commit 29c43b7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 28 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ on:
workflow_dispatch:

jobs:
# https://github.com/pre-commit/action
pre-commit:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/[email protected]

# Run tests
test:
name: Test
Expand All @@ -44,7 +33,6 @@ jobs:
- name: Get Docker version
run: |
docker --version
docker-compose --version
- name: Install pytest
run: pip install pytest requests
Expand All @@ -54,13 +42,13 @@ jobs:

- name: Run JupyterHub
working-directory: ${{ matrix.example }}
run: docker-compose up --detach
run: docker compose up --detach

- name: Test
working-directory: ${{ matrix.example }}
run: pytest --verbose --capture=no

- name: Print docker-compose logs
- name: Print docker compose logs
if: always()
working-directory: ${{ matrix.example }}
run: docker-compose logs
run: docker compose logs
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Key components of this reference deployment are:
- **Authenticator**: Uses [Native Authenticator](https://github.com/jupyterhub/nativeauthenticator) to authenticate users.
Any user will be allowed to sign up.

- **Spawner**:Uses [DockerSpawner](https://github.com/jupyterhub/dockerspawner)
- **Spawner**: Uses [DockerSpawner](https://github.com/jupyterhub/dockerspawner)
to spawn single-user Jupyter Notebook servers in separate Docker
containers on the same host.

Expand All @@ -60,11 +60,11 @@ This deployment uses [JupyterHub Native Authenticator](https://native-authentica

## Build the JupyterHub Docker image

1. Use [docker-compose](https://docs.docker.com/compose/reference/) to build
1. Use [docker compose](https://docs.docker.com/compose/reference/) to build
the JupyterHub Docker image:

```bash
docker-compose build
docker compose build
```

## Customisation: Jupyter Notebook Image
Expand All @@ -85,14 +85,14 @@ JupyterHub may timeout if the image being pulled is large, so it is better to
pull the image to the host before running JupyterHub.

This deployment defaults to the
[jupyter/base-notebook](https://hub.docker.com/r/jupyter/base-notebook/)
[quay.io/jupyter/base-notebook](https://quay.io/repository/jupyter/base-notebook)
Notebook image, which is built from the `base-notebook`
[Docker stacks](https://github.com/jupyter/docker-stacks).

You can pull the image using the following command:

```bash
docker pull jupyter/base-notebook:latest
docker pull quay.io/jupyter/base-notebook:latest
```

## Run JupyterHub
Expand All @@ -102,15 +102,15 @@ Run the JupyterHub container on the host.
To run the JupyterHub container in detached mode:

```bash
docker-compose up -d
docker compose up -d
```

Once the container is running, you should be able to access the JupyterHub console at `http://localhost:8000`.

To bring down the JupyterHub container:

```bash
docker-compose down
docker compose down
```

---
Expand Down Expand Up @@ -166,8 +166,8 @@ Suppose you have the following running containers:
docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Names}}"

CONTAINER ID IMAGE NAMES
bc02dd6bb91b jupyter/minimal-notebook jupyter-jtyberg
7b48a0b33389 jupyterhub jupyterhub
bc02dd6bb91b quay.io/jupyter/minimal-notebook jupyter-jtyberg
7b48a0b33389 quay.io/jupyterhub jupyterhub
```

In this deployment, the user's notebook directories (`/home/jovyan/work`) are backed by Docker volumes.
Expand All @@ -185,7 +185,7 @@ docker run --rm \
-u root \
-v /tmp:/backups \
-v jtyberg:/notebooks \
jupyter/minimal-notebook \
quay.io/jupyter/minimal-notebook \
tar cvf /backups/jtyberg-backup.tar /notebooks
```

Expand Down
2 changes: 1 addition & 1 deletion basic-example/Dockerfile.jupyterhub
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
ARG JUPYTERHUB_VERSION
FROM jupyterhub/jupyterhub:$JUPYTERHUB_VERSION
FROM quay.io/jupyterhub/jupyterhub:$JUPYTERHUB_VERSION

# Install dockerspawner, nativeauthenticator
# hadolint ignore=DL3013
Expand Down
4 changes: 2 additions & 2 deletions basic-example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

# JupyterHub docker-compose configuration file
# JupyterHub docker compose configuration file
version: "3"

services:
Expand Down Expand Up @@ -32,7 +32,7 @@ services:
# All containers will join this network
DOCKER_NETWORK_NAME: jupyterhub-network
# JupyterHub will spawn this Notebook image for users
DOCKER_NOTEBOOK_IMAGE: jupyter/base-notebook:latest
DOCKER_NOTEBOOK_IMAGE: quay.io/jupyter/base-notebook:latest
# Notebook directory inside user image
DOCKER_NOTEBOOK_DIR: /home/jovyan/work

Expand Down

0 comments on commit 29c43b7

Please sign in to comment.