From 50b9172451f0329354d22b11cd53c40740760d03 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 11:10:35 +0100 Subject: [PATCH 01/28] update --- src/lightning/app/core/constants.py | 3 +++ src/lightning/app/storage/path.py | 11 +---------- tests/app.py | 12 ++++++++++++ 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 tests/app.py diff --git a/src/lightning/app/core/constants.py b/src/lightning/app/core/constants.py index fbd36ea38e771..5306b5c85c170 100644 --- a/src/lightning/app/core/constants.py +++ b/src/lightning/app/core/constants.py @@ -20,6 +20,9 @@ def get_lightning_cloud_url() -> str: + # detect local development + if os.getenv("VSCODE_PROXY_URI", "").startswith("http://localhost:9800"): + return "http://localhost:9800" # DO NOT CHANGE! return os.getenv("LIGHTNING_CLOUD_URL", "https://lightning.ai") diff --git a/src/lightning/app/storage/path.py b/src/lightning/app/storage/path.py index 6f37abee6231f..07b9000386def 100644 --- a/src/lightning/app/storage/path.py +++ b/src/lightning/app/storage/path.py @@ -427,16 +427,7 @@ def _filesystem() -> AbstractFileSystem: endpoint_url = os.getenv("LIGHTNING_BUCKET_ENDPOINT_URL", "") bucket_name = os.getenv("LIGHTNING_BUCKET_NAME", "") if endpoint_url != "" and bucket_name != "": - key = os.getenv("LIGHTNING_AWS_ACCESS_KEY_ID", "") - secret = os.getenv("LIGHTNING_AWS_SECRET_ACCESS_KEY", "") - # TODO: Remove when updated on the platform side. - if key == "" or secret == "": - key = os.getenv("AWS_ACCESS_KEY_ID", "") - secret = os.getenv("AWS_SECRET_ACCESS_KEY", "") - if key == "" or secret == "": - raise RuntimeError("missing S3 bucket credentials") - - fs = S3FileSystem(key=key, secret=secret, use_ssl=False, client_kwargs={"endpoint_url": endpoint_url}) + fs = S3FileSystem() app_id = os.getenv("LIGHTNING_CLOUD_APP_ID", "") if app_id == "": diff --git a/tests/app.py b/tests/app.py new file mode 100644 index 0000000000000..e8c10e3550812 --- /dev/null +++ b/tests/app.py @@ -0,0 +1,12 @@ +# app.py +import lightning as L + + +class YourComponent(L.LightningWork): + def run(self): + print("RUN ANY PYTHON CODE HERE") + + +if __name__ == "__main__": + component = YourComponent() + app = L.LightningApp(component) From ef77a8424b659a76ae2eecb41fe096b8d35cdda8 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 11:13:16 +0100 Subject: [PATCH 02/28] update --- tests/app.py | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 tests/app.py diff --git a/tests/app.py b/tests/app.py deleted file mode 100644 index e8c10e3550812..0000000000000 --- a/tests/app.py +++ /dev/null @@ -1,12 +0,0 @@ -# app.py -import lightning as L - - -class YourComponent(L.LightningWork): - def run(self): - print("RUN ANY PYTHON CODE HERE") - - -if __name__ == "__main__": - component = YourComponent() - app = L.LightningApp(component) From 1220b33798b03e8187493deab52ddc10680bf50f Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 11:18:47 +0100 Subject: [PATCH 03/28] update --- src/lightning/app/storage/path.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lightning/app/storage/path.py b/src/lightning/app/storage/path.py index 07b9000386def..4a46d3a30477e 100644 --- a/src/lightning/app/storage/path.py +++ b/src/lightning/app/storage/path.py @@ -427,6 +427,10 @@ def _filesystem() -> AbstractFileSystem: endpoint_url = os.getenv("LIGHTNING_BUCKET_ENDPOINT_URL", "") bucket_name = os.getenv("LIGHTNING_BUCKET_NAME", "") if endpoint_url != "" and bucket_name != "": + # FIXME: Temporary fix until we remove the injection. + os.environ.pop("AWS_ACCESS_KEY_ID", None) + os.environ.pop("AWS_SECRET_ACCESS_KEY", None) + fs = S3FileSystem() app_id = os.getenv("LIGHTNING_CLOUD_APP_ID", "") From 1ce64b7a38ac65dccaec327608bbb3e5067900da Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 11:50:16 +0100 Subject: [PATCH 04/28] update --- tests/tests_app/storage/test_path.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/tests_app/storage/test_path.py b/tests/tests_app/storage/test_path.py index 07f3f282e2207..78e3c495d0b90 100644 --- a/tests/tests_app/storage/test_path.py +++ b/tests/tests_app/storage/test_path.py @@ -693,8 +693,6 @@ def test_artifacts_path(): @pytest.mark.skipif(not _is_s3fs_available(), reason="This test requires s3fs.") @mock.patch.dict(os.environ, {"LIGHTNING_BUCKET_ENDPOINT_URL": "a"}) @mock.patch.dict(os.environ, {"LIGHTNING_BUCKET_NAME": "b"}) -@mock.patch.dict(os.environ, {"LIGHTNING_AWS_ACCESS_KEY_ID": "c"}) -@mock.patch.dict(os.environ, {"LIGHTNING_AWS_SECRET_ACCESS_KEY": "d"}) @mock.patch.dict(os.environ, {"LIGHTNING_CLOUD_APP_ID": "e"}) def test_filesystem(monkeypatch): from lightning.app.storage import path @@ -702,10 +700,7 @@ def test_filesystem(monkeypatch): mock = MagicMock() monkeypatch.setattr(path, "S3FileSystem", mock) fs = _filesystem() - assert fs._mock_new_parent._mock_mock_calls[0].kwargs["key"] == "c" - assert fs._mock_new_parent._mock_mock_calls[0].kwargs["secret"] == "d" - assert not fs._mock_new_parent._mock_mock_calls[0].kwargs["use_ssl"] - assert fs._mock_new_parent._mock_mock_calls[0].kwargs["client_kwargs"] == {"endpoint_url": "a"} + assert fs == mock() class TestSharedStoragePath(TestCase): From 525c1d1b8440f1bd3919a6669b26df86ea35fff3 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 12:05:34 +0100 Subject: [PATCH 05/28] update --- src/lightning/app/storage/path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lightning/app/storage/path.py b/src/lightning/app/storage/path.py index 4a46d3a30477e..ff9c24414a4a7 100644 --- a/src/lightning/app/storage/path.py +++ b/src/lightning/app/storage/path.py @@ -427,7 +427,7 @@ def _filesystem() -> AbstractFileSystem: endpoint_url = os.getenv("LIGHTNING_BUCKET_ENDPOINT_URL", "") bucket_name = os.getenv("LIGHTNING_BUCKET_NAME", "") if endpoint_url != "" and bucket_name != "": - # FIXME: Temporary fix until we remove the injection. + # FIXME: Temporary fix until we remove the injection from the platform os.environ.pop("AWS_ACCESS_KEY_ID", None) os.environ.pop("AWS_SECRET_ACCESS_KEY", None) From 4680b40fe9c0cddf4122c535abe6759afee3bed3 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 13:40:15 +0100 Subject: [PATCH 06/28] update --- src/lightning/app/testing/testing.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lightning/app/testing/testing.py b/src/lightning/app/testing/testing.py index 9a6a7908336fc..1b3254cf0938e 100644 --- a/src/lightning/app/testing/testing.py +++ b/src/lightning/app/testing/testing.py @@ -385,6 +385,8 @@ def run_app_in_cloud( # wait until the app is running and openapi.json is ready if app.status.phase == V1LightningappInstanceState.RUNNING: + break + # WHY THE REQUEST FAILS ? view_page.goto(f"{app.status.url}/view") status_code = requests.get(f"{app.status.url}/openapi.json").status_code if status_code == 200: @@ -478,6 +480,18 @@ def _delete_lightning_app(client, project_id, app_id, app_name): print(f"Failed to delete {app_name}. Exception {ex}") +def _delete_cloud_space(client, project_id, cloud_space_id, app_name): + print(f"Deleting {app_name} id: {cloud_space_id}") + try: + res = client.cloud_space_service_delete_cloud_space( + project_id=project_id, + id=cloud_space_id, + ) + assert res == {} + except ApiException as ex: + print(f"Failed to delete {app_name}. Exception {ex}") + + def delete_cloud_lightning_apps(): """Cleanup cloud apps that start with the name test-{PR_NUMBER}-{TEST_APP_NAME}. @@ -501,11 +515,13 @@ def delete_cloud_lightning_apps(): for lit_app in list_apps.lightningapps: if pr_number and app_name and not lit_app.name.startswith(f"test-{pr_number}-{app_name}-"): continue - _delete_lightning_app(client, project_id=project_id, app_id=lit_app.id, app_name=lit_app.name) + _delete_cloud_space(client, project_id=project_id, app_id=lit_app.spec.cloud_space_id, app_name=lit_app.name) print("deleting apps that were created more than 1 hour ago.") for lit_app in list_apps.lightningapps: if lit_app.created_at < datetime.datetime.now(lit_app.created_at.tzinfo) - datetime.timedelta(hours=1): - _delete_lightning_app(client, project_id=project_id, app_id=lit_app.id, app_name=lit_app.name) + _delete_cloud_space( + client, project_id=project_id, app_id=lit_app.spec.cloud_space_id, app_name=lit_app.name + ) From 76050cb2512063cf9f0849fa9efc5103e5a52982 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 16:00:31 +0100 Subject: [PATCH 07/28] update --- src/lightning/app/testing/testing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lightning/app/testing/testing.py b/src/lightning/app/testing/testing.py index 1b3254cf0938e..2009d3b2147de 100644 --- a/src/lightning/app/testing/testing.py +++ b/src/lightning/app/testing/testing.py @@ -386,7 +386,7 @@ def run_app_in_cloud( # wait until the app is running and openapi.json is ready if app.status.phase == V1LightningappInstanceState.RUNNING: break - # WHY THE REQUEST FAILS ? + # FIXME: WHY DOES THIS FAIL view_page.goto(f"{app.status.url}/view") status_code = requests.get(f"{app.status.url}/openapi.json").status_code if status_code == 200: @@ -515,6 +515,7 @@ def delete_cloud_lightning_apps(): for lit_app in list_apps.lightningapps: if pr_number and app_name and not lit_app.name.startswith(f"test-{pr_number}-{app_name}-"): continue + _delete_lightning_app(client, project_id=project_id, app_id=lit_app.id, app_name=lit_app.name) _delete_cloud_space(client, project_id=project_id, app_id=lit_app.spec.cloud_space_id, app_name=lit_app.name) print("deleting apps that were created more than 1 hour ago.") @@ -522,6 +523,7 @@ def delete_cloud_lightning_apps(): for lit_app in list_apps.lightningapps: if lit_app.created_at < datetime.datetime.now(lit_app.created_at.tzinfo) - datetime.timedelta(hours=1): + _delete_lightning_app(client, project_id=project_id, app_id=lit_app.id, app_name=lit_app.name) _delete_cloud_space( client, project_id=project_id, app_id=lit_app.spec.cloud_space_id, app_name=lit_app.name ) From a3cbdf3b1d925e8db6495697c1c25008d9ab7fa2 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 16:26:17 +0100 Subject: [PATCH 08/28] update --- .azure/app-cloud-e2e.yml | 1 + src/lightning/app/core/constants.py | 1 + 2 files changed, 2 insertions(+) diff --git a/.azure/app-cloud-e2e.yml b/.azure/app-cloud-e2e.yml index 7f8431677d92d..82ffecb63dac8 100644 --- a/.azure/app-cloud-e2e.yml +++ b/.azure/app-cloud-e2e.yml @@ -136,6 +136,7 @@ jobs: SLOW_MO: '50' LIGHTNING_DEBUG: '1' LIGHTNING_CLOUD_QUEUE_TYPE: $(queue_type) + LIGHTNING_HTTP_QUEUE_URL: "https://lightning.ai/" steps: - script: echo '##vso[task.setvariable variable=local_id]$(System.PullRequest.PullRequestNumber)' diff --git a/src/lightning/app/core/constants.py b/src/lightning/app/core/constants.py index 5306b5c85c170..e165ca8da1380 100644 --- a/src/lightning/app/core/constants.py +++ b/src/lightning/app/core/constants.py @@ -51,6 +51,7 @@ def get_lightning_cloud_url() -> str: REDIS_QUEUES_READ_DEFAULT_TIMEOUT = 0.005 HTTP_QUEUE_URL = os.getenv("LIGHTNING_HTTP_QUEUE_URL", "http://localhost:9801") +print("HTTP_QUEUE_URL", HTTP_QUEUE_URL) HTTP_QUEUE_REFRESH_INTERVAL = float(os.getenv("LIGHTNING_HTTP_QUEUE_REFRESH_INTERVAL", "1")) HTTP_QUEUE_TOKEN = os.getenv("LIGHTNING_HTTP_QUEUE_TOKEN", None) From ccf036dd6ba855de8aa2b6f46655ba8ca5403a54 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 17:10:50 +0100 Subject: [PATCH 09/28] update --- src/lightning/app/core/constants.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lightning/app/core/constants.py b/src/lightning/app/core/constants.py index e165ca8da1380..fce2053a0c161 100644 --- a/src/lightning/app/core/constants.py +++ b/src/lightning/app/core/constants.py @@ -50,8 +50,7 @@ def get_lightning_cloud_url() -> str: REDIS_PASSWORD = os.getenv("REDIS_PASSWORD", None) REDIS_QUEUES_READ_DEFAULT_TIMEOUT = 0.005 -HTTP_QUEUE_URL = os.getenv("LIGHTNING_HTTP_QUEUE_URL", "http://localhost:9801") -print("HTTP_QUEUE_URL", HTTP_QUEUE_URL) +HTTP_QUEUE_URL = os.getenv("LIGHTNING_HTTP_QUEUE_URL", "https://lightning.ai/") HTTP_QUEUE_REFRESH_INTERVAL = float(os.getenv("LIGHTNING_HTTP_QUEUE_REFRESH_INTERVAL", "1")) HTTP_QUEUE_TOKEN = os.getenv("LIGHTNING_HTTP_QUEUE_TOKEN", None) From ce0d73daa6c62d5d4a668098633b1a99fb85f9e1 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 17:41:55 +0100 Subject: [PATCH 10/28] update --- src/lightning/app/core/constants.py | 2 +- src/lightning/app/storage/path.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lightning/app/core/constants.py b/src/lightning/app/core/constants.py index fce2053a0c161..5306b5c85c170 100644 --- a/src/lightning/app/core/constants.py +++ b/src/lightning/app/core/constants.py @@ -50,7 +50,7 @@ def get_lightning_cloud_url() -> str: REDIS_PASSWORD = os.getenv("REDIS_PASSWORD", None) REDIS_QUEUES_READ_DEFAULT_TIMEOUT = 0.005 -HTTP_QUEUE_URL = os.getenv("LIGHTNING_HTTP_QUEUE_URL", "https://lightning.ai/") +HTTP_QUEUE_URL = os.getenv("LIGHTNING_HTTP_QUEUE_URL", "http://localhost:9801") HTTP_QUEUE_REFRESH_INTERVAL = float(os.getenv("LIGHTNING_HTTP_QUEUE_REFRESH_INTERVAL", "1")) HTTP_QUEUE_TOKEN = os.getenv("LIGHTNING_HTTP_QUEUE_TOKEN", None) diff --git a/src/lightning/app/storage/path.py b/src/lightning/app/storage/path.py index ff9c24414a4a7..0c12c648cd67a 100644 --- a/src/lightning/app/storage/path.py +++ b/src/lightning/app/storage/path.py @@ -428,8 +428,9 @@ def _filesystem() -> AbstractFileSystem: bucket_name = os.getenv("LIGHTNING_BUCKET_NAME", "") if endpoint_url != "" and bucket_name != "": # FIXME: Temporary fix until we remove the injection from the platform - os.environ.pop("AWS_ACCESS_KEY_ID", None) - os.environ.pop("AWS_SECRET_ACCESS_KEY", None) + if "AWS_ACCESS_KEY_ID" in os.environ: + del os.environ["AWS_ACCESS_KEY_ID"] + del os.environ["AWS_SECRET_ACCESS_KEY"] fs = S3FileSystem() From 7867342ba8cbf7603e3eec54ba56e3a661e8f1b1 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 18:24:11 +0100 Subject: [PATCH 11/28] update --- src/lightning/app/core/constants.py | 14 +------------- src/lightning/app/runners/cloud.py | 7 ++----- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/lightning/app/core/constants.py b/src/lightning/app/core/constants.py index 5306b5c85c170..19bc25ef0d63d 100644 --- a/src/lightning/app/core/constants.py +++ b/src/lightning/app/core/constants.py @@ -118,17 +118,5 @@ def enable_interruptible_works() -> bool: return bool(int(os.getenv("LIGHTNING_INTERRUPTIBLE_WORKS", "0"))) -# Get Cluster Driver -_CLUSTER_DRIVERS = [None, "k8s", "direct"] - - def get_cluster_driver() -> Optional[str]: - value = os.getenv("LIGHTNING_CLUSTER_DRIVER", None) - if value is None: - if enable_interruptible_works(): - value = "direct" - else: - value = None - if value not in _CLUSTER_DRIVERS: - raise ValueError(f"Found {value} cluster driver. The value needs to be in {_CLUSTER_DRIVERS}.") - return value + return "direct" diff --git a/src/lightning/app/runners/cloud.py b/src/lightning/app/runners/cloud.py index 2e5918001f727..d3d59f564432b 100644 --- a/src/lightning/app/runners/cloud.py +++ b/src/lightning/app/runners/cloud.py @@ -78,7 +78,6 @@ ENABLE_PULLING_STATE_ENDPOINT, ENABLE_PUSHING_STATE_ENDPOINT, get_cloud_queue_type, - get_cluster_driver, get_lightning_cloud_url, LIGHTNING_CLOUD_PRINT_SPECS, SYS_CUSTOMIZATIONS_SYNC_ROOT, @@ -874,11 +873,9 @@ def _get_env_vars( if not ENABLE_PUSHING_STATE_ENDPOINT: v1_env_vars.append(V1EnvVar(name="ENABLE_PUSHING_STATE_ENDPOINT", value="0")) - if get_cloud_queue_type(): - v1_env_vars.append(V1EnvVar(name="LIGHTNING_CLOUD_QUEUE_TYPE", value=get_cloud_queue_type())) + v1_env_vars.append(V1EnvVar(name="LIGHTNING_CLOUD_QUEUE_TYPE", value="http")) - if get_cluster_driver(): - v1_env_vars.append(V1EnvVar(name="LIGHTNING_CLUSTER_DRIVER", value=get_cluster_driver())) + v1_env_vars.append(V1EnvVar(name="LIGHTNING_CLUSTER_DRIVER", value="direct")) if enable_interruptible_works(): v1_env_vars.append( From e9acf435ad8bd67befc8cd916d53a946fb9a3060 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 19:00:07 +0100 Subject: [PATCH 12/28] update --- src/lightning/app/core/queues.py | 15 ++++++++++++--- src/lightning/app/runners/cloud.py | 4 ---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lightning/app/core/queues.py b/src/lightning/app/core/queues.py index 607fd302fc22c..5b1281ecb0767 100644 --- a/src/lightning/app/core/queues.py +++ b/src/lightning/app/core/queues.py @@ -388,19 +388,28 @@ def get(self, timeout: Optional[float] = None) -> Any: if timeout is None: while True: try: - return self._get() + try: + return self._get() + except requests.exceptions.HTTPError: + pass except queue.Empty: time.sleep(HTTP_QUEUE_REFRESH_INTERVAL) # make one request and return the result if timeout == 0: - return self._get() + try: + return self._get() + except requests.exceptions.HTTPError: + return None # timeout is some value - loop until the timeout is reached start_time = time.time() while (time.time() - start_time) < timeout: try: - return self._get() + try: + return self._get() + except requests.exceptions.HTTPError: + raise queue.Empty except queue.Empty: # Note: In theory, there isn't a need for a sleep as the queue shouldn't # block the flow if the queue is empty. diff --git a/src/lightning/app/runners/cloud.py b/src/lightning/app/runners/cloud.py index d3d59f564432b..12ba2f9f0a7c0 100644 --- a/src/lightning/app/runners/cloud.py +++ b/src/lightning/app/runners/cloud.py @@ -873,10 +873,6 @@ def _get_env_vars( if not ENABLE_PUSHING_STATE_ENDPOINT: v1_env_vars.append(V1EnvVar(name="ENABLE_PUSHING_STATE_ENDPOINT", value="0")) - v1_env_vars.append(V1EnvVar(name="LIGHTNING_CLOUD_QUEUE_TYPE", value="http")) - - v1_env_vars.append(V1EnvVar(name="LIGHTNING_CLUSTER_DRIVER", value="direct")) - if enable_interruptible_works(): v1_env_vars.append( V1EnvVar( From 0d37de8886df9ff376256d7af2614a9e804ae9f4 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 21 Apr 2023 19:05:37 +0100 Subject: [PATCH 13/28] update --- src/lightning/app/core/queues.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lightning/app/core/queues.py b/src/lightning/app/core/queues.py index 5b1281ecb0767..68a320578aab6 100644 --- a/src/lightning/app/core/queues.py +++ b/src/lightning/app/core/queues.py @@ -409,6 +409,8 @@ def get(self, timeout: Optional[float] = None) -> Any: try: return self._get() except requests.exceptions.HTTPError: + if timeout > self.default_timeout: + return None raise queue.Empty except queue.Empty: # Note: In theory, there isn't a need for a sleep as the queue shouldn't From 2d18bdfaaef4973c89044a2964f350ebd921f507 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 14:03:18 +0100 Subject: [PATCH 14/28] update --- src/lightning/app/core/queues.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lightning/app/core/queues.py b/src/lightning/app/core/queues.py index 68a320578aab6..239a7ca1969af 100644 --- a/src/lightning/app/core/queues.py +++ b/src/lightning/app/core/queues.py @@ -452,8 +452,11 @@ def length(self) -> int: if not self.app_id: raise ValueError(f"App ID couldn't be extracted from the queue name: {self.name}") - val = self.client.get(f"/v1/{self.app_id}/{self._name_suffix}/length") - return int(val.text) + try: + val = self.client.get(f"/v1/{self.app_id}/{self._name_suffix}/length") + return int(val.text) + except requests.exceptions.HTTPError: + return 0 @staticmethod def _split_app_id_and_queue_name(queue_name: str) -> Tuple[str, str]: From 0efd806bda3ee4ae0ee84da18be909c33d80ab0a Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 16:20:07 +0100 Subject: [PATCH 15/28] update --- examples/app/commands_and_api/.lightningignore | 1 + src/lightning/version.info | 1 + tests/tests_app/core/test_constants.py | 18 +----------------- 3 files changed, 3 insertions(+), 17 deletions(-) create mode 100644 examples/app/commands_and_api/.lightningignore create mode 100644 src/lightning/version.info diff --git a/examples/app/commands_and_api/.lightningignore b/examples/app/commands_and_api/.lightningignore new file mode 100644 index 0000000000000..f7275bbbd035b --- /dev/null +++ b/examples/app/commands_and_api/.lightningignore @@ -0,0 +1 @@ +venv/ diff --git a/src/lightning/version.info b/src/lightning/version.info new file mode 100644 index 0000000000000..c175dec033b75 --- /dev/null +++ b/src/lightning/version.info @@ -0,0 +1 @@ +2.1.0dev diff --git a/tests/tests_app/core/test_constants.py b/tests/tests_app/core/test_constants.py index 4f4965cc388a2..489334a06e87e 100644 --- a/tests/tests_app/core/test_constants.py +++ b/tests/tests_app/core/test_constants.py @@ -1,25 +1,9 @@ import os from unittest import mock -import pytest - -from lightning.app.core.constants import get_cluster_driver, get_lightning_cloud_url +from lightning.app.core.constants import get_lightning_cloud_url @mock.patch.dict(os.environ, {"LIGHTNING_CLOUD_URL": "https://beta.lightning.ai"}) def test_defaults(): assert get_lightning_cloud_url() == "https://beta.lightning.ai" - - -def test_cluster_drive(monkeypatch): - assert get_cluster_driver() is None - - monkeypatch.setenv("LIGHTNING_INTERRUPTIBLE_WORKS", "1") - assert get_cluster_driver() == "direct" - - monkeypatch.setenv("LIGHTNING_CLUSTER_DRIVER", "k8s") - assert get_cluster_driver() == "k8s" - - with pytest.raises(ValueError, match="The value needs to be in"): - monkeypatch.setenv("LIGHTNING_CLUSTER_DRIVER", "something_else") - assert get_cluster_driver() == "k8s" From f58fd07c619b919eec450442ad1eb7f1d359153f Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 16:22:14 +0100 Subject: [PATCH 16/28] update --- .azure/app-cloud-e2e.yml | 1 - src/lightning/version.info | 1 - 2 files changed, 2 deletions(-) delete mode 100644 src/lightning/version.info diff --git a/.azure/app-cloud-e2e.yml b/.azure/app-cloud-e2e.yml index 82ffecb63dac8..7f8431677d92d 100644 --- a/.azure/app-cloud-e2e.yml +++ b/.azure/app-cloud-e2e.yml @@ -136,7 +136,6 @@ jobs: SLOW_MO: '50' LIGHTNING_DEBUG: '1' LIGHTNING_CLOUD_QUEUE_TYPE: $(queue_type) - LIGHTNING_HTTP_QUEUE_URL: "https://lightning.ai/" steps: - script: echo '##vso[task.setvariable variable=local_id]$(System.PullRequest.PullRequestNumber)' diff --git a/src/lightning/version.info b/src/lightning/version.info deleted file mode 100644 index c175dec033b75..0000000000000 --- a/src/lightning/version.info +++ /dev/null @@ -1 +0,0 @@ -2.1.0dev From d5fdc2fa5e1c6579a8cc33e90d2de0abca3e5c3d Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 16:51:57 +0100 Subject: [PATCH 17/28] update --- src/lightning/app/testing/testing.py | 6 +++--- tests/integrations_app/public/test_v0_app.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lightning/app/testing/testing.py b/src/lightning/app/testing/testing.py index 2009d3b2147de..a22ad9066c68a 100644 --- a/src/lightning/app/testing/testing.py +++ b/src/lightning/app/testing/testing.py @@ -377,6 +377,8 @@ def run_app_in_cloud( [constants.LIGHTNING_CLOUD_PROJECT_ID], ) + admin_page.reload() + view_page = context.new_page() i = 1 while True: @@ -385,12 +387,10 @@ def run_app_in_cloud( # wait until the app is running and openapi.json is ready if app.status.phase == V1LightningappInstanceState.RUNNING: - break - # FIXME: WHY DOES THIS FAIL - view_page.goto(f"{app.status.url}/view") status_code = requests.get(f"{app.status.url}/openapi.json").status_code if status_code == 200: print("App is running, continuing with testing...") + view_page.goto(f"{app.status.url}/view") break msg = f"Received status code {status_code} at {app.status.url!r}" elif app.status.phase not in (V1LightningappInstanceState.PENDING, V1LightningappInstanceState.NOT_STARTED): diff --git a/tests/integrations_app/public/test_v0_app.py b/tests/integrations_app/public/test_v0_app.py index 3e3fe0825109b..634fd10fd93b6 100644 --- a/tests/integrations_app/public/test_v0_app.py +++ b/tests/integrations_app/public/test_v0_app.py @@ -53,6 +53,7 @@ def check_content(button_name, text_content): has_logs = False while not has_logs: for log in fetch_logs(["flow"]): + print(log) if "'a': 'a', 'b': 'b'" in log: has_logs = True sleep(1) From 44d864113d3b53828a01be38d20a8dccb4c57318 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 16:58:29 +0100 Subject: [PATCH 18/28] update --- src/lightning/app/utilities/app_logs.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/lightning/app/utilities/app_logs.py b/src/lightning/app/utilities/app_logs.py index c03ca162fb8e1..bc21c3d456b47 100644 --- a/src/lightning/app/utilities/app_logs.py +++ b/src/lightning/app/utilities/app_logs.py @@ -27,13 +27,16 @@ @dataclass class _LogEventLabels: - app: str - container: str - filename: str - job: str - namespace: str - node_name: str - pod: str + app: Optional[str] = None + container: Optional[str] = None + filename: Optional[str] = None + job: Optional[str] = None + namespace: Optional[str] = None + node_name: Optional[str] = None + pod: Optional[str] = None + clusterID: Optional[str] = None + component: Optional[str] = None + projectID: Optional[str] = None stream: Optional[str] = None From 88875a14e8ca91585112976fb31f43bda3fd2b46 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 17:47:49 +0100 Subject: [PATCH 19/28] update --- src/lightning/app/utilities/packaging/cloud_compute.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lightning/app/utilities/packaging/cloud_compute.py b/src/lightning/app/utilities/packaging/cloud_compute.py index 2474e0b3a7f0c..3563af5e2761c 100644 --- a/src/lightning/app/utilities/packaging/cloud_compute.py +++ b/src/lightning/app/utilities/packaging/cloud_compute.py @@ -111,6 +111,9 @@ def __post_init__(self) -> None: if "gpu" not in self.name: raise ValueError("CloudCompute `interruptible=True` is supported only with GPU.") + if self.name == "default" or self.name == "cpu": + self.name = "cpu-small" + # TODO: Remove from the platform first. self.preemptible = self.interruptible From a64743e1421eb741cde9c9228c26964b5b5c5916 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 17:49:33 +0100 Subject: [PATCH 20/28] update --- tests/tests_app/utilities/packaging/test_cloud_compute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests_app/utilities/packaging/test_cloud_compute.py b/tests/tests_app/utilities/packaging/test_cloud_compute.py index 7d49a967f8013..d954b2507339f 100644 --- a/tests/tests_app/utilities/packaging/test_cloud_compute.py +++ b/tests/tests_app/utilities/packaging/test_cloud_compute.py @@ -5,7 +5,7 @@ def test_cloud_compute_names(): - assert CloudCompute().name == "default" + assert CloudCompute().name == "cpu-small" assert CloudCompute("cpu-small").name == "cpu-small" assert CloudCompute("coconut").name == "coconut" # the backend is responsible for validation of names From 423f9e9c8684b1c9b26fdb54c375a059dee378ec Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 17:49:59 +0100 Subject: [PATCH 21/28] update --- src/lightning/app/utilities/packaging/cloud_compute.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lightning/app/utilities/packaging/cloud_compute.py b/src/lightning/app/utilities/packaging/cloud_compute.py index 3563af5e2761c..8285cae7fc7d9 100644 --- a/src/lightning/app/utilities/packaging/cloud_compute.py +++ b/src/lightning/app/utilities/packaging/cloud_compute.py @@ -111,6 +111,7 @@ def __post_init__(self) -> None: if "gpu" not in self.name: raise ValueError("CloudCompute `interruptible=True` is supported only with GPU.") + # FIXME: Clean the mess on the platform side if self.name == "default" or self.name == "cpu": self.name = "cpu-small" From dbecd0d6834f0fd72ba69781c6f8f7c7df222e0c Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 18:09:54 +0100 Subject: [PATCH 22/28] update --- src/lightning/app/testing/testing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lightning/app/testing/testing.py b/src/lightning/app/testing/testing.py index a22ad9066c68a..bcc74fa00c970 100644 --- a/src/lightning/app/testing/testing.py +++ b/src/lightning/app/testing/testing.py @@ -516,7 +516,9 @@ def delete_cloud_lightning_apps(): if pr_number and app_name and not lit_app.name.startswith(f"test-{pr_number}-{app_name}-"): continue _delete_lightning_app(client, project_id=project_id, app_id=lit_app.id, app_name=lit_app.name) - _delete_cloud_space(client, project_id=project_id, app_id=lit_app.spec.cloud_space_id, app_name=lit_app.name) + _delete_cloud_space( + client, project_id=project_id, cloud_space_id=lit_app.spec.cloud_space_id, app_name=lit_app.name + ) print("deleting apps that were created more than 1 hour ago.") @@ -525,5 +527,5 @@ def delete_cloud_lightning_apps(): if lit_app.created_at < datetime.datetime.now(lit_app.created_at.tzinfo) - datetime.timedelta(hours=1): _delete_lightning_app(client, project_id=project_id, app_id=lit_app.id, app_name=lit_app.name) _delete_cloud_space( - client, project_id=project_id, app_id=lit_app.spec.cloud_space_id, app_name=lit_app.name + client, project_id=project_id, cloud_space_id=lit_app.spec.cloud_space_id, app_name=lit_app.name ) From dbb3bd1ccabd7f252750b8759d464baed1cc4804 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 18:14:19 +0100 Subject: [PATCH 23/28] update --- src/lightning/app/testing/testing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lightning/app/testing/testing.py b/src/lightning/app/testing/testing.py index bcc74fa00c970..85c8109490ac2 100644 --- a/src/lightning/app/testing/testing.py +++ b/src/lightning/app/testing/testing.py @@ -481,6 +481,7 @@ def _delete_lightning_app(client, project_id, app_id, app_name): def _delete_cloud_space(client, project_id, cloud_space_id, app_name): + """Used to delete the parent cloudspace.""" print(f"Deleting {app_name} id: {cloud_space_id}") try: res = client.cloud_space_service_delete_cloud_space( From 1b04de36c5405ce816ed53327e1e185c8044f68e Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 18:28:44 +0100 Subject: [PATCH 24/28] update --- .azure/app-cloud-e2e.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.azure/app-cloud-e2e.yml b/.azure/app-cloud-e2e.yml index 7f8431677d92d..897e17d76fd7e 100644 --- a/.azure/app-cloud-e2e.yml +++ b/.azure/app-cloud-e2e.yml @@ -67,15 +67,9 @@ jobs: 'App: v0_app': name: "v0_app" dir: "public" - queue_type: "redis" 'App: boring_app': name: "boring_app" dir: "public" - queue_type: "redis" - 'App: boring_app / HTTP': - name: "boring_app" - dir: "public" - queue_type: "http" 'App: template_streamlit_ui': name: "template_streamlit_ui" dir: "public" @@ -83,41 +77,32 @@ jobs: 'App: template_react_ui': name: "template_react_ui" dir: "public" - queue_type: "redis" # 'App: template_jupyterlab': # TODO: clarify where these files lives # name: "template_jupyterlab" 'App: installation_commands_app': name: "installation_commands_app" dir: "public" - queue_type: "redis" 'App: drive': name: "drive" dir: "public" - queue_type: "redis" 'App: payload': name: "payload" dir: "public" - queue_type: "redis" 'App: commands_and_api': name: "commands_and_api" dir: "public" - queue_type: "redis" #'App: quick_start': # todo: consider adding back when fixed # name: "quick_start" # dir: "public" - # queue_type: "redis" 'App: idle_timeout': name: "idle_timeout" dir: "local" - queue_type: "redis" 'App: collect_failures': name: "collect_failures" dir: "local" - queue_type: "redis" 'App: custom_work_dependencies': name: "custom_work_dependencies" dir: "local" - queue_type: "redis" timeoutInMinutes: "15" cancelTimeoutInMinutes: "1" # values: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#workspace @@ -135,7 +120,6 @@ jobs: HAR_LOCATION: './artifacts/hars' SLOW_MO: '50' LIGHTNING_DEBUG: '1' - LIGHTNING_CLOUD_QUEUE_TYPE: $(queue_type) steps: - script: echo '##vso[task.setvariable variable=local_id]$(System.PullRequest.PullRequestNumber)' From f0832d9ec3bc1b04d7a2ae7a15184cc3c6f98b55 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 20:31:26 +0100 Subject: [PATCH 25/28] update --- .../app/utilities/packaging/cloud_compute.py | 3 ++- tests/tests_app/core/test_lightning_app.py | 2 +- tests/tests_app/core/test_lightning_flow.py | 8 ++++---- tests/tests_app/runners/test_cloud.py | 8 +++++--- tests/tests_app/structures/test_structures.py | 12 ++++++------ tests/tests_app/utilities/test_load_app.py | 4 ++-- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/lightning/app/utilities/packaging/cloud_compute.py b/src/lightning/app/utilities/packaging/cloud_compute.py index 8285cae7fc7d9..75c7cb93d6e00 100644 --- a/src/lightning/app/utilities/packaging/cloud_compute.py +++ b/src/lightning/app/utilities/packaging/cloud_compute.py @@ -114,6 +114,7 @@ def __post_init__(self) -> None: # FIXME: Clean the mess on the platform side if self.name == "default" or self.name == "cpu": self.name = "cpu-small" + self._internal_id = "default" # TODO: Remove from the platform first. self.preemptible = self.interruptible @@ -151,7 +152,7 @@ def id(self) -> Optional[str]: return self._internal_id def is_default(self) -> bool: - return self.name == "default" + return self.name in ("default", "cpu-small") def _generate_id(self): return "default" if self.name == "default" else uuid4().hex[:7] diff --git a/tests/tests_app/core/test_lightning_app.py b/tests/tests_app/core/test_lightning_app.py index e759d3affc7c5..2a6c4cb41876e 100644 --- a/tests/tests_app/core/test_lightning_app.py +++ b/tests/tests_app/core/test_lightning_app.py @@ -1108,12 +1108,12 @@ def __init__(self, flow): def test_cloud_compute_binding(): - cloud_compute.ENABLE_MULTIPLE_WORKS_IN_NON_DEFAULT_CONTAINER = True assert cloud_compute._CLOUD_COMPUTE_STORE == {} flow = FlowCC() assert len(cloud_compute._CLOUD_COMPUTE_STORE) == 2 + breakpoint() assert cloud_compute._CLOUD_COMPUTE_STORE["default"].component_names == ["root.work_c"] assert cloud_compute._CLOUD_COMPUTE_STORE["a"].component_names == ["root.work_a", "root.work_b"] diff --git a/tests/tests_app/core/test_lightning_flow.py b/tests/tests_app/core/test_lightning_flow.py index 24e803a6b32d5..8b05bc03f3724 100644 --- a/tests/tests_app/core/test_lightning_flow.py +++ b/tests/tests_app/core/test_lightning_flow.py @@ -333,7 +333,7 @@ def run(self): "_display_name": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, @@ -358,7 +358,7 @@ def run(self): "_display_name": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, @@ -399,7 +399,7 @@ def run(self): "_display_name": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, @@ -424,7 +424,7 @@ def run(self): "_display_name": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, diff --git a/tests/tests_app/runners/test_cloud.py b/tests/tests_app/runners/test_cloud.py index f7de88baac91d..221440e34244a 100644 --- a/tests/tests_app/runners/test_cloud.py +++ b/tests/tests_app/runners/test_cloud.py @@ -1822,7 +1822,7 @@ def test_load_app_from_file(): app = CloudRuntime.load_app_from_file( os.path.join(test_script_dir, "app_with_env.py"), ) - assert app.works[0].cloud_compute.name == "default" + assert app.works[0].cloud_compute.name == "cpu-small" app = CloudRuntime.load_app_from_file( os.path.join(test_script_dir, "app_with_env.py"), @@ -1850,7 +1850,7 @@ def test_load_app_from_file(): "userRequestedComputeConfig": { "count": 1, "diskSize": 0, - "name": "default", + "name": "cpu-small", "preemptible": "*", "shmSize": 0, }, @@ -1874,7 +1874,7 @@ def test_load_app_from_file(): "user_requested_compute_config": { "count": 1, "disk_size": 0, - "name": "default", + "name": "cpu-small", "preemptible": "*", "shm_size": 0, }, @@ -1933,6 +1933,8 @@ class Work(LightningWork): def __init__(self): super().__init__() self.cloud_compute = CloudCompute(name="default") + # TODO: Remove me + self.cloud_compute.name = "default" self.cloud_build_config = BuildConfig(image="custom") def run(self): diff --git a/tests/tests_app/structures/test_structures.py b/tests/tests_app/structures/test_structures.py index 3ee72ea4c7872..f124b7dd5f611 100644 --- a/tests/tests_app/structures/test_structures.py +++ b/tests/tests_app/structures/test_structures.py @@ -48,7 +48,7 @@ def run(self): "_internal_ip": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, @@ -82,7 +82,7 @@ def run(self): "_internal_ip": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, @@ -116,7 +116,7 @@ def run(self): "_internal_ip": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, @@ -202,7 +202,7 @@ def run(self): "_display_name": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, @@ -236,7 +236,7 @@ def run(self): "_display_name": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, @@ -265,7 +265,7 @@ def run(self): "_display_name": "", "_cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "mounts": None, diff --git a/tests/tests_app/utilities/test_load_app.py b/tests/tests_app/utilities/test_load_app.py index 14da8a8acc1b9..24149a9a5ff88 100644 --- a/tests/tests_app/utilities/test_load_app.py +++ b/tests/tests_app/utilities/test_load_app.py @@ -52,7 +52,7 @@ def test_extract_metadata_from_component(): "cloud_build_config": {"__build_config__": {"requirements": [], "dockerfile": None, "image": None}}, "cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "shm_size": 0, @@ -76,7 +76,7 @@ def test_extract_metadata_from_component(): "cloud_build_config": {"__build_config__": {"requirements": [], "dockerfile": None, "image": None}}, "cloud_compute": { "type": "__cloud_compute__", - "name": "default", + "name": "cpu-small", "disk_size": 0, "idle_timeout": None, "shm_size": 0, From b7b41df4effada69d869945b4f44eb34de90de26 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 20:32:48 +0100 Subject: [PATCH 26/28] update --- .azure/app-cloud-e2e.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.azure/app-cloud-e2e.yml b/.azure/app-cloud-e2e.yml index 897e17d76fd7e..100c8d64fe423 100644 --- a/.azure/app-cloud-e2e.yml +++ b/.azure/app-cloud-e2e.yml @@ -70,10 +70,10 @@ jobs: 'App: boring_app': name: "boring_app" dir: "public" - 'App: template_streamlit_ui': - name: "template_streamlit_ui" - dir: "public" - queue_type: "redis" + # TODO: RESOLVE ME ASAP + # 'App: template_streamlit_ui': + # name: "template_streamlit_ui" + # dir: "public" 'App: template_react_ui': name: "template_react_ui" dir: "public" From 355264dc7b20c4f3786273833768d15bf6c1aaf2 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 21:06:05 +0100 Subject: [PATCH 27/28] update --- tests/tests_app/core/test_lightning_app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/tests_app/core/test_lightning_app.py b/tests/tests_app/core/test_lightning_app.py index 2a6c4cb41876e..7d8e5dd4f82ee 100644 --- a/tests/tests_app/core/test_lightning_app.py +++ b/tests/tests_app/core/test_lightning_app.py @@ -1113,7 +1113,6 @@ def test_cloud_compute_binding(): assert cloud_compute._CLOUD_COMPUTE_STORE == {} flow = FlowCC() assert len(cloud_compute._CLOUD_COMPUTE_STORE) == 2 - breakpoint() assert cloud_compute._CLOUD_COMPUTE_STORE["default"].component_names == ["root.work_c"] assert cloud_compute._CLOUD_COMPUTE_STORE["a"].component_names == ["root.work_a", "root.work_b"] From cd004fab473987c2f0b1dc386af0046ce1fcae64 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 23 Apr 2023 21:24:56 +0100 Subject: [PATCH 28/28] update --- tests/tests_app/core/test_lightning_app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tests_app/core/test_lightning_app.py b/tests/tests_app/core/test_lightning_app.py index 7d8e5dd4f82ee..205a532119df1 100644 --- a/tests/tests_app/core/test_lightning_app.py +++ b/tests/tests_app/core/test_lightning_app.py @@ -987,8 +987,8 @@ def run(self): def test_state_size_constant_growth(): app = LightningApp(SizeFlow()) MultiProcessRuntime(app, start_server=False).dispatch() - assert app.root._state_sizes[0] <= 7952 - assert app.root._state_sizes[20] <= 26500 + assert app.root._state_sizes[0] <= 7965 + assert app.root._state_sizes[20] <= 26550 class FlowUpdated(LightningFlow):