Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024.1.1 release #2419

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d5974bc
CLN: split #1928, refactor render test
fangchenli Feb 14, 2024
f3e3b02
update
fangchenli Feb 15, 2024
21581f9
Merge remote-tracking branch 'upstream/develop' into split-1928-test-…
fangchenli Feb 20, 2024
809c698
Merge branch 'develop' into split-1928-test-render
fangchenli Feb 28, 2024
182efab
Merge branch 'develop' into split-1928-test-render
fangchenli Mar 11, 2024
254424d
Add middleware to prefix JupyterHub navbar items with /hub.
marcelovilla Mar 26, 2024
9d2257d
Provide mechanism to skip cloud provider tests by setting repo NO_PRO…
tylergraff Mar 28, 2024
a385207
remove debug code
tylergraff Mar 28, 2024
01de097
Fix diverging main/develop (#2372)
dcmcand Apr 1, 2024
955697c
add full names for cloud provider in guided init
exitflynn Apr 1, 2024
4867dcb
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Apr 1, 2024
8094913
update azurerm version (#2370)
Adam-D-Lewis Apr 1, 2024
25b8ba3
Merge branch 'develop' into pre-commit-ci-update-config
aktech Apr 2, 2024
0449280
Merge branch 'develop' into jupyterhub-navbar-redirect
marcelovilla Apr 3, 2024
ecd26e6
Merge branch 'develop' into full_name_cloud_providers_cli
marcelovilla Apr 4, 2024
6a83ada
Get JupyterHub `groups` from Keycloak, support `oauthenticator` 16.3+…
krassowski Apr 4, 2024
5c03e88
Merge branch 'develop' into full_name_cloud_providers_cli
marcelovilla Apr 4, 2024
97c5991
add full names for cloud providers in guided init (#2375)
marcelovilla Apr 4, 2024
06b17aa
Merge branch 'develop' into split-1928-test-render
marcelovilla Apr 4, 2024
d1166fb
Merge branch 'develop' into jupyterhub-navbar-redirect
viniciusdc Apr 4, 2024
994b57b
Add middleware to prefix JupyterHub navbar items with /hub. (#2360)
marcelovilla Apr 4, 2024
7d59633
Merge branch 'develop' into split-1928-test-render
marcelovilla Apr 4, 2024
0f95420
CLN: split #1928, refactor render test (#2246)
marcelovilla Apr 5, 2024
fab1925
Merge branch 'develop' into pre-commit-ci-update-config
marcelovilla Apr 8, 2024
a5cbb13
[pre-commit.ci] pre-commit autoupdate (#2376)
marcelovilla Apr 8, 2024
e743bad
add trailing slash for jupyterhub proxy paths (#2387)
Adam-D-Lewis Apr 10, 2024
f3028b7
remove references to deprecated cdsdashboards (#2390)
Adam-D-Lewis Apr 10, 2024
a1c7d91
Shift the concurrency configuration away from the job level
viniciusdc Apr 11, 2024
42dc6a8
add cancel-in-progress
viniciusdc Apr 11, 2024
8d94bd4
Trigger concurrency group
viniciusdc Apr 11, 2024
a26b8df
add default node groups to config (#2398)
Adam-D-Lewis Apr 12, 2024
5784638
Add explanation on concurrency settings
viniciusdc Apr 16, 2024
5919747
Add upgrade step, edit current release version and add release notes.
marcelovilla Apr 16, 2024
ece881b
incorporate code comment feedback
tylergraff Apr 17, 2024
79b1218
Add prompt to ask user whether to include default node groups configu…
marcelovilla Apr 17, 2024
1cbb18d
Remove irrelevant empty line.
marcelovilla Apr 18, 2024
02bdede
Update release date.
marcelovilla Apr 18, 2024
91c6825
Update concurrency settings for Integration tests (#2393)
marcelovilla Apr 18, 2024
147b8ce
Make CI/CD Cloud Provider Test Conditional (#2369)
marcelovilla Apr 18, 2024
7c83e43
Prepare 2024.4.1 release (#2403)
marcelovilla Apr 19, 2024
cf90f8c
Update release date and add two new PRs to the whats changed section.
marcelovilla Apr 19, 2024
6b569df
Update release date.
marcelovilla Apr 20, 2024
7f8b767
Update release date and add two new PRs to the whats changed section.…
marcelovilla Apr 20, 2024
0c3adc8
make userscheduler run on general node group (#2415)
Adam-D-Lewis Apr 22, 2024
85d3a75
Upgrade to Pydantic V2 (#2348)
Adam-D-Lewis Apr 22, 2024
2f85ece
Pydantic2 PR fix (#2421)
Adam-D-Lewis Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/test-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ on:

jobs:
test-render-providers:
# avoid running on PRs coming from a fork
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
# Prevents the execution of this test under the following conditions:
# 1. When the 'NO_PROVIDER_CREDENTIALS' GitHub variable is set, indicating the absence of provider credentials.
# 2. For pull requests (PRs) originating from a fork, since GitHub does not provide the fork's credentials to the destination repository.
# ref. https://github.com/nebari-dev/nebari/issues/2379
if: |
vars.NO_PROVIDER_CREDENTIALS == '' &&
(github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request')
name: "Test Nebari Provider"
runs-on: ubuntu-latest
permissions:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test_local_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ on:
required: true
type: string

# When the cancel-in-progress: true option is specified, any concurrent jobs or workflows using the same
# concurrency group will cancel both the pending and currently running jobs or workflows. This allows only
# one job or workflow in the concurrency group to be in progress at a time.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test-local-integration:
runs-on: "cirun-runner--${{ github.run_id }}"
defaults:
run:
shell: bash -l {0}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
steps:
- name: 'Checkout Infrastructure'
uses: actions/checkout@main
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ repos:

# python
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.3.0
hooks:
- id: black
args: ["--line-length=88", "--exclude=/src/_nebari/template/"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.3.5
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -73,7 +73,7 @@ repos:

# terraform
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.86.0
rev: v1.88.4
hooks:
- id: terraform_fmt
args:
Expand Down
20 changes: 20 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ This file is copied to nebari-dev/nebari-docs using a GitHub Action. -->

---

## Release 2024.4.1 - April 20, 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
* Update concurrency settings for Integration tests by @viniciusdc in https://github.com/nebari-dev/nebari/pull/2393
* Make CI/CD Cloud Provider Test Conditional by @tylergraff in https://github.com/nebari-dev/nebari/pull/2369

### 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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies = [
"kubernetes==27.2.0",
"pluggy==1.3.0",
"prompt-toolkit==3.0.36",
"pydantic==1.10.12",
"pydantic==2.4.2",
"pynacl==1.5.0",
"python-keycloak>=3.9.0",
"questionary==2.0.0",
Expand Down
25 changes: 18 additions & 7 deletions src/_nebari/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
import pathlib
import re
import sys
import typing
from typing import Any, Dict, List, Union

import pydantic

from _nebari.utils import yaml


def set_nested_attribute(data: typing.Any, attrs: typing.List[str], value: typing.Any):
def set_nested_attribute(data: Any, attrs: List[str], value: Any):
"""Takes an arbitrary set of attributes and accesses the deep
nested object config to set value
"""

def _get_attr(d: typing.Any, attr: str):
def _get_attr(d: Any, attr: str):
if isinstance(d, list) and re.fullmatch(r"\d+", attr):
return d[int(attr)]
elif hasattr(d, "__getitem__"):
return d[attr]
else:
return getattr(d, attr)

def _set_attr(d: typing.Any, attr: str, value: typing.Any):
def _set_attr(d: Any, attr: str, value: Any):
if isinstance(d, list) and re.fullmatch(r"\d+", attr):
d[int(attr)] = value
elif hasattr(d, "__getitem__"):
Expand Down Expand Up @@ -63,6 +63,15 @@ def set_config_from_environment_variables(
return config


def dump_nested_model(model_dict: Dict[str, Union[pydantic.BaseModel, str]]):
result = {}
for key, value in model_dict.items():
result[key] = (
value.model_dump() if isinstance(value, pydantic.BaseModel) else value
)
return result


def read_configuration(
config_filename: pathlib.Path,
config_schema: pydantic.BaseModel,
Expand All @@ -77,7 +86,8 @@ def read_configuration(
)

with filename.open() as f:
config = config_schema(**yaml.load(f.read()))
config_dict = yaml.load(f)
config = config_schema(**config_dict)

if read_environment:
config = set_config_from_environment_variables(config)
Expand All @@ -87,14 +97,15 @@ def read_configuration(

def write_configuration(
config_filename: pathlib.Path,
config: typing.Union[pydantic.BaseModel, typing.Dict],
config: Union[pydantic.BaseModel, Dict],
mode: str = "w",
):
"""Write the nebari configuration file to disk"""
with config_filename.open(mode) as f:
if isinstance(config, pydantic.BaseModel):
yaml.dump(config.dict(), f)
yaml.dump(config.model_dump(), f)
else:
config = dump_nested_model(config)
yaml.dump(config, f)


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
18 changes: 15 additions & 3 deletions src/_nebari/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
import tempfile
from pathlib import Path
from typing import Any, Dict

import pydantic
import requests
Expand All @@ -18,6 +19,13 @@
)
from _nebari.provider.oauth.auth0 import create_client
from _nebari.stages.bootstrap import CiEnum
from _nebari.stages.infrastructure import (
DEFAULT_AWS_NODE_GROUPS,
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
from _nebari.stages.terraform_state import TerraformStateEnum
Expand Down Expand Up @@ -45,7 +53,7 @@ def render_config(
region: str = None,
disable_prompt: bool = False,
ssl_cert_email: str = None,
):
) -> Dict[str, Any]:
config = {
"provider": cloud_provider,
"namespace": namespace,
Expand Down Expand Up @@ -112,11 +120,12 @@ def render_config(
if cloud_provider == ProviderEnum.do:
do_region = region or constants.DO_DEFAULT_REGION
do_kubernetes_versions = kubernetes_version or get_latest_kubernetes_version(
digital_ocean.kubernetes_versions(do_region)
digital_ocean.kubernetes_versions()
)
config["digital_ocean"] = {
"kubernetes_version": do_kubernetes_versions,
"region": do_region,
"node_groups": node_groups_to_dict(DEFAULT_DO_NODE_GROUPS),
}

config["theme"]["jupyterhub"][
Expand All @@ -131,6 +140,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),
}

config["theme"]["jupyterhub"][
Expand All @@ -152,6 +162,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),
}

config["theme"]["jupyterhub"][
Expand All @@ -170,6 +181,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),
}
config["theme"]["jupyterhub"][
"hub_subtitle"
Expand All @@ -189,7 +201,7 @@ def render_config(
from nebari.plugins import nebari_plugin_manager

try:
config_model = nebari_plugin_manager.config_schema.parse_obj(config)
config_model = nebari_plugin_manager.config_schema.model_validate(config)
except pydantic.ValidationError as e:
print(str(e))

Expand Down
Loading
Loading