Skip to content

Commit

Permalink
Prepare 2024.4.1 release (#2403)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelovilla authored Apr 19, 2024
2 parents 147b8ce + 02bdede commit 7c83e43
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 9 deletions.
18 changes: 18 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ This file is copied to nebari-dev/nebari-docs using a GitHub Action. -->

---

## Release 2024.4.1 - April 18, 2024

### What's Changed
* update azurerm version by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2370
* Get JupyterHub `groups` from Keycloak, support `oauthenticator` 16.3+ by @krassowski in https://github.com/nebari-dev/nebari/pull/2361
* add full names for cloud providers in guided init by @exitflynn in https://github.com/nebari-dev/nebari/pull/2375
* Add middleware to prefix JupyterHub navbar items with /hub. by @marcelovilla in https://github.com/nebari-dev/nebari/pull/2360
* CLN: split #1928, refactor render test by @fangchenli in https://github.com/nebari-dev/nebari/pull/2246
* add trailing slash for jupyterhub proxy paths by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2387
* remove references to deprecated cdsdashboards by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2390
* add default node groups to config by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2398

### New Contributors
* @exitflynn made their first contribution in https://github.com/nebari-dev/nebari/pull/2375

**Full Changelog**: https://github.com/nebari-dev/nebari/compare/2024.3.3...2024.4.1


## Release 2024.3.3 - March 27, 2024

### What's Changed
Expand Down
2 changes: 1 addition & 1 deletion src/_nebari/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CURRENT_RELEASE = "2024.3.3"
CURRENT_RELEASE = "2024.4.1"

# NOTE: Terraform cannot be upgraded further due to Hashicorp licensing changes
# implemented in August 2023.
Expand Down
13 changes: 5 additions & 8 deletions src/_nebari/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
DEFAULT_AZURE_NODE_GROUPS,
DEFAULT_DO_NODE_GROUPS,
DEFAULT_GCP_NODE_GROUPS,
node_groups_to_dict,
)
from _nebari.stages.kubernetes_ingress import CertificateEnum
from _nebari.stages.kubernetes_keycloak import AuthenticationEnum
Expand All @@ -36,10 +37,6 @@
WELCOME_HEADER_TEXT = "Your open source data science platform, hosted"


def _node_groups_to_dict(node_groups):
return {ng_name: ng.dict() for ng_name, ng in node_groups.items()}


def render_config(
project_name: str,
nebari_domain: str = None,
Expand Down Expand Up @@ -127,7 +124,7 @@ def render_config(
config["digital_ocean"] = {
"kubernetes_version": do_kubernetes_versions,
"region": do_region,
"node_groups": _node_groups_to_dict(DEFAULT_DO_NODE_GROUPS),
"node_groups": node_groups_to_dict(DEFAULT_DO_NODE_GROUPS),
}

config["theme"]["jupyterhub"][
Expand All @@ -142,7 +139,7 @@ def render_config(
config["google_cloud_platform"] = {
"kubernetes_version": gcp_kubernetes_version,
"region": gcp_region,
"node_groups": _node_groups_to_dict(DEFAULT_GCP_NODE_GROUPS),
"node_groups": node_groups_to_dict(DEFAULT_GCP_NODE_GROUPS),
}

config["theme"]["jupyterhub"][
Expand All @@ -164,7 +161,7 @@ def render_config(
"kubernetes_version": azure_kubernetes_version,
"region": azure_region,
"storage_account_postfix": random_secure_string(length=4),
"node_groups": _node_groups_to_dict(DEFAULT_AZURE_NODE_GROUPS),
"node_groups": node_groups_to_dict(DEFAULT_AZURE_NODE_GROUPS),
}

config["theme"]["jupyterhub"][
Expand All @@ -183,7 +180,7 @@ def render_config(
config["amazon_web_services"] = {
"kubernetes_version": aws_kubernetes_version,
"region": aws_region,
"node_groups": _node_groups_to_dict(DEFAULT_AWS_NODE_GROUPS),
"node_groups": node_groups_to_dict(DEFAULT_AWS_NODE_GROUPS),
}
config["theme"]["jupyterhub"][
"hub_subtitle"
Expand Down
11 changes: 11 additions & 0 deletions src/_nebari/stages/infrastructure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def _calculate_node_groups(config: schema.Main):
return config.local.dict()["node_selectors"]


def node_groups_to_dict(node_groups):
return {ng_name: ng.dict() for ng_name, ng in node_groups.items()}


@contextlib.contextmanager
def kubernetes_provider_context(kubernetes_credentials: Dict[str, str]):
credential_mapping = {
Expand Down Expand Up @@ -542,6 +546,13 @@ class ExistingProvider(schema.Base):
value: key.value for key, value in provider_enum_name_map.items()
}

provider_enum_default_node_groups_map: Dict[schema.ProviderEnum, Any] = {
schema.ProviderEnum.gcp: node_groups_to_dict(DEFAULT_GCP_NODE_GROUPS),
schema.ProviderEnum.aws: node_groups_to_dict(DEFAULT_AWS_NODE_GROUPS),
schema.ProviderEnum.azure: node_groups_to_dict(DEFAULT_AZURE_NODE_GROUPS),
schema.ProviderEnum.do: node_groups_to_dict(DEFAULT_DO_NODE_GROUPS),
}


class InputSchema(schema.Base):
local: Optional[LocalProvider]
Expand Down
35 changes: 35 additions & 0 deletions src/_nebari/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
from rich.prompt import Prompt

from _nebari.config import backup_configuration
from _nebari.stages.infrastructure import (
provider_enum_default_node_groups_map,
provider_enum_name_map,
)
from _nebari.utils import (
get_k8s_version_prefix,
get_provider_config_block_name,
Expand Down Expand Up @@ -738,6 +742,37 @@ def _version_specific_upgrade(
return config


class Upgrade_2024_4_1(UpgradeStep):
version = "2024.4.1"

def _version_specific_upgrade(
self, config, start_version, config_filename: Path, *args, **kwargs
):
# Default configuration for the node groups was added in this version. Therefore,
# users upgrading who don't have any specific node groups defined on their config
# file already, will be prompted and asked whether they want to include the default
if provider := config.get("provider", ""):
provider_full_name = provider_enum_name_map[provider]
if provider_full_name in config and "node_groups" not in config.get(
provider_full_name, {}
):
try:
default_node_groups = provider_enum_default_node_groups_map[
provider
]
continue_ = Prompt.ask(
f"Would you like to include the default configuration for the node groups in [purple]{config_filename}[/purple]?",
choices=["y", "N"],
default="N",
)
if continue_ == "y":
config[provider_full_name]["node_groups"] = default_node_groups
except KeyError:
pass

return config


__rounded_version__ = str(rounded_ver_parse(__version__))

# Manually-added upgrade steps must go above this line
Expand Down

0 comments on commit 7c83e43

Please sign in to comment.