Skip to content

Commit 99a4b45

Browse files
committed
Cleanup some code
1 parent 10dfa8d commit 99a4b45

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This is a GitHub workflow defining a set of jobs with a set of steps.
2-
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
2+
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
33
#
44
name: Tests
55

@@ -15,14 +15,15 @@ jobs:
1515
# https://github.com/pre-commit/action
1616
pre-commit:
1717
name: Lint
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-22.04
1919
steps:
2020
- uses: actions/checkout@v3
2121
- uses: actions/setup-python@v4
2222
- uses: pre-commit/action@v3.0.0
2323

2424
# Run tests
2525
test:
26+
name: Test
2627
runs-on: ubuntu-22.04
2728
timeout-minutes: 10
2829
strategy:
@@ -47,11 +48,9 @@ jobs:
4748
run: cat ci/config_token.py >> ${{ matrix.example }}/jupyterhub_config.py
4849

4950
- name: Run JupyterHub
50-
run: |
51-
cd ${{ matrix.example }}
52-
docker-compose up -d
51+
working-directory: ${{ matrix.example }}
52+
run: docker-compose up --detach
5353

5454
- name: Test
55-
run: |
56-
cd ${{ matrix.example }}
57-
pytest -vs
55+
working-directory: ${{ matrix.example }}
56+
run: pytest --verbose --capture=no

basic-example/Dockerfile.jupyterhub

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ ARG JUPYTERHUB_VERSION
44
FROM jupyterhub/jupyterhub:$JUPYTERHUB_VERSION
55

66
# Install dockerspawner, nativeauthenticator
7+
# hadolint ignore=DL3013
78
RUN python3 -m pip install --no-cache-dir \
8-
dockerspawner==12.* \
9-
jupyterhub-nativeauthenticator==1.*
9+
dockerspawner \
10+
jupyterhub-nativeauthenticator
1011

11-
COPY ./jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py
1212
CMD ["jupyterhub", "-f", "/srv/jupyterhub/jupyterhub_config.py"]

basic-example/docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ services:
3232
# All containers will join this network
3333
DOCKER_NETWORK_NAME: jupyterhub-network
3434
# JupyterHub will spawn this Notebook image for users
35-
DOCKER_NOTEBOOK_IMAGE: jupyter/minimal-notebook:latest
35+
DOCKER_NOTEBOOK_IMAGE: jupyter/base-notebook:latest
3636
# Notebook directory inside user image
3737
DOCKER_NOTEBOOK_DIR: /home/jovyan/work
3838
# Using this run command
3939
DOCKER_SPAWN_CMD: start-singleuser.sh
40-
command: >
41-
jupyterhub -f /srv/jupyterhub/jupyterhub_config.py
4240

4341
volumes:
4442
jupyterhub-data:

basic-example/jupyterhub_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
c.DockerSpawner.network_name = network_name
3131

3232
# Explicitly set notebook directory because we'll be mounting a volume to it.
33-
# Most jupyter/docker-stacks *-notebook images run the Notebook server as
33+
# Most `jupyter/docker-stacks` *-notebook images run the Notebook server as
3434
# user `jovyan`, and set the notebook directory to `/home/jovyan/work`.
3535
# We follow the same convention.
36-
notebook_dir = os.environ.get("DOCKER_NOTEBOOK_DIR") or "/home/jovyan/work"
36+
notebook_dir = os.environ.get("DOCKER_NOTEBOOK_DIR", "/home/jovyan/work")
3737
c.DockerSpawner.notebook_dir = notebook_dir
3838

3939
# Mount the real user's Docker volume on the host to the notebook user's

ci/check_hub.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ while [ $count -lt 60 ]; do
1313
printf .
1414
count=$((count+1))
1515
done
16+
1617
if [ $started -eq 0 ]; then
1718
echo "*****"
1819
echo "JupyterHub did not start"

0 commit comments

Comments
 (0)