lightning-sdk 0.1.50__py3-none-any.whl → 0.1.53__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/ai_hub.py +16 -27
- lightning_sdk/api/ai_hub_api.py +7 -1
- lightning_sdk/api/job_api.py +12 -7
- lightning_sdk/api/lit_container_api.py +24 -7
- lightning_sdk/api/mmt_api.py +12 -7
- lightning_sdk/api/utils.py +52 -0
- lightning_sdk/cli/run.py +65 -18
- lightning_sdk/cli/serve.py +1 -5
- lightning_sdk/cli/upload.py +33 -15
- lightning_sdk/helpers.py +1 -1
- lightning_sdk/job/base.py +28 -1
- lightning_sdk/job/job.py +27 -25
- lightning_sdk/job/v1.py +6 -2
- lightning_sdk/job/v2.py +12 -12
- lightning_sdk/lightning_cloud/login.py +4 -1
- lightning_sdk/lightning_cloud/openapi/__init__.py +17 -0
- lightning_sdk/lightning_cloud/openapi/api/assistants_service_api.py +105 -0
- lightning_sdk/lightning_cloud/openapi/api/cluster_service_api.py +417 -1
- lightning_sdk/lightning_cloud/openapi/api/file_system_service_api.py +105 -0
- lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +5 -1
- lightning_sdk/lightning_cloud/openapi/api/lit_registry_service_api.py +113 -0
- lightning_sdk/lightning_cloud/openapi/api/storage_service_api.py +101 -0
- lightning_sdk/lightning_cloud/openapi/api/user_service_api.py +5 -1
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +17 -0
- lightning_sdk/lightning_cloud/openapi/models/cluster_id_usagerestrictions_body.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/id_contactowner_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/litregistry_lit_repo_name_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/metricsstream_create_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/usagerestrictions_id_body.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_assistant_model_status.py +4 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_provider.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_artifact_event.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_artifact_event_type.py +103 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_accelerator.py +81 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_tagging_options.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_usage_restriction.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_contact_assistant_owner_reason.py +102 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_contact_assistant_owner_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_cluster_usage_restriction_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_api.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_filesystem_mmt.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_job_spec.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_list_cluster_usage_restrictions_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_filesystem_mm_ts_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_metrics_stream.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_model.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_path_mapping.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_post_cloud_space_artifact_events_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_resource_visibility.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_update_lit_repository_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +128 -76
- lightning_sdk/lightning_cloud/utils/data_connection.py +75 -7
- lightning_sdk/mmt/base.py +36 -26
- lightning_sdk/mmt/mmt.py +28 -26
- lightning_sdk/mmt/v1.py +4 -1
- lightning_sdk/mmt/v2.py +14 -13
- lightning_sdk/models.py +5 -4
- lightning_sdk/studio.py +68 -1
- lightning_sdk/utils/resolve.py +7 -0
- {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.53.dist-info}/METADATA +2 -2
- {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.53.dist-info}/RECORD +69 -52
- {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.53.dist-info}/LICENSE +0 -0
- {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.53.dist-info}/WHEEL +0 -0
- {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.53.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.53.dist-info}/top_level.txt +0 -0
lightning_sdk/job/base.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import warnings
|
|
1
2
|
from abc import ABC, abstractmethod
|
|
2
3
|
from typing import TYPE_CHECKING, Any, Dict, Optional, TypedDict, Union
|
|
3
4
|
|
|
4
5
|
from lightning_sdk.api.utils import _get_cloud_url
|
|
5
|
-
from lightning_sdk.utils.resolve import _resolve_deprecated_cluster, _resolve_teamspace
|
|
6
|
+
from lightning_sdk.utils.resolve import _resolve_deprecated_cluster, _resolve_teamspace, in_studio
|
|
6
7
|
|
|
7
8
|
if TYPE_CHECKING:
|
|
8
9
|
from lightning_sdk.machine import Machine
|
|
@@ -83,6 +84,7 @@ class _BaseJob(ABC):
|
|
|
83
84
|
artifacts_local: Optional[str] = None,
|
|
84
85
|
artifacts_remote: Optional[str] = None,
|
|
85
86
|
entrypoint: str = "sh -c",
|
|
87
|
+
path_mappings: Optional[Dict[str, str]] = None,
|
|
86
88
|
cluster: Optional[str] = None, # deprecated in favor of cloud_account
|
|
87
89
|
) -> "_BaseJob":
|
|
88
90
|
"""Run async workloads using a docker image or a compute environment from your studio.
|
|
@@ -121,6 +123,7 @@ class _BaseJob(ABC):
|
|
|
121
123
|
To use the pre-defined entrypoint of the provided image, set this to an empty string.
|
|
122
124
|
Only applicable when submitting docker jobs.
|
|
123
125
|
"""
|
|
126
|
+
from lightning_sdk.lightning_cloud.openapi.rest import ApiException
|
|
124
127
|
from lightning_sdk.studio import Studio
|
|
125
128
|
|
|
126
129
|
cloud_account = _resolve_deprecated_cluster(cloud_account, cluster)
|
|
@@ -175,6 +178,12 @@ class _BaseJob(ABC):
|
|
|
175
178
|
raise RuntimeError(
|
|
176
179
|
"image and studio are mutually exclusive as both define the environment to run the job in"
|
|
177
180
|
)
|
|
181
|
+
if cloud_account is None and in_studio():
|
|
182
|
+
try:
|
|
183
|
+
resolve_studio = Studio(teamspace=teamspace, user=user, org=org)
|
|
184
|
+
cloud_account = resolve_studio.cloud_account
|
|
185
|
+
except (ValueError, ApiException):
|
|
186
|
+
warnings.warn("Could not infer cloud account from studio. Using teamspace default.")
|
|
178
187
|
|
|
179
188
|
# they either need to specified both or none of them
|
|
180
189
|
if bool(artifacts_local) != bool(artifacts_remote):
|
|
@@ -200,6 +209,7 @@ class _BaseJob(ABC):
|
|
|
200
209
|
artifacts_local=artifacts_local,
|
|
201
210
|
artifacts_remote=artifacts_remote,
|
|
202
211
|
entrypoint=entrypoint,
|
|
212
|
+
path_mappings=path_mappings,
|
|
203
213
|
)
|
|
204
214
|
|
|
205
215
|
@abstractmethod
|
|
@@ -217,6 +227,7 @@ class _BaseJob(ABC):
|
|
|
217
227
|
artifacts_local: Optional[str] = None,
|
|
218
228
|
artifacts_remote: Optional[str] = None,
|
|
219
229
|
entrypoint: str = "sh -c",
|
|
230
|
+
path_mappings: Optional[Dict[str, str]] = None,
|
|
220
231
|
) -> "_BaseJob":
|
|
221
232
|
"""Submit a new job to the Lightning AI platform.
|
|
222
233
|
|
|
@@ -264,6 +275,22 @@ class _BaseJob(ABC):
|
|
|
264
275
|
Caution: This also deletes all artifacts and snapshots associated with the job.
|
|
265
276
|
"""
|
|
266
277
|
|
|
278
|
+
def wait(self, interval: float = 5.0) -> None:
|
|
279
|
+
"""Waits for the job to be either completed, manually stopped or failed.
|
|
280
|
+
|
|
281
|
+
Args:
|
|
282
|
+
interval: the number of seconds to spend in-between status checks.
|
|
283
|
+
"""
|
|
284
|
+
import time
|
|
285
|
+
|
|
286
|
+
from lightning_sdk.status import Status
|
|
287
|
+
|
|
288
|
+
while True:
|
|
289
|
+
if self.status in (Status.Completed, Status.Stopped, Status.Failed):
|
|
290
|
+
break
|
|
291
|
+
|
|
292
|
+
time.sleep(interval)
|
|
293
|
+
|
|
267
294
|
@property
|
|
268
295
|
@abstractmethod
|
|
269
296
|
def status(self) -> "Status":
|
lightning_sdk/job/job.py
CHANGED
|
@@ -101,9 +101,10 @@ class Job(_BaseJob):
|
|
|
101
101
|
interruptible: bool = False,
|
|
102
102
|
image_credentials: Optional[str] = None,
|
|
103
103
|
cloud_account_auth: bool = False,
|
|
104
|
-
artifacts_local: Optional[str] = None,
|
|
105
|
-
artifacts_remote: Optional[str] = None,
|
|
106
104
|
entrypoint: str = "sh -c",
|
|
105
|
+
path_mappings: Optional[Dict[str, str]] = None,
|
|
106
|
+
artifacts_local: Optional[str] = None, # deprecated in terms of path_mappings
|
|
107
|
+
artifacts_remote: Optional[str] = None, # deprecated in terms of path_mappings
|
|
107
108
|
cluster: Optional[str] = None, # deprecated in favor of cloud_account
|
|
108
109
|
) -> "Job":
|
|
109
110
|
"""Run async workloads using a docker image or a compute environment from your studio.
|
|
@@ -127,20 +128,19 @@ class Job(_BaseJob):
|
|
|
127
128
|
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
128
129
|
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
129
130
|
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
130
|
-
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
131
|
-
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
132
|
-
Only supported for jobs with a docker image compute environment.
|
|
133
|
-
artifacts_remote: The remote storage to persist your artifacts to.
|
|
134
|
-
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
135
|
-
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
136
|
-
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
137
|
-
within it.
|
|
138
|
-
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
139
|
-
Only supported for jobs with a docker image compute environment.
|
|
140
131
|
entrypoint: The entrypoint of your docker container. Defaults to `sh -c` which
|
|
141
132
|
just runs the provided command in a standard shell.
|
|
142
133
|
To use the pre-defined entrypoint of the provided image, set this to an empty string.
|
|
143
134
|
Only applicable when submitting docker jobs.
|
|
135
|
+
path_mappings: Dictionary of path mappings. The keys are the path inside the container whereas the value
|
|
136
|
+
represents the data-connection name and the path inside that connection.
|
|
137
|
+
Should be of form
|
|
138
|
+
{
|
|
139
|
+
"<CONTAINER_PATH_1>": "<CONNECTION_NAME_1>:<PATH_WITHIN_CONNECTION_1>",
|
|
140
|
+
"<CONTAINER_PATH_2>": "<CONNECTION_NAME_2>"
|
|
141
|
+
}
|
|
142
|
+
If the path inside the connection is omitted it's assumed to be the root path of that connection.
|
|
143
|
+
Only applicable when submitting docker jobs.
|
|
144
144
|
"""
|
|
145
145
|
ret_val = super().run(
|
|
146
146
|
name=name,
|
|
@@ -159,6 +159,7 @@ class Job(_BaseJob):
|
|
|
159
159
|
artifacts_local=artifacts_local,
|
|
160
160
|
artifacts_remote=artifacts_remote,
|
|
161
161
|
entrypoint=entrypoint,
|
|
162
|
+
path_mappings=path_mappings,
|
|
162
163
|
cluster=cluster,
|
|
163
164
|
)
|
|
164
165
|
# required for typing with "Job"
|
|
@@ -178,9 +179,10 @@ class Job(_BaseJob):
|
|
|
178
179
|
cloud_account: Optional[str] = None,
|
|
179
180
|
image_credentials: Optional[str] = None,
|
|
180
181
|
cloud_account_auth: bool = False,
|
|
181
|
-
artifacts_local: Optional[str] = None,
|
|
182
|
-
artifacts_remote: Optional[str] = None,
|
|
183
182
|
entrypoint: str = "sh -c",
|
|
183
|
+
path_mappings: Optional[Dict[str, str]] = None,
|
|
184
|
+
artifacts_local: Optional[str] = None, # deprecated in terms of path_mappings
|
|
185
|
+
artifacts_remote: Optional[str] = None, # deprecated in terms of path_mappings
|
|
184
186
|
) -> "Job":
|
|
185
187
|
"""Submit a new job to the Lightning AI platform.
|
|
186
188
|
|
|
@@ -199,19 +201,18 @@ class Job(_BaseJob):
|
|
|
199
201
|
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
200
202
|
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
201
203
|
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
202
|
-
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
203
|
-
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
204
|
-
Only supported for jobs with a docker image compute environment.
|
|
205
|
-
artifacts_remote: The remote storage to persist your artifacts to.
|
|
206
|
-
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
207
|
-
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
208
|
-
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
209
|
-
within it.
|
|
210
|
-
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
211
|
-
Only supported for jobs with a docker image compute environment.
|
|
212
204
|
entrypoint: The entrypoint of your docker container. Defaults to sh -c.
|
|
213
205
|
To use the pre-defined entrypoint of the provided image, set this to an empty string.
|
|
214
206
|
Only applicable when submitting docker jobs.
|
|
207
|
+
path_mappings: Dictionary of path mappings. The keys are the path inside the container whereas the value
|
|
208
|
+
represents the data-connection name and the path inside that connection.
|
|
209
|
+
Should be of form
|
|
210
|
+
{
|
|
211
|
+
"<CONTAINER_PATH_1>": "<CONNECTION_NAME_1>:<PATH_WITHIN_CONNECTION_1>",
|
|
212
|
+
"<CONTAINER_PATH_2>": "<CONNECTION_NAME_2>"
|
|
213
|
+
}
|
|
214
|
+
If the path inside the connection is omitted it's assumed to be the root path of that connection.
|
|
215
|
+
Only applicable when submitting docker jobs.
|
|
215
216
|
"""
|
|
216
217
|
self._job = self._internal_job._submit(
|
|
217
218
|
machine=machine,
|
|
@@ -223,9 +224,10 @@ class Job(_BaseJob):
|
|
|
223
224
|
interruptible=interruptible,
|
|
224
225
|
image_credentials=image_credentials,
|
|
225
226
|
cloud_account_auth=cloud_account_auth,
|
|
227
|
+
entrypoint=entrypoint,
|
|
228
|
+
path_mappings=path_mappings,
|
|
226
229
|
artifacts_local=artifacts_local,
|
|
227
230
|
artifacts_remote=artifacts_remote,
|
|
228
|
-
entrypoint=entrypoint,
|
|
229
231
|
)
|
|
230
232
|
return self
|
|
231
233
|
|
lightning_sdk/job/v1.py
CHANGED
|
@@ -85,6 +85,7 @@ class _JobV1(_BaseJob):
|
|
|
85
85
|
image_credentials=None,
|
|
86
86
|
cloud_account_auth=False,
|
|
87
87
|
cluster=cluster,
|
|
88
|
+
path_mappings=None,
|
|
88
89
|
)
|
|
89
90
|
|
|
90
91
|
def _submit(
|
|
@@ -101,6 +102,7 @@ class _JobV1(_BaseJob):
|
|
|
101
102
|
artifacts_local: Optional[str] = None,
|
|
102
103
|
artifacts_remote: Optional[str] = None,
|
|
103
104
|
entrypoint: str = "sh -c",
|
|
105
|
+
path_mappings: Optional[Dict[str, str]] = None,
|
|
104
106
|
) -> "_JobV1":
|
|
105
107
|
"""Submit a job to run on a machine.
|
|
106
108
|
|
|
@@ -114,12 +116,11 @@ class _JobV1(_BaseJob):
|
|
|
114
116
|
cloud_account: The cloud account to run the job on.
|
|
115
117
|
image_credentials: The image credentials for the job (not supported).
|
|
116
118
|
cloud_account_auth: Whether to use cloud account authentication for the job (not supported).
|
|
117
|
-
artifacts_local: The local path for persisting artifacts (not supported).
|
|
118
|
-
artifacts_remote: The remote path for persisting artifacts (not supported).
|
|
119
119
|
entrypoint: The entrypoint of your docker container (not supported).
|
|
120
120
|
Defaults to `sh -c` which just runs the provided command in a standard shell.
|
|
121
121
|
To use the pre-defined entrypoint of the provided image, set this to an empty string.
|
|
122
122
|
Only applicable when submitting docker jobs.
|
|
123
|
+
path_mappings: The mappings from data connection inside your container (not supported)
|
|
123
124
|
|
|
124
125
|
Returns:
|
|
125
126
|
The submitted job.
|
|
@@ -141,6 +142,9 @@ class _JobV1(_BaseJob):
|
|
|
141
142
|
if entrypoint != "sh -c":
|
|
142
143
|
raise ValueError("Specifying the entrypoint is not yet supported with jobs")
|
|
143
144
|
|
|
145
|
+
if path_mappings is not None:
|
|
146
|
+
raise ValueError("Specifying path mappings is not yet supported with jobs")
|
|
147
|
+
|
|
144
148
|
# TODO: add support for empty names (will give an empty string)
|
|
145
149
|
_submitted = self._job_api.submit_job(
|
|
146
150
|
name=self._name,
|
lightning_sdk/job/v2.py
CHANGED
|
@@ -46,9 +46,10 @@ class _JobV2(_BaseJob):
|
|
|
46
46
|
cloud_account: Optional[str] = None,
|
|
47
47
|
image_credentials: Optional[str] = None,
|
|
48
48
|
cloud_account_auth: bool = False,
|
|
49
|
-
artifacts_local: Optional[str] = None,
|
|
50
|
-
artifacts_remote: Optional[str] = None,
|
|
51
49
|
entrypoint: str = "sh -c",
|
|
50
|
+
path_mappings: Optional[Dict[str, str]] = None,
|
|
51
|
+
artifacts_local: Optional[str] = None, # deprecated in favor of path_mappings
|
|
52
|
+
artifacts_remote: Optional[str] = None, # deprecated in favor of path_mappings
|
|
52
53
|
) -> "_JobV2":
|
|
53
54
|
"""Submit a new job to the Lightning AI platform.
|
|
54
55
|
|
|
@@ -70,16 +71,14 @@ class _JobV2(_BaseJob):
|
|
|
70
71
|
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
71
72
|
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
72
73
|
Only supported for jobs with a docker image compute environment.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
just runs the provided command in a standard shell.
|
|
82
|
-
To use the pre-defined entrypoint of the provided image, set this to an empty string.
|
|
74
|
+
path_mappings: Dictionary of path mappings. The keys are the path inside the container whereas the value
|
|
75
|
+
represents the data-connection name and the path inside that connection.
|
|
76
|
+
Should be of form
|
|
77
|
+
{
|
|
78
|
+
"<CONTAINER_PATH_1>": "<CONNECTION_NAME_1>:<PATH_WITHIN_CONNECTION_1>",
|
|
79
|
+
"<CONTAINER_PATH_2>": "<CONNECTION_NAME_2>"
|
|
80
|
+
}
|
|
81
|
+
If the path inside the connection is omitted it's assumed to be the root path of that connection.
|
|
83
82
|
Only applicable when submitting docker jobs.
|
|
84
83
|
"""
|
|
85
84
|
# Command is required if Studio is provided to know what to run
|
|
@@ -114,6 +113,7 @@ class _JobV2(_BaseJob):
|
|
|
114
113
|
artifacts_local=artifacts_local,
|
|
115
114
|
artifacts_remote=artifacts_remote,
|
|
116
115
|
entrypoint=entrypoint,
|
|
116
|
+
path_mappings=path_mappings,
|
|
117
117
|
)
|
|
118
118
|
self._job = submitted
|
|
119
119
|
self._name = submitted.name
|
|
@@ -168,7 +168,10 @@ class AuthServer:
|
|
|
168
168
|
ok = webbrowser.open(url)
|
|
169
169
|
if not ok:
|
|
170
170
|
# can't open a browser, authentication failed
|
|
171
|
-
|
|
171
|
+
deployment_id = os.environ.get("LIGHTNING_DEPLOYMENT_ID", None)
|
|
172
|
+
if deployment_id is not None and deployment_id != "":
|
|
173
|
+
raise RuntimeError("Failed to authenticate to Lightning. Ensure that you have selected 'Include SDK credentials' in the 'Environment' section of the deployment settings.")
|
|
174
|
+
raise RuntimeError("Failed to authenticate to Lightning. When running without access to a browser, 'LIGHTNING_USER_ID' and 'LIGHTNING_API_KEY' should be exported.")
|
|
172
175
|
|
|
173
176
|
@app.get("/login-complete")
|
|
174
177
|
async def save_token(request: Request,
|
|
@@ -80,6 +80,7 @@ from lightning_sdk.lightning_cloud.openapi.models.cloudspaces_id_body import Clo
|
|
|
80
80
|
from lightning_sdk.lightning_cloud.openapi.models.cluster_id_capacityblock_body import ClusterIdCapacityblockBody
|
|
81
81
|
from lightning_sdk.lightning_cloud.openapi.models.cluster_id_capacityreservations_body import ClusterIdCapacityreservationsBody
|
|
82
82
|
from lightning_sdk.lightning_cloud.openapi.models.cluster_id_proxies_body import ClusterIdProxiesBody
|
|
83
|
+
from lightning_sdk.lightning_cloud.openapi.models.cluster_id_usagerestrictions_body import ClusterIdUsagerestrictionsBody
|
|
83
84
|
from lightning_sdk.lightning_cloud.openapi.models.clusters_id_body import ClustersIdBody
|
|
84
85
|
from lightning_sdk.lightning_cloud.openapi.models.clusters_id_body1 import ClustersIdBody1
|
|
85
86
|
from lightning_sdk.lightning_cloud.openapi.models.command_argument_command_argument_type import CommandArgumentCommandArgumentType
|
|
@@ -105,6 +106,7 @@ from lightning_sdk.lightning_cloud.openapi.models.id_artifacts_body import IdArt
|
|
|
105
106
|
from lightning_sdk.lightning_cloud.openapi.models.id_codeconfig_body import IdCodeconfigBody
|
|
106
107
|
from lightning_sdk.lightning_cloud.openapi.models.id_collaborate_body import IdCollaborateBody
|
|
107
108
|
from lightning_sdk.lightning_cloud.openapi.models.id_complete_body import IdCompleteBody
|
|
109
|
+
from lightning_sdk.lightning_cloud.openapi.models.id_contactowner_body import IdContactownerBody
|
|
108
110
|
from lightning_sdk.lightning_cloud.openapi.models.id_engage_body import IdEngageBody
|
|
109
111
|
from lightning_sdk.lightning_cloud.openapi.models.id_engage_body1 import IdEngageBody1
|
|
110
112
|
from lightning_sdk.lightning_cloud.openapi.models.id_execute_body import IdExecuteBody
|
|
@@ -133,6 +135,7 @@ from lightning_sdk.lightning_cloud.openapi.models.jobs_id_body2 import JobsIdBod
|
|
|
133
135
|
from lightning_sdk.lightning_cloud.openapi.models.jobs_id_body3 import JobsIdBody3
|
|
134
136
|
from lightning_sdk.lightning_cloud.openapi.models.litloggermetrics_id_body import LitloggermetricsIdBody
|
|
135
137
|
from lightning_sdk.lightning_cloud.openapi.models.litpages_id_body import LitpagesIdBody
|
|
138
|
+
from lightning_sdk.lightning_cloud.openapi.models.litregistry_lit_repo_name_body import LitregistryLitRepoNameBody
|
|
136
139
|
from lightning_sdk.lightning_cloud.openapi.models.loggermetrics_id_body import LoggermetricsIdBody
|
|
137
140
|
from lightning_sdk.lightning_cloud.openapi.models.metrics_stream_id_loggerartifacts_body import MetricsStreamIdLoggerartifactsBody
|
|
138
141
|
from lightning_sdk.lightning_cloud.openapi.models.metricsstream_create_body import MetricsstreamCreateBody
|
|
@@ -190,6 +193,7 @@ from lightning_sdk.lightning_cloud.openapi.models.update import Update
|
|
|
190
193
|
from lightning_sdk.lightning_cloud.openapi.models.upload_id_complete_body import UploadIdCompleteBody
|
|
191
194
|
from lightning_sdk.lightning_cloud.openapi.models.upload_id_parts_body import UploadIdPartsBody
|
|
192
195
|
from lightning_sdk.lightning_cloud.openapi.models.uploads_upload_id_body import UploadsUploadIdBody
|
|
196
|
+
from lightning_sdk.lightning_cloud.openapi.models.usagerestrictions_id_body import UsagerestrictionsIdBody
|
|
193
197
|
from lightning_sdk.lightning_cloud.openapi.models.user_id_affiliatelinks_body import UserIdAffiliatelinksBody
|
|
194
198
|
from lightning_sdk.lightning_cloud.openapi.models.user_id_membershiprolebindings_body import UserIdMembershiprolebindingsBody
|
|
195
199
|
from lightning_sdk.lightning_cloud.openapi.models.user_id_membershiprolebindings_body1 import UserIdMembershiprolebindingsBody1
|
|
@@ -234,11 +238,14 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_capacity_block_offering imp
|
|
|
234
238
|
from lightning_sdk.lightning_cloud.openapi.models.v1_check_external_service_status_response import V1CheckExternalServiceStatusResponse
|
|
235
239
|
from lightning_sdk.lightning_cloud.openapi.models.v1_check_snowflake_connection_response import V1CheckSnowflakeConnectionResponse
|
|
236
240
|
from lightning_sdk.lightning_cloud.openapi.models.v1_checkbox import V1Checkbox
|
|
241
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_provider import V1CloudProvider
|
|
237
242
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space import V1CloudSpace
|
|
238
243
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_app import V1CloudSpaceApp
|
|
239
244
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_app_action import V1CloudSpaceAppAction
|
|
240
245
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_app_action_type import V1CloudSpaceAppActionType
|
|
241
246
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_app_owner_type import V1CloudSpaceAppOwnerType
|
|
247
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_artifact_event import V1CloudSpaceArtifactEvent
|
|
248
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_artifact_event_type import V1CloudSpaceArtifactEventType
|
|
242
249
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_code_version import V1CloudSpaceCodeVersion
|
|
243
250
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_code_version_status import V1CloudSpaceCodeVersionStatus
|
|
244
251
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_engagement_response import V1CloudSpaceEngagementResponse
|
|
@@ -268,6 +275,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_state import V1Clus
|
|
|
268
275
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_status import V1ClusterStatus
|
|
269
276
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_tagging_options import V1ClusterTaggingOptions
|
|
270
277
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_type import V1ClusterType
|
|
278
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_usage_restriction import V1ClusterUsageRestriction
|
|
271
279
|
from lightning_sdk.lightning_cloud.openapi.models.v1_collab_action import V1CollabAction
|
|
272
280
|
from lightning_sdk.lightning_cloud.openapi.models.v1_collab_session import V1CollabSession
|
|
273
281
|
from lightning_sdk.lightning_cloud.openapi.models.v1_command_argument import V1CommandArgument
|
|
@@ -280,6 +288,8 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_complete_upload_project_art
|
|
|
280
288
|
from lightning_sdk.lightning_cloud.openapi.models.v1_complete_upload_service_execution_artifact_response import V1CompleteUploadServiceExecutionArtifactResponse
|
|
281
289
|
from lightning_sdk.lightning_cloud.openapi.models.v1_completed_part import V1CompletedPart
|
|
282
290
|
from lightning_sdk.lightning_cloud.openapi.models.v1_compute_config import V1ComputeConfig
|
|
291
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_contact_assistant_owner_reason import V1ContactAssistantOwnerReason
|
|
292
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_contact_assistant_owner_response import V1ContactAssistantOwnerResponse
|
|
283
293
|
from lightning_sdk.lightning_cloud.openapi.models.v1_conversation import V1Conversation
|
|
284
294
|
from lightning_sdk.lightning_cloud.openapi.models.v1_conversation_response_chunk import V1ConversationResponseChunk
|
|
285
295
|
from lightning_sdk.lightning_cloud.openapi.models.v1_count_metrics_streams_response import V1CountMetricsStreamsResponse
|
|
@@ -327,6 +337,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_delete_cluster_capacity_res
|
|
|
327
337
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_cluster_encryption_key_response import V1DeleteClusterEncryptionKeyResponse
|
|
328
338
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_cluster_proxy_response import V1DeleteClusterProxyResponse
|
|
329
339
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_cluster_response import V1DeleteClusterResponse
|
|
340
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_cluster_usage_restriction_response import V1DeleteClusterUsageRestrictionResponse
|
|
330
341
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_conversation_response import V1DeleteConversationResponse
|
|
331
342
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_data_connection_response import V1DeleteDataConnectionResponse
|
|
332
343
|
from lightning_sdk.lightning_cloud.openapi.models.v1_delete_dataset_response import V1DeleteDatasetResponse
|
|
@@ -416,6 +427,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_filesystem_app import V1Fil
|
|
|
416
427
|
from lightning_sdk.lightning_cloud.openapi.models.v1_filesystem_cloud_space import V1FilesystemCloudSpace
|
|
417
428
|
from lightning_sdk.lightning_cloud.openapi.models.v1_filesystem_dataset import V1FilesystemDataset
|
|
418
429
|
from lightning_sdk.lightning_cloud.openapi.models.v1_filesystem_job import V1FilesystemJob
|
|
430
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_filesystem_mmt import V1FilesystemMMT
|
|
419
431
|
from lightning_sdk.lightning_cloud.openapi.models.v1_filesystem_slurm_job import V1FilesystemSlurmJob
|
|
420
432
|
from lightning_sdk.lightning_cloud.openapi.models.v1_filesystem_snowflake_connection import V1FilesystemSnowflakeConnection
|
|
421
433
|
from lightning_sdk.lightning_cloud.openapi.models.v1_filesystem_work import V1FilesystemWork
|
|
@@ -525,6 +537,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_accelerators_r
|
|
|
525
537
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_availabilities_response import V1ListClusterAvailabilitiesResponse
|
|
526
538
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_capacity_reservations_response import V1ListClusterCapacityReservationsResponse
|
|
527
539
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_proxies_response import V1ListClusterProxiesResponse
|
|
540
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_usage_restrictions_response import V1ListClusterUsageRestrictionsResponse
|
|
528
541
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_clusters_response import V1ListClustersResponse
|
|
529
542
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_conversations_response import V1ListConversationsResponse
|
|
530
543
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_data_connection_artifacts_response import V1ListDataConnectionArtifactsResponse
|
|
@@ -543,6 +556,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_filesystem_apps_respon
|
|
|
543
556
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_filesystem_cloud_spaces_response import V1ListFilesystemCloudSpacesResponse
|
|
544
557
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_filesystem_datasets_response import V1ListFilesystemDatasetsResponse
|
|
545
558
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_filesystem_jobs_response import V1ListFilesystemJobsResponse
|
|
559
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_list_filesystem_mm_ts_response import V1ListFilesystemMMTsResponse
|
|
546
560
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_filesystem_slurm_jobs_response import V1ListFilesystemSlurmJobsResponse
|
|
547
561
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_filesystem_snowflake_response import V1ListFilesystemSnowflakeResponse
|
|
548
562
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_gallery_components_response import V1ListGalleryComponentsResponse
|
|
@@ -646,10 +660,12 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_organization import V1Organ
|
|
|
646
660
|
from lightning_sdk.lightning_cloud.openapi.models.v1_owner_type import V1OwnerType
|
|
647
661
|
from lightning_sdk.lightning_cloud.openapi.models.v1_package_manager import V1PackageManager
|
|
648
662
|
from lightning_sdk.lightning_cloud.openapi.models.v1_parameterization_spec import V1ParameterizationSpec
|
|
663
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_path_mapping import V1PathMapping
|
|
649
664
|
from lightning_sdk.lightning_cloud.openapi.models.v1_path_telemetry import V1PathTelemetry
|
|
650
665
|
from lightning_sdk.lightning_cloud.openapi.models.v1_phase_type import V1PhaseType
|
|
651
666
|
from lightning_sdk.lightning_cloud.openapi.models.v1_plugin import V1Plugin
|
|
652
667
|
from lightning_sdk.lightning_cloud.openapi.models.v1_plugins_list_response import V1PluginsListResponse
|
|
668
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_post_cloud_space_artifact_events_response import V1PostCloudSpaceArtifactEventsResponse
|
|
653
669
|
from lightning_sdk.lightning_cloud.openapi.models.v1_presigned_url import V1PresignedUrl
|
|
654
670
|
from lightning_sdk.lightning_cloud.openapi.models.v1_profiler_capture import V1ProfilerCapture
|
|
655
671
|
from lightning_sdk.lightning_cloud.openapi.models.v1_profiler_enabled_response import V1ProfilerEnabledResponse
|
|
@@ -753,6 +769,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_accelerators
|
|
|
753
769
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_availability_request import V1UpdateClusterAvailabilityRequest
|
|
754
770
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_index_response import V1UpdateIndexResponse
|
|
755
771
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_lit_page_response import V1UpdateLitPageResponse
|
|
772
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_update_lit_repository_response import V1UpdateLitRepositoryResponse
|
|
756
773
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_metrics_stream_visibility_response import V1UpdateMetricsStreamVisibilityResponse
|
|
757
774
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_model_visibility_response import V1UpdateModelVisibilityResponse
|
|
758
775
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_project_cluster_accelerators_response import V1UpdateProjectClusterAcceleratorsResponse
|
|
@@ -43,6 +43,111 @@ class AssistantsServiceApi(object):
|
|
|
43
43
|
api_client = ApiClient()
|
|
44
44
|
self.api_client = api_client
|
|
45
45
|
|
|
46
|
+
def assistants_service_contact_assistant_owner(self, body: 'IdContactownerBody', id: 'str', **kwargs) -> 'V1ContactAssistantOwnerResponse': # noqa: E501
|
|
47
|
+
"""assistants_service_contact_assistant_owner # noqa: E501
|
|
48
|
+
|
|
49
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
50
|
+
asynchronous HTTP request, please pass async_req=True
|
|
51
|
+
>>> thread = api.assistants_service_contact_assistant_owner(body, id, async_req=True)
|
|
52
|
+
>>> result = thread.get()
|
|
53
|
+
|
|
54
|
+
:param async_req bool
|
|
55
|
+
:param IdContactownerBody body: (required)
|
|
56
|
+
:param str id: (required)
|
|
57
|
+
:return: V1ContactAssistantOwnerResponse
|
|
58
|
+
If the method is called asynchronously,
|
|
59
|
+
returns the request thread.
|
|
60
|
+
"""
|
|
61
|
+
kwargs['_return_http_data_only'] = True
|
|
62
|
+
if kwargs.get('async_req'):
|
|
63
|
+
return self.assistants_service_contact_assistant_owner_with_http_info(body, id, **kwargs) # noqa: E501
|
|
64
|
+
else:
|
|
65
|
+
(data) = self.assistants_service_contact_assistant_owner_with_http_info(body, id, **kwargs) # noqa: E501
|
|
66
|
+
return data
|
|
67
|
+
|
|
68
|
+
def assistants_service_contact_assistant_owner_with_http_info(self, body: 'IdContactownerBody', id: 'str', **kwargs) -> 'V1ContactAssistantOwnerResponse': # noqa: E501
|
|
69
|
+
"""assistants_service_contact_assistant_owner # noqa: E501
|
|
70
|
+
|
|
71
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
72
|
+
asynchronous HTTP request, please pass async_req=True
|
|
73
|
+
>>> thread = api.assistants_service_contact_assistant_owner_with_http_info(body, id, async_req=True)
|
|
74
|
+
>>> result = thread.get()
|
|
75
|
+
|
|
76
|
+
:param async_req bool
|
|
77
|
+
:param IdContactownerBody body: (required)
|
|
78
|
+
:param str id: (required)
|
|
79
|
+
:return: V1ContactAssistantOwnerResponse
|
|
80
|
+
If the method is called asynchronously,
|
|
81
|
+
returns the request thread.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
all_params = ['body', 'id'] # noqa: E501
|
|
85
|
+
all_params.append('async_req')
|
|
86
|
+
all_params.append('_return_http_data_only')
|
|
87
|
+
all_params.append('_preload_content')
|
|
88
|
+
all_params.append('_request_timeout')
|
|
89
|
+
|
|
90
|
+
params = locals()
|
|
91
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
92
|
+
if key not in all_params:
|
|
93
|
+
raise TypeError(
|
|
94
|
+
"Got an unexpected keyword argument '%s'"
|
|
95
|
+
" to method assistants_service_contact_assistant_owner" % key
|
|
96
|
+
)
|
|
97
|
+
params[key] = val
|
|
98
|
+
del params['kwargs']
|
|
99
|
+
# verify the required parameter 'body' is set
|
|
100
|
+
if ('body' not in params or
|
|
101
|
+
params['body'] is None):
|
|
102
|
+
raise ValueError("Missing the required parameter `body` when calling `assistants_service_contact_assistant_owner`") # noqa: E501
|
|
103
|
+
# verify the required parameter 'id' is set
|
|
104
|
+
if ('id' not in params or
|
|
105
|
+
params['id'] is None):
|
|
106
|
+
raise ValueError("Missing the required parameter `id` when calling `assistants_service_contact_assistant_owner`") # noqa: E501
|
|
107
|
+
|
|
108
|
+
collection_formats = {}
|
|
109
|
+
|
|
110
|
+
path_params = {}
|
|
111
|
+
if 'id' in params:
|
|
112
|
+
path_params['id'] = params['id'] # noqa: E501
|
|
113
|
+
|
|
114
|
+
query_params = []
|
|
115
|
+
|
|
116
|
+
header_params = {}
|
|
117
|
+
|
|
118
|
+
form_params = []
|
|
119
|
+
local_var_files = {}
|
|
120
|
+
|
|
121
|
+
body_params = None
|
|
122
|
+
if 'body' in params:
|
|
123
|
+
body_params = params['body']
|
|
124
|
+
# HTTP header `Accept`
|
|
125
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
126
|
+
['application/json']) # noqa: E501
|
|
127
|
+
|
|
128
|
+
# HTTP header `Content-Type`
|
|
129
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
130
|
+
['application/json']) # noqa: E501
|
|
131
|
+
|
|
132
|
+
# Authentication setting
|
|
133
|
+
auth_settings = [] # noqa: E501
|
|
134
|
+
|
|
135
|
+
return self.api_client.call_api(
|
|
136
|
+
'/v1/agents/{id}/contact-owner', 'POST',
|
|
137
|
+
path_params,
|
|
138
|
+
query_params,
|
|
139
|
+
header_params,
|
|
140
|
+
body=body_params,
|
|
141
|
+
post_params=form_params,
|
|
142
|
+
files=local_var_files,
|
|
143
|
+
response_type='V1ContactAssistantOwnerResponse', # noqa: E501
|
|
144
|
+
auth_settings=auth_settings,
|
|
145
|
+
async_req=params.get('async_req'),
|
|
146
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
147
|
+
_preload_content=params.get('_preload_content', True),
|
|
148
|
+
_request_timeout=params.get('_request_timeout'),
|
|
149
|
+
collection_formats=collection_formats)
|
|
150
|
+
|
|
46
151
|
def assistants_service_create_assistant(self, body: 'ProjectIdAgentsBody', project_id: 'str', **kwargs) -> 'V1Assistant': # noqa: E501
|
|
47
152
|
"""assistants_service_create_assistant # noqa: E501
|
|
48
153
|
|