Commit Graph

96 Commits

Author SHA1 Message Date
Luca Antiga 01f57a9cbd
Reuse existing commands when running connect more than once (#15471)
* Reuse connection if it matches a connection from an active terminal
* Remove unused import
* Include both name and id in the check
* Fix messages and tests
* Add test
* Handle monkeypatching more cleanly
* Remove unused imports

Co-authored-by: Luca Antiga <luca@lightning.ai>
Co-authored-by: thomas chaton <thomas@grid.ai>
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-11-07 20:01:35 +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
Luca Antiga 5cf50363c3
Fix handling of script arguments in tracer (#15518)
* Don't assume script args start with double dash

* add changelog

Co-authored-by: Luca Antiga <luca@lightning.ai>
Co-authored-by: awaelchli <aedu.waelchli@gmail.com>
2022-11-04 16:03:46 +01:00
thomas chaton 1824ad0636
[App] Hot Fix: Missing root flow in app.flows (#15531) 2022-11-04 15:00:56 +00:00
thomas chaton 984daa6fa2
[App] Add start method to the LightningWork (#15523) 2022-11-04 12:53:48 +01:00
thomas chaton 921dc1cd9a
[App] Resolve inconsistency where the `flow.flows` property isn't recursive leading to flow overrides (#15466)
* update

* update

* update

* update

* update

* resolve attachment

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update
2022-11-03 22:10:47 +00:00
Luca Antiga 16960276ff
Periodically sync database to the drive (#15441) 2022-11-03 21:07:14 +00: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
Ethan Harris 555257a4ba
[App] Auto-upgrade / detect environment mis-match from the CLI (#15434)
* Add auto-upgrade from the CLI and check for current env

* No longer require `python -m` in docs

* Tabs -> spaces

* Ignore pre-releases

* Test + docs
2022-11-02 17:13:36 -04:00
Mansy 19df40d899
Allow force run app on cloud if loading locally errors (#15019)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 18:22:54 +00: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
Dmitry Frolov 11196b1707
Fix default CloudCompute for flows (#15371)
* Fix default CloudCompute for flows
* Unit test added
2022-10-29 08:36:59 +01:00
Ethan Harris b340859df9
[App] Add `ServeStreamlit` work (#15400)
* Init

* Updates

* Add test for model building

* Imports

* Fix

* Typing

* Ignore serve streamlit in mypy
2022-10-28 16:33:53 -04: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
thomas chaton 2e72a4c801
Add support for functions (#15098) 2022-10-28 15:06:45 +00:00
Ethan Harris bbf7848a5f
[App] Fix cluster logic (#15383) 2022-10-28 15:35:21 +01:00
Ethan Harris e9a6b83437
[App] Reduce import depths and add test (#15330)
Co-authored-by: thomas chaton <thomas@grid.ai>
2022-10-28 13:57:35 +00:00
thomas chaton b6ebc7b5f5
[App] Add env variables to desactivate pull and push of the App State (#15367) 2022-10-28 13:26:08 +00:00
thomas chaton df4b705768
Add JustPy Frontend (#15002)
* update

* update

* update

* update

* changelog

* update

* update

* update

* update

* update

* update

* update

* update

* uipdate

* update

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2022-10-27 11:48:26 -04: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
Jirka Borovec 95ae393ca8
LAI: creating mirror package (#15105)
* placeholder

* mirror + prune

* makedir

* setup

* ci

* ci

* name

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

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

* ci clean

* empty

* py

* parallel

* doctest

* flake8

* ci

* typo

* replace

* clean

* Apply suggestions from code review

* re.sub

* fix UI path

* full replace

* ui path?

* replace

* updates

* regex

* ci

* fix

* ci

* path

* ci

* replace

* Update .actions/setup_tools.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* also convert lightning_lite tests for PL tests to adapt mocking paths

* fix app example test

* update logger propagation for PL tests

* update logger propagation for PL tests

* Apply suggestions from code review

* Revert "update logger propagation for PL tests"

This reverts commit c1a5e119c7.

* playwright

* py

* update import in tests

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

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

* try edit import in overwrite

* debug code

* rev playwright

* Revert "try edit import in overwrite"

This reverts commit c02f766521.

* ci: adjust examples

* adjust examples cloud

* mock lightning_app

* Install assistant dependencies

* lightning

* setup

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* Apply suggestions from code review

* disable cache

* move doctest to install

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

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

* )

* echo ./

* ci

* lru

* revert disabling cache, prints

* ci

* prune ci jobs

* prune ci jobs

* training loop standalone tests

* add sys modules cleanup fixture

* make use of fixture

* revert standalone

* ci e2e

* fix imports in lightning

* fix imports of lightning in tests

* Revert "make use of fixture"

This reverts commit c15efdd205.

* Revert other commits for fixtures

* revert use of fixture

* py3.9

* fix mocking

* fix paths

* hack mocking

* docs

* Apply suggestions from code review

* rev suggestion

* Minor changes to the parametrizations

* Update checkgroup with the new and changed jobs

* include frontend dir

* cli

* fix imports and entry point

* Revert standalone

* rc1

* e2e on staging

* Revert "Revert standalone"

This reverts commit 9df96685b8.

* groups

* to

* ci: pt ver

* docker

* Apply suggestions from code review

* Copy over changes from previous commit to other groups

* Add back changes from bad merge

* Uppercase step name everywhere

* update

* ci

* ci: lai oldest

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Justus Schock <justus.schock@posteo.de>
Co-authored-by: manskx <ahmed.mansy156@gmail.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: thomas chaton <thomas@grid.ai>
Co-authored-by: Luca Antiga <luca.antiga@gmail.com>
2022-10-27 12:32:49 +02:00
thomas chaton 5da74847e2
[App] Show logs command to be standalone and re-usable (#15343) 2022-10-27 09:05:48 +00:00
Luca Furst 488c2ac69c
Prevent bug when launching apps on multiple clusters (#15226)
Stops a bug when cross-launching an app between clusters.

Currently the platform does not allow running multiple app instances. If you have `app-1` running on `cluster-1` and try to run it on `cluster-2`, the CLI will succeed but the app will never start.

This PR prevents this disconnect. The app should not be uploaded / released if it won't run. An error is presented to the user explaining what happened and how to proceed (specify a different `--name`: e.g. `app-2`).

Once the platform supports multiple app instances / running individual apps on multiple clusters, this PR can be reverted.
2022-10-25 23:36:57 +00:00
Raphael Randschau 13baad56e4
Add support for custom cloud compute configurations for Flows (#14831)
* use more recent lightning cloud launcher

* allow LightningApp to use custom cloud compute for flows

* feedback from adrian

* adjust other cloud tests

* update

* update

* update commens

* Update src/lightning_app/core/app.py

Co-authored-by: Sherin Thomas <sherin@grid.ai>

* Close profiler when `StopIteration` is raised (#14945)

* Find last checkpoints on restart (#14907)


Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* Remove unused gcsfs dependency (#14962)

* Update hpu mixed precision link (#14974)

Signed-off-by: Jerome <janand@habana.ai>

* Bump version of fsspec (#14975)

fsspec verbump

* Fix TPU test CI (#14926)

* Fix TPU test CI

* +x first

* Lite first to uncovert errors faster

* Fixes

* One more

* Simplify XLALauncher wrapping to avoid pickle error

* debug

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

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

* Debug commit successful. Trying local definitions

* Require tpu for mock test

* ValueError: The number of devices must be either 1 or 8, got 4 instead

* Fix mock test

* Simplify call, rely on defaults

* Skip OSError for now. Maybe upgrading will help

* Simplify launch tests, move some to lite

* Stricter typing

* RuntimeError: Accessing the XLA device before processes have spawned is not allowed.

* Revert "RuntimeError: Accessing the XLA device before processes have spawned is not allowed."

This reverts commit f65107ebf3.

* Alternative boring solution to the reverted commit

* Fix failing test on CUDA machine

* Workarounds

* Try latest mkl

* Revert "Try latest mkl"

This reverts commit d06813aa67.

* Wrong exception

* xfail

* Mypy

* Comment change

* Spawn launch refactor

* Accept that we cannot lazy init now

* Fix mypy and launch test failures

* The base dockerfile already includes mkl-2022.1.0 - what if we use it?

* try a different mkl version

* Revert mkl version changes

Co-authored-by: awaelchli <aedu.waelchli@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Akihiro Nitta <nitta@akihironitta.com>

* Trainer: fix support for non-distributed PyTorch (#14971)

* Trainer: fix non-distributed use
* Update CHANGELOG

* fixes typing errors in rich_progress.py (#14963)

* revert default cloud compute rename

* allow LightningApp to use custom cloud compute for flows

* feedback from adrian

* update

* resolve merge with master conflict

* remove preemptible

* update CHANGELOG

* add basic flow cloud compute documentation

* fix docs build

* add missing symlink

* try to fix sphinx

* another attempt for docs

* fix new test

Signed-off-by: Jerome <janand@habana.ai>
Co-authored-by: thomas chaton <thomas@grid.ai>
Co-authored-by: Sherin Thomas <sherin@grid.ai>
Co-authored-by: Ziyad Sheebaelhamd <47150407+ziyadsheeba@users.noreply.github.com>
Co-authored-by: otaj <6065855+otaj@users.noreply.github.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: Jerome Anand <88475913+jerome-habana@users.noreply.github.com>
Co-authored-by: awaelchli <aedu.waelchli@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Akihiro Nitta <nitta@akihironitta.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: DP <10988155+donlapark@users.noreply.github.com>
2022-10-25 11:29:15 -07:00
Sherin Thomas 53d2c0684e
Pick queue type only if specified (#15295)
Pick queue type only if specified (#15295)
2022-10-25 22:17:56 +05:30
thomas chaton bd658441bd
[App] testing `lightning` in `lightning-app` package (#15286)
* hot fix

* update

* update

* update

* cmd

* pkg

* update

* Apply suggestions from code review

* update

* update

* Apply suggestions from code review

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* cleaning

* Apply suggestions from code review

* update

* update

Co-authored-by: Jirka <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2022-10-25 09:24:20 -04:00
thomas chaton f98de623fd
Add support for local connect terminal context (#15241)
* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* Update .azure/app-cloud-e2e.yml

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* update

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
2022-10-24 13:27:22 -04:00
Jirka Borovec 56ca4aafee
CI: fix example imports for App as standalone (#15260)
* cleaning

* adjust examples

* fix some imports

* fix imports

* ci

* fixing

* cmd_install._install_app

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

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

* bloody queues

* queue

* mock

* queue

* scope

* win

Co-authored-by: otaj <ota@lightning.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-24 09:52:04 -04:00
Jirka Borovec be1eb5e86d
CI: apps (#15242)
* CI: apps
* fix imports
* req
* doctest
* SQLModel
* fsspec
* azure
* docs
* falek8

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-22 13:20:49 +02:00
thomas chaton 969a323345
[App] Optimise Queues Calls (#15235) 2022-10-21 20:38:09 +00:00
Kaushik B 7354073e6e
App: Remove the unsupported params for CloudCompute (#14852) 2022-10-21 19:37:59 +00:00
Rick Izzo b6f01ab010
Renamed Mount root_dir Argument to mount_path (#15228)
* renamed Mount argument

* fix tests

* Apply suggestions from code review

Co-authored-by: Luca Antiga <luca.antiga@gmail.com>

* updated examples as well

Co-authored-by: Luca Antiga <luca.antiga@gmail.com>
2022-10-20 17:33:35 -04:00
thomas chaton 320bca95dd
[App] Enable help without running application (#15196) 2022-10-20 17:45:03 +00:00
thomas chaton 8ec7ddf317
[App] Pass LightningWork to LightningApp (#15215)
* update

* update

* update

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* ll

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Jirka <jirka.borovec@seznam.cz>
Co-authored-by: Luca Antiga <luca.antiga@gmail.com>
2022-10-20 16:18:06 +02:00
Sherin Thomas bad6253a05
[App] Authentication for HTTP queue (#15202)
[App] Authentication for HTTP queue (#15202)
2022-10-20 17:08:32 +05:30
otaj 2f5060963a
[LAI] Rename instances of "lightning_app" and "pytorch_lightning" (#15208)
* rename instances of lightning_app and pytorch_lightning
* solve failing azure tests
* wrong runif import
* lit_app

Co-authored-by: Jirka <jirka.borovec@seznam.cz>
2022-10-20 10:56:44 +00:00
Rick Izzo 7a827b09bb
Separate the concept of a Drive from that of a Mount (#15120)
* added mount class and configured it into compute config

* added mount to the cloud runtime dispatcher

* raise error if s3 bucket is passed to a drive telling the user to utilize mounts

* added example for app

* udpated tests

* updated tests

* addressed code review comments

* fix bug

* bugfix

* updates'

* code review comments

* updates

* fixed tests after rename

* fix tests
2022-10-19 23:24:27 -04:00
thomas chaton 979d728563
Add Database Component (#14995) 2022-10-19 19:52:12 +00:00
thomas chaton d675d06957
Protect Flow from exception during request processing (#15187) 2022-10-19 18:29:40 +00:00
Ethan Harris 4acb10f981
Add support for command descriptions (#15193) 2022-10-19 17:34:35 +01:00
thomas chaton d11c0d6cc3
Resolve s3 drive issue where the root folder doesn't need to exist locally (#15127) 2022-10-18 14:16:18 +01:00
Pritam Soni 80080550d9
feat: allow root path to run the app on `/path` (#14972)
* feat: add base path
* uvicorn fix arg
* Add prefix
* update with base_path fix
* replace base path with root path
* Apply suggestions from code review

Co-authored-by: Kaushik B <45285388+kaushikb11@users.noreply.github.com>
Co-authored-by: Kaushik B <kaushikbokka@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
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-07 14:09:40 +00:00
Sherin Thomas 129f4fa873
[App/Feature] HTTP Queues (#14978)
[App/Feature] HTTP Queues (#14978)
2022-10-06 16:01:49 +05:30
Ethan Harris 0a9fc22b4f
Fix bug in upload file endpoint (#14924)
Co-authored-by: thomas chaton <thomas@grid.ai>
Co-authored-by: otaj <6065855+otaj@users.noreply.github.com>
2022-10-05 10:05:41 +00:00
thomas chaton b936fd4380
[app] Add CloudCompute ID serializable within the flow and works state (#14819) 2022-10-04 19:46:44 +00:00
Sherin Thomas 53694eb93d
[App/Improvement] Cleaning up Queue abstraction (#14977)
[App/Improvement] Cleaning up Queue abstraction (#14977)
2022-10-04 22:07:31 +05:30
Raphael Randschau 6edf5c5cc2
fix connect/ disconnect without arguments (#14877) 2022-09-27 03:43:36 +00:00
Christopher Nguyen 0841f23bdf
Fix icon encoding in PL App pretty-print (#14795)
Co-authored-by: awaelchli <aedu.waelchli@gmail.com>
2022-09-20 16:39:11 -04:00
Adrian Wälchli e872b274ca
User-friendly exception when `LightningWork.run()` method is missing (#14759) 2022-09-17 19:45:07 +00:00
Pranjal Datta 8f14184180
Fix property setter override by default setter (#14259) 2022-09-17 07:06:45 +00:00