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

[App] Simplify messaging in cloud dispatch #16160

Merged
merged 2 commits into from
Dec 21, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lightning_app/runners/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def dispatch(
raise RuntimeError("The source upload url is empty.")

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

# Save the config for re-runs
app_config.save_to_dir(root)
Expand Down
7 changes: 1 addition & 6 deletions src/lightning_app/utilities/cloud.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import warnings

from lightning_cloud.openapi import V1Membership

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


Expand Down
5 changes: 2 additions & 3 deletions tests/tests_app/runners/test_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,9 +1383,8 @@ def test_get_project(monkeypatch):
V1Membership(name="test-project2", project_id="test-project-id2"),
]
)
with pytest.warns(UserWarning, match="Defaulting to the project test-project1"):
ret = _get_project(mock_client)
assert ret.project_id == "test-project-id1"
ret = _get_project(mock_client)
assert ret.project_id == "test-project-id1"


def write_file_of_size(path, size):
Expand Down