Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jupyterhub-traefik-proxy 1.0.0 (mk2) #22870

Merged
72 changes: 72 additions & 0 deletions recipes/jupyterhub-traefik-proxy/000-ipv4-localhost.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git a/jupyterhub_traefik_proxy/proxy.py b/jupyterhub_traefik_proxy/proxy.py
index ddbefbe..28c218d 100644
--- a/jupyterhub_traefik_proxy/proxy.py
+++ b/jupyterhub_traefik_proxy/proxy.py
@@ -153,7 +153,7 @@ class TraefikProxy(Proxy):
)

traefik_api_url = Unicode(
- "http://localhost:8099",
+ "http://127.0.0.1:8099",
config=True,
help="""traefik authenticated api endpoint url""",
)
diff --git a/tests/conftest.py b/tests/conftest.py
index e35c0da..c8dfed5 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -224,13 +224,13 @@ def _make_etcd_proxy(*, auth=False, client_ca=None, **extra_kwargs):
client_ca = str(client_ca)
kwargs.update(
dict(
- etcd_url="https://localhost:2379",
+ etcd_url="https://127.0.0.1:2379",
etcd_username=Config.etcd_user,
etcd_password=Config.etcd_password,
etcd_client_kwargs=dict(
grpc_options=[
- ("grpc.ssl_target_name_override", "localhost"),
- ("grpc.default_authority", "localhost"),
+ ("grpc.ssl_target_name_override", "127.0.0.1"),
+ ("grpc.default_authority", "127.0.0.1"),
],
ca_cert=client_ca,
),
@@ -550,16 +550,16 @@ async def launch_etcd_auth(etcd_ssl_key_cert, etcd_client_ca):
f"--peer-trusted-ca-file={etcd_client_ca}",
f"--cert-file={cert}",
f"--key-file={key}",
- "--initial-cluster=default=https://localhost:2380",
- "--initial-advertise-peer-urls=https://localhost:2380",
- "--listen-peer-urls=https://localhost:2380",
- "--listen-client-urls=https://localhost:2379",
- "--advertise-client-urls=https://localhost:2379",
+ "--initial-cluster=default=https://127.0.0.1:2380",
+ "--initial-advertise-peer-urls=https://127.0.0.1:2380",
+ "--listen-peer-urls=https://127.0.0.1:2380",
+ "--listen-client-urls=https://127.0.0.1:2379",
+ "--advertise-client-urls=https://127.0.0.1:2379",
"--log-level=debug",
],
)
etcdctl_args = [
- "--endpoints=localhost:2379",
+ "--endpoints=127.0.0.1:2379",
"--user",
f"{Config.etcd_user}:{Config.etcd_password}",
f"--cacert={etcd_client_ca}",
@@ -575,11 +575,11 @@ async def launch_etcd_auth(etcd_ssl_key_cert, etcd_client_ca):
c = etcd3.client(
user=Config.etcd_user,
password=Config.etcd_password,
- host="localhost",
+ host="127.0.0.1",
port=2379,
grpc_options=[
- ("grpc.ssl_target_name_override", "localhost"),
- ("grpc.default_authority", "localhost"),
+ ("grpc.ssl_target_name_override", "127.0.0.1"),
+ ("grpc.default_authority", "127.0.0.1"),
],
ca_cert=etcd_client_ca,
)
151 changes: 151 additions & 0 deletions recipes/jupyterhub-traefik-proxy/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{% set version = "1.0.1" %}

package:
name: jupyterhub-traefik-proxy-split
version: {{ version }}

source:
url: https://pypi.org/packages/source/j/jupyterhub-traefik-proxy/jupyterhub-traefik-proxy-{{ version }}.tar.gz
sha256: 19f242763eb0ee4861537ed956cafe78db49c3bf653e7726717adce39599e2f5
patches:
- 000-ipv4-localhost.diff

build:
noarch: python
number: 0

requirements:
host:
- python >=3.6
run:
- python >=3.6

outputs:
- name: jupyterhub-traefik-proxy
build:
noarch: python
script:
- {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
requirements:
host:
- pip
- python >=3.6
run:
- aiohttp
- escapism
- jupyterhub >=0.9
- passlib
- python >=3.6
- toml
- traefik >=2,<3
test:
imports:
- jupyterhub_traefik_proxy
- jupyterhub_traefik_proxy.fileprovider
commands:
- pip check
requires:
- pip

- name: jupyterhub-traefik-proxy-with-consul
build:
noarch: python
requirements:
host:
- pip
- python >=3.6
run:
- {{ pin_subpackage("jupyterhub-traefik-proxy", max_pin="x.x.x") }}
- python >=3.6
- python-consul2
test:
imports:
- jupyterhub_traefik_proxy
- jupyterhub_traefik_proxy.consul
commands:
- pip check
requires:
- pip

- name: jupyterhub-traefik-proxy-with-etcd
build:
noarch: python
requirements:
host:
- pip
- python >=3.6
run:
- {{ pin_subpackage("jupyterhub-traefik-proxy", max_pin="x.x.x") }}
- etcdpy
- python >=3.6
test:
imports:
- jupyterhub_traefik_proxy
- jupyterhub_traefik_proxy.etcd
commands:
- pip check
requires:
- pip

- name: jupyterhub-traefik-proxy-with-yaml
build:
noarch: python
requirements:
host:
- pip
- python >=3.6
run:
- {{ pin_subpackage("jupyterhub-traefik-proxy", max_pin="x.x.x") }}
- python >=3.6
- ruamel.yaml
test:
imports:
- jupyterhub_traefik_proxy
commands:
- pip check
requires:
- pip

- name: jupyterhub-traefik-proxy-with-all
build:
noarch: python
requirements:
host:
- pip
- python >=3.6
run:
- {{ pin_subpackage("jupyterhub-traefik-proxy-with-consul", max_pin="x.x.x") }}
- {{ pin_subpackage("jupyterhub-traefik-proxy-with-etcd", max_pin="x.x.x") }}
- {{ pin_subpackage("jupyterhub-traefik-proxy-with-yaml", max_pin="x.x.x") }}
- {{ pin_subpackage("jupyterhub-traefik-proxy", max_pin="x.x.x") }}
- python >=3.6
test:
files:
- run_test_all.py
source_files:
- tests
imports:
- jupyterhub_traefik_proxy
commands:
- pip check
- python run_test_all.py
requires:
- notebook >=4.0,<7.0
- pip
- pytest
- pytest-asyncio
- pytest-cov
- websockets
- urllib3 <2

about:
home: https://jupyterhub-traefik-proxy.readthedocs.io
summary: JupyterHub proxy implementation with traefik
dev_url: https://github.com/jupyterhub/traefik-proxy
license: BSD-3-Clause
license_file: LICENSE

extra:
feedstock-name: jupyterhub-traefik-proxy
recipe-maintainers:
- bollwyvl
33 changes: 33 additions & 0 deletions recipes/jupyterhub-traefik-proxy/run_test_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import sys
import subprocess
import platform
from pathlib import Path

HERE = Path(__file__).parent

# pytest arg inputs... etcd is available on conda-forge, so _could_ be tested, but...
SKIPS = ["etcd", "consul"]
# slightly higher locally, but...
COV_FAIL_UNDER = 70

# osx-specific skips
if platform.system() == "Darwin":
SKIPS += ["(add_get_delete and external_file_proxy_toml)"]

PYTEST_ARGS = [
sys.executable,
"-m",
"pytest",
"-vv",
"--asyncio-mode=auto",
"--cov=jupyterhub_traefik_proxy",
"--cov-report=term-missing:skip-covered",
"--no-cov-on-fail",
f"--cov-fail-under={COV_FAIL_UNDER}",
"-k",
f"""not ({" or ".join(SKIPS)})""",
]

if __name__ == "__main__":
print("\t".join(PYTEST_ARGS))
sys.exit(subprocess.call(PYTEST_ARGS))