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

1.8.4.post release final #15999

Merged
merged 4 commits into from Dec 9, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lightning_app/components/serve/streamlit.py
Expand Up @@ -58,6 +58,7 @@ def run(self) -> None:
],
env=env,
)
self._process.wait()

def on_exit(self) -> None:
if self._process is not None:
Expand Down
7 changes: 2 additions & 5 deletions src/lightning_app/core/app.py
Expand Up @@ -526,14 +526,11 @@ def _update_layout(self) -> None:
component._layout = layout

def _update_is_headless(self) -> None:
is_headless = _is_headless(self)
self.is_headless = _is_headless(self)

# If `is_headless` changed, handle it.
# This ensures support for apps which dynamically add a UI at runtime.
if self.is_headless != is_headless:
self.is_headless = is_headless

_handle_is_headless(self)
_handle_is_headless(self)

def _apply_restarting(self) -> bool:
self._reset_original_state()
Expand Down
2 changes: 1 addition & 1 deletion src/lightning_app/testing/config.py
Expand Up @@ -6,7 +6,7 @@
class _Config:
id = os.getenv("LIGHTNING_USER_ID")
key = os.getenv("LIGHTNING_API_KEY")
url = os.getenv("LIGHTNING_CLOUD_URL", "")
url = os.getenv("LIGHTNING_CLOUD_URL", "https://lightning.ai")
api_key = os.getenv("LIGHTNING_API_KEY")
username = os.getenv("LIGHTNING_USERNAME")
video_location = os.getenv("VIDEO_LOCATION", "./artifacts/videos")
Expand Down
9 changes: 7 additions & 2 deletions src/lightning_app/utilities/app_helpers.py
Expand Up @@ -19,7 +19,7 @@

import websockets
from deepdiff import Delta
from lightning_cloud.openapi import AppinstancesIdBody, Externalv1LightningappInstance
from lightning_cloud.openapi import AppinstancesIdBody, Externalv1LightningappInstance, V1LightningappInstanceState

import lightning_app
from lightning_app.utilities.exceptions import LightningAppStateException
Expand Down Expand Up @@ -556,7 +556,12 @@ def _handle_is_headless(app: "LightningApp"):
"App was not found. Please open an issue at https://github.com/lightning-AI/lightning/issues."
)

if current_lightningapp_instance.spec.is_headless == app.is_headless:
if any(
[
current_lightningapp_instance.spec.is_headless == app.is_headless,
current_lightningapp_instance.status.phase != V1LightningappInstanceState.RUNNING,
]
):
return

current_lightningapp_instance.spec.is_headless = app.is_headless
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_examples_app/public/test_boring_app.py
Expand Up @@ -30,5 +30,5 @@ def check_hello_there(*_, **__):

assert result.exit_code == 0
assert result.exception is None
assert any("--filepath=/content/.storage/boring_file.txt" in line for line in lines)
assert any("Received from root.dict.dst_w" in line for line in lines)
print("Succeeded App!")