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

Extension Mechanism Implementation #1833

Merged
merged 147 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
3fa82c5
Initial commit moving towards stages plugin
costrouc Jun 13, 2023
4dfe5f2
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 13, 2023
e35af55
Work to make runnable along with working on schema
costrouc Jun 14, 2023
4540a1d
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 14, 2023
39f6419
Setting defaults for schema
costrouc Jun 14, 2023
c533d3d
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 14, 2023
828d3d3
Working subcommands using extension system
costrouc Jun 15, 2023
154ed53
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 15, 2023
813f231
Working render!
costrouc Jun 15, 2023
1eedde3
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 15, 2023
c8816ce
Making it further through deployment
costrouc Jun 15, 2023
8c6e7a4
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 15, 2023
cc16019
[WIP] Add InputVar schema (#1835)
iameskild Jun 15, 2023
5bc8706
Working local deploy, render, destroy and major simplifications
costrouc Jun 15, 2023
c3b794d
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 15, 2023
c9c8440
Fully working deploy with checks again
costrouc Jun 15, 2023
e45e2c0
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 15, 2023
7ac3609
Add more InputVars schema (#1836)
iameskild Jun 15, 2023
1f86a7b
Adding more schema information about providers
costrouc Jun 15, 2023
56b4d38
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 15, 2023
31a6390
Fixes to schema to allow for local deployment
costrouc Jun 16, 2023
76f8d6d
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 16, 2023
9896875
Apply validation on the kubernetes version
costrouc Jun 16, 2023
e70dd2b
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 16, 2023
0b7ebc0
Fixing the upgrade command
costrouc Jun 16, 2023
04010d8
Fixing support and upgrde commands
costrouc Jun 16, 2023
a051ec5
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 16, 2023
97d1464
More work to get init working again
costrouc Jun 16, 2023
9eb56c6
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 16, 2023
613b82d
Make cli entirely extension subcommands
costrouc Jun 16, 2023
ced44d0
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 16, 2023
95cde1e
Ensure that plugy extensions can be loaded via entrypoints
costrouc Jun 16, 2023
ee0e4b8
Adding import module subcommand option
costrouc Jun 16, 2023
e231365
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 16, 2023
468af6b
More fixes around AWS deployment
costrouc Jun 19, 2023
f63cefd
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 19, 2023
be97d69
Cleaner destroy when running stages.
costrouc Jun 20, 2023
9ce35b4
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 20, 2023
be9c034
Missing schema import
costrouc Jun 20, 2023
7be54f1
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 20, 2023
09c998d
Working gcp deployment
costrouc Jun 20, 2023
a466e83
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 20, 2023
fd8fc22
Azure fixes
costrouc Jun 20, 2023
f3826e5
Add InputVar schema to kubernetes_services stage (#1837)
iameskild Jun 20, 2023
46f4b6f
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 20, 2023
c99334c
Fixups for input_var schema
costrouc Jun 20, 2023
2a8999e
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 20, 2023
3e81c67
Fixing digital ocean deployment
costrouc Jun 21, 2023
719f578
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 21, 2023
bba0161
Further enhancements to the schema and making domain optional
costrouc Jun 21, 2023
436529c
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 21, 2023
c3f1a6e
Prevent bucket from being deleted each time
costrouc Jun 21, 2023
0359499
Significantly simplify the initialization
costrouc Jun 21, 2023
87c85b5
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 21, 2023
60bca92
Integrating PR https://github.com/nebari-dev/nebari/pull/1803
costrouc Jun 21, 2023
b1213ff
Fixup for test-nebari-provider
costrouc Jun 21, 2023
85548e0
Fixup for nebari provider
costrouc Jun 21, 2023
f2d8e20
Don't require the github client id/secret
costrouc Jun 21, 2023
f770355
Missing schema import
costrouc Jun 21, 2023
94ddf58
Fixing indexing to use pydantic schema
costrouc Jun 21, 2023
a0e833f
Undefined variables
costrouc Jun 21, 2023
867ddfd
Yaml export
costrouc Jun 21, 2023
506f6f3
Missing import
costrouc Jun 21, 2023
e71f3ce
Expect pydantic schema
costrouc Jun 21, 2023
9ab3342
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 21, 2023
8e0c12d
Dump to stringio
costrouc Jun 21, 2023
9151463
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 21, 2023
4fd18a2
Wrong path for render_template
costrouc Jun 21, 2023
bbd8b3a
Fixing broken path in action
costrouc Jun 21, 2023
1307a59
Fixing the cli tests
costrouc Jun 21, 2023
5564674
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 21, 2023
a88e6f1
Adding controls around stages exclusion
costrouc Jun 22, 2023
d20b7a8
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 22, 2023
e8e0def
Typo in deploy subcommand
costrouc Jun 22, 2023
5c680a6
Remove image from kubespawner to preserve default behavior
costrouc Jun 22, 2023
1683dec
More fixing of the tests
costrouc Jun 22, 2023
9964ef0
Exclude yaml checks to new stages directory
costrouc Jun 22, 2023
cdfe3e6
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 22, 2023
79820f5
Typo in yaml exclusion path
costrouc Jun 22, 2023
6507ed1
Fixing ruff checks
costrouc Jun 22, 2023
8cb8d55
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 22, 2023
dfc92b7
Reworking stages for more complete testing and passing
costrouc Jun 23, 2023
fe48c24
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 23, 2023
2dd5dcb
Fixing render template path
costrouc Jun 23, 2023
644995f
Adding a timeout to notebook tests
costrouc Jun 23, 2023
de24730
Add NebariPluginManager, allow schema to be dynamically extended (#1844)
iameskild Jun 27, 2023
be03543
Moving schema to stages
costrouc Jun 28, 2023
dd46e27
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 28, 2023
c26006b
Moving validation of environment variables to schema and providers
costrouc Jun 29, 2023
fd5e71a
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 29, 2023
a70485b
Further work to uncouple stages
costrouc Jun 29, 2023
ac04e96
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 29, 2023
73776ac
Adding changes
costrouc Jun 29, 2023
c894cf6
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 29, 2023
31ef601
Missing import
costrouc Jun 29, 2023
608c16f
Fixing path
costrouc Jun 29, 2023
bd527d9
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 29, 2023
840364a
Adding digital ocean validation
costrouc Jun 30, 2023
158958a
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
fa398e4
Adding aws checks for region, zone, and instances
costrouc Jun 30, 2023
237a780
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
33bcdfc
Typo and apply validation at different level
costrouc Jun 30, 2023
da12f6e
load_config -> read_config for naming
costrouc Jun 30, 2023
00ae443
Adding digital ocean spaces access keys
costrouc Jun 30, 2023
da2ce8b
Wrong reference to config
costrouc Jun 30, 2023
542aaeb
Fixing conftest
costrouc Jun 30, 2023
1febe5f
Making docs links in constants module
costrouc Jun 30, 2023
1eb5c05
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
77fc327
Fixing tests
costrouc Jun 30, 2023
9a1191b
Missing import
costrouc Jun 30, 2023
1db1523
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
394e608
Wrong import module
costrouc Jun 30, 2023
ae0b5fe
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
1e47558
Fixing tests
costrouc Jun 30, 2023
f2d6972
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
9494614
Mocking more methods in tests
costrouc Jun 30, 2023
3f15336
Adding more concise data
costrouc Jun 30, 2023
026172d
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
963cf85
Properly escaping strings
costrouc Jun 30, 2023
6fdaeaf
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
5e9f063
Trigger CI again
costrouc Jun 30, 2023
0100345
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
5592821
Ensure that username matches before
costrouc Jun 30, 2023
a43dadf
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jun 30, 2023
fe55fa9
Missing import after rebase
costrouc Aug 2, 2023
2670a20
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 2, 2023
b48eef6
Remove os.path.join error in ruff
costrouc Aug 2, 2023
e08b1f4
Fixing import
costrouc Aug 2, 2023
27cd898
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 2, 2023
b7eebd2
Ignore certain pathlib warings
costrouc Aug 2, 2023
1f9338e
Missing import
costrouc Aug 2, 2023
2bdb9d7
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 2, 2023
c045be4
Missing import
costrouc Aug 2, 2023
142182c
Changes to account for #1832 and #1868
costrouc Aug 3, 2023
371483b
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 3, 2023
f36c41f
Missing pathlib import
costrouc Aug 3, 2023
beac07a
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 3, 2023
cc25393
Ensure pathlib everywhere
costrouc Aug 3, 2023
05fe1d8
Ensure using pathlib type
costrouc Aug 3, 2023
ec78e2c
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 3, 2023
e27c83e
Bump the highest supported kubernetes version
costrouc Aug 3, 2023
107d882
Clean up tests
iameskild Aug 8, 2023
3e1380d
Minor clean, path updates
iameskild Aug 8, 2023
79b9066
Remove linger checks.py
iameskild Aug 9, 2023
7167b51
Fix tests
iameskild Aug 9, 2023
5577d37
fix jhub_ssh test
iameskild Aug 9, 2023
16f6ba4
Extension mechanism AWS testing (#1864)
sblair-metrostar Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .github/actions/publish-from-template/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ runs:
shell: bash
env: ${{ env }}
run:
python .github/actions/publish-from-template/render_template.py ${{
inputs.filename }}
python ${{ github.action_path }}/render_template.py ${{inputs.filename }}

- uses: JasonEtco/create-an-issue@v2
# Only render template and create an issue in case the workflow is a scheduled one
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/kubernetes_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ jobs:
pytest tests/tests_deployment/ -v -s

- name: JupyterHub Notebook Tests
timeout-minutes: 2
# run jhub-client after pytest since jhubctl can cleanup
# the running server
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:
kv/data/repository/nebari-dev/nebari/azure/nebari-dev-ci/github-nebari-dev-repo-ci tenant_id | ARM_TENANT_ID;
kv/data/repository/nebari-dev/nebari/azure/nebari-dev-ci/github-nebari-dev-repo-ci subscription_id | ARM_SUBSCRIPTION_ID;
kv/data/repository/nebari-dev/nebari/shared_secrets DIGITALOCEAN_TOKEN | DIGITALOCEAN_TOKEN;
kv/data/repository/nebari-dev/nebari/shared_secrets SPACES_ACCESS_KEY_ID | SPACES_ACCESS_KEY_ID;
kv/data/repository/nebari-dev/nebari/shared_secrets SPACES_SECRET_ACCESS_KEY | SPACES_SECRET_ACCESS_KEY;

- name: 'Authenticate to GCP'
if: ${{ matrix.provider == 'gcp' }}
Expand Down Expand Up @@ -123,7 +125,7 @@ jobs:

- name: Nebari Initialize
run: |
nebari init "${{ matrix.provider }}" --project "TestProvider" --domain "${{ matrix.provider }}.nebari.dev" --auth-provider github --disable-prompt --ci-provider ${{ matrix.cicd }}
nebari init "${{ matrix.provider }}" --project "TestProvider" --domain "${{ matrix.provider }}.nebari.dev" --auth-provider password --disable-prompt --ci-provider ${{ matrix.cicd }}
cat "nebari-config.yaml"

- name: Nebari Render
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: check-json
- id: check-yaml
# jinja2 templates for helm charts
exclude: "src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/(clearml/chart/templates/.*|prefect/chart/templates/.*)"
exclude: "src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/(clearml/chart/templates/.*|prefect/chart/templates/.*)"
args: [--allow-multiple-documents]
- id: check-toml
# Lint: Checks that non-binary executables have a proper shebang.
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ classifiers = [
]

dependencies = [
"pluggy==1.0.0",
"auth0-python==4.0.0",
"azure-identity==1.12.0",
"azure-mgmt-containerservice==19.1.0",
Expand Down Expand Up @@ -96,7 +97,7 @@ Documentation = "https://www.nebari.dev/docs"
Source = "https://github.com/nebari-dev/nebari"

[project.scripts]
nebari = "_nebari.cli.main:app"
nebari = "nebari.__main__:main"

[tool.ruff]
select = [
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ addopts =
--tb=native
# turn warnings into errors
-Werror
# ignore deprecation warnings (TODO: filter further)
-W ignore::DeprecationWarning
markers =
conda: conda required to run this test (deselect with '-m \"not conda\"')
aws: deploy on aws
Expand Down
84 changes: 84 additions & 0 deletions src/_nebari/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import typing

import typer
from typer.core import TyperGroup

from _nebari.version import __version__
from nebari.plugins import nebari_plugin_manager


class OrderCommands(TyperGroup):
def list_commands(self, ctx: typer.Context):
"""Return list of commands in the order appear."""
return list(self.commands)


def version_callback(value: bool):
if value:
typer.echo(__version__)
raise typer.Exit()


def exclude_stages(ctx: typer.Context, stages: typing.List[str]):
nebari_plugin_manager.excluded_stages = stages
return stages


def exclude_default_stages(ctx: typer.Context, exclude_default_stages: bool):
nebari_plugin_manager.exclude_default_stages = exclude_default_stages
return exclude_default_stages


def import_plugin(plugins: typing.List[str]):
try:
nebari_plugin_manager.load_plugins(plugins)
except ModuleNotFoundError:
typer.echo(
"ERROR: Python module {e.name} not found. Make sure that the module is in your python path {sys.path}"
)
typer.Exit()
return plugins


def create_cli():
app = typer.Typer(
cls=OrderCommands,
help="Nebari CLI 🪴",
add_completion=False,
no_args_is_help=True,
rich_markup_mode="rich",
pretty_exceptions_show_locals=False,
context_settings={"help_option_names": ["-h", "--help"]},
)

@app.callback()
def common(
ctx: typer.Context,
version: bool = typer.Option(
None,
"-V",
"--version",
help="Nebari version number",
callback=version_callback,
),
plugins: typing.List[str] = typer.Option(
[],
"--import-plugin",
help="Import nebari plugin",
),
excluded_stages: typing.List[str] = typer.Option(
[],
"--exclude-stage",
help="Exclude nebari stage(s) by name or regex",
),
exclude_default_stages: bool = typer.Option(
False,
"--exclude-default-stages",
help="Exclude default nebari included stages",
),
):
pass

nebari_plugin_manager.plugin_manager.hook.nebari_subcommand(cli=app)

return app
43 changes: 0 additions & 43 deletions src/_nebari/cli/dev.py

This file was deleted.

76 changes: 0 additions & 76 deletions src/_nebari/cli/keycloak.py

This file was deleted.

Loading
Loading