diff --git a/.github/workflows/generate_cli_doc.yml b/.github/workflows/generate_cli_doc.yml index c0ae6ee7d2..bc9aa6c4d5 100644 --- a/.github/workflows/generate_cli_doc.yml +++ b/.github/workflows/generate_cli_doc.yml @@ -25,10 +25,10 @@ jobs: working-directory: ./docs-sphinx steps: - name: Check out repository 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: "3.10" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 745272cd67..771999f51d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,7 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" @@ -20,7 +20,7 @@ jobs: run: python -m pip install --upgrade pip build - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -58,7 +58,7 @@ jobs: steps: - name: Set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" @@ -66,7 +66,7 @@ jobs: run: python -m pip install --upgrade pip build - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/run-precommit.yaml b/.github/workflows/run-precommit.yaml index 50904ae178..9592a58373 100644 --- a/.github/workflows/run-precommit.yaml +++ b/.github/workflows/run-precommit.yaml @@ -17,9 +17,9 @@ jobs: shell: bash -l {0} steps: - name: Checkout repository 🔔 - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 - name: Run terraform pre-commit ⚡️ - uses: pre-commit/action@v3.0.0 + uses: pre-commit/action@v3.0.1 with: extra_args: --all-files terraform_fmt diff --git a/.github/workflows/test-provider.yaml b/.github/workflows/test-provider.yaml index 3c0a3fa89c..717a332482 100644 --- a/.github/workflows/test-provider.yaml +++ b/.github/workflows/test-provider.yaml @@ -56,7 +56,7 @@ jobs: fail-fast: false steps: - name: "Checkout Infrastructure" - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout the branch from the PR that triggered the job if: ${{ github.event_name == 'issue_comment' }} @@ -65,9 +65,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.11" - name: Retrieve secret from Vault uses: hashicorp/vault-action@v2.5.0 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6a8fa4a446..5e527e9aa5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,22 +32,21 @@ jobs: strategy: matrix: python-version: - - "3.8" - - "3.9" - "3.10" - "3.11" + - "3.12" fail-fast: false concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.python-version }} cancel-in-progress: true steps: - name: "Checkout Infrastructure" - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup miniconda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/test_aws_integration.yaml b/.github/workflows/test_aws_integration.yaml index fa1a2332df..36112ccd50 100644 --- a/.github/workflows/test_aws_integration.yaml +++ b/.github/workflows/test_aws_integration.yaml @@ -43,13 +43,13 @@ jobs: contents: read steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ env.NEBARI_GH_BRANCH }} fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/test_conda_build.yaml b/.github/workflows/test_conda_build.yaml index e34363d9a3..2a959cdb6b 100644 --- a/.github/workflows/test_conda_build.yaml +++ b/.github/workflows/test_conda_build.yaml @@ -25,21 +25,21 @@ jobs: cancel-in-progress: true steps: - name: "Checkout Infrastructure" - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup miniconda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: 3.8 + python-version: "3.10" channels: conda-forge activate-environment: nebari-dev - name: Install dependencies run: | - conda install build grayskull conda-build + conda install build grayskull conda-build conda-verify - name: Generate sdist run: | @@ -52,3 +52,8 @@ jobs: - name: Build conda package run: | conda build nebari + + - name: Test conda package + run: | + conda install --use-local nebari + nebari --version diff --git a/.github/workflows/test_do_integration.yaml b/.github/workflows/test_do_integration.yaml index dbe10a3028..dcfacf3175 100644 --- a/.github/workflows/test_do_integration.yaml +++ b/.github/workflows/test_do_integration.yaml @@ -42,12 +42,12 @@ jobs: pull-requests: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ env.NEBARI_GH_BRANCH }} fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/test_gcp_integration.yaml b/.github/workflows/test_gcp_integration.yaml index 57ef84288f..0418e0af40 100644 --- a/.github/workflows/test_gcp_integration.yaml +++ b/.github/workflows/test_gcp_integration.yaml @@ -42,13 +42,13 @@ jobs: pull-requests: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ env.NEBARI_GH_BRANCH }} fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/test_helm_charts.yaml b/.github/workflows/test_helm_charts.yaml index daf9abb6da..1d86eb92e4 100644 --- a/.github/workflows/test_helm_charts.yaml +++ b/.github/workflows/test_helm_charts.yaml @@ -23,13 +23,13 @@ jobs: runs-on: ubuntu-latest steps: - name: "Checkout Infrastructure" - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.11" - name: Install additional Python dependencies run: | pip install python-hcl2 diff --git a/.github/workflows/test_local_integration.yaml b/.github/workflows/test_local_integration.yaml index 05dec384b0..67e2a7108e 100644 --- a/.github/workflows/test_local_integration.yaml +++ b/.github/workflows/test_local_integration.yaml @@ -57,12 +57,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 env: CONDA: /home/runnerx/miniconda3 with: auto-update-conda: true - python-version: 3.8 + python-version: "3.11" miniconda-version: "latest" - name: Install Nebari and playwright @@ -70,7 +70,7 @@ jobs: pip install .[dev] playwright install - - uses: azure/setup-kubectl@v3 + - uses: azure/setup-kubectl@v4.0.0 with: version: v1.19.16 @@ -140,9 +140,9 @@ jobs: nebari keycloak adduser --user "${TEST_USERNAME}" "${TEST_PASSWORD}" --config nebari-config.yaml nebari keycloak listusers --config nebari-config.yaml - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 - name: Get nebari-config.yaml full path run: echo "NEBARI_CONFIG_PATH=`realpath ./local-deployment/nebari-config.yaml`" >> "$GITHUB_ENV" @@ -170,7 +170,7 @@ jobs: - name: Save Cypress screenshots and videos if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.1 with: name: e2e-cypress path: | diff --git a/.github/workflows/typing.yaml b/.github/workflows/typing.yaml index ae3fa18b93..de70d69483 100644 --- a/.github/workflows/typing.yaml +++ b/.github/workflows/typing.yaml @@ -24,12 +24,12 @@ jobs: cancel-in-progress: true steps: - name: "Checkout Repository" - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" cache: "pip" diff --git a/README.md b/README.md index 1787360b84..c693dfb22f 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Amazon [AWS](https://aws.amazon.com/), [GCP](https://cloud.google.com/ "Google C - Operating System: Currently, Nebari supports development on macOS and Linux operating systems. Windows is NOT supported. However, we would welcome contributions that add and improve support for Windows. -- You need Python >= 3.8 on your local machine or virtual environment to work on Nebari. +- You need Python >= 3.10 on your local machine or virtual environment to work on Nebari. - Adopting virtual environments ([`conda`](https://docs.conda.io/en/latest/), [`pipenv`](https://github.com/pypa/pipenv) or [`venv`](https://docs.python.org/3/library/venv.html)) is also encouraged. diff --git a/pyproject.toml b/pyproject.toml index cb90bc52d0..9c21badb43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ name = "nebari" dynamic = ["version"] description = "A Jupyter and Dask-powered open source data science platform." readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.10" license = "BSD-3-Clause" authors = [ { name = "Nebari development team", email = "internal-it@quansight.com" }, @@ -42,8 +42,6 @@ classifiers = [ "Intended Audience :: Developers", "Topic :: Software Development :: Build Tools", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Intended Audience :: Developers", @@ -55,23 +53,23 @@ classifiers = [ ] dependencies = [ - "auth0-python==4.4.2", + "auth0-python==4.7.1", "azure-identity==1.12.0", "azure-mgmt-containerservice==26.0.0", "azure-mgmt-resource==23.0.1", "bcrypt==4.0.1", - "boto3==1.28.40", + "boto3==1.34.63", "cloudflare==2.11.7", "kubernetes==27.2.0", "pluggy==1.3.0", "prompt-toolkit==3.0.36", "pydantic==1.10.12", "pynacl==1.5.0", - "python-keycloak==3.3.0", + "python-keycloak>=3.9.0", "questionary==2.0.0", "requests-toolbelt==1.0.0", "rich==13.5.1", - "ruamel.yaml==0.17.32", + "ruamel.yaml==0.18.6", "typer==0.9.0", "packaging==23.2", ] diff --git a/src/_nebari/render.py b/src/_nebari/render.py index d46a66852f..daf2fa506d 100644 --- a/src/_nebari/render.py +++ b/src/_nebari/render.py @@ -8,7 +8,6 @@ from rich.table import Table from _nebari.deprecate import DEPRECATED_FILE_PATHS -from _nebari.utils import is_relative_to from nebari import hookspecs, schema @@ -89,7 +88,7 @@ def render_template( for path in deleted: abs_path = (output_directory / path).resolve() - if not is_relative_to(abs_path, output_directory): + if not abs_path.is_relative_to(output_directory): raise Exception( f"[ERROR] SHOULD NOT HAPPEN filename was about to be deleted but path={abs_path} is outside of output_directory" ) diff --git a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/files/jupyterhub/03-profiles.py b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/files/jupyterhub/03-profiles.py index 50d527b863..5c66ca72d5 100644 --- a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/files/jupyterhub/03-profiles.py +++ b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/files/jupyterhub/03-profiles.py @@ -533,14 +533,13 @@ def render_profiles(spawner): # userinfo request to have the groups in the key # "auth_state.oauth_user.groups" auth_state = yield spawner.user.get_auth_state() - spawner.log.error(str(auth_state)) username = auth_state["oauth_user"]["preferred_username"] # only return the lowest level group name # e.g. /projects/myproj -> myproj # and /developers -> developers groups = [Path(group).name for group in auth_state["oauth_user"]["groups"]] - spawner.log.error(f"user info: {username} {groups}") + spawner.log.info(f"user info: {username} {groups}") keycloak_profilenames = auth_state["oauth_user"].get("jupyterlab_profiles", []) diff --git a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/monitoring/main.tf b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/monitoring/main.tf index 413a9e08d2..869f616c71 100644 --- a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/monitoring/main.tf +++ b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/monitoring/main.tf @@ -181,6 +181,14 @@ resource "helm_release" "prometheus-grafana" { "${var.node-group.key}" = var.node-group.value } + additionalDataSources = [ + { + name = "Loki" + type = "loki" + url = "http://loki-gateway.${var.namespace}" + } + ] + # Avoid using the default password, as that's a security risk adminPassword : random_password.grafana_admin_password.result diff --git a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/monitoring/values.yaml b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/monitoring/values.yaml index f3cf47c88d..ada868882f 100644 --- a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/monitoring/values.yaml +++ b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/monitoring/values.yaml @@ -1,7 +1 @@ # https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml - -grafana: - additionalDataSources: - - name: Loki - type: loki - url: http://loki-gateway.dev diff --git a/src/_nebari/utils.py b/src/_nebari/utils.py index 3378116a1d..3488c6f0e8 100644 --- a/src/_nebari/utils.py +++ b/src/_nebari/utils.py @@ -268,18 +268,6 @@ def random_secure_string( return "".join(secrets.choice(chars) for i in range(length)) -def is_relative_to(self: Path, other: Path, /) -> bool: - """Compatibility function to bring ``Path.is_relative_to`` to Python 3.8""" - if sys.version_info[:2] >= (3, 9): - return self.is_relative_to(other) - - try: - self.relative_to(other) - return True - except ValueError: - return False - - def set_do_environment(): os.environ["AWS_ACCESS_KEY_ID"] = os.environ["SPACES_ACCESS_KEY_ID"] os.environ["AWS_SECRET_ACCESS_KEY"] = os.environ["SPACES_SECRET_ACCESS_KEY"]