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

Added support, cost, upgrade and keycloak commands. #1468

Merged
merged 8 commits into from
Sep 27, 2022

Conversation

asmijafar20
Copy link
Contributor

Fixes | Closes | Resolves #

Please remove anything marked as optional that you don't need to fill in.
Choose one of the keywords preceding to refer to the issue this PR solves, followed by the issue number (e.g Fixes # 666).
If there is no issue, remove the line. Remove this note after reading.

Changes introduced in this PR:

Types of changes

What types of changes does your PR introduce?

Put an 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 to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests?

  • Yes
  • No

Documentation

Does your contribution include breaking changes or deprecations?
If so have you updated the documentation?

  • Yes, docstrings
  • Yes, main documentation
  • Yes, deprecation notices

Further comments (optional)

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered and more.

@asmijafar20 asmijafar20 changed the base branch from main to typer_cli September 22, 2022 14:53
Copy link
Member

@iameskild iameskild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for this update @asmijafar20! I left a comment below regarding some changes that might need to be made. I'll let you decide how to proceed, if you have questions or concerns, feel free to reach out :)

qhub/keycloak.py Outdated

from .schema import verify
from .utils import load_yaml

logger = logging.getLogger(__name__)


def do_keycloak(config_filename, *args):
def do_keycloak(config_filename, add_user, listusers):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is the reason the Kubernetes CI test is failing. Let's see if we can keep the original function while also making this work for our Typer CLI as well. This might just mean updating how we pass the above values to the function. A more robust solution might involve creating two subcommands, add-user and listusers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viniciusdc and I wrote a code for the keycloak subcommand. But we couldn't make it possible because it's just tricky to do with typer. So later we changed the do_keycloak function, but CI will still fail because qhub entrypoint is using the previous do_keycloak function. Although I have pushed the new changes to the PR also added the subcommand code in the qhub/cli/keycloak.py (commented part).

@asmijafar20
Copy link
Contributor Author

asmijafar20 commented Sep 26, 2022

  • upgrade command is working fine.
  • cost command gives the following output (working fine): FileNotFoundError: [Errno 2] No such file or directory: infracost.
  • keycloak command: CI is failing due to do_keycloak function.
  • support command gives the following error: ConfigException: Invalid kube-config file. Expected key current-context in /home/ubntu/.kube/config.

@iameskild iameskild self-requested a review September 27, 2022 03:29
Copy link
Member

@iameskild iameskild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asmijafar20 I was able to get the keycloak command to work with the existing CLI and also break it up into subcommands. I think there is still some clean up to do but we can tackle that later. Thanks for all your work on this :)

@iameskild iameskild merged commit ecc5f65 into typer_cli Sep 27, 2022
@iameskild iameskild deleted the typer_cli_09/22/2022 branch September 27, 2022 03:30
viniciusdc added a commit that referenced this pull request Oct 7, 2022
* Initial typer CLI implmentation

* edit logic

* Nebari cli: Add files _init.py and main.py (#1423)

* Nebari cli: Add files _init.py and main.py

* run pre-commit

Co-authored-by: iameskild <[email protected]>

* Order CLI commands

* Nebari typer cli commands (#1432)

* Nebari typer cli commands

* add validate command

* Change validate command

* add precommit

* Nebari Render Command (#1433)

* Nebari Render Command

* add render_template

* Add dry-run

* Updates to init

* More work on init

* Nebari deploy and destroy commands (#1436)

* Nebari deploy and destroy commands

* Add typer confirm to destroy command

* Run pre-commit

Co-authored-by: eskild <[email protected]>
Co-authored-by: iameskild <[email protected]>

* Add guided-init

* Add deploy flags and change repository default value (#1441)

* Nebari deploy and destroy commands

* Add typer confirm to destroy command

* Add deploy arguments and change repository default value

* Add rendre design

* Run pre-commit

Co-authored-by: eskild <[email protected]>
Co-authored-by: iameskild <[email protected]>

* Nebari Typer CLI

* Add pre-commit

* Add disable_checks in deploy command

* Combine guided-init and init, part 1

* Remove `dotenv` work. (#1472)

* Remove Usage: dotenv [OPTIONS] COMMAND [ARGS]
* Remove pathlib

* guided-init clean up

* Added `support`, `cost`, `upgrade` and `keycloak` commands. (#1468)

* Add , ,  and  commands.

* Add pre-commit

* Add pre-commit

* Add pre-commit

* Add rich print

* Change do_keycloak function

* Create two keycloak subcommands

Co-authored-by: iameskild <[email protected]>
Co-authored-by: eskild <[email protected]>

* clean up

* update help messages

* Update qhub/cli/_init.py

Co-authored-by: Pavithra Eswaramoorthy <[email protected]>

* Update qhub/cli/_init.py

Co-authored-by: Pavithra Eswaramoorthy <[email protected]>

* Changes from review, part 1

* Update qhub/cli/_init.py

Co-authored-by: Pavithra Eswaramoorthy <[email protected]>

* Update qhub/cli/_init.py

Co-authored-by: Pavithra Eswaramoorthy <[email protected]>

* Update qhub/cli/_init.py

Co-authored-by: Tania Allard <[email protected]>

* Update qhub/cli/_init.py

Co-authored-by: Tania Allard <[email protected]>

* Update qhub/cli/_init.py

Co-authored-by: Tania Allard <[email protected]>

* Update qhub/cli/_init.py

Co-authored-by: Tania Allard <[email protected]>

* Update qhub/cli/_init.py

Co-authored-by: Tania Allard <[email protected]>

* Update qhub/cli/main.py

Co-authored-by: Tania Allard <[email protected]>

* Changes from review, part 2

* Update env, clean up

* Changes from review, part 3

* Minor update

* Changes based review, part 4

* more clean up

* Add `version` options to Nebari CLI (#1476)

* Add version Options to Nebari

* Add pre-commit

Co-authored-by: eskild <[email protected]>

* Change colour from blue1 to green and spring_green to blue

* Add suggested changes, Remove extra spaces

* Add pre-commit

* change kubernetes msg

* Update CI to use new nebari cli entrypoint (#1480)

* Update CI to use new nebari cli entrypoint

* Add --disable-prompt to nebari init

* Update name of keycloak subcommands

* Reorder command

* Update command

* Minor update to test_e2e

* Update hostname used for test_deployment

* Another minor update to the tests_e2e

* Add --disable-prompt to nebari destroy

* use --disable-prompt in ci test

* Update .github/workflows/kubernetes_test.yaml

Co-authored-by: Vinicius D. Cerutti <[email protected]>

* Update kubernetes_test.yaml

* Update .github/workflows/kubernetes_test.yaml

Co-authored-by: Tania Allard <[email protected]>

* Update qhub/cli/main.py

Co-authored-by: Tania Allard <[email protected]>

* Fix yaml

* Fix yaml again

Co-authored-by: Vinicius D. Cerutti <[email protected]>
Co-authored-by: Tania Allard <[email protected]>

Co-authored-by: iameskild <[email protected]>
Co-authored-by: eskild <[email protected]>
Co-authored-by: Pavithra Eswaramoorthy <[email protected]>
Co-authored-by: Tania Allard <[email protected]>
Co-authored-by: Vinicius D. Cerutti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants