18
18
DEBUG_ENABLED ,
19
19
FLOW_DURATION_SAMPLES ,
20
20
FLOW_DURATION_THRESHOLD ,
21
+ FRONTEND_DIR ,
21
22
STATE_ACCUMULATE_WAIT ,
22
23
)
23
24
from lightning_app .core .queues import BaseQueue , SingleProcessQueue
24
25
from lightning_app .frontend import Frontend
25
26
from lightning_app .storage import Drive , Path
26
27
from lightning_app .storage .path import storage_root_dir
28
+ from lightning_app .utilities import frontend
27
29
from lightning_app .utilities .app_helpers import _delta_to_app_state_delta , _LightningAppRef , Logger
28
30
from lightning_app .utilities .commands .base import _process_requests
29
31
from lightning_app .utilities .component import _convert_paths_after_init , _validate_root_flow
@@ -46,6 +48,7 @@ def __init__(
46
48
self ,
47
49
root : "lightning_app.LightningFlow" ,
48
50
debug : bool = False ,
51
+ info : frontend .AppInfo = None ,
49
52
):
50
53
"""The Lightning App, or App in short runs a tree of one or more components that interact to create end-to-end
51
54
applications. There are two kinds of components: :class:`~lightning_app.core.flow.LightningFlow` and
@@ -62,6 +65,8 @@ def __init__(
62
65
It must define a `run()` method that the app can call.
63
66
debug: Whether to activate the Lightning Logger debug mode.
64
67
This can be helpful when reporting bugs on Lightning repo.
68
+ info: Provide additional info about the app which will be used to update html title,
69
+ description and image meta tags and specify any additional tags as list of html strings.
65
70
66
71
.. doctest::
67
72
@@ -133,6 +138,10 @@ def __init__(
133
138
134
139
logger .debug (f"ENV: { os .environ } " )
135
140
141
+ # update index.html,
142
+ # this should happen once for all apps before the ui server starts running.
143
+ frontend .update_index_file_with_info (FRONTEND_DIR , info = info )
144
+
136
145
def get_component_by_name (self , component_name : str ):
137
146
"""Returns the instance corresponding to the given component name."""
138
147
from lightning_app .structures import Dict , List
0 commit comments