lightning-sdk 0.1.49__py3-none-any.whl → 0.1.50__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lightning_sdk/__init__.py +1 -1
- lightning_sdk/api/job_api.py +6 -6
- lightning_sdk/api/lit_container_api.py +22 -9
- lightning_sdk/api/mmt_api.py +6 -6
- lightning_sdk/cli/download.py +20 -1
- lightning_sdk/cli/run.py +11 -3
- lightning_sdk/job/base.py +4 -4
- lightning_sdk/job/job.py +4 -3
- lightning_sdk/job/v1.py +3 -3
- lightning_sdk/job/v2.py +2 -2
- lightning_sdk/job/work.py +2 -2
- lightning_sdk/lit_container.py +19 -0
- lightning_sdk/mmt/base.py +4 -4
- lightning_sdk/mmt/mmt.py +5 -3
- lightning_sdk/mmt/v1.py +2 -2
- lightning_sdk/mmt/v2.py +2 -2
- {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.50.dist-info}/METADATA +1 -1
- {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.50.dist-info}/RECORD +22 -22
- {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.50.dist-info}/LICENSE +0 -0
- {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.50.dist-info}/WHEEL +0 -0
- {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.50.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.50.dist-info}/top_level.txt +0 -0
lightning_sdk/__init__.py
CHANGED
lightning_sdk/api/job_api.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import time
|
|
2
|
-
from typing import TYPE_CHECKING, Dict, List, Optional
|
|
2
|
+
from typing import TYPE_CHECKING, Dict, List, Optional, Union
|
|
3
3
|
from urllib.request import urlopen
|
|
4
4
|
|
|
5
5
|
from lightning_sdk.api.utils import (
|
|
6
6
|
_COMPUTE_NAME_TO_MACHINE,
|
|
7
|
-
_MACHINE_TO_COMPUTE_NAME,
|
|
8
7
|
_create_app,
|
|
8
|
+
_machine_to_compute_name,
|
|
9
9
|
remove_datetime_prefix,
|
|
10
10
|
)
|
|
11
11
|
from lightning_sdk.api.utils import (
|
|
@@ -120,7 +120,7 @@ class JobApiV1:
|
|
|
120
120
|
studio_id: str,
|
|
121
121
|
teamspace_id: str,
|
|
122
122
|
cloud_account: str,
|
|
123
|
-
machine: Machine,
|
|
123
|
+
machine: Union[Machine, str],
|
|
124
124
|
interruptible: bool,
|
|
125
125
|
) -> Externalv1LightningappInstance:
|
|
126
126
|
"""Creates an arbitrary app."""
|
|
@@ -130,7 +130,7 @@ class JobApiV1:
|
|
|
130
130
|
teamspace_id=teamspace_id,
|
|
131
131
|
cloud_account=cloud_account,
|
|
132
132
|
plugin_type="job",
|
|
133
|
-
compute=
|
|
133
|
+
compute=_machine_to_compute_name(machine),
|
|
134
134
|
name=name,
|
|
135
135
|
entrypoint=command,
|
|
136
136
|
interruptible=interruptible,
|
|
@@ -209,7 +209,7 @@ class JobApiV2:
|
|
|
209
209
|
teamspace_id: str,
|
|
210
210
|
studio_id: Optional[str],
|
|
211
211
|
image: Optional[str],
|
|
212
|
-
machine: Machine,
|
|
212
|
+
machine: Union[Machine, str],
|
|
213
213
|
interruptible: bool,
|
|
214
214
|
env: Optional[Dict[str, str]],
|
|
215
215
|
image_credentials: Optional[str],
|
|
@@ -223,7 +223,7 @@ class JobApiV2:
|
|
|
223
223
|
for k, v in env.items():
|
|
224
224
|
env_vars.append(V1EnvVar(name=k, value=v))
|
|
225
225
|
|
|
226
|
-
instance_name =
|
|
226
|
+
instance_name = _machine_to_compute_name(machine)
|
|
227
227
|
|
|
228
228
|
run_id = __GLOBAL_LIGHTNING_UNIQUE_IDS_STORE__[studio_id] if studio_id is not None else ""
|
|
229
229
|
|
|
@@ -10,6 +10,14 @@ class LitContainerApi:
|
|
|
10
10
|
def __init__(self) -> None:
|
|
11
11
|
self._client = LightningClient(max_tries=3)
|
|
12
12
|
|
|
13
|
+
import docker
|
|
14
|
+
|
|
15
|
+
try:
|
|
16
|
+
self._docker_client = docker.from_env()
|
|
17
|
+
self._docker_client.ping()
|
|
18
|
+
except docker.errors.DockerException as e:
|
|
19
|
+
raise RuntimeError(f"Failed to connect to Docker daemon: {e!s}. Is Docker running?") from None
|
|
20
|
+
|
|
13
21
|
def list_containers(self, project_id: str) -> List:
|
|
14
22
|
project = self._client.lit_registry_service_get_lit_project_registry(project_id)
|
|
15
23
|
return project.repositories
|
|
@@ -24,19 +32,24 @@ class LitContainerApi:
|
|
|
24
32
|
import docker
|
|
25
33
|
|
|
26
34
|
try:
|
|
27
|
-
|
|
28
|
-
client.ping()
|
|
29
|
-
except docker.errors.DockerException as e:
|
|
30
|
-
raise RuntimeError(f"Failed to connect to Docker daemon: {e!s}. Is Docker running?") from None
|
|
31
|
-
|
|
32
|
-
try:
|
|
33
|
-
client.images.get(container)
|
|
35
|
+
self._docker_client.images.get(container)
|
|
34
36
|
except docker.errors.ImageNotFound:
|
|
35
37
|
raise ValueError(f"Container {container} does not exist") from None
|
|
36
38
|
|
|
37
39
|
registry_url = _get_registry_url()
|
|
38
40
|
repository = f"{registry_url}/lit-container/{teamspace.owner.name}/{teamspace.name}/{container}"
|
|
39
|
-
tagged =
|
|
41
|
+
tagged = self._docker_client.api.tag(container, repository, tag)
|
|
40
42
|
if not tagged:
|
|
41
43
|
raise ValueError(f"Could not tag container {container} with {repository}:{tag}")
|
|
42
|
-
return
|
|
44
|
+
return self._docker_client.api.push(repository, stream=True, decode=True)
|
|
45
|
+
|
|
46
|
+
def download_container(self, container: str, teamspace: Teamspace, tag: str) -> Generator[str, None, None]:
|
|
47
|
+
import docker
|
|
48
|
+
|
|
49
|
+
registry_url = _get_registry_url()
|
|
50
|
+
repository = f"{registry_url}/lit-container/{teamspace.owner.name}/{teamspace.name}/{container}"
|
|
51
|
+
try:
|
|
52
|
+
self._docker_client.images.pull(repository, tag=tag)
|
|
53
|
+
except docker.errors.APIError as e:
|
|
54
|
+
raise ValueError(f"Could not pull container {container} from {repository}:{tag}") from e
|
|
55
|
+
return self._docker_client.api.tag(repository, container, tag)
|
lightning_sdk/api/mmt_api.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import time
|
|
3
|
-
from typing import TYPE_CHECKING, Dict, List, Optional
|
|
3
|
+
from typing import TYPE_CHECKING, Dict, List, Optional, Union
|
|
4
4
|
|
|
5
5
|
from lightning_sdk.api.job_api import JobApiV1
|
|
6
6
|
from lightning_sdk.api.utils import (
|
|
7
7
|
_COMPUTE_NAME_TO_MACHINE,
|
|
8
|
-
_MACHINE_TO_COMPUTE_NAME,
|
|
9
8
|
_create_app,
|
|
9
|
+
_machine_to_compute_name,
|
|
10
10
|
)
|
|
11
11
|
from lightning_sdk.api.utils import (
|
|
12
12
|
_get_cloud_url as _cloud_url,
|
|
@@ -43,13 +43,13 @@ class MMTApiV1(JobApiV1):
|
|
|
43
43
|
cloud_account: Optional[str],
|
|
44
44
|
teamspace_id: str,
|
|
45
45
|
studio_id: str,
|
|
46
|
-
machine: Machine,
|
|
46
|
+
machine: Union[Machine, str],
|
|
47
47
|
interruptible: bool,
|
|
48
48
|
strategy: str,
|
|
49
49
|
) -> Externalv1LightningappInstance:
|
|
50
50
|
"""Creates a multi-machine job with given commands."""
|
|
51
51
|
distributed_args = {
|
|
52
|
-
"cloud_compute":
|
|
52
|
+
"cloud_compute": _machine_to_compute_name(machine),
|
|
53
53
|
"num_instances": num_machines,
|
|
54
54
|
"strategy": strategy,
|
|
55
55
|
}
|
|
@@ -80,7 +80,7 @@ class MMTApiV2:
|
|
|
80
80
|
teamspace_id: str,
|
|
81
81
|
studio_id: Optional[str],
|
|
82
82
|
image: Optional[str],
|
|
83
|
-
machine: Machine,
|
|
83
|
+
machine: Union[Machine, str],
|
|
84
84
|
interruptible: bool,
|
|
85
85
|
env: Optional[Dict[str, str]],
|
|
86
86
|
image_credentials: Optional[str],
|
|
@@ -94,7 +94,7 @@ class MMTApiV2:
|
|
|
94
94
|
for k, v in env.items():
|
|
95
95
|
env_vars.append(V1EnvVar(name=k, value=v))
|
|
96
96
|
|
|
97
|
-
instance_name =
|
|
97
|
+
instance_name = _machine_to_compute_name(machine)
|
|
98
98
|
|
|
99
99
|
run_id = __GLOBAL_LIGHTNING_UNIQUE_IDS_STORE__[studio_id] if studio_id is not None else ""
|
|
100
100
|
|
lightning_sdk/cli/download.py
CHANGED
|
@@ -3,14 +3,18 @@ import re
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
|
|
8
|
+
from lightning_sdk.api.lit_container_api import LitContainerApi
|
|
6
9
|
from lightning_sdk.cli.exceptions import StudioCliError
|
|
7
10
|
from lightning_sdk.cli.studios_menu import _StudiosMenu
|
|
11
|
+
from lightning_sdk.cli.teamspace_menu import _TeamspacesMenu
|
|
8
12
|
from lightning_sdk.models import download_model
|
|
9
13
|
from lightning_sdk.studio import Studio
|
|
10
14
|
from lightning_sdk.utils.resolve import _get_authed_user, skip_studio_init
|
|
11
15
|
|
|
12
16
|
|
|
13
|
-
class _Downloads(_StudiosMenu):
|
|
17
|
+
class _Downloads(_StudiosMenu, _TeamspacesMenu):
|
|
14
18
|
"""Download files and folders from Lightning AI."""
|
|
15
19
|
|
|
16
20
|
def model(self, name: str, download_dir: str = ".") -> None:
|
|
@@ -130,3 +134,18 @@ class _Downloads(_StudiosMenu):
|
|
|
130
134
|
f"Could not download the file from the given Studio {studio}. "
|
|
131
135
|
"Please contact Lightning AI directly to resolve this issue."
|
|
132
136
|
) from e
|
|
137
|
+
|
|
138
|
+
def container(self, container: str, teamspace: Optional[str] = None, tag: str = "latest") -> None:
|
|
139
|
+
"""Download a docker container from a teamspace.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
container: The name of the container to download.
|
|
143
|
+
teamspace: The name of the teamspace to download the container from.
|
|
144
|
+
tag: The tag of the container to download.
|
|
145
|
+
"""
|
|
146
|
+
resolved_teamspace = self._resolve_teamspace(teamspace)
|
|
147
|
+
console = Console()
|
|
148
|
+
with console.status("Downloading container..."):
|
|
149
|
+
api = LitContainerApi()
|
|
150
|
+
api.download_container(container, resolved_teamspace, tag)
|
|
151
|
+
console.print("Container downloaded successfully", style="green")
|
lightning_sdk/cli/run.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, Dict, Optional
|
|
1
|
+
from typing import TYPE_CHECKING, Dict, Optional, Union
|
|
2
2
|
|
|
3
3
|
from lightning_sdk.job import Job
|
|
4
4
|
from lightning_sdk.machine import Machine
|
|
@@ -137,7 +137,11 @@ class _Run:
|
|
|
137
137
|
if machine is None:
|
|
138
138
|
# TODO: infer from studio
|
|
139
139
|
machine = "CPU"
|
|
140
|
-
machine_enum
|
|
140
|
+
machine_enum: Union[str, Machine]
|
|
141
|
+
try:
|
|
142
|
+
machine_enum = Machine[machine.upper()]
|
|
143
|
+
except KeyError:
|
|
144
|
+
machine_enum = machine
|
|
141
145
|
|
|
142
146
|
resolved_teamspace = Teamspace(name=teamspace, org=org, user=user)
|
|
143
147
|
|
|
@@ -195,7 +199,11 @@ class _Run:
|
|
|
195
199
|
if machine is None:
|
|
196
200
|
# TODO: infer from studio
|
|
197
201
|
machine = "CPU"
|
|
198
|
-
machine_enum
|
|
202
|
+
machine_enum: Union[str, Machine]
|
|
203
|
+
try:
|
|
204
|
+
machine_enum = Machine[machine.upper()]
|
|
205
|
+
except KeyError:
|
|
206
|
+
machine_enum = machine
|
|
199
207
|
|
|
200
208
|
resolved_teamspace = Teamspace(name=teamspace, org=org, user=user)
|
|
201
209
|
if cloud_account is None:
|
lightning_sdk/job/base.py
CHANGED
|
@@ -16,7 +16,7 @@ if TYPE_CHECKING:
|
|
|
16
16
|
class MachineDict(TypedDict):
|
|
17
17
|
name: str
|
|
18
18
|
status: "Status"
|
|
19
|
-
machine: "Machine"
|
|
19
|
+
machine: Union["Machine", str]
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class JobDict(MachineDict):
|
|
@@ -68,7 +68,7 @@ class _BaseJob(ABC):
|
|
|
68
68
|
def run(
|
|
69
69
|
cls,
|
|
70
70
|
name: str,
|
|
71
|
-
machine: "Machine",
|
|
71
|
+
machine: Union["Machine", str],
|
|
72
72
|
command: Optional[str] = None,
|
|
73
73
|
studio: Union["Studio", str, None] = None,
|
|
74
74
|
image: Optional[str] = None,
|
|
@@ -205,7 +205,7 @@ class _BaseJob(ABC):
|
|
|
205
205
|
@abstractmethod
|
|
206
206
|
def _submit(
|
|
207
207
|
self,
|
|
208
|
-
machine: "Machine",
|
|
208
|
+
machine: Union["Machine", str],
|
|
209
209
|
command: Optional[str] = None,
|
|
210
210
|
studio: Optional["Studio"] = None,
|
|
211
211
|
image: Optional[str] = None,
|
|
@@ -271,7 +271,7 @@ class _BaseJob(ABC):
|
|
|
271
271
|
|
|
272
272
|
@property
|
|
273
273
|
@abstractmethod
|
|
274
|
-
def machine(self) -> "Machine":
|
|
274
|
+
def machine(self) -> Union["Machine", str]:
|
|
275
275
|
"""The machine type the job is running on."""
|
|
276
276
|
|
|
277
277
|
@property
|
lightning_sdk/job/job.py
CHANGED
|
@@ -89,7 +89,7 @@ class Job(_BaseJob):
|
|
|
89
89
|
def run(
|
|
90
90
|
cls,
|
|
91
91
|
name: str,
|
|
92
|
-
machine: "Machine",
|
|
92
|
+
machine: Union["Machine", str],
|
|
93
93
|
command: Optional[str] = None,
|
|
94
94
|
studio: Union["Studio", str, None] = None,
|
|
95
95
|
image: Union[str, None] = None,
|
|
@@ -169,7 +169,7 @@ class Job(_BaseJob):
|
|
|
169
169
|
|
|
170
170
|
def _submit(
|
|
171
171
|
self,
|
|
172
|
-
machine: "Machine",
|
|
172
|
+
machine: Union["Machine", str],
|
|
173
173
|
command: Optional[str] = None,
|
|
174
174
|
studio: Optional["Studio"] = None,
|
|
175
175
|
image: Optional[str] = None,
|
|
@@ -225,6 +225,7 @@ class Job(_BaseJob):
|
|
|
225
225
|
cloud_account_auth=cloud_account_auth,
|
|
226
226
|
artifacts_local=artifacts_local,
|
|
227
227
|
artifacts_remote=artifacts_remote,
|
|
228
|
+
entrypoint=entrypoint,
|
|
228
229
|
)
|
|
229
230
|
return self
|
|
230
231
|
|
|
@@ -248,7 +249,7 @@ class Job(_BaseJob):
|
|
|
248
249
|
return self._internal_job.status
|
|
249
250
|
|
|
250
251
|
@property
|
|
251
|
-
def machine(self) -> "Machine":
|
|
252
|
+
def machine(self) -> Union["Machine", str]:
|
|
252
253
|
"""The machine type the job is running on."""
|
|
253
254
|
return self._internal_job.machine
|
|
254
255
|
|
lightning_sdk/job/v1.py
CHANGED
|
@@ -44,7 +44,7 @@ class _JobV1(_BaseJob):
|
|
|
44
44
|
def run(
|
|
45
45
|
cls,
|
|
46
46
|
name: str,
|
|
47
|
-
machine: "Machine",
|
|
47
|
+
machine: Union["Machine", str],
|
|
48
48
|
command: str,
|
|
49
49
|
studio: "Studio",
|
|
50
50
|
teamspace: Union[str, "Teamspace", None] = None,
|
|
@@ -89,7 +89,7 @@ class _JobV1(_BaseJob):
|
|
|
89
89
|
|
|
90
90
|
def _submit(
|
|
91
91
|
self,
|
|
92
|
-
machine: "Machine",
|
|
92
|
+
machine: Union["Machine", str],
|
|
93
93
|
command: Optional[str] = None,
|
|
94
94
|
studio: Optional["Studio"] = None,
|
|
95
95
|
image: Optional[str] = None,
|
|
@@ -195,7 +195,7 @@ class _JobV1(_BaseJob):
|
|
|
195
195
|
return Work(_work[0].id, self, self.teamspace)
|
|
196
196
|
|
|
197
197
|
@property
|
|
198
|
-
def machine(self) -> "Machine":
|
|
198
|
+
def machine(self) -> Union["Machine", str]:
|
|
199
199
|
"""Get the machine the job is running on."""
|
|
200
200
|
return self.work.machine
|
|
201
201
|
|
lightning_sdk/job/v2.py
CHANGED
|
@@ -37,7 +37,7 @@ class _JobV2(_BaseJob):
|
|
|
37
37
|
|
|
38
38
|
def _submit(
|
|
39
39
|
self,
|
|
40
|
-
machine: "Machine",
|
|
40
|
+
machine: Union["Machine", str],
|
|
41
41
|
command: Optional[str] = None,
|
|
42
42
|
studio: Optional["Studio"] = None,
|
|
43
43
|
image: Optional[str] = None,
|
|
@@ -143,7 +143,7 @@ class _JobV2(_BaseJob):
|
|
|
143
143
|
return self._job_api._job_state_to_external(self._latest_job.state)
|
|
144
144
|
|
|
145
145
|
@property
|
|
146
|
-
def machine(self) -> "Machine":
|
|
146
|
+
def machine(self) -> Union["Machine", str]:
|
|
147
147
|
"""The machine type the job is running on."""
|
|
148
148
|
# only fetch the job it it hasn't been fetched yet as machine cannot change over time
|
|
149
149
|
return self._job_api._get_job_machine_from_spec(self._guaranteed_job.spec)
|
lightning_sdk/job/work.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, Any, Optional, Protocol
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Optional, Protocol, Union
|
|
2
2
|
|
|
3
3
|
from lightning_sdk.api.job_api import JobApiV1
|
|
4
4
|
|
|
@@ -51,7 +51,7 @@ class Work:
|
|
|
51
51
|
return self._job._name_filter(self._guaranteed_work.name)
|
|
52
52
|
|
|
53
53
|
@property
|
|
54
|
-
def machine(self) -> "Machine":
|
|
54
|
+
def machine(self) -> Union["Machine", str]:
|
|
55
55
|
return self._job_api.get_machine_from_work(self._guaranteed_work)
|
|
56
56
|
|
|
57
57
|
@property
|
lightning_sdk/lit_container.py
CHANGED
|
@@ -76,3 +76,22 @@ class LitContainer:
|
|
|
76
76
|
resp = self._api.upload_container(container, teamspace, tag)
|
|
77
77
|
for line in resp:
|
|
78
78
|
print(line)
|
|
79
|
+
|
|
80
|
+
def download_container(
|
|
81
|
+
self, container: str, teamspace: str, org: Optional[str] = None, user: Optional[str] = None, tag: str = "latest"
|
|
82
|
+
) -> None:
|
|
83
|
+
"""Download a container from the docker registry.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
container: The name of the container to download.
|
|
87
|
+
teamspace: The teamspace which contains the container.
|
|
88
|
+
org: The organization which contains the container.
|
|
89
|
+
user: The user which contains the container.
|
|
90
|
+
tag: The tag to use for the container.
|
|
91
|
+
"""
|
|
92
|
+
try:
|
|
93
|
+
teamspace = _resolve_teamspace(teamspace=teamspace, org=org, user=user)
|
|
94
|
+
except Exception as e:
|
|
95
|
+
raise ValueError(f"Could not resolve teamspace: {e}") from e
|
|
96
|
+
|
|
97
|
+
return self._api.download_container(container, teamspace, tag)
|
lightning_sdk/mmt/base.py
CHANGED
|
@@ -23,7 +23,7 @@ class MMTMachine(Protocol):
|
|
|
23
23
|
...
|
|
24
24
|
|
|
25
25
|
@property
|
|
26
|
-
def machine(self) -> "Machine":
|
|
26
|
+
def machine(self) -> Union["Machine", str]:
|
|
27
27
|
"""The actual machine type this node is running on."""
|
|
28
28
|
...
|
|
29
29
|
|
|
@@ -54,7 +54,7 @@ class _BaseMMT(_BaseJob):
|
|
|
54
54
|
def run(
|
|
55
55
|
cls,
|
|
56
56
|
name: str,
|
|
57
|
-
machine: "Machine",
|
|
57
|
+
machine: Union["Machine", str],
|
|
58
58
|
num_machines: int,
|
|
59
59
|
command: Optional[str] = None,
|
|
60
60
|
studio: Union["Studio", str, None] = None,
|
|
@@ -199,7 +199,7 @@ class _BaseMMT(_BaseJob):
|
|
|
199
199
|
def _submit(
|
|
200
200
|
self,
|
|
201
201
|
num_machines: int,
|
|
202
|
-
machine: "Machine",
|
|
202
|
+
machine: Union["Machine", str],
|
|
203
203
|
command: Optional[str] = None,
|
|
204
204
|
studio: Optional["Studio"] = None,
|
|
205
205
|
image: Optional[str] = None,
|
|
@@ -257,7 +257,7 @@ class _BaseMMT(_BaseJob):
|
|
|
257
257
|
|
|
258
258
|
@property
|
|
259
259
|
@abstractmethod
|
|
260
|
-
def machine(self) -> "Machine":
|
|
260
|
+
def machine(self) -> Union["Machine", str]:
|
|
261
261
|
"""Returns the machine type this job is running on."""
|
|
262
262
|
|
|
263
263
|
@abstractmethod
|
lightning_sdk/mmt/mmt.py
CHANGED
|
@@ -97,7 +97,7 @@ class MMT(_BaseMMT):
|
|
|
97
97
|
cls,
|
|
98
98
|
name: str,
|
|
99
99
|
num_machines: int,
|
|
100
|
-
machine: "Machine",
|
|
100
|
+
machine: Union["Machine", str],
|
|
101
101
|
command: Optional[str] = None,
|
|
102
102
|
studio: Union["Studio", str, None] = None,
|
|
103
103
|
image: Union[str, None] = None,
|
|
@@ -167,6 +167,7 @@ class MMT(_BaseMMT):
|
|
|
167
167
|
cloud_account_auth=cloud_account_auth,
|
|
168
168
|
artifacts_local=artifacts_local,
|
|
169
169
|
artifacts_remote=artifacts_remote,
|
|
170
|
+
entrypoint=entrypoint,
|
|
170
171
|
cluster=cluster, # deprecated in favor of cloud_account
|
|
171
172
|
)
|
|
172
173
|
# required for typing with "MMT"
|
|
@@ -180,7 +181,7 @@ class MMT(_BaseMMT):
|
|
|
180
181
|
def _submit(
|
|
181
182
|
self,
|
|
182
183
|
num_machines: int,
|
|
183
|
-
machine: "Machine",
|
|
184
|
+
machine: Union["Machine", str],
|
|
184
185
|
command: Optional[str] = None,
|
|
185
186
|
studio: Optional["Studio"] = None,
|
|
186
187
|
image: Optional[str] = None,
|
|
@@ -239,6 +240,7 @@ class MMT(_BaseMMT):
|
|
|
239
240
|
cloud_account_auth=cloud_account_auth,
|
|
240
241
|
artifacts_local=artifacts_local,
|
|
241
242
|
artifacts_remote=artifacts_remote,
|
|
243
|
+
entrypoint=entrypoint,
|
|
242
244
|
)
|
|
243
245
|
return self
|
|
244
246
|
|
|
@@ -264,7 +266,7 @@ class MMT(_BaseMMT):
|
|
|
264
266
|
return self._internal_mmt.machines
|
|
265
267
|
|
|
266
268
|
@property
|
|
267
|
-
def machine(self) -> "Machine":
|
|
269
|
+
def machine(self) -> Union["Machine", str]:
|
|
268
270
|
"""Returns the machine type this job is running on."""
|
|
269
271
|
return self._internal_mmt.machine
|
|
270
272
|
|
lightning_sdk/mmt/v1.py
CHANGED
|
@@ -43,7 +43,7 @@ class _MMTV1(_BaseMMT):
|
|
|
43
43
|
def _submit(
|
|
44
44
|
self,
|
|
45
45
|
num_machines: int,
|
|
46
|
-
machine: "Machine",
|
|
46
|
+
machine: Union["Machine", str],
|
|
47
47
|
command: Optional[str] = None,
|
|
48
48
|
studio: Optional["Studio"] = None,
|
|
49
49
|
image: Optional[str] = None,
|
|
@@ -166,7 +166,7 @@ class _MMTV1(_BaseMMT):
|
|
|
166
166
|
return f"/teamspace/jobs/{self.name}/snapshot"
|
|
167
167
|
|
|
168
168
|
@property
|
|
169
|
-
def machine(self) -> "Machine":
|
|
169
|
+
def machine(self) -> Union["Machine", str]:
|
|
170
170
|
"""Returns the machine type this job is running on."""
|
|
171
171
|
return self.machines[0].machine
|
|
172
172
|
|
lightning_sdk/mmt/v2.py
CHANGED
|
@@ -42,7 +42,7 @@ class _MMTV2(_BaseMMT):
|
|
|
42
42
|
def _submit(
|
|
43
43
|
self,
|
|
44
44
|
num_machines: int,
|
|
45
|
-
machine: "Machine",
|
|
45
|
+
machine: Union["Machine", str],
|
|
46
46
|
command: Optional[str] = None,
|
|
47
47
|
studio: Optional["Studio"] = None,
|
|
48
48
|
image: Optional[str] = None,
|
|
@@ -169,7 +169,7 @@ class _MMTV2(_BaseMMT):
|
|
|
169
169
|
raise NotImplementedError
|
|
170
170
|
|
|
171
171
|
@property
|
|
172
|
-
def machine(self) -> "Machine":
|
|
172
|
+
def machine(self) -> Union["Machine", str]:
|
|
173
173
|
"""Returns the machine type this job is running on."""
|
|
174
174
|
return self._job_api._get_job_machine_from_spec(self._guaranteed_job.spec)
|
|
175
175
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
docs/source/conf.py,sha256=r8yX20eC-4mHhMTd0SbQb5TlSWHhO6wnJ0VJ_FBFpag,13249
|
|
2
|
-
lightning_sdk/__init__.py,sha256=
|
|
2
|
+
lightning_sdk/__init__.py,sha256=7m3PnW4ypq_Vcr5POTDAdFl_IzMe1ouPzuhbPqkGbiU,970
|
|
3
3
|
lightning_sdk/agents.py,sha256=ly6Ma1j0ZgGPFyvPvMN28JWiB9dATIstFa5XM8pMi6I,1577
|
|
4
4
|
lightning_sdk/ai_hub.py,sha256=kBjtmrzVHPCgqtV_TrSNkuf4oT2DLm8SYRTz4iTQmmY,6624
|
|
5
5
|
lightning_sdk/constants.py,sha256=ztl1PTUBULnqTf3DyKUSJaV_O20hNtUYT6XvAYIrmIk,749
|
|
6
6
|
lightning_sdk/helpers.py,sha256=RnQwUquc_YPotjh6YXOoJvZs8krX_QFhd7kGv4U_spQ,1844
|
|
7
|
-
lightning_sdk/lit_container.py,sha256=
|
|
7
|
+
lightning_sdk/lit_container.py,sha256=423XYYpzoGppv200kMbD9dB-iqP6xdHj7q5kejJLDKE,3778
|
|
8
8
|
lightning_sdk/machine.py,sha256=qutfVwQJHC02c2ygB_O5wrFI-Eq9zbfA0E1OPEYcCO0,861
|
|
9
9
|
lightning_sdk/models.py,sha256=d27VAYUcbWKd4kuL_CqwCi3IguyjmKUR9EVWfXWTwmc,5606
|
|
10
10
|
lightning_sdk/organization.py,sha256=WCfzdgjtvY1_A07DnxOpp74V2JR2gQwtXbIEcFDnoVU,1232
|
|
@@ -18,9 +18,9 @@ lightning_sdk/api/__init__.py,sha256=Qn2VVRvir_gO7w4yxGLkZY-R3T7kdiTPKgQ57BhIA9k
|
|
|
18
18
|
lightning_sdk/api/agents_api.py,sha256=G47TbFo9kYqnBMqdw2RW-lfS1VAUBSXDmzs6fpIEMUs,4059
|
|
19
19
|
lightning_sdk/api/ai_hub_api.py,sha256=CYQLFLA89m3xQ-6Ss3UX4TDK6ZWRwmPGA5DjyJqW3RM,5578
|
|
20
20
|
lightning_sdk/api/deployment_api.py,sha256=T480Nej7LqmtkAx8SBkPGQ5JxeyQ-GVIDqUCc7Z1yfk,21448
|
|
21
|
-
lightning_sdk/api/job_api.py,sha256=
|
|
22
|
-
lightning_sdk/api/lit_container_api.py,sha256=
|
|
23
|
-
lightning_sdk/api/mmt_api.py,sha256=
|
|
21
|
+
lightning_sdk/api/job_api.py,sha256=C9-6mwy5ufxgK7Q8YhMa8U90B_bNIbA8yo-aLvAp1w8,12261
|
|
22
|
+
lightning_sdk/api/lit_container_api.py,sha256=yuzALzKHd_vwFNaPbxmPvLWAjItB1npKnVj1QMJbXl8,2541
|
|
23
|
+
lightning_sdk/api/mmt_api.py,sha256=zmNmoSX6JPRQiHlBcGVGdk2LGYzlwiOyP0Io2NNyWDU,7353
|
|
24
24
|
lightning_sdk/api/org_api.py,sha256=Ze3z_ATVrukobujV5YdC42DKj45Vuwl7X52q_Vr-o3U,803
|
|
25
25
|
lightning_sdk/api/studio_api.py,sha256=Cfsq8HFc4uUsj8hncnhnD_TLhw0cg-ryclGowj8S6Y0,26374
|
|
26
26
|
lightning_sdk/api/teamspace_api.py,sha256=KYNyfx3aUYJyPeluM9iYphcIogBc--Bt3cV4IAgY7A4,11236
|
|
@@ -29,7 +29,7 @@ lightning_sdk/api/utils.py,sha256=VG3sCxWjn6MHONYghA73PZH-ErgqsHyj1ZMU6qzBCFk,22
|
|
|
29
29
|
lightning_sdk/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
30
|
lightning_sdk/cli/ai_hub.py,sha256=8oy6TogDiWnHuLT3cv33XEW7vPqXPA0dDMds8kX3Z4g,1649
|
|
31
31
|
lightning_sdk/cli/delete.py,sha256=TePfbCUKR2Bzq3D-avAX6AATQAR0GfFIxj_Qw3qSczo,2431
|
|
32
|
-
lightning_sdk/cli/download.py,sha256=
|
|
32
|
+
lightning_sdk/cli/download.py,sha256=Fw_Gqhkb4668V5GgmDmM2q36Oogbj7q3f4VWaaqbBeY,6886
|
|
33
33
|
lightning_sdk/cli/entrypoint.py,sha256=dybKJ9lTs7ixzaVRLGk4Gv1b11j3VKlAJr5B7itfDRA,2120
|
|
34
34
|
lightning_sdk/cli/exceptions.py,sha256=QUF3OMAMZwBikvlusimSHSBjb6ywvHpfAumJBEaodSw,169
|
|
35
35
|
lightning_sdk/cli/inspect.py,sha256=VeiazH-9DNn0SrQmP-ZM5JDdy8veQy5yxVe_Dj-KQWI,1349
|
|
@@ -38,7 +38,7 @@ lightning_sdk/cli/jobs_menu.py,sha256=6VqJecnyybYjdozj7MXH1gJehskJlwP8SoewQEXDz8
|
|
|
38
38
|
lightning_sdk/cli/legacy.py,sha256=ocTVNwlsLRS5aMjbMkwFPjT3uEYvS8C40CJ0PeRRv8g,4707
|
|
39
39
|
lightning_sdk/cli/list.py,sha256=gLfIf9iXPPyotqIy8MkWGJXWmGF8BV3jtmcZ8cCd3Ng,3856
|
|
40
40
|
lightning_sdk/cli/mmts_menu.py,sha256=OAwWywYeFSdmXBLR7raZlL7tpAhZld4r71LUHvmnZdA,2175
|
|
41
|
-
lightning_sdk/cli/run.py,sha256=
|
|
41
|
+
lightning_sdk/cli/run.py,sha256=80fZInp90YyfSRdEQZbNaebZ7jQWbusNYn0FTWKH9c4,12051
|
|
42
42
|
lightning_sdk/cli/serve.py,sha256=UaXhGHU6nbAzrnVigSKOTrMjLwSs-sjyhuJCdVUBwzc,8722
|
|
43
43
|
lightning_sdk/cli/stop.py,sha256=qBlVaYAJGxiNSwskxqB7zizTVPIpBGlJ4c7kIXII7iw,1373
|
|
44
44
|
lightning_sdk/cli/studios_menu.py,sha256=0kQGqGel8gAbpdJtjOM1a6NEat_TnIqRNprNn8QiK58,3236
|
|
@@ -47,11 +47,11 @@ lightning_sdk/cli/upload.py,sha256=pn7yIq98e_gMoaFhETHfiXai_15qdyG6t1hsdjN-oWg,1
|
|
|
47
47
|
lightning_sdk/deployment/__init__.py,sha256=BLu7_cVLp97TYxe6qe-J1zKUSZXAVcvCjgcA7plV2k4,497
|
|
48
48
|
lightning_sdk/deployment/deployment.py,sha256=Dp15pn8rFAfMfaDhKn0v3bphFuvLgkPFs3KSNxW6eyc,15472
|
|
49
49
|
lightning_sdk/job/__init__.py,sha256=1MxjQ6rHkyUHCypSW9RuXuVMVH11WiqhIXcU2LCFMwE,64
|
|
50
|
-
lightning_sdk/job/base.py,sha256=
|
|
51
|
-
lightning_sdk/job/job.py,sha256=
|
|
52
|
-
lightning_sdk/job/v1.py,sha256=
|
|
53
|
-
lightning_sdk/job/v2.py,sha256=
|
|
54
|
-
lightning_sdk/job/work.py,sha256=
|
|
50
|
+
lightning_sdk/job/base.py,sha256=xQ6zDUmCSncQ1mqSQP--VNOjyNxtiSjAykKC1_aFG1s,16320
|
|
51
|
+
lightning_sdk/job/job.py,sha256=Ikq0T9exdsYS77OEsQFoxMjKCgYfVdXMOlbBaZFCZ1w,13496
|
|
52
|
+
lightning_sdk/job/v1.py,sha256=CYiKiIFGEBmns0iDRybalp_1TRBGEfvu5lCJLvyvq84,10238
|
|
53
|
+
lightning_sdk/job/v2.py,sha256=EGkFuNxtixR7h1q0ld4Lm1OQk5fG4ox5jqsIO7ZAGIk,10204
|
|
54
|
+
lightning_sdk/job/work.py,sha256=Xm5byWTcOxYI8zZ3Sz6P8HxBTBAJ3S2KucndXA5KePQ,2332
|
|
55
55
|
lightning_sdk/lightning_cloud/__init__.py,sha256=o91SMAlwr4Ke5ESe8fHjqXcj31_h7rT-MlFoXA-n2EI,173
|
|
56
56
|
lightning_sdk/lightning_cloud/__version__.py,sha256=lOfmWHtjmiuSG28TbKQqd2B3nwmSGOlKVFwhaj_cRJk,23
|
|
57
57
|
lightning_sdk/lightning_cloud/env.py,sha256=XZXpF4sD9jlB8DY0herTy_8XiUJuDVjxy5APjRD2_aU,1379
|
|
@@ -851,10 +851,10 @@ lightning_sdk/lightning_cloud/utils/dataset.py,sha256=4nUspe8iAaRPgSYpXA2uAQCgyd
|
|
|
851
851
|
lightning_sdk/lightning_cloud/utils/name_generator.py,sha256=MkciuA10332V0mcE2PxLIiwWomWE0Fm_gNGK01vwRr4,58046
|
|
852
852
|
lightning_sdk/lightning_cloud/utils/network.py,sha256=axPgl8rhyPcPjxiztDxyksfxax3VNg2OXL5F5Uc81b4,406
|
|
853
853
|
lightning_sdk/mmt/__init__.py,sha256=ExMu90-96bGBnyp5h0CErQszUGB1-PcjC4-R8_NYbeY,117
|
|
854
|
-
lightning_sdk/mmt/base.py,sha256=
|
|
855
|
-
lightning_sdk/mmt/mmt.py,sha256=
|
|
856
|
-
lightning_sdk/mmt/v1.py,sha256=
|
|
857
|
-
lightning_sdk/mmt/v2.py,sha256=
|
|
854
|
+
lightning_sdk/mmt/base.py,sha256=1w91ggRWAAvUmBAnVqY2ecHU_lLz0_7AhJrtR1b-PPs,14870
|
|
855
|
+
lightning_sdk/mmt/mmt.py,sha256=lkrg-LYHyQLFIoV4A9C5BvjUFAefLeHzgeDbmpF1NEs,14135
|
|
856
|
+
lightning_sdk/mmt/v1.py,sha256=SHKQZYG3enK8idyO96S54DnRdEej4n38TKHBO8YEeZo,9371
|
|
857
|
+
lightning_sdk/mmt/v2.py,sha256=_qDGWaeHoW3laJ_cSglNN_JTGSxAiGeaZfQIX6iGLG8,9706
|
|
858
858
|
lightning_sdk/services/__init__.py,sha256=gSWUjccEhMI9CIWL_nbrFHUK2S6TM2725mEzrLMfK1Y,225
|
|
859
859
|
lightning_sdk/services/file_endpoint.py,sha256=we5HC_o74J4Y6fSP_31jIizi_I_1FO_Rb2qblspD9eE,7855
|
|
860
860
|
lightning_sdk/services/utilities.py,sha256=IeOx8hc3F8ZevHeKBysh08BXhJliTNzvKp1gwpEfdik,4087
|
|
@@ -863,9 +863,9 @@ lightning_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
|
863
863
|
lightning_sdk/utils/dynamic.py,sha256=glUTO1JC9APtQ6Gr9SO02a3zr56-sPAXM5C3NrTpgyQ,1959
|
|
864
864
|
lightning_sdk/utils/enum.py,sha256=h2JRzqoBcSlUdanFHmkj_j5DleBHAu1esQYUsdNI-hU,4106
|
|
865
865
|
lightning_sdk/utils/resolve.py,sha256=RWvlOWLHjaHhR0W0zT3mN719cbzhFfYCKBss38zfv3k,5783
|
|
866
|
-
lightning_sdk-0.1.
|
|
867
|
-
lightning_sdk-0.1.
|
|
868
|
-
lightning_sdk-0.1.
|
|
869
|
-
lightning_sdk-0.1.
|
|
870
|
-
lightning_sdk-0.1.
|
|
871
|
-
lightning_sdk-0.1.
|
|
866
|
+
lightning_sdk-0.1.50.dist-info/LICENSE,sha256=uFIuZwj5z-4TeF2UuacPZ1o17HkvKObT8fY50qN84sg,1064
|
|
867
|
+
lightning_sdk-0.1.50.dist-info/METADATA,sha256=XLrPyTcYOTNrqvE8jTtECxvaJ1Ev19fwe2Qk4BMaJ6E,4031
|
|
868
|
+
lightning_sdk-0.1.50.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
869
|
+
lightning_sdk-0.1.50.dist-info/entry_points.txt,sha256=msB9PJWIJ784dX-OP8by51d4IbKYH3Fj1vCuA9oXjHY,68
|
|
870
|
+
lightning_sdk-0.1.50.dist-info/top_level.txt,sha256=ps8doKILFXmN7F1mHncShmnQoTxKBRPIcchC8TpoBw4,19
|
|
871
|
+
lightning_sdk-0.1.50.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|