From a337b7ee76dcfe09cb1a81858efea03b92073c69 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Thu, 7 Nov 2024 13:17:45 +0000 Subject: [PATCH 1/8] Update Z2JH to 4.0.0 --- helm-chart/binderhub/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm-chart/binderhub/Chart.yaml b/helm-chart/binderhub/Chart.yaml index 66b24727f..c04c1b7d4 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.3.7" + version: "4.0.0" 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.23.0-0" +kubeVersion: ">=1.28.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 From 608cbd64b896137f677ee4c05a490f11cf1caac4 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Thu, 7 Nov 2024 15:37:58 +0000 Subject: [PATCH 2/8] Replace NullAuthenticator with `null` --- helm-chart/binderhub/values.yaml | 2 +- tools/templates/lint-and-validate-values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helm-chart/binderhub/values.yaml b/helm-chart/binderhub/values.yaml index e11c7237e..bd1f4c6dd 100644 --- a/helm-chart/binderhub/values.yaml +++ b/helm-chart/binderhub/values.yaml @@ -72,7 +72,7 @@ jupyterhub: hub: config: JupyterHub: - authenticator_class: nullauthenticator.NullAuthenticator + authenticator_class: "null" BinderSpawner: auth_enabled: false loadRoles: diff --git a/tools/templates/lint-and-validate-values.yaml b/tools/templates/lint-and-validate-values.yaml index 4b2d0ea15..92af3d540 100644 --- a/tools/templates/lint-and-validate-values.yaml +++ b/tools/templates/lint-and-validate-values.yaml @@ -56,7 +56,7 @@ jupyterhub: hub: config: JupyterHub: - authenticator_class: nullauthenticator.NullAuthenticator + authenticator_class: "null" extraConfig: hub-test-config: | dummy jupyterhub python code... From d36f86ab5ff946605144b785616b3fab451d3262 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Thu, 7 Nov 2024 15:41:03 +0000 Subject: [PATCH 3/8] Test k8s 1.28 - 1.30 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26cc61cbd..67333c21d 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.29 + - v1.30 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.23 + - k3s-channel: v1.28 helm-version: v3.5.0 test: helm test-variation: dind From 996291439fd43c24c617e0892a74bb3b92471148 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Thu, 7 Nov 2024 15:47:00 +0000 Subject: [PATCH 4/8] Remove timeout from `pytest.mark.asyncio` `ERROR binderhub/tests/test_build.py - ValueError: mark.asyncio accepts only a keyword argument 'scope'.` --- binderhub/tests/test_build.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/binderhub/tests/test_build.py b/binderhub/tests/test_build.py index 3f9fca503..d05439080 100644 --- a/binderhub/tests/test_build.py +++ b/binderhub/tests/test_build.py @@ -21,7 +21,7 @@ # We have optimized this slow test, for more information, see the README of # https://github.com/binderhub-ci-repos/minimal-dockerfile. -@pytest.mark.asyncio(timeout=900) +@pytest.mark.asyncio @pytest.mark.parametrize( "slug", [ @@ -102,7 +102,7 @@ async def test_build(app, needs_build, needs_launch, always_build, slug, pytestc stop.raise_for_status() -@pytest.mark.asyncio(timeout=900) +@pytest.mark.asyncio @pytest.mark.parametrize( "app,build_only_query_param", [ @@ -152,7 +152,7 @@ async def test_build_only(app, build_only_query_param, needs_build): assert final["phase"] == "ready" -@pytest.mark.asyncio(timeout=120) +@pytest.mark.asyncio @pytest.mark.remote async def test_build_fail(app, needs_build, needs_launch, always_build): """ @@ -176,7 +176,7 @@ async def test_build_fail(app, needs_build, needs_launch, always_build): assert failed_events > 0, "Should have seen phase 'failed'" -@pytest.mark.asyncio(timeout=120) +@pytest.mark.asyncio @pytest.mark.parametrize( "app,build_only_query_param,expected_error_msg", [ @@ -485,7 +485,7 @@ async def test_local_repo2docker_build(): assert docker_client.images.get(name) -@pytest.mark.asyncio(timeout=20) +@pytest.mark.asyncio async def test_local_repo2docker_build_stop(io_loop): q = Queue() # We need a slow build here so that we can interrupt it, so pick a large repo that From ba490a751ab9511ea4b69b10e367a96c2233f3cd Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sat, 9 Nov 2024 18:44:25 +0000 Subject: [PATCH 5/8] EventLog: remove taskName if present --- binderhub/events.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/binderhub/events.py b/binderhub/events.py index a2a071140..02fa730e6 100644 --- a/binderhub/events.py +++ b/binderhub/events.py @@ -12,14 +12,17 @@ from traitlets.config import Configurable -def _skip_message(record, **kwargs): +def _skip_fields(record, **kwargs): """ - Remove 'message' from log record. + Remove unwanted fields from log record. - It is always emitted with 'null', and we do not want it, - since we are always emitting events only + message: always emitted with 'null', and we do not want it, + since we are always emitting events only + taskName: """ del record["message"] + if "taskName" in record: + del record["taskName"] return json.dumps(record, **kwargs) @@ -49,7 +52,7 @@ def __init__(self, *args, **kwargs): if self.handlers_maker: self.handlers = self.handlers_maker(self) - formatter = jsonlogger.JsonFormatter(json_serializer=_skip_message) + formatter = jsonlogger.JsonFormatter(json_serializer=_skip_fields) for handler in self.handlers: handler.setFormatter(formatter) self.log.addHandler(handler) From b60cfb0302fe3bdc2ad76aaa00458f1406ba8c87 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sat, 9 Nov 2024 18:47:32 +0000 Subject: [PATCH 6/8] Add timeouts back using `@pytest.mark.timeout()` --- binderhub/tests/test_build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/binderhub/tests/test_build.py b/binderhub/tests/test_build.py index d05439080..a3f014090 100644 --- a/binderhub/tests/test_build.py +++ b/binderhub/tests/test_build.py @@ -21,6 +21,7 @@ # We have optimized this slow test, for more information, see the README of # https://github.com/binderhub-ci-repos/minimal-dockerfile. +@pytest.mark.timeout(900) @pytest.mark.asyncio @pytest.mark.parametrize( "slug", @@ -102,6 +103,7 @@ async def test_build(app, needs_build, needs_launch, always_build, slug, pytestc stop.raise_for_status() +@pytest.mark.timeout(900) @pytest.mark.asyncio @pytest.mark.parametrize( "app,build_only_query_param", @@ -152,6 +154,7 @@ async def test_build_only(app, build_only_query_param, needs_build): assert final["phase"] == "ready" +@pytest.mark.timeout(120) @pytest.mark.asyncio @pytest.mark.remote async def test_build_fail(app, needs_build, needs_launch, always_build): @@ -176,6 +179,7 @@ async def test_build_fail(app, needs_build, needs_launch, always_build): assert failed_events > 0, "Should have seen phase 'failed'" +@pytest.mark.timeout(120) @pytest.mark.asyncio @pytest.mark.parametrize( "app,build_only_query_param,expected_error_msg", @@ -484,7 +488,7 @@ async def test_local_repo2docker_build(): docker_client = docker.from_env(version="auto") assert docker_client.images.get(name) - +@pytest.mark.timeout(20) @pytest.mark.asyncio async def test_local_repo2docker_build_stop(io_loop): q = Queue() From 5a4e43df3d136407578cb97a94a2e097326132bd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:12:36 +0000 Subject: [PATCH 7/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- binderhub/tests/test_build.py | 1 + 1 file changed, 1 insertion(+) diff --git a/binderhub/tests/test_build.py b/binderhub/tests/test_build.py index a3f014090..2384e6302 100644 --- a/binderhub/tests/test_build.py +++ b/binderhub/tests/test_build.py @@ -488,6 +488,7 @@ async def test_local_repo2docker_build(): docker_client = docker.from_env(version="auto") assert docker_client.images.get(name) + @pytest.mark.timeout(20) @pytest.mark.asyncio async def test_local_repo2docker_build_stop(io_loop): From 6f2e26f3ea96dc73d5c1518a66fab81f1a7baeec Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 10 Nov 2024 17:06:28 +0000 Subject: [PATCH 8/8] Remove pytest.mark.asyncio (should be automatic) --- binderhub/tests/test_build.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/binderhub/tests/test_build.py b/binderhub/tests/test_build.py index 2384e6302..029ac4ba9 100644 --- a/binderhub/tests/test_build.py +++ b/binderhub/tests/test_build.py @@ -22,7 +22,6 @@ # We have optimized this slow test, for more information, see the README of # https://github.com/binderhub-ci-repos/minimal-dockerfile. @pytest.mark.timeout(900) -@pytest.mark.asyncio @pytest.mark.parametrize( "slug", [ @@ -104,7 +103,6 @@ async def test_build(app, needs_build, needs_launch, always_build, slug, pytestc @pytest.mark.timeout(900) -@pytest.mark.asyncio @pytest.mark.parametrize( "app,build_only_query_param", [ @@ -155,7 +153,6 @@ async def test_build_only(app, build_only_query_param, needs_build): @pytest.mark.timeout(120) -@pytest.mark.asyncio @pytest.mark.remote async def test_build_fail(app, needs_build, needs_launch, always_build): """ @@ -180,7 +177,6 @@ async def test_build_fail(app, needs_build, needs_launch, always_build): @pytest.mark.timeout(120) -@pytest.mark.asyncio @pytest.mark.parametrize( "app,build_only_query_param,expected_error_msg", [ @@ -490,7 +486,6 @@ async def test_local_repo2docker_build(): @pytest.mark.timeout(20) -@pytest.mark.asyncio async def test_local_repo2docker_build_stop(io_loop): q = Queue() # We need a slow build here so that we can interrupt it, so pick a large repo that