Skip to content

Commit b7911ca

Browse files
authored
Merge pull request #115 from manics/refactor
Remove most configuration, get this working
2 parents d2bed7a + 1b80d4d commit b7911ca

23 files changed

+253
-783
lines changed

.env

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# 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
3+
#
4+
name: Tests
5+
6+
on:
7+
pull_request:
8+
push:
9+
workflow_dispatch:
10+
11+
jobs:
12+
# https://github.com/pre-commit/action
13+
pre-commit:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-python@v4
19+
- uses: pre-commit/action@v3.0.0
20+
21+
# Run tests
22+
test:
23+
runs-on: ubuntu-22.04
24+
timeout-minutes: 10
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
- uses: actions/setup-python@v4
30+
31+
- name: Get Docker version
32+
run: |
33+
docker --version
34+
docker-compose --version
35+
36+
- name: Install pytest
37+
run: pip install pytest
38+
39+
- name: Add a test admin token
40+
run: cat ci/config_token.py >> jupyterhub_config.py
41+
42+
- name: Run JupyterHub
43+
run: docker-compose up -d
44+
45+
- name: Test
46+
run: pytest -vs

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# pre-commit is a tool to perform a predefined set of tasks manually and/or
2+
# automatically before git commits are made.
3+
#
4+
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
5+
#
6+
# Common tasks
7+
#
8+
# - Run on all files: pre-commit run --all-files
9+
# - Register git hooks: pre-commit install --install-hooks
10+
#
11+
repos:
12+
# Autoformat: Python code
13+
- repo: https://github.com/psf/black
14+
rev: 22.8.0
15+
hooks:
16+
- id: black
17+
args:
18+
- --target-version=py38
19+
- --target-version=py39
20+
- --target-version=py310
21+
22+
# Autoformat: markdown, yaml
23+
- repo: https://github.com/pre-commit/mirrors-prettier
24+
rev: v2.7.1
25+
hooks:
26+
- id: prettier

Dockerfile.jupyterhub

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33
ARG JUPYTERHUB_VERSION
4-
FROM jupyterhub/jupyterhub-onbuild:$JUPYTERHUB_VERSION
4+
FROM jupyterhub/jupyterhub:$JUPYTERHUB_VERSION
55

6-
# Install dockerspawner, oauth, postgres
7-
RUN /opt/conda/bin/conda install -yq psycopg2=2.7 && \
8-
/opt/conda/bin/conda clean -tipsy && \
9-
/opt/conda/bin/pip install --no-cache-dir \
10-
oauthenticator==0.8.* \
11-
dockerspawner==0.9.*
6+
# Install dockerspawner, nativeauthenticator
7+
RUN python3 -m pip install --no-cache-dir \
8+
dockerspawner==12.* \
9+
jupyterhub-nativeauthenticator==1.*
1210

13-
# Copy TLS certificate and key
14-
ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.crt
15-
ENV SSL_KEY /srv/jupyterhub/secrets/jupyterhub.key
16-
COPY ./secrets/*.crt $SSL_CERT
17-
COPY ./secrets/*.key $SSL_KEY
18-
RUN chmod 700 /srv/jupyterhub/secrets && \
19-
chmod 600 /srv/jupyterhub/secrets/*
20-
21-
COPY ./userlist /srv/jupyterhub/userlist
11+
CMD ["jupyterhub", "-f", "/srv/jupyterhub/jupyterhub_config.py"]

Makefile

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)