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

Minor correction release 2.2.0.post [rebase & merge] #19450

Merged
merged 8 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
if: |
((matrix.pkg-name == 'lightning' || matrix.pkg-name == 'notset') && matrix.pkg-extra == 'app') ||
matrix.pkg-name == 'app'
run: lightning --version
run: lightning_app --version

- name: DocTests actions
working-directory: .actions/
Expand Down
6 changes: 3 additions & 3 deletions docs/source-app/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ And here's the output you get when running the above application using **Lightni

.. code-block:: console

$ lightning run app docs/source/code_samples/quickstart/app_01.py
$ lightning_app run app docs/source/code_samples/quickstart/app_01.py
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
State: {'works': {'w_1': {'vars': {'counter': 1}}, 'w_2': {'vars': {'counter': 0}}}}

Expand Down Expand Up @@ -175,7 +175,7 @@ Here's the output you get when running the above application using **Lightning C

.. code-block:: console

$ lightning run app docs/source/code_samples/quickstart/app_02.py
$ lightning_app run app docs/source/code_samples/quickstart/app_02.py
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
# After you have clicked `run` on the UI.
0.0 0.0
Expand Down Expand Up @@ -230,7 +230,7 @@ When running the above app, we see the following logs:

.. code-block:: console

$ lightning run app docs/source/code_samples/quickstart/app/app_0.py
$ lightning_app run app docs/source/code_samples/quickstart/app/app_0.py
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
# After you have clicked `run` on the UI.
0.0, 0.0
Expand Down
6 changes: 3 additions & 3 deletions docs/source-app/get_started/go_beyond_training_content.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Install this App by typing:

.. code-block:: bash

lightning install app lightning/quick-start
lightning_app install app lightning/quick-start

Verify the App was successfully installed:

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

.. code:: bash

lightning run app app.py
lightning_app run app app.py

----

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

.. code:: bash

lightning run app app.py --cloud
lightning_app run app app.py --cloud

..
Your app should look like this one (|qs_live_app|)
Expand Down
4 changes: 2 additions & 2 deletions docs/source-app/get_started/jumpstart_from_app_gallery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ User Workflow

.. code-block:: bash

lightning install app lightning/hackernews-app
lightning_app install app lightning/hackernews-app

#. Go through the installation steps.

Expand All @@ -71,7 +71,7 @@ User Workflow
.. code-block:: bash

cd LAI-Hackernews-App
lightning run app app.py
lightning_app run app app.py

.. video:: https://pl-public-data.s3.amazonaws.com/assets_lightning/hackernews.mp4
:poster: https://pl-public-data.s3.amazonaws.com/assets_lightning/hackernews.png
Expand Down
4 changes: 2 additions & 2 deletions docs/source-app/get_started/training_with_apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ To run your app, copy the following command to your local terminal:

.. code-block:: bash

lightning run app app.py
lightning_app run app app.py

Simply add ``--cloud`` to run this application in the cloud with a GPU machine 🤯

.. code-block:: bash

lightning run app app.py --cloud
lightning_app run app app.py --cloud


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.
Expand Down
2 changes: 1 addition & 1 deletion docs/source-app/glossary/command_lines/command_lines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A Command-line Interface (CLI) is an user interface (UI) in a terminal to intera

.. note::

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

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

Expand Down
4 changes: 2 additions & 2 deletions docs/source-app/glossary/environment_variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Environment Variables

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

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.
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.

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

.. code:: bash

lightning run app app.py --cloud --env FOO=BAR --env BAZ=FAZ
lightning_app run app app.py --cloud --env FOO=BAR --env BAZ=FAZ

Environment variables are available in all Flows and Works, and can be accessed as follows:

Expand Down
6 changes: 3 additions & 3 deletions docs/source-app/glossary/secrets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ Use a secret

.. code:: bash

lightning run app app.py --cloud --secret <environment-variable>=<secret-name>
lightning_app run app app.py --cloud --secret <environment-variable>=<secret-name>

In this example, the command would be:

.. code:: bash

lightning run app app.py --cloud --secret api_token=github_api_token
lightning_app run app app.py --cloud --secret api_token=github_api_token


The ``--secret`` option can be used for multiple Secrets, and alongside the ``--env`` option.
Expand All @@ -60,7 +60,7 @@ Here's an example:

.. code:: bash

lightning run app app.py --cloud --env FOO=bar --secret MY_APP_SECRET=my-secret --secret ANOTHER_SECRET=another-secret
lightning_app run app app.py --cloud --env FOO=bar --secret MY_APP_SECRET=my-secret --secret ANOTHER_SECRET=another-secret


----
Expand Down
2 changes: 1 addition & 1 deletion docs/source-app/glossary/use_local_lightning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ git clone https://github.com/Lightning-AI/lightning.git
cd lightning
pip install -e .
export PACKAGE_LIGHTNING=1 # <- this is the magic to use your version (not mainstream PyPI)!
lightning run app app.py --cloud
lightning_app run app app.py --cloud
```

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.
2 changes: 1 addition & 1 deletion docs/source-app/landing_app_run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pip install lightning

# run the app on the --cloud (--setup installs deps automatically)
lightning run app app.py --setup --cloud
lightning_app run app app.py --setup --cloud
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lightning run app app.py --cloud
lightning_app run app app.py --cloud
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lightning run app app.py --setup --cloud
lightning_app run app app.py --setup --cloud
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lightning run app app.py
lightning_app run app app.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lightning run app app.py --setup
lightning_app run app app.py --setup
4 changes: 2 additions & 2 deletions docs/source-app/workflows/add_server/any_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ Start the app to see your new UI!

.. code:: bash

lightning run app app.py
lightning_app run app app.py

To run the app on the cloud, use the ``--cloud`` argument.

.. code:: bash

lightning run app app.py --cloud
lightning_app run app app.py --cloud

----

Expand Down
2 changes: 1 addition & 1 deletion docs/source-app/workflows/add_web_ui/justpy/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ Now, you can run the Lightning App with:

.. code-block::

lightning run app app.py
lightning_app run app app.py
6 changes: 3 additions & 3 deletions docs/source-app/workflows/add_web_ui/panel/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Run the App locally:

.. code:: bash

lightning run app app.py
lightning_app run app app.py

The App should look like this:

Expand All @@ -124,7 +124,7 @@ Now, run it on the cloud:

.. code:: bash

lightning run app app.py --cloud
lightning_app run app app.py --cloud

----

Expand Down Expand Up @@ -319,7 +319,7 @@ Finally run the App

.. code:: bash

lightning run app app.py
lightning_app run app app.py

.. figure:: https://pl-public-data.s3.amazonaws.com/assets_lightning/panel-lightning-theme.gif
:alt: Basic Panel Plotly Lightning App with theming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Connect React to a Lightning app
Example code
************
To illustrate how to connect a React app and a lightning App, we'll be using the `example_app.py` file
which :doc:`lightning init react-ui <create_react_template>` created:
which :doc:`lightning_app init react-ui <create_react_template>` created:

.. literalinclude:: ../../../../../src/lightning/app/cli/react-ui-template/example_app.py

and the App.tsx file also created by :doc:`lightning init react-ui <create_react_template>`:
and the App.tsx file also created by :doc:`lightning_app init react-ui <create_react_template>`:

.. literalinclude:: ../../../../../src/lightning/app/cli/react-ui-template/ui/src/App.tsx

Expand Down Expand Up @@ -54,7 +54,7 @@ At this point, the React app will render in the Lightning app. Test it out!

.. code:: bash

lightning run app example_app.py
lightning_app run app example_app.py

However, to make powerful React+Lightning apps, you must also connect the Lightning App state to the react app.
These lines enable two-way communication between the react app and the Lightning app.
Expand Down
20 changes: 10 additions & 10 deletions docs/source-app/workflows/build_command_line_interface/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Execute the following command in a terminal:

.. code-block::

lightning run app app.py
lightning_app run app app.py

The following appears the terminal:

Expand All @@ -47,19 +47,19 @@ The following appears the terminal:
***************************

In another terminal, connect to the running App.
When you connect to an App, the Lightning CLI is replaced by the App CLI. To exit the App CLI, you need to run ``lightning disconnect``.
When you connect to an App, the Lightning CLI is replaced by the App CLI. To exit the App CLI, you need to run ``lightning_app disconnect``.

.. code-block::

lightning connect localhost
lightning_app connect localhost

To see a list of available commands:

.. code-block::

lightning --help
lightning_app --help
You are connected to the cloud Lightning App: localhost.
Usage: lightning [OPTIONS] COMMAND [ARGS]...
Usage: lightning_app [OPTIONS] COMMAND [ARGS]...

--help Show this message and exit.

Expand All @@ -70,9 +70,9 @@ To find the arguments of the commands:

.. code-block::

lightning add --help
lightning_app add --help
You are connected to the cloud Lightning App: localhost.
Usage: lightning add [ARGS]...
Usage: lightning_app add [ARGS]...

Options
name: Add description
Expand All @@ -87,7 +87,7 @@ Trigger the command line exposed by your App:

.. code-block::

lightning add --name=my_name
lightning_app add --name=my_name
WARNING: Lightning Command Line Interface is an experimental feature and unannounced changes are likely.

In your first terminal, **Received name: my_name** and **["my_name"]** are printed.
Expand All @@ -106,11 +106,11 @@ In your first terminal, **Received name: my_name** and **["my_name"]** are print
5. Disconnect from the App
**************************

To exit the App CLI, you need to run ``lightning disconnect``.
To exit the App CLI, you need to run ``lightning_app disconnect``.

.. code-block::

lightning disconnect
lightning_app disconnect
You are disconnected from the local Lightning App.

----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In a terminal, run the following command and open ``http://127.0.0.1:7501/docs``

.. code-block:: python

lightning run app app.py
lightning_app run app app.py
Your Lightning App is starting. This won't take long.
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view

Expand All @@ -58,11 +58,11 @@ In a terminal, run the following command and open ``http://127.0.0.1:7501/docs``
***************************

In another terminal, connect to the running App.
When you connect to an App, the Lightning CLI is replaced by the App CLI. To exit the App CLI, you need to run ``lightning disconnect``.
When you connect to an App, the Lightning CLI is replaced by the App CLI. To exit the App CLI, you need to run ``lightning_app disconnect``.

.. code-block::

lightning connect localhost
lightning_app connect localhost

Storing `run_notebook` under /Users/thomas/.lightning/lightning_connection/commands/run_notebook.py
You can review all the downloaded commands under /Users/thomas/.lightning/lightning_connection/commands folder.
Expand All @@ -72,10 +72,10 @@ To see a list of available commands:

.. code-block::

lightning --help
lightning_app --help

You are connected to the cloud Lightning App: localhost.
Usage: lightning [OPTIONS] COMMAND [ARGS]...
Usage: lightning_app [OPTIONS] COMMAND [ARGS]...

--help Show this message and exit.

Expand All @@ -87,7 +87,7 @@ To find the arguments of the commands:

.. code-block::

lightning run notebook --help
lightning_app run notebook --help

You are connected to the cloud Lightning App: localhost.
usage: notebook [-h] [--name NAME] [--cloud_compute CLOUD_COMPUTE]
Expand All @@ -111,15 +111,15 @@ Run the first Notebook with the following command:

.. code-block:: python

lightning run notebook --name="my_notebook"
lightning_app run notebook --name="my_notebook"
WARNING: Lightning Command Line Interface is an experimental feature and unannounced changes are likely.
The notebook my_notebook was created.

And run a second notebook.

.. code-block:: python

lightning run notebook --name="my_notebook_2"
lightning_app run notebook --name="my_notebook_2"
WARNING: Lightning Command Line Interface is an experimental feature and unannounced changes are likely.
The notebook my_notebook_2 was created.

Expand All @@ -141,7 +141,7 @@ To exit the App CLI, you need to run **lightning disconnect**.

.. code-block::

lightning disconnect
lightning_app disconnect
You are disconnected from the local Lightning App.

----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A Command-line Interface (CLI) is an user interface (UI) in a terminal to intera

.. note::

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

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

Expand Down
Loading
Loading