Skip to content

Commit

Permalink
Merge pull request #527 from minrk/internal-ssl
Browse files Browse the repository at this point in the history
update internal-ssl test for current docker compose
  • Loading branch information
minrk authored Feb 12, 2025
2 parents e7d609b + 1e5dd7d commit 3befb25
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions examples/internal-ssl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM jupyterhub/jupyterhub:4
FROM jupyterhub/jupyterhub:5

COPY setup.py requirements.txt /src/dockerspawner/
COPY pyproject.toml setup.py requirements.txt /src/dockerspawner/
COPY dockerspawner /src/dockerspawner/dockerspawner
RUN pip install /src/dockerspawner

Expand Down
17 changes: 7 additions & 10 deletions examples/internal-ssl/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

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

services:
proxy:
depends_on:
generate-certs:
condition: service_completed_successfully

container_name: proxy
image: jupyterhub/configurable-http-proxy:4
image: quay.io/jupyterhub/configurable-http-proxy:4
restart: always
environment:
CONFIGPROXY_AUTH_TOKEN: ${CONFIGPROXY_AUTH_TOKEN}
Expand Down Expand Up @@ -110,13 +107,13 @@ services:
volumes:
data:
external:
name: ${DATA_VOLUME_HOST}
name: ${DATA_VOLUME_HOST}
external: true
ssl:
external:
name: ${SSL_VOLUME_HOST}
name: ${SSL_VOLUME_HOST}
external: true

networks:
default:
external:
name: ${DOCKER_NETWORK_NAME}
name: ${DOCKER_NETWORK_NAME}
external: true
10 changes: 5 additions & 5 deletions examples/internal-ssl/test_internal_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@pytest.fixture(scope='session')
def compose_build():
check_call(['docker-compose', 'build'], cwd=here)
check_call(['docker', 'compose', 'build'], cwd=here)


@pytest.fixture(scope='session')
Expand Down Expand Up @@ -49,27 +49,27 @@ def volumes_and_networks():

@pytest.fixture(scope='session')
def compose_up(volumes_and_networks, compose_build):
p = Popen(['docker-compose', 'up'], cwd=here)
p = Popen(['docker', 'compose', 'up'], cwd=here)
for i in range(60):
try:
r = requests.get(hub_url + '/hub/')
r.raise_for_status()
except Exception:
time.sleep(1)
if p.poll() is not None:
raise RuntimeError("`docker-compose up` failed")
raise RuntimeError("`docker compose up` failed")
else:
break
else:
p.terminate()
check_call(['docker-compose', 'rm', '-s', '-f'], cwd=here)
check_call(['docker', 'compose', 'rm', '-s', '-f'], cwd=here)
raise TimeoutError("hub never showed up at %s" % hub_url)

try:
yield
finally:
p.terminate()
check_call(['docker-compose', 'rm', '-s', '-f'], cwd=here)
check_call(['docker', 'compose', 'rm', '-s', '-f'], cwd=here)


def test_internal_ssl(compose_up):
Expand Down

0 comments on commit 3befb25

Please sign in to comment.