Skip to content

Commit

Permalink
Bump Lightning Cloud 0.5.64 (#19372)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchaton authored Jan 30, 2024
1 parent 5361acd commit 10c3a71
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion requirements/app/app.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lightning-cloud == 0.5.61 # Must be pinned to ensure compatibility
lightning-cloud == 0.5.64 # Must be pinned to ensure compatibility
packaging
typing-extensions >=4.4.0, <4.10.0
deepdiff >=5.7.0, <6.6.0
Expand Down
7 changes: 2 additions & 5 deletions src/lightning/app/cli/commands/cp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
Externalv1LightningappInstance,
ProjectIdStorageBody,
V1CloudSpace,
V1GetClusterResponse,
)
from rich.live import Live
from rich.progress import BarColumn, DownloadColumn, Progress, TaskID, TextColumn
Expand Down Expand Up @@ -332,16 +331,14 @@ def _get_progress_bar(**kwargs: Any) -> Progress:
)


def _storage_host(cluster: Union[V1GetClusterResponse, Externalv1Cluster]) -> str:
def _storage_host(cluster: Externalv1Cluster) -> str:
dev_host = os.environ.get("LIGHTNING_STORAGE_HOST")
if dev_host:
return dev_host
return f"https://storage.{cluster.spec.driver.kubernetes.root_domain_name}"


def _cluster_from_lit_resource(
lit_resource: Union[Externalv1LightningappInstance, V1CloudSpace]
) -> Union[V1GetClusterResponse, Externalv1Cluster]:
def _cluster_from_lit_resource(lit_resource: Union[Externalv1LightningappInstance, V1CloudSpace]) -> Externalv1Cluster:
client = LightningClient()
if isinstance(lit_resource, Externalv1LightningappInstance):
return client.cluster_service_get_cluster(lit_resource.spec.cluster_id)
Expand Down
2 changes: 1 addition & 1 deletion src/lightning/data/streaming/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# This is required for full pytree serialization / deserialization support
_TORCH_GREATER_EQUAL_2_1_0 = RequirementCache("torch>=2.1.0")
_VIZ_TRACKER_AVAILABLE = RequirementCache("viztracer")
_LIGHTNING_CLOUD_LATEST = RequirementCache("lightning-cloud>=0.5.61")
_LIGHTNING_CLOUD_LATEST = RequirementCache("lightning-cloud>=0.5.64")
_BOTO3_AVAILABLE = RequirementCache("boto3")

# DON'T CHANGE ORDER
Expand Down
4 changes: 2 additions & 2 deletions tests/integrations_app/public/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from integrations_app.public import _PATH_EXAMPLES


@_RunIf(pl=True)
@_RunIf(pl=True, skip_windows=True)
@pytest.mark.parametrize(
"file",
[
Expand All @@ -21,7 +21,7 @@ def test_scripts(file):


@pytest.mark.xfail(strict=False, reason="causing some issues with CI, not sure if the test is actually needed")
@_RunIf(pl=True)
@_RunIf(pl=True, skip_windows=True)
def test_components_app_example():
runner = CliRunner()
result = runner.invoke(
Expand Down
3 changes: 1 addition & 2 deletions tests/tests_app/cli/test_cp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
V1CloudSpace,
V1ClusterDriver,
V1ClusterSpec,
V1GetClusterResponse,
V1KubernetesClusterDriver,
V1LightningappInstanceArtifact,
V1LightningappInstanceSpec,
Expand Down Expand Up @@ -213,7 +212,7 @@ def test_cp_zip_remote_to_local_app_artifact(monkeypatch):
monkeypatch.setattr(cp, "_AuthTokenGetter", MagicMock(return_value=token_getter))

client = MagicMock()
client.cluster_service_get_cluster.return_value = V1GetClusterResponse(
client.cluster_service_get_cluster.return_value = Externalv1Cluster(
spec=V1ClusterSpec(driver=V1ClusterDriver(kubernetes=V1KubernetesClusterDriver(root_domain_name="my-domain")))
)
client.projects_service_list_memberships.return_value = V1ListMembershipsResponse(
Expand Down
15 changes: 7 additions & 8 deletions tests/tests_app/runners/test_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
V1DriveStatus,
V1DriveType,
V1EnvVar,
V1GetClusterResponse,
V1GetUserResponse,
V1LightningappInstanceSpec,
V1LightningappInstanceState,
Expand Down Expand Up @@ -208,7 +207,7 @@ def test_new_instance_on_different_cluster(self, tmpdir, cloud_backend, project_
)

# Mock all clusters as global clusters
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: V1GetClusterResponse(
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: Externalv1Cluster(
id=cluster_id, spec=V1ClusterSpec(cluster_type=V1ClusterType.GLOBAL)
)

Expand Down Expand Up @@ -277,7 +276,7 @@ def test_running_deleted_app(self, tmpdir, cloud_backend, project_id):
)

# Mock all clusters as global clusters
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: V1GetClusterResponse(
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: Externalv1Cluster(
id=cluster_id, spec=V1ClusterSpec(cluster_type=V1ClusterType.GLOBAL)
)

Expand Down Expand Up @@ -588,7 +587,7 @@ def test_call_with_work_app(self, lightningapps, start_with_flow, monkeypatch, t
mock_client.projects_service_list_project_cluster_bindings.return_value = V1ListProjectClusterBindingsResponse(
clusters=[V1ProjectClusterBinding(cluster_id="test")]
)
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: V1GetClusterResponse(
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: Externalv1Cluster(
id=cluster_id, spec=V1ClusterSpec(cluster_type=V1ClusterType.GLOBAL)
)
mock_client.cloud_space_service_create_lightning_run_instance.return_value = V1LightningRun()
Expand Down Expand Up @@ -765,7 +764,7 @@ def test_call_with_work_app_and_attached_drives(self, lightningapps, monkeypatch
mock_client.projects_service_list_project_cluster_bindings.return_value = V1ListProjectClusterBindingsResponse(
clusters=[V1ProjectClusterBinding(cluster_id="test")]
)
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: V1GetClusterResponse(
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: Externalv1Cluster(
id=cluster_id, spec=V1ClusterSpec(cluster_type=V1ClusterType.GLOBAL)
)
mock_client.cloud_space_service_create_lightning_run_instance.return_value = V1LightningRun()
Expand Down Expand Up @@ -901,7 +900,7 @@ def test_call_with_work_app_and_app_comment_command_execution_set(self, lightnin
mock_client.projects_service_list_project_cluster_bindings.return_value = (
V1ListProjectClusterBindingsResponse(clusters=[V1ProjectClusterBinding(cluster_id="test")])
)
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: V1GetClusterResponse(
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: Externalv1Cluster(
id=cluster_id, spec=V1ClusterSpec(cluster_type=V1ClusterType.GLOBAL)
)
mock_client.cloud_space_service_list_cloud_spaces.return_value = V1ListCloudSpacesResponse(
Expand Down Expand Up @@ -1031,7 +1030,7 @@ def test_call_with_work_app_and_multiple_attached_drives(self, lightningapps, mo
]
)
)
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: V1GetClusterResponse(
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: Externalv1Cluster(
id=cluster_id, spec=V1ClusterSpec(cluster_type=V1ClusterType.GLOBAL)
)
mock_client.cloud_space_service_list_cloud_spaces.return_value = V1ListCloudSpacesResponse(
Expand Down Expand Up @@ -1247,7 +1246,7 @@ def test_call_with_work_app_and_attached_mount_and_drive(self, lightningapps, mo
mock_client.projects_service_list_project_cluster_bindings.return_value = (
V1ListProjectClusterBindingsResponse(clusters=[V1ProjectClusterBinding(cluster_id="test")])
)
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: V1GetClusterResponse(
mock_client.cluster_service_get_cluster.side_effect = lambda cluster_id: Externalv1Cluster(
id=cluster_id, spec=V1ClusterSpec(cluster_type=V1ClusterType.GLOBAL)
)
mock_client.cloud_space_service_list_cloud_spaces.return_value = V1ListCloudSpacesResponse(
Expand Down
5 changes: 2 additions & 3 deletions tests/tests_data/streaming/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
V1ListClustersResponse,
V1ListDataConnectionsResponse,
)
from lightning_cloud.resolver import _resolve_dir


@pytest.mark.skipif(sys.platform == "win32", reason="windows isn't supported")
Expand Down Expand Up @@ -356,7 +355,7 @@ def test_resolve_dir_absolute(tmp_path, monkeypatch):
# relative path
monkeypatch.chdir(tmp_path)
relative = "relative"
resolved_dir = _resolve_dir(str(relative))
resolved_dir = resolver._resolve_dir(str(relative))
assert resolved_dir.path == str(tmp_path / relative)
assert Path(resolved_dir.path).is_absolute()
monkeypatch.undo()
Expand All @@ -367,4 +366,4 @@ def test_resolve_dir_absolute(tmp_path, monkeypatch):
link = tmp_path / "link"
link.symlink_to(src)
assert link.resolve() == src
assert _resolve_dir(str(link)).path == str(src)
assert resolver._resolve_dir(str(link)).path == str(src)

0 comments on commit 10c3a71

Please sign in to comment.