Skip to content

Commit

Permalink
Update upgrade for 2023.10.1 (#2080)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenafoster authored Oct 20, 2023
1 parent c57d501 commit 76769e0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
14 changes: 10 additions & 4 deletions src/_nebari/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,16 +529,16 @@ def _version_specific_upgrade(
return config


class Upgrade_2023_9_1(UpgradeStep):
version = "2023.9.1"
class Upgrade_2023_10_1(UpgradeStep):
version = "2023.10.1"
# JupyterHub Helm chart 2.0.0 (app version 3.0.0) requires K8S Version >=1.23. (reference: https://z2jh.jupyter.org/en/stable/)
# This released has been tested against 1.26
min_k8s_version = 1.26

def _version_specific_upgrade(
self, config, start_version, config_filename: Path, *args, **kwargs
):
# Upgrading to 2023.9.1 is considered high-risk because it includes a major refacto
# Upgrading to 2023.10.1 is considered high-risk because it includes a major refacto
# to introduce the extension mechanism system.
rich.print("\n ⚠️ Warning ⚠️")
rich.print(
Expand All @@ -555,7 +555,7 @@ def _version_specific_upgrade(
# which they can override if they are happy they understand the situation.
config["prevent_deploy"] = True

# Nebari version 2023.9.1 upgrades JupyterHub to 3.1. CDS Dashboards are only compatible with
# Nebari version 2023.10.1 upgrades JupyterHub to 3.1. CDS Dashboards are only compatible with
# JupyterHub versions 1.X and so will be removed during upgrade.
rich.print("\n ⚠️ Deprecation Warning ⚠️")
rich.print(
Expand All @@ -565,6 +565,12 @@ def _version_specific_upgrade(
rich.print("-> Removing cdsdashboards from config file.")
del config["cdsdashboards"]

# Deprecation Warning - ClearML, Prefect, kbatch
rich.print("\n ⚠️ Deprecation Warning ⚠️")
rich.print(
"-> We will be removing and ending support for ClearML, Prefect and kbatch in the next release. The kbatch has been functionally replaced by Argo-Jupyter-Scheduler. We have seen little interest in ClearML and Prefect in recent years, and removing makes sense at this point. However if you wish to continue using them with Nebari we encourage you to [green][link=https://www.nebari.dev/docs/how-tos/nebari-extension-system/#developing-an-extension]write your own Nebari extension[/link][/green]."
)

# Kubernetes version check
# JupyterHub Helm chart 2.0.0 (app version 3.0.0) requires K8S Version >=1.23. (reference: https://z2jh.jupyter.org/en/stable/)

Expand Down
18 changes: 9 additions & 9 deletions tests/tests_unit/test_cli_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from typer.testing import CliRunner

import _nebari.upgrade
import _nebari.version
from _nebari.cli import create_cli
from _nebari.constants import AZURE_DEFAULT_REGION
from _nebari.upgrade import UPGRADE_KUBERNETES_MESSAGE
from _nebari.utils import get_provider_config_block_name
from _nebari.version import rounded_ver_parse

MOCK_KUBERNETES_VERSIONS = {
"aws": ["1.20"],
Expand Down Expand Up @@ -393,12 +393,12 @@ def test_cli_upgrade_to_0_4_0_fails_for_custom_auth_without_attempt_fixes():


@pytest.mark.skipif(
_nebari.upgrade.__version__ < "2023.9.1",
reason="This test is only valid for versions <= 2023.9.1",
rounded_ver_parse(_nebari.upgrade.__version__) < rounded_ver_parse("2023.10.1"),
reason="This test is only valid for versions >= 2023.10.1",
)
def test_cli_upgrade_to_2023_9_1_cdsdashboard_removed(monkeypatch: pytest.MonkeyPatch):
def test_cli_upgrade_to_2023_10_1_cdsdashboard_removed(monkeypatch: pytest.MonkeyPatch):
start_version = "2023.7.2"
end_version = "2023.9.1"
end_version = "2023.10.1"

addl_config = yaml.safe_load(
"""
Expand All @@ -422,8 +422,8 @@ def test_cli_upgrade_to_2023_9_1_cdsdashboard_removed(monkeypatch: pytest.Monkey


@pytest.mark.skipif(
_nebari.upgrade.__version__ < "2023.9.1",
reason="This test is only valid for versions <= 2023.9.1",
rounded_ver_parse(_nebari.upgrade.__version__) < rounded_ver_parse("2023.10.1"),
reason="This test is only valid for versions >= 2023.10.1",
)
@pytest.mark.parametrize(
("provider", "k8s_status"),
Expand All @@ -442,11 +442,11 @@ def test_cli_upgrade_to_2023_9_1_cdsdashboard_removed(monkeypatch: pytest.Monkey
("gcp", "invalid"),
],
)
def test_cli_upgrade_to_2023_9_1_kubernetes_validations(
def test_cli_upgrade_to_2023_10_1_kubernetes_validations(
monkeypatch: pytest.MonkeyPatch, provider: str, k8s_status: str
):
start_version = "2023.7.2"
end_version = "2023.9.1"
end_version = "2023.10.1"
monkeypatch.setattr(_nebari.upgrade, "__version__", end_version)

kubernetes_configs = {
Expand Down

0 comments on commit 76769e0

Please sign in to comment.