From a9b6812b94d061e11765408b21dabda44e0fd784 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Sun, 4 Jun 2023 22:30:42 +0200 Subject: [PATCH 1/5] Update to jupyterhub 3.0.0-alpha.1 --- .github/workflows/test.yml | 8 ++++---- helm-chart/binderhub/Chart.yaml | 4 ++-- helm-chart/images/binderhub/requirements.in | 2 +- helm-chart/images/binderhub/requirements.txt | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8d64d1d0..30bcd12cb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,7 @@ jobs: k3s-channel: # Available channels: https://github.com/k3s-io/k3s/blob/HEAD/channel.yaml # Don't use "latest", instead bump it using a PR so we know when a new version breaks BinderHub - - v1.26 + - v1.27 test: - main - auth @@ -69,7 +69,7 @@ jobs: # which isn't documented anywhere, but is currently at 3.5.0. We also # test with the latest k8s and helm versions. # - - k3s-channel: v1.21 + - k3s-channel: v1.23 helm-version: v3.5.0 test: helm test-variation: dind @@ -77,14 +77,14 @@ jobs: --values testing/k8s-binder-k8s-hub/binderhub-chart+dind.yaml --set config.BinderHub.image_prefix=$REGISTRY_HOST/test/ --set registry.url=http://$REGISTRY_HOST - - k3s-channel: v1.26 + - k3s-channel: v1.27 test: helm test-variation: pink local-chart-extra-args: >- --values testing/k8s-binder-k8s-hub/binderhub-chart+pink.yaml --set config.BinderHub.image_prefix=$REGISTRY_HOST/test/ --set registry.url=http://$REGISTRY_HOST - - k3s-channel: v1.26 + - k3s-channel: v1.27 test: helm test-variation: upgrade # upgrade-from represents a release channel, see: https://jupyterhub.github.io/helm-chart/info.json diff --git a/helm-chart/binderhub/Chart.yaml b/helm-chart/binderhub/Chart.yaml index 9b58c8d30..49f40b4a4 100644 --- a/helm-chart/binderhub/Chart.yaml +++ b/helm-chart/binderhub/Chart.yaml @@ -12,7 +12,7 @@ dependencies: # and run "./dependencies freeze --upgrade". # - name: jupyterhub - version: "2.0.0" + version: "3.0.0-alpha.1" repository: "https://jupyterhub.github.io/helm-chart" description: |- BinderHub is like a JupyterHub that automatically builds environments for the @@ -22,7 +22,7 @@ keywords: [jupyter, jupyterhub, binderhub] home: https://binderhub.readthedocs.io/en/latest/ sources: [https://github.com/jupyterhub/binderhub] icon: https://jupyterhub.github.io/helm-chart/images/hublogo.svg -kubeVersion: ">=1.21.0-0" +kubeVersion: ">=1.23.0-0" maintainers: # Since it is a requirement of Artifact Hub to have specific maintainers # listed, we have added some below, but in practice the entire JupyterHub team diff --git a/helm-chart/images/binderhub/requirements.in b/helm-chart/images/binderhub/requirements.in index 061fadc65..1b462744b 100644 --- a/helm-chart/images/binderhub/requirements.in +++ b/helm-chart/images/binderhub/requirements.in @@ -10,7 +10,7 @@ google-cloud-logging==3.* # jupyterhub's major version should be matched with the JupyterHub Helm chart's # used version of JupyterHub. # -jupyterhub==3.* +jupyterhub==4.* # https://github.com/kubernetes-client/python kubernetes==9.* diff --git a/helm-chart/images/binderhub/requirements.txt b/helm-chart/images/binderhub/requirements.txt index 79f925996..47e72cb21 100644 --- a/helm-chart/images/binderhub/requirements.txt +++ b/helm-chart/images/binderhub/requirements.txt @@ -76,7 +76,7 @@ jsonschema==4.17.3 # jupyter-telemetry jupyter-telemetry==0.1.0 # via jupyterhub -jupyterhub==3.1.1 +jupyterhub==4.0.0 # via # -r helm-chart/images/binderhub/../../../requirements.txt # -r helm-chart/images/binderhub/requirements.in From 76510b0f51d0da02023396000625680c935b0760 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Sun, 4 Jun 2023 22:52:15 +0200 Subject: [PATCH 2/5] maint: adjust test against jupyterhub to pass _xsrf token --- binderhub/tests/test_auth.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/binderhub/tests/test_auth.py b/binderhub/tests/test_auth.py index 74121b055..7ef9e9a2b 100644 --- a/binderhub/tests/test_auth.py +++ b/binderhub/tests/test_auth.py @@ -44,15 +44,22 @@ async def test_auth(app, path, authenticated, use_session): # not authenticated, we should get the page and be done assert r.url == url return + assert "/hub/login" in urlparse(r.url).path + + # acquire a _xsrf cookie to pass in the post request we are about to make + login_url = f"{app.hub_url}/hub/login" + r2 = await async_requests.get(login_url) + assert r2.status_code == 200, f"{r2.status_code} {r2.url}" + _xsrf_cookie = r2.cookies.get("_xsrf", path="/hub/") + assert _xsrf_cookie # submit login form - assert "/hub/login" in urlparse(r.url).path - r2 = await async_requests.post( - r.url, data={"username": "dummy", "password": "dummy"} + r3 = await async_requests.post( + r.url, data={"username": "dummy", "password": "dummy", "_xsrf": _xsrf_cookie} ) - assert r2.status_code == 200, f"{r2.status_code} {r.url}" + assert r3.status_code == 200, f"{r3.status_code} {r3.url}" # verify that we landed at the destination after auth - assert r2.url == url + assert r3.url == url @skip_remote From 90752f8f05946c3abd9a50f7c218a5337045b4c1 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 5 Jun 2023 14:36:22 +0200 Subject: [PATCH 3/5] Update changelog about breaking changes --- CHANGES.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9e8cf3d5e..0e2de9cf9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,11 +27,12 @@ If you have custom configuration you should add it using the `extraConfig` Helm - `cors.allowedOrigin` ➡️ `config.BinderHub.cors_allow_origin` - `jupyterhub.custom.cors.allowedOrigin` ➡️ `jupyterhub.hub.config.BinderSpawner.cors_allow_origin` -### Kubernetes 1.21+ is required +### Kubernetes 1.23+ is required Older versions of Kubernetes are no longer supported [#1493](https://github.com/jupyterhub/binderhub/pull/1493) -[#1609](https://github.com/jupyterhub/binderhub/pull/1609). +[#1609](https://github.com/jupyterhub/binderhub/pull/1609) +[#1714](https://github.com/jupyterhub/binderhub/pull/1714). ### `dind.enabled` replaced by `imageBuilderType: dind` @@ -75,11 +76,14 @@ The following build configuration properties should be set using Traitlets in th If you have subclassed `binderhub.build.Build` you must update your subclass (including `__init__()` if defined) to inherit from `binderhub.build.KubernetesBuildExecutor`. The behaviour of the class is otherwise unchanged. -### Z2JH 2 and JupyterHub 3 +### Z2JH 3 and JupyterHub 4 -The Z2JH dependency has been updated to 2.0.0 which includes JupyterHub 3 -[#1544](https://github.com/jupyterhub/binderhub/pull/1544). -See https://z2jh.jupyter.org/en/stable/administrator/upgrading/upgrade-1-to-2.html for breaking changes. +The Z2JH dependency has been updated from 1.2.0 to 3.0.0 which includes JupyterHub 4 +[#1544](https://github.com/jupyterhub/binderhub/pull/1544) [#1714](https://github.com/jupyterhub/binderhub/pull/1714). + +See [Z2JH's upgrade notes](https://z2jh.jupyter.org/en/stable/administrator/upgrading/index.html) +and [changelog](https://z2jh.jupyter.org/en/latest/changelog.html) for breaking +changes in the upgrade from 1.2.0 to 2.0.0, and then from 2.0.0 to 3.0.0. ### Python versions have been increased From a98a7d979268917c2bbf2f0a266f2997190f967b Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 12 Jun 2023 15:09:53 +0200 Subject: [PATCH 4/5] Update z2jh to 3.0.0-beta.1 --- helm-chart/binderhub/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/binderhub/Chart.yaml b/helm-chart/binderhub/Chart.yaml index 49f40b4a4..b8058de95 100644 --- a/helm-chart/binderhub/Chart.yaml +++ b/helm-chart/binderhub/Chart.yaml @@ -12,7 +12,7 @@ dependencies: # and run "./dependencies freeze --upgrade". # - name: jupyterhub - version: "3.0.0-alpha.1" + version: "3.0.0-beta.1" repository: "https://jupyterhub.github.io/helm-chart" description: |- BinderHub is like a JupyterHub that automatically builds environments for the From a81862cbe44bb75739eec6961e9196578b9cda60 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 12 Jun 2023 17:00:41 +0200 Subject: [PATCH 5/5] Update jupyterhub from 4.0.0 to 4.0.1 --- helm-chart/images/binderhub/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/images/binderhub/requirements.txt b/helm-chart/images/binderhub/requirements.txt index 47e72cb21..9f4b0b381 100644 --- a/helm-chart/images/binderhub/requirements.txt +++ b/helm-chart/images/binderhub/requirements.txt @@ -76,7 +76,7 @@ jsonschema==4.17.3 # jupyter-telemetry jupyter-telemetry==0.1.0 # via jupyterhub -jupyterhub==4.0.0 +jupyterhub==4.0.1 # via # -r helm-chart/images/binderhub/../../../requirements.txt # -r helm-chart/images/binderhub/requirements.in