Commit Graph

17 Commits

Author SHA1 Message Date
Rick Izzo 7b2788e39c
Deduplicate top level lighting CLI command groups (#15761)
* unify remove and delete command groups & the add and delete command groups
* added changelog
* fix tests
* Apply suggestions from code review

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
2022-11-22 09:41:33 +00:00
Carlos Mocholí f392180c38
Do not modify PACKAGE_NAME on install (#15493)
* Do not modify PACKAGE_NAME on install

* Fix ci pkg action

* Required

* Typos

* Apply suggestions from code review

* Undo defaults

* Cleanup

* Implement idea

* Fuck

* Apps mock fix

* Fix app-pytest with PKG_NAME=app

* Justus suggestion

* Debug Windows

* Update setup.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Revert "Debug Windows"

This reverts commit 9fe3ba3665.

* SSH action

* Crazy bug

* Revert "SSH action"

This reverts commit 5061e8e7d6.

* Package import step

* Avoid env conflict

* Debug

* Whitespace

* Try removing existing lite build

* This should be redundant now

* Add back env now that source-lit is gone

* Remove download artifact

* checkgroup

* TODOs suggested by Jirka

* _

* Revert "_". These are local variables, do not need protected

This reverts commit 8340b85991.

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2022-11-04 17:51:03 +01:00
Raphael Randschau f53c0a7053
Add SSH command to CLI (#15310)
* implement ssh command

* add tests that ssh command is available

* most SSH command tests

* update changelog

* Update src/lightning_app/cli/lightning_cli.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* adrian feedback pt1

* Update src/lightning_app/cli/lightning_cli.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* more feedback

* rework to support app name

* update tests based on different interface

* Update src/lightning_app/cli/lightning_cli.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Update src/lightning_app/cli/lightning_cli.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Update src/lightning_app/cli/lightning_cli.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Update src/lightning_app/cli/lightning_cli.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* update tests with changed expectation

* fix tests that broke with introduction of shutils

* fix too long line

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2022-11-03 08:32:08 -07:00
Luca Furst ec156ad6e3
[App] Remove --instance-types from cluster creation (#15314)
## What does this PR do?

Removes the ability to specify `--instance-types` when creating clusters.

Instead, all clusters will be able to use every instance type supported by the platform.
2022-10-31 18:19:26 +00:00
Raphael Randschau adc8238597
Add SSH key management to CLI (#15291)
* add cli commands for adding/ removing resources

as discussed with Adrian, we want to adopt "lightning add" and "lightning remove" for  ssh-keys,
as the resource already exists.

* implement ssh-key management
* one parameter for public key, optional name
* handle the case where a private key file was provided
* make ssh key-mgmt support classes protected
* re-order add ssh-key args
* change types signatures of add_key
* rename test cases
* update changelog

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-28 20:42:26 +02:00
Luca Furst c1a3cb5381
[App] Format client error ApiExceptions without a traceback (#15130)
## What does this PR do?

The lightning CLI uses the lightning APIs to create, read, update, and delete resources such as apps and clusters.

If an API call fails due to client error (e.g. invalid input, unauthorized, unauthenticated) the API will return an HTTP status code in the 400s, along with a custom message in the response body.

The CLI (usually) does not directly handle these exceptions. As a result the exception bubbles up through the click framework (which does not recognize the exception type) and to the python runtime, which produces a long traceback and dumps the raw exception to the user.

This PR fixes the user experience. When our API fails on a client error, the CLI will display the message from the server without a traceback.
2022-10-27 09:44:22 -04:00
Raphael Randschau 6edf5c5cc2
fix connect/ disconnect without arguments (#14877) 2022-09-27 03:43:36 +00:00
Mansy 1bcb5c301d
[App][CLI] Fix lightning cli --version (#14433)
* [App][CLI] Fix lightning cli --version
2022-09-01 07:58:09 +00:00
Mansy 0e30e4a5a0
[App][CI] Fix psutil requirement CI (#14413) 2022-08-26 23:55:22 +00:00
Dmitry Frolov 2182d755c4
[CLI] Adding opportunity to see basic cluster logs (#14334)
* pinning starsessions

* pinning starsessions

* adding strict back to requirements.txt

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Duplicated

* Basic implementation

* Basic implementation

* Basic implementation

* Basic implementation

* Common things moved to log helpers file

* Decomposing logs reader classes for reusing

* Setting colors for log levels

* Manifest trimming

* Changes added to CHANGELOG

* Prettifications

* Prettifications

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Logs function name change

* Logs function name change

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* attempt to fix the pydanitc import

* Tests + command name fixes

* Extending tests

* Adding limit argument

* Unmerging CI fix

* Unmerging CI fix

* Adding fields for errors

* Adding log level fixed field width

* Adding absent typing + exeptions raising

* Adding socket error logging

* Addressing comments on cluster list function return value

* Addressing comments on adding e2e tests

* Adding version range for arrow package in reqs

* New unit tests

* arrow time parsing callback modified + unit tests

* helpers updated

* helpers updated

* helpers updated

* One more test

* CMD test fix

* CMD test fix

* CMD test fix

* CMD test fix

* CMD test fix

* LightningClient mocking

* Flaky test removed

Co-authored-by: hhsecond <sherin@grid.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2022-08-23 15:48:22 -04:00
Raphael Randschau d71dba3721
BYOC: fix default types for cluster instance types (#14260) 2022-08-18 14:12:59 -07:00
Raphael Randschau 98ded4524f
[CLI] change cluster creation cost savings mode default (#14132)
* [CLI] change cluster creation cost savings mode default

instead of having customers opt-into cost savings mode, we'll ask them to opt-out of cost savings mode.
2022-08-11 08:19:21 -07:00
Raphael Randschau 619c2ff058
[CLI] fix cluster creation CLI requiring instance-type selection (#14056)
fix cluster creation CLI requiring instace-type selection

we've marked `instance_types` as `required=False`, but the CLI calls `split` on the value.
So if nothing is provided, we'll actually receive a runtime error, effectively rendering the flag as required.

Co-authored-by: thomas chaton <thomas@grid.ai>
2022-08-09 12:17:57 -07:00
Raphael Randschau 26d69ceada
[CLI] add support for listing apps (#13987)
* add support for listing apps

* update changelog with correct PR number

* add tests for pagination

* fix wrong mock on test_cli

* ensure all enum values are accounted for

* make AppManager and AppList protected, add limit to pagination calls

* add restarting transition /w tests

* add state transition not yet run with tests
2022-08-05 13:42:00 -07:00
Raphael Randschau 2919dcf7ee
[CLI] add support for cluster management (#13835) 2022-08-02 10:31:09 +02:00
thomas chaton 4c35867b61
[App] Introduce Commands (#13602) 2022-07-25 17:13:46 +00:00
Sherin Thomas b90525b5b5
adding LAI test (#13321)
* tests

* ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Jirka <jirka.borovec@seznam.cz>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: mansy <mansy@lightning.ai>
2022-06-30 16:43:04 -04:00