Skip to content

Commit 16bd042

Browse files
justusschocklexierule
authored andcommitted
Rename Lightning App CLI (#19440)
(cherry picked from commit 0acd5f9)
1 parent 0574ff0 commit 16bd042

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+116
-107
lines changed

.github/workflows/ci-pkg-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
if: |
8080
((matrix.pkg-name == 'lightning' || matrix.pkg-name == 'notset') && matrix.pkg-extra == 'app') ||
8181
matrix.pkg-name == 'app'
82-
run: lightning --version
82+
run: lightning_app --version
8383

8484
- name: DocTests actions
8585
working-directory: .actions/

docs/source-app/basics.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ And here's the output you get when running the above application using **Lightni
8585

8686
.. code-block:: console
8787
88-
$ lightning run app docs/source/code_samples/quickstart/app_01.py
88+
$ lightning_app run app docs/source/code_samples/quickstart/app_01.py
8989
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
9090
State: {'works': {'w_1': {'vars': {'counter': 1}}, 'w_2': {'vars': {'counter': 0}}}}
9191
@@ -175,7 +175,7 @@ Here's the output you get when running the above application using **Lightning C
175175

176176
.. code-block:: console
177177
178-
$ lightning run app docs/source/code_samples/quickstart/app_02.py
178+
$ lightning_app run app docs/source/code_samples/quickstart/app_02.py
179179
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
180180
# After you have clicked `run` on the UI.
181181
0.0 0.0
@@ -230,7 +230,7 @@ When running the above app, we see the following logs:
230230

231231
.. code-block:: console
232232
233-
$ lightning run app docs/source/code_samples/quickstart/app/app_0.py
233+
$ lightning_app run app docs/source/code_samples/quickstart/app/app_0.py
234234
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
235235
# After you have clicked `run` on the UI.
236236
0.0, 0.0

docs/source-app/get_started/go_beyond_training_content.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Install this App by typing:
5656

5757
.. code-block:: bash
5858
59-
lightning install app lightning/quick-start
59+
lightning_app install app lightning/quick-start
6060
6161
Verify the App was successfully installed:
6262

@@ -74,7 +74,7 @@ Run the app locally with the ``run`` command 🤯
7474

7575
.. code:: bash
7676
77-
lightning run app app.py
77+
lightning_app run app app.py
7878
7979
----
8080

@@ -86,7 +86,7 @@ Add the ``--cloud`` argument to run on the `Lightning.AI cloud <http://lightning
8686

8787
.. code:: bash
8888
89-
lightning run app app.py --cloud
89+
lightning_app run app app.py --cloud
9090
9191
..
9292
Your app should look like this one (|qs_live_app|)

docs/source-app/get_started/jumpstart_from_app_gallery.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ User Workflow
5454

5555
.. code-block:: bash
5656
57-
lightning install app lightning/hackernews-app
57+
lightning_app install app lightning/hackernews-app
5858
5959
#. Go through the installation steps.
6060

@@ -71,7 +71,7 @@ User Workflow
7171
.. code-block:: bash
7272
7373
cd LAI-Hackernews-App
74-
lightning run app app.py
74+
lightning_app run app app.py
7575
7676
.. video:: https://pl-public-data.s3.amazonaws.com/assets_lightning/hackernews.mp4
7777
:poster: https://pl-public-data.s3.amazonaws.com/assets_lightning/hackernews.png

docs/source-app/get_started/training_with_apps.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ To run your app, copy the following command to your local terminal:
6565

6666
.. code-block:: bash
6767
68-
lightning run app app.py
68+
lightning_app run app app.py
6969
7070
Simply add ``--cloud`` to run this application in the cloud with a GPU machine 🤯
7171

7272
.. code-block:: bash
7373
74-
lightning run app app.py --cloud
74+
lightning_app run app app.py --cloud
7575
7676
7777
Congratulations! Now, you know how to run a `PyTorch Lightning <https://github.com/Lightning-AI/lightning/tree/master/src/lightning/pytorch>`_ script with Lightning Apps.

docs/source-app/glossary/command_lines/command_lines.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A Command-line Interface (CLI) is an user interface (UI) in a terminal to intera
1616

1717
.. note::
1818

19-
The Lightning guideline to build CLI is `lightning <VERB> <NOUN> ...` or `<ACTION> <OBJECT> ...`.
19+
The Lightning guideline to build CLI is `lightning_app <VERB> <NOUN> ...` or `<ACTION> <OBJECT> ...`.
2020

2121
As an example, Lightning provides a CLI to interact with your Lightning Apps and the `lightning.ai <https://lightning.ai/>`_ platform as follows:
2222

docs/source-app/glossary/environment_variables.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Environment Variables
66

77
If your App is using configuration values you don't want to commit with your App source code, you can use environment variables.
88

9-
Lightning allows you to set environment variables when running the App from the CLI with the `lightning run app` command. You can use environment variables to pass any values to the App, and avoiding sticking those values in the source code.
9+
Lightning allows you to set environment variables when running the App from the CLI with the `lightning_app run app` command. You can use environment variables to pass any values to the App, and avoiding sticking those values in the source code.
1010

1111
Set one or multiple variables using the **--env** option:
1212

1313
.. code:: bash
1414
15-
lightning run app app.py --cloud --env FOO=BAR --env BAZ=FAZ
15+
lightning_app run app app.py --cloud --env FOO=BAR --env BAZ=FAZ
1616
1717
Environment variables are available in all Flows and Works, and can be accessed as follows:
1818

docs/source-app/glossary/secrets.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ Use a secret
4545

4646
.. code:: bash
4747
48-
lightning run app app.py --cloud --secret <environment-variable>=<secret-name>
48+
lightning_app run app app.py --cloud --secret <environment-variable>=<secret-name>
4949
5050
In this example, the command would be:
5151

5252
.. code:: bash
5353
54-
lightning run app app.py --cloud --secret api_token=github_api_token
54+
lightning_app run app app.py --cloud --secret api_token=github_api_token
5555
5656
5757
The ``--secret`` option can be used for multiple Secrets, and alongside the ``--env`` option.
@@ -60,7 +60,7 @@ Here's an example:
6060

6161
.. code:: bash
6262
63-
lightning run app app.py --cloud --env FOO=bar --secret MY_APP_SECRET=my-secret --secret ANOTHER_SECRET=another-secret
63+
lightning_app run app app.py --cloud --env FOO=bar --secret MY_APP_SECRET=my-secret --secret ANOTHER_SECRET=another-secret
6464
6565
6666
----

docs/source-app/glossary/use_local_lightning.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git clone https://github.com/Lightning-AI/lightning.git
99
cd lightning
1010
pip install -e .
1111
export PACKAGE_LIGHTNING=1 # <- this is the magic to use your version (not mainstream PyPI)!
12-
lightning run app app.py --cloud
12+
lightning_app run app app.py --cloud
1313
```
1414

1515
By setting `PACKAGE_LIGHTNING=1`, lightning packages the lightning source code in your local directory in addition to your app source code and uploads them to the cloud.

docs/source-app/landing_app_run.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
pip install lightning
33

44
# run the app on the --cloud (--setup installs deps automatically)
5-
lightning run app app.py --setup --cloud
5+
lightning_app run app app.py --setup --cloud

0 commit comments

Comments
 (0)