Skip to content

Commit

Permalink
Merge branch 'develop' into 347-traefik-volume
Browse files Browse the repository at this point in the history
  • Loading branch information
kenafoster authored Mar 20, 2024
2 parents 6f96c0b + d698630 commit 619b8ff
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate_cli_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ 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"

- name: Upgrade pip
run: python -m pip install --upgrade pip build

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -58,15 +58,15 @@ jobs:

steps:
- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Upgrade pip
run: python -m pip install --upgrade pip build

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-precommit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].0
uses: pre-commit/[email protected].1
with:
extra_args: --all-files terraform_fmt
6 changes: 3 additions & 3 deletions .github/workflows/test-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand All @@ -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/[email protected]
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_aws_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test_conda_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/test_do_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_gcp_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_helm_charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test_local_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ 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
run: |
pip install .[dev]
playwright install
- uses: azure/setup-kubectl@v3
- uses: azure/setup-kubectl@v4.0.0
with:
version: v1.19.16

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/typing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
12 changes: 5 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" },
Expand All @@ -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",
Expand All @@ -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",
]
Expand Down
3 changes: 1 addition & 2 deletions src/_nebari/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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", [])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions src/_nebari/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 619b8ff

Please sign in to comment.