lightning-sdk 0.1.39__py3-none-any.whl → 0.1.40__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/_mmt/__init__.py +3 -0
- lightning_sdk/_mmt/base.py +180 -0
- lightning_sdk/_mmt/mmt.py +161 -0
- lightning_sdk/_mmt/v1.py +69 -0
- lightning_sdk/_mmt/v2.py +141 -0
- lightning_sdk/api/mmt_api.py +147 -0
- lightning_sdk/api/teamspace_api.py +0 -9
- lightning_sdk/cli/mmt.py +137 -0
- lightning_sdk/job/base.py +2 -3
- lightning_sdk/job/v1.py +2 -1
- lightning_sdk/job/v2.py +6 -9
- lightning_sdk/lightning_cloud/openapi/__init__.py +7 -3
- lightning_sdk/lightning_cloud/openapi/api/assistants_service_api.py +90 -284
- lightning_sdk/lightning_cloud/openapi/api/models_store_api.py +118 -1
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +7 -3
- lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/model_id_visibility_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_aws_direct_v1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/{project_id_agentmanagedmodels_body.py → v1_body.py} +21 -47
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_api.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_files_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_managed_model.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_managed_model_abilities.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_model.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_state.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_query_param.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_list_managed_models_response.py → v1_resource_visibility.py} +23 -23
- lightning_sdk/lightning_cloud/openapi/models/{v1_delete_managed_model_response.py → v1_update_model_visibility_response.py} +6 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +27 -1
- lightning_sdk/models.py +29 -8
- lightning_sdk/teamspace.py +12 -9
- {lightning_sdk-0.1.39.dist-info → lightning_sdk-0.1.40.dist-info}/METADATA +1 -1
- {lightning_sdk-0.1.39.dist-info → lightning_sdk-0.1.40.dist-info}/RECORD +40 -29
- {lightning_sdk-0.1.39.dist-info → lightning_sdk-0.1.40.dist-info}/entry_points.txt +1 -0
- {lightning_sdk-0.1.39.dist-info → lightning_sdk-0.1.40.dist-info}/LICENSE +0 -0
- {lightning_sdk-0.1.39.dist-info → lightning_sdk-0.1.40.dist-info}/WHEEL +0 -0
- {lightning_sdk-0.1.39.dist-info → lightning_sdk-0.1.40.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import time
|
|
2
|
+
from typing import TYPE_CHECKING, Dict, Optional
|
|
3
|
+
|
|
4
|
+
from lightning_sdk.api.utils import (
|
|
5
|
+
_COMPUTE_NAME_TO_MACHINE,
|
|
6
|
+
_MACHINE_TO_COMPUTE_NAME,
|
|
7
|
+
)
|
|
8
|
+
from lightning_sdk.api.utils import (
|
|
9
|
+
_get_cloud_url as _cloud_url,
|
|
10
|
+
)
|
|
11
|
+
from lightning_sdk.constants import __GLOBAL_LIGHTNING_UNIQUE_IDS_STORE__
|
|
12
|
+
from lightning_sdk.lightning_cloud.openapi import (
|
|
13
|
+
MultimachinejobsIdBody,
|
|
14
|
+
ProjectIdMultimachinejobsBody,
|
|
15
|
+
V1EnvVar,
|
|
16
|
+
V1JobSpec,
|
|
17
|
+
V1MultiMachineJob,
|
|
18
|
+
V1MultiMachineJobState,
|
|
19
|
+
)
|
|
20
|
+
from lightning_sdk.lightning_cloud.rest_client import LightningClient
|
|
21
|
+
from lightning_sdk.machine import Machine
|
|
22
|
+
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from lightning_sdk.status import Status
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class MMTApi:
|
|
28
|
+
mmt_state_unspecified = "MultiMachineJob_STATE_UNSPECIFIED"
|
|
29
|
+
mmt_state_running = "MultiMachineJob_STATE_RUNNING"
|
|
30
|
+
mmt_state_stopped = "MultiMachineJob_STATE_STOPPED"
|
|
31
|
+
mmt_state_deleted = "MultiMachineJob_STATE_DELETED"
|
|
32
|
+
mmt_state_failed = "MultiMachineJob_STATE_FAILED"
|
|
33
|
+
mmt_state_completed = "MultiMachineJob_STATE_COMPLETED"
|
|
34
|
+
|
|
35
|
+
def __init__(self) -> None:
|
|
36
|
+
self._cloud_url = _cloud_url()
|
|
37
|
+
self._client = LightningClient(max_tries=7)
|
|
38
|
+
|
|
39
|
+
def submit_job(
|
|
40
|
+
self,
|
|
41
|
+
name: str,
|
|
42
|
+
num_machines: int,
|
|
43
|
+
command: Optional[str],
|
|
44
|
+
cluster_id: Optional[str],
|
|
45
|
+
teamspace_id: str,
|
|
46
|
+
studio_id: Optional[str],
|
|
47
|
+
image: Optional[str],
|
|
48
|
+
machine: Machine,
|
|
49
|
+
interruptible: bool,
|
|
50
|
+
env: Optional[Dict[str, str]],
|
|
51
|
+
image_credentials: Optional[str],
|
|
52
|
+
cluster_auth: bool,
|
|
53
|
+
artifacts_local: Optional[str],
|
|
54
|
+
artifacts_remote: Optional[str],
|
|
55
|
+
) -> V1MultiMachineJob:
|
|
56
|
+
env_vars = []
|
|
57
|
+
if env is not None:
|
|
58
|
+
for k, v in env.items():
|
|
59
|
+
env_vars.append(V1EnvVar(name=k, value=v))
|
|
60
|
+
|
|
61
|
+
instance_name = _MACHINE_TO_COMPUTE_NAME[machine]
|
|
62
|
+
|
|
63
|
+
run_id = __GLOBAL_LIGHTNING_UNIQUE_IDS_STORE__[studio_id] if studio_id is not None else ""
|
|
64
|
+
|
|
65
|
+
spec = V1JobSpec(
|
|
66
|
+
cloudspace_id=studio_id or "",
|
|
67
|
+
cluster_id=cluster_id or "",
|
|
68
|
+
command=command or "",
|
|
69
|
+
env=env_vars,
|
|
70
|
+
image=image or "",
|
|
71
|
+
instance_name=instance_name,
|
|
72
|
+
run_id=run_id,
|
|
73
|
+
spot=interruptible,
|
|
74
|
+
image_cluster_credentials=cluster_auth,
|
|
75
|
+
image_secret_ref=image_credentials or "",
|
|
76
|
+
artifacts_source=artifacts_local or "",
|
|
77
|
+
artifacts_destination=artifacts_remote or "",
|
|
78
|
+
)
|
|
79
|
+
body = ProjectIdMultimachinejobsBody(name=name, spec=spec, cluster_id=cluster_id or "", machines=num_machines)
|
|
80
|
+
|
|
81
|
+
job: V1MultiMachineJob = self._client.jobs_service_create_multi_machine_job(project_id=teamspace_id, body=body)
|
|
82
|
+
return job
|
|
83
|
+
|
|
84
|
+
def get_job_by_name(self, name: str, teamspace_id: str) -> V1MultiMachineJob:
|
|
85
|
+
job: V1MultiMachineJob = self._client.jobs_service_get_multi_machine_job_by_name(
|
|
86
|
+
project_id=teamspace_id, name=name
|
|
87
|
+
)
|
|
88
|
+
return job
|
|
89
|
+
|
|
90
|
+
def get_job(self, job_id: str, teamspace_id: str) -> V1MultiMachineJob:
|
|
91
|
+
job: V1MultiMachineJob = self._client.jobs_service_get_multi_machine_job(project_id=teamspace_id, id=job_id)
|
|
92
|
+
return job
|
|
93
|
+
|
|
94
|
+
def stop_job(self, job_id: str, teamspace_id: str) -> None:
|
|
95
|
+
from lightning_sdk.status import Status
|
|
96
|
+
|
|
97
|
+
current_job = self.get_job(job_id=job_id, teamspace_id=teamspace_id)
|
|
98
|
+
|
|
99
|
+
current_state = self._job_state_to_external(current_job.desired_state)
|
|
100
|
+
|
|
101
|
+
if current_state in (
|
|
102
|
+
Status.Stopped,
|
|
103
|
+
Status.Completed,
|
|
104
|
+
Status.Failed,
|
|
105
|
+
):
|
|
106
|
+
return
|
|
107
|
+
|
|
108
|
+
if current_state != Status.Stopped:
|
|
109
|
+
update_body = MultimachinejobsIdBody(desired_state=self.mmt_state_stopped)
|
|
110
|
+
self._client.jobs_service_update_multi_machine_job(body=update_body, project_id=teamspace_id, id=job_id)
|
|
111
|
+
|
|
112
|
+
while True:
|
|
113
|
+
current_job = self.get_job(job_id=job_id, teamspace_id=teamspace_id)
|
|
114
|
+
if self._job_state_to_external(current_job.desired_state) in (
|
|
115
|
+
Status.Stopped,
|
|
116
|
+
Status.Completed,
|
|
117
|
+
Status.Stopped,
|
|
118
|
+
Status.Failed,
|
|
119
|
+
):
|
|
120
|
+
break
|
|
121
|
+
time.sleep(1)
|
|
122
|
+
|
|
123
|
+
def delete_job(self, job_id: str, teamspace_id: str) -> None:
|
|
124
|
+
self._client.jobs_service_delete_multi_machine_job(project_id=teamspace_id, id=job_id)
|
|
125
|
+
|
|
126
|
+
def _job_state_to_external(self, state: V1MultiMachineJobState) -> "Status":
|
|
127
|
+
from lightning_sdk.status import Status
|
|
128
|
+
|
|
129
|
+
if str(state) == self.mmt_state_unspecified:
|
|
130
|
+
return Status.Pending
|
|
131
|
+
if str(state) == self.mmt_state_running:
|
|
132
|
+
return Status.Running
|
|
133
|
+
if str(state) == self.mmt_state_stopped:
|
|
134
|
+
return Status.Stopped
|
|
135
|
+
if str(state) == self.mmt_state_completed:
|
|
136
|
+
return Status.Completed
|
|
137
|
+
if str(state) == self.mmt_state_failed:
|
|
138
|
+
return Status.Failed
|
|
139
|
+
return Status.Pending
|
|
140
|
+
|
|
141
|
+
def _get_job_machine_from_spec(self, spec: V1JobSpec) -> "Machine":
|
|
142
|
+
instance_name = spec.instance_name
|
|
143
|
+
instance_type = spec.instance_type
|
|
144
|
+
|
|
145
|
+
return _COMPUTE_NAME_TO_MACHINE.get(
|
|
146
|
+
instance_type, _COMPUTE_NAME_TO_MACHINE.get(instance_name, instance_type or instance_name)
|
|
147
|
+
)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from dataclasses import dataclass
|
|
3
2
|
from pathlib import Path
|
|
4
3
|
from typing import Dict, List, Optional
|
|
5
4
|
|
|
@@ -273,11 +272,3 @@ class TeamspaceApi:
|
|
|
273
272
|
download_dir=download_dir,
|
|
274
273
|
progress_bar=progress_bar,
|
|
275
274
|
)
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
@dataclass
|
|
279
|
-
class UploadedModelInfo:
|
|
280
|
-
name: str
|
|
281
|
-
version: str
|
|
282
|
-
teamspace: str
|
|
283
|
-
cluster: str
|
lightning_sdk/cli/mmt.py
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
from typing import Dict, Optional
|
|
2
|
+
|
|
3
|
+
from fire import Fire
|
|
4
|
+
|
|
5
|
+
from lightning_sdk._mmt import MMT
|
|
6
|
+
from lightning_sdk.api.studio_api import _cloud_url
|
|
7
|
+
from lightning_sdk.lightning_cloud.login import Auth
|
|
8
|
+
from lightning_sdk.machine import Machine
|
|
9
|
+
from lightning_sdk.teamspace import Teamspace
|
|
10
|
+
|
|
11
|
+
_MACHINE_VALUES = tuple([machine.value for machine in Machine])
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class MMTCLI:
|
|
15
|
+
"""Command line interface (CLI) to interact with/manage Lightning AI MMT."""
|
|
16
|
+
|
|
17
|
+
def __init__(self) -> None:
|
|
18
|
+
# Need to set the docstring here for f-strings to work.
|
|
19
|
+
# Sadly this is the only way to really show options as f-strings are not allowed as docstrings directly
|
|
20
|
+
# and fire does not show values for literals, just that it is a literal.
|
|
21
|
+
docstr = f"""Run async workloads on multiple machines using a docker image.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
name: The name of the job. Needs to be unique within the teamspace.
|
|
25
|
+
num_machines: The number of Machines to run on. Defaults to 2 Machines
|
|
26
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}. Defaults to CPU
|
|
27
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
28
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
29
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
30
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
31
|
+
teamspace: The teamspace the job should be associated with. Defaults to the current teamspace.
|
|
32
|
+
org: The organization owning the teamspace (if any). Defaults to the current organization.
|
|
33
|
+
user: The user owning the teamspace (if any). Defaults to the current user.
|
|
34
|
+
cluster: The cluster to run the job on. Defaults to the studio cluster if running with studio compute env.
|
|
35
|
+
If not provided will fall back to the teamspaces default cluster.
|
|
36
|
+
env: Environment variables to set inside the job.
|
|
37
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
38
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
39
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
40
|
+
cluster_auth: Whether to authenticate with the cluster to pull the image.
|
|
41
|
+
Required if the registry is part of a cluster provider (e.g. ECR).
|
|
42
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
43
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
44
|
+
Only supported for jobs with a docker image compute environment.
|
|
45
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
46
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
47
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
48
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
49
|
+
within it.
|
|
50
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
51
|
+
Only supported for jobs with a docker image compute environment.
|
|
52
|
+
"""
|
|
53
|
+
# TODO: the docstrings from artifacts_local and artifacts_remote don't show up completely,
|
|
54
|
+
# might need to switch to explicit cli definition
|
|
55
|
+
self.run.__func__.__doc__ = docstr
|
|
56
|
+
|
|
57
|
+
def login(self) -> None:
|
|
58
|
+
"""Login to Lightning AI Studios."""
|
|
59
|
+
auth = Auth()
|
|
60
|
+
auth.clear()
|
|
61
|
+
|
|
62
|
+
try:
|
|
63
|
+
auth.authenticate()
|
|
64
|
+
except ConnectionError:
|
|
65
|
+
raise RuntimeError(f"Unable to connect to {_cloud_url()}. Please check your internet connection.") from None
|
|
66
|
+
|
|
67
|
+
def logout(self) -> None:
|
|
68
|
+
"""Logout from Lightning AI Studios."""
|
|
69
|
+
auth = Auth()
|
|
70
|
+
auth.clear()
|
|
71
|
+
|
|
72
|
+
# TODO: sadly, fire displays both Optional[type] and Union[type, None] as Optional[Optional]
|
|
73
|
+
# see https://github.com/google/python-fire/pull/513
|
|
74
|
+
# might need to move to different cli library
|
|
75
|
+
def run(
|
|
76
|
+
self,
|
|
77
|
+
name: Optional[str] = None,
|
|
78
|
+
num_machines: int = 2,
|
|
79
|
+
machine: Optional[str] = None,
|
|
80
|
+
command: Optional[str] = None,
|
|
81
|
+
studio: Optional[str] = None,
|
|
82
|
+
image: Optional[str] = None,
|
|
83
|
+
teamspace: Optional[str] = None,
|
|
84
|
+
org: Optional[str] = None,
|
|
85
|
+
user: Optional[str] = None,
|
|
86
|
+
cluster: Optional[str] = None,
|
|
87
|
+
env: Optional[Dict[str, str]] = None,
|
|
88
|
+
interruptible: bool = False,
|
|
89
|
+
image_credentials: Optional[str] = None,
|
|
90
|
+
cluster_auth: bool = False,
|
|
91
|
+
artifacts_local: Optional[str] = None,
|
|
92
|
+
artifacts_remote: Optional[str] = None,
|
|
93
|
+
) -> None:
|
|
94
|
+
if name is None:
|
|
95
|
+
from datetime import datetime
|
|
96
|
+
|
|
97
|
+
timestr = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
|
|
98
|
+
name = f"mmt-{timestr}"
|
|
99
|
+
|
|
100
|
+
if machine is None:
|
|
101
|
+
# TODO: infer from studio
|
|
102
|
+
machine = "CPU"
|
|
103
|
+
machine_enum = Machine(machine.upper())
|
|
104
|
+
|
|
105
|
+
teamspace = Teamspace(name=teamspace, org=org, user=user)
|
|
106
|
+
if cluster is None:
|
|
107
|
+
cluster = teamspace.default_cluster
|
|
108
|
+
|
|
109
|
+
if image is None:
|
|
110
|
+
raise RuntimeError("Currently only docker images are specified")
|
|
111
|
+
MMT.run(
|
|
112
|
+
name=name,
|
|
113
|
+
num_machines=num_machines,
|
|
114
|
+
machine=machine_enum,
|
|
115
|
+
command=command,
|
|
116
|
+
studio=studio,
|
|
117
|
+
image=image,
|
|
118
|
+
teamspace=teamspace,
|
|
119
|
+
org=org,
|
|
120
|
+
user=user,
|
|
121
|
+
cluster=cluster,
|
|
122
|
+
env=env,
|
|
123
|
+
interruptible=interruptible,
|
|
124
|
+
image_credentials=image_credentials,
|
|
125
|
+
cluster_auth=cluster_auth,
|
|
126
|
+
artifacts_local=artifacts_local,
|
|
127
|
+
artifacts_remote=artifacts_remote,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def main_cli() -> None:
|
|
132
|
+
"""CLI entrypoint."""
|
|
133
|
+
Fire(MMTCLI(), name="_mmt")
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
if __name__ == "__main__":
|
|
137
|
+
main_cli()
|
lightning_sdk/job/base.py
CHANGED
|
@@ -114,7 +114,7 @@ class _BaseJob(ABC):
|
|
|
114
114
|
)
|
|
115
115
|
|
|
116
116
|
inst = cls(name=name, teamspace=teamspace, org=org, user=user, _fetch_job=False)
|
|
117
|
-
inst._submit(
|
|
117
|
+
return inst._submit(
|
|
118
118
|
machine=machine,
|
|
119
119
|
cluster=cluster,
|
|
120
120
|
command=command,
|
|
@@ -127,7 +127,6 @@ class _BaseJob(ABC):
|
|
|
127
127
|
artifacts_local=artifacts_local,
|
|
128
128
|
artifacts_remote=artifacts_remote,
|
|
129
129
|
)
|
|
130
|
-
return inst
|
|
131
130
|
|
|
132
131
|
@abstractmethod
|
|
133
132
|
def _submit(
|
|
@@ -143,7 +142,7 @@ class _BaseJob(ABC):
|
|
|
143
142
|
cluster_auth: bool = False,
|
|
144
143
|
artifacts_local: Optional[str] = None,
|
|
145
144
|
artifacts_remote: Optional[str] = None,
|
|
146
|
-
) ->
|
|
145
|
+
) -> "_BaseJob":
|
|
147
146
|
"""Submits a job and updates the internal _job attribute as well as the _name attribute."""
|
|
148
147
|
|
|
149
148
|
@abstractmethod
|
lightning_sdk/job/v1.py
CHANGED
|
@@ -71,7 +71,7 @@ class _JobV1(_BaseJob):
|
|
|
71
71
|
cluster_auth: bool = False,
|
|
72
72
|
artifacts_local: Optional[str] = None,
|
|
73
73
|
artifacts_remote: Optional[str] = None,
|
|
74
|
-
) ->
|
|
74
|
+
) -> "_JobV1":
|
|
75
75
|
if studio is None:
|
|
76
76
|
raise ValueError("Studio is required for submitting jobs")
|
|
77
77
|
|
|
@@ -100,6 +100,7 @@ class _JobV1(_BaseJob):
|
|
|
100
100
|
)
|
|
101
101
|
self._name = _submitted.name
|
|
102
102
|
self._job = _submitted
|
|
103
|
+
return self
|
|
103
104
|
|
|
104
105
|
def _update_internal_job(self) -> None:
|
|
105
106
|
try:
|
lightning_sdk/job/v2.py
CHANGED
|
@@ -38,7 +38,7 @@ class _JobV2(_BaseJob):
|
|
|
38
38
|
cluster_auth: bool = False,
|
|
39
39
|
artifacts_local: Optional[str] = None,
|
|
40
40
|
artifacts_remote: Optional[str] = None,
|
|
41
|
-
) ->
|
|
41
|
+
) -> "_JobV2":
|
|
42
42
|
# Command is required if Studio is provided to know what to run
|
|
43
43
|
# Image is mutually exclusive with Studio
|
|
44
44
|
# Command is optional for Image
|
|
@@ -73,19 +73,16 @@ class _JobV2(_BaseJob):
|
|
|
73
73
|
)
|
|
74
74
|
self._job = submitted
|
|
75
75
|
self._name = submitted.name
|
|
76
|
+
return self
|
|
76
77
|
|
|
77
78
|
def stop(self) -> None:
|
|
78
|
-
|
|
79
|
-
self._update_internal_job()
|
|
80
|
-
|
|
81
|
-
self._job_api.stop_job(job_id=self._job.id, teamspace_id=self._teamspace.id)
|
|
79
|
+
self._job_api.stop_job(job_id=self._guaranteed_job.id, teamspace_id=self._teamspace.id)
|
|
82
80
|
|
|
83
81
|
def delete(self) -> None:
|
|
84
|
-
if self._job is None:
|
|
85
|
-
self._update_internal_job()
|
|
86
|
-
|
|
87
82
|
self._job_api.delete_job(
|
|
88
|
-
job_id=self.
|
|
83
|
+
job_id=self._guaranteed_job.id,
|
|
84
|
+
teamspace_id=self._teamspace.id,
|
|
85
|
+
cloudspace_id=self._guaranteed_job.spec.cloudspace_id,
|
|
89
86
|
)
|
|
90
87
|
|
|
91
88
|
@property
|
|
@@ -137,6 +137,7 @@ from lightning_sdk.lightning_cloud.openapi.models.metricsstream_create_body impo
|
|
|
137
137
|
from lightning_sdk.lightning_cloud.openapi.models.metricsstream_delete_body import MetricsstreamDeleteBody
|
|
138
138
|
from lightning_sdk.lightning_cloud.openapi.models.metricsstream_id_body import MetricsstreamIdBody
|
|
139
139
|
from lightning_sdk.lightning_cloud.openapi.models.model_id_versions_body import ModelIdVersionsBody
|
|
140
|
+
from lightning_sdk.lightning_cloud.openapi.models.model_id_visibility_body import ModelIdVisibilityBody
|
|
140
141
|
from lightning_sdk.lightning_cloud.openapi.models.models_model_id_body import ModelsModelIdBody
|
|
141
142
|
from lightning_sdk.lightning_cloud.openapi.models.multimachinejobs_id_body import MultimachinejobsIdBody
|
|
142
143
|
from lightning_sdk.lightning_cloud.openapi.models.multipartuploads_upload_id_body import MultipartuploadsUploadIdBody
|
|
@@ -146,7 +147,6 @@ from lightning_sdk.lightning_cloud.openapi.models.orgs_id_body import OrgsIdBody
|
|
|
146
147
|
from lightning_sdk.lightning_cloud.openapi.models.profiler_captures_body import ProfilerCapturesBody
|
|
147
148
|
from lightning_sdk.lightning_cloud.openapi.models.profiler_enabled_body import ProfilerEnabledBody
|
|
148
149
|
from lightning_sdk.lightning_cloud.openapi.models.project_id_agentmanagedendpoints_body import ProjectIdAgentmanagedendpointsBody
|
|
149
|
-
from lightning_sdk.lightning_cloud.openapi.models.project_id_agentmanagedmodels_body import ProjectIdAgentmanagedmodelsBody
|
|
150
150
|
from lightning_sdk.lightning_cloud.openapi.models.project_id_agents_body import ProjectIdAgentsBody
|
|
151
151
|
from lightning_sdk.lightning_cloud.openapi.models.project_id_cloudspaces_body import ProjectIdCloudspacesBody
|
|
152
152
|
from lightning_sdk.lightning_cloud.openapi.models.project_id_clusters_body import ProjectIdClustersBody
|
|
@@ -222,6 +222,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_billing_feature import V1Bi
|
|
|
222
222
|
from lightning_sdk.lightning_cloud.openapi.models.v1_billing_period import V1BillingPeriod
|
|
223
223
|
from lightning_sdk.lightning_cloud.openapi.models.v1_billing_subscription import V1BillingSubscription
|
|
224
224
|
from lightning_sdk.lightning_cloud.openapi.models.v1_billing_tier import V1BillingTier
|
|
225
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_body import V1Body
|
|
225
226
|
from lightning_sdk.lightning_cloud.openapi.models.v1_build_spec import V1BuildSpec
|
|
226
227
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cpu_system_metrics import V1CPUSystemMetrics
|
|
227
228
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cancel_cloud_space_instance_switch_response import V1CancelCloudSpaceInstanceSwitchResponse
|
|
@@ -339,7 +340,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_delete_lightningwork_respon
|
|
|
339
340
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_lit_page_response import V1DeleteLitPageResponse
|
|
340
341
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_logger_artifact_response import V1DeleteLoggerArtifactResponse
|
|
341
342
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_managed_endpoint_response import V1DeleteManagedEndpointResponse
|
|
342
|
-
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_managed_model_response import V1DeleteManagedModelResponse
|
|
343
343
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_metrics_stream_response import V1DeleteMetricsStreamResponse
|
|
344
344
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_model_response import V1DeleteModelResponse
|
|
345
345
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_model_version_response import V1DeleteModelVersionResponse
|
|
@@ -365,6 +365,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_delete_user_slurm_job_respo
|
|
|
365
365
|
from lightning_sdk.lightning_cloud.openapi.models.v1_dependency_cache_state import V1DependencyCacheState
|
|
366
366
|
from lightning_sdk.lightning_cloud.openapi.models.v1_dependency_file_info import V1DependencyFileInfo
|
|
367
367
|
from lightning_sdk.lightning_cloud.openapi.models.v1_deployment import V1Deployment
|
|
368
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_api import V1DeploymentAPI
|
|
368
369
|
from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_event import V1DeploymentEvent
|
|
369
370
|
from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_event_type import V1DeploymentEventType
|
|
370
371
|
from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_metrics import V1DeploymentMetrics
|
|
@@ -552,7 +553,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_lightningwork_response
|
|
|
552
553
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_lit_pages_response import V1ListLitPagesResponse
|
|
553
554
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_logger_artifact_response import V1ListLoggerArtifactResponse
|
|
554
555
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_managed_endpoints_response import V1ListManagedEndpointsResponse
|
|
555
|
-
from lightning_sdk.lightning_cloud.openapi.models.v1_list_managed_models_response import V1ListManagedModelsResponse
|
|
556
556
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_memberships_response import V1ListMembershipsResponse
|
|
557
557
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_metrics_streams_response import V1ListMetricsStreamsResponse
|
|
558
558
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_model_versions_response import V1ListModelVersionsResponse
|
|
@@ -598,6 +598,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_magic_link_login_request im
|
|
|
598
598
|
from lightning_sdk.lightning_cloud.openapi.models.v1_magic_link_login_response import V1MagicLinkLoginResponse
|
|
599
599
|
from lightning_sdk.lightning_cloud.openapi.models.v1_managed_endpoint import V1ManagedEndpoint
|
|
600
600
|
from lightning_sdk.lightning_cloud.openapi.models.v1_managed_model import V1ManagedModel
|
|
601
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_managed_model_abilities import V1ManagedModelAbilities
|
|
601
602
|
from lightning_sdk.lightning_cloud.openapi.models.v1_membership import V1Membership
|
|
602
603
|
from lightning_sdk.lightning_cloud.openapi.models.v1_message import V1Message
|
|
603
604
|
from lightning_sdk.lightning_cloud.openapi.models.v1_message_author import V1MessageAuthor
|
|
@@ -653,6 +654,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_publish_cloud_space_respons
|
|
|
653
654
|
from lightning_sdk.lightning_cloud.openapi.models.v1_published_cloud_space_response import V1PublishedCloudSpaceResponse
|
|
654
655
|
from lightning_sdk.lightning_cloud.openapi.models.v1_purchase_capacity_block_response import V1PurchaseCapacityBlockResponse
|
|
655
656
|
from lightning_sdk.lightning_cloud.openapi.models.v1_python_dependency_info import V1PythonDependencyInfo
|
|
657
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_query_param import V1QueryParam
|
|
656
658
|
from lightning_sdk.lightning_cloud.openapi.models.v1_query_result import V1QueryResult
|
|
657
659
|
from lightning_sdk.lightning_cloud.openapi.models.v1_query_result_row import V1QueryResultRow
|
|
658
660
|
from lightning_sdk.lightning_cloud.openapi.models.v1_quest import V1Quest
|
|
@@ -671,6 +673,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_request_cluster_access_requ
|
|
|
671
673
|
from lightning_sdk.lightning_cloud.openapi.models.v1_request_cluster_access_response import V1RequestClusterAccessResponse
|
|
672
674
|
from lightning_sdk.lightning_cloud.openapi.models.v1_request_verification_code_response import V1RequestVerificationCodeResponse
|
|
673
675
|
from lightning_sdk.lightning_cloud.openapi.models.v1_resource_tag import V1ResourceTag
|
|
676
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_resource_visibility import V1ResourceVisibility
|
|
674
677
|
from lightning_sdk.lightning_cloud.openapi.models.v1_resources import V1Resources
|
|
675
678
|
from lightning_sdk.lightning_cloud.openapi.models.v1_response_choice import V1ResponseChoice
|
|
676
679
|
from lightning_sdk.lightning_cloud.openapi.models.v1_response_choice_delta import V1ResponseChoiceDelta
|
|
@@ -736,6 +739,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_accelerators
|
|
|
736
739
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_availability_request import V1UpdateClusterAvailabilityRequest
|
|
737
740
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_index_response import V1UpdateIndexResponse
|
|
738
741
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_lit_page_response import V1UpdateLitPageResponse
|
|
742
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_update_model_visibility_response import V1UpdateModelVisibilityResponse
|
|
739
743
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_project_cluster_accelerators_response import V1UpdateProjectClusterAcceleratorsResponse
|
|
740
744
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_shared_metrics_stream_response import V1UpdateSharedMetricsStreamResponse
|
|
741
745
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_snowflake_query_response import V1UpdateSnowflakeQueryResponse
|