Skip to content

Commit

Permalink
upgrade instructions for PR 2453 (#2466)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelovilla authored May 23, 2024
2 parents 11717f9 + 4b5ff03 commit 619684d
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions src/_nebari/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
import secrets
import string
import textwrap
from abc import ABC
from pathlib import Path
from typing import Any, ClassVar, Dict
Expand Down Expand Up @@ -784,6 +785,78 @@ def _version_specific_upgrade(
return config


class Upgrade_2024_6_1(UpgradeStep):
version = "2024.6.1"

def _version_specific_upgrade(
self, config, start_version, config_filename: Path, *args, **kwargs
):
if (provider := config.get("provider", "")) == ProviderEnum.gcp.value:
provider_full_name = provider_enum_name_map[provider]
if not config.get(provider_full_name, {}).get("node_groups", {}):
try:
text = textwrap.dedent(
f"""
The default node groups for GCP have been changed to cost efficient e2 family nodes reducing the running cost of Nebari on GCP by ~50%.
This change will affect your current deployment, and will result in ~15 minutes of downtime during the upgrade step as the node groups are switched out, but shouldn't result in data loss.
As always, make sure to backup data before upgrading. See https://www.nebari.dev/docs/how-tos/manual-backup for more information.
Would you like to upgrade to the cost effective node groups [purple]{config_filename}[/purple]?
If not, select "N" and the old default node groups will be added to the nebari config file.
"""
)
continue_ = Prompt.ask(
text,
choices=["y", "N"],
default="y",
)
if continue_ == "N":
config[provider_full_name]["node_groups"] = {
"general": {
"instance": "n1-standard-8",
"min_nodes": 1,
"max_nodes": 1,
},
"user": {
"instance": "n1-standard-4",
"min_nodes": 0,
"max_nodes": 5,
},
"worker": {
"instance": "n1-standard-4",
"min_nodes": 0,
"max_nodes": 5,
},
}
except KeyError:
pass
else:
text = textwrap.dedent(
"""
The default node groups for GCP have been changed to cost efficient e2 family nodes reducing the running cost of Nebari on GCP by ~50%.
Consider upgrading your node group instance types to the new default configuration.
Upgrading your general node will result in ~15 minutes of downtime during the upgrade step as the node groups are switched out, but shouldn't result in data loss.
As always, make sure to backup data before upgrading. See https://www.nebari.dev/docs/how-tos/manual-backup for more information.
The new default node groups instances are:
"""
)
text += json.dumps(
{
"general": {"instance": "e2-highmem-4"},
"user": {"instance": "e2-standard-4"},
"worker": {"instance": "e2-standard-4"},
},
indent=4,
)
text += "\n\nHit enter to continue"
Prompt.ask(text)
return config


__rounded_version__ = str(rounded_ver_parse(__version__))

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

0 comments on commit 619684d

Please sign in to comment.