Skip to content

Commit 9657671

Browse files
authored
[App] Simplify messaging in cloud dispatch (#16160)
1 parent 1e16836 commit 9657671

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/lightning_app/runners/cloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def dispatch(
448448
raise RuntimeError("The source upload url is empty.")
449449

450450
if getattr(lightning_app_release, "cluster_id", None):
451-
logger.info(f"Running app on {lightning_app_release.cluster_id}")
451+
print(f"Running app on {lightning_app_release.cluster_id}")
452452

453453
# Save the config for re-runs
454454
app_config.save_to_dir(root)

src/lightning_app/utilities/cloud.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import warnings
32

43
from lightning_cloud.openapi import V1Membership
54

@@ -25,11 +24,7 @@ def _get_project(client: LightningClient, project_id: str = LIGHTNING_CLOUD_PROJ
2524
if len(projects.memberships) == 0:
2625
raise ValueError("No valid projects found. Please reach out to lightning.ai team to create a project")
2726
if len(projects.memberships) > 1:
28-
warnings.warn(
29-
f"It is currently not supported to have multiple projects but "
30-
f"found {len(projects.memberships)} projects."
31-
f" Defaulting to the project {projects.memberships[0].name}"
32-
)
27+
print(f"Defaulting to the project: {projects.memberships[0].name}")
3328
return projects.memberships[0]
3429

3530

tests/tests_app/runners/test_cloud.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,9 +1383,8 @@ def test_get_project(monkeypatch):
13831383
V1Membership(name="test-project2", project_id="test-project-id2"),
13841384
]
13851385
)
1386-
with pytest.warns(UserWarning, match="Defaulting to the project test-project1"):
1387-
ret = _get_project(mock_client)
1388-
assert ret.project_id == "test-project-id1"
1386+
ret = _get_project(mock_client)
1387+
assert ret.project_id == "test-project-id1"
13891388

13901389

13911390
def write_file_of_size(path, size):

0 commit comments

Comments
 (0)