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

Add ability to list user installed plugins from the CLI #2891

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

soapy1
Copy link

@soapy1 soapy1 commented Jan 3, 2025

Reference Issues or PRs

Fixes #2857

What does this implement/fix?

This PR adds 2 new pieces of functionality:

  1. highlights (in cyan) user installed plugins when running nebari info
  2. adds a plugin subcommand
    a. currently this command has one more subcommand list which will list user installed plugins
    b. this can be extended in the future to add more plugin related subcommands. For example nebari plugin install, nebari plugin remove

Put a x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features not to work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

  • Did you test the pull request locally?
  • Did you add new tests?

How to test this PR?

(1) highlight user installed plugins

to test:

  • install a nebari plugin
$ pip install nebari-plugin-mlflow-aws
  • run a nebari info
    Screenshot from 2025-01-02 17-44-48

(2) plugin subcommand

to test:

  • run nebari -h and notice the plugin subcommand in the Additional Commands section
$ nebari -h                                                                                                                                                         [17:44:34]
                                                                                                                                                                                                                          
 Usage: nebari [OPTIONS] COMMAND [ARGS]...                                                                                                                                                                                
                                                                                                                                                                                                                          
 Nebari CLI 🪴                                                                                                                                                                                                            
                                                                                                                                                                                                                          
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --version                 -V            Nebari version number                                                                                                                                                          │
│ --import-plugin                   TEXT  Import nebari plugin                                                                                                                                                           │
│ --exclude-stage                   TEXT  Exclude nebari stage(s) by name or regex                                                                                                                                       │
│ --exclude-default-stages                Exclude default nebari included stages                                                                                                                                         │
│ --help                    -h            Show this message and exit.                                                                                                                                                    │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ destroy                   Destroy the Nebari cluster from your nebari-config.yaml file.                                                                                                                                │
│ deploy                    Deploy the Nebari cluster from your nebari-config.yaml file.                                                                                                                                 │
│ init                      Create and initialize your nebari-config.yaml file.                                                                                                                                          │
│ info                                                                                                                                                                                                                   │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Additional Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ validate             Validate the values in the nebari-config.yaml file are acceptable.                                                                                                                                │
│ upgrade              Upgrade your nebari-config.yaml.                                                                                                                                                                  │
│ support              Support tool to write all Kubernetes logs locally and compress them into a zip file.                                                                                                              │
│ render               Dynamically render the Terraform scripts and other files from your nebari-config.yaml file.                                                                                                       │
│ plugin               Interact with nebari plugins                                                                                                                                                                      │
│ keycloak             Interact with the Nebari Keycloak identity and access management tool.                                                                                                                            │
│ dev                  Development tools and advanced features.                                                                                                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
  • run nebari plugin -h to ensure the subcommand help message works
$ nebari plugin -h                                                                                                                                                  [17:45:47]
                                                                                                                                                                                                                          
 Usage: nebari plugin [OPTIONS] COMMAND [ARGS]...                                                                                                                                                                         
                                                                                                                                                                                                                          
 Interact with nebari plugins                                                                                                                                                                                             
                                                                                                                                                                                                                          
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help  -h        Show this message and exit.                                                                                                                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ list                                    List installed plugins                                                                                                                                                         │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
  • run nebari plugin list an notice all the user installed plugins are available
 $ nebari plugin list                                                                                                                                               [18:05:32]
               Plugins                
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ name                     ┃ version ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│ nebari_plugin_mlflow_aws │ 0.0.16  │
└──────────────────────────┴─────────┘

@soapy1 soapy1 force-pushed the list-plugins branch 2 times, most recently from be0351d to 98ae9a0 Compare January 3, 2025 16:11
@soapy1 soapy1 marked this pull request as ready for review January 3, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New 🚦
Development

Successfully merging this pull request may close these issues.

[ENH] - Create CLI command to list Nebari plugins
1 participant