lightning-sdk 0.1.41__py3-none-any.whl → 0.1.42__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 +8 -3
- lightning_sdk/api/ai_hub_api.py +3 -3
- lightning_sdk/api/deployment_api.py +6 -6
- lightning_sdk/api/job_api.py +32 -6
- lightning_sdk/api/mmt_api.py +59 -19
- lightning_sdk/api/studio_api.py +37 -19
- lightning_sdk/api/teamspace_api.py +34 -29
- lightning_sdk/api/utils.py +46 -34
- lightning_sdk/cli/ai_hub.py +3 -3
- lightning_sdk/cli/entrypoint.py +3 -1
- lightning_sdk/cli/mmt.py +11 -10
- lightning_sdk/cli/run.py +9 -8
- lightning_sdk/cli/serve.py +130 -0
- lightning_sdk/deployment/deployment.py +18 -12
- lightning_sdk/job/base.py +118 -24
- lightning_sdk/job/job.py +87 -9
- lightning_sdk/job/v1.py +75 -18
- lightning_sdk/job/v2.py +51 -15
- lightning_sdk/job/work.py +36 -7
- lightning_sdk/lightning_cloud/openapi/__init__.py +12 -0
- lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +215 -5
- lightning_sdk/lightning_cloud/openapi/api/lit_logger_service_api.py +218 -0
- lightning_sdk/lightning_cloud/openapi/api/models_store_api.py +226 -0
- lightning_sdk/lightning_cloud/openapi/api/snowflake_service_api.py +21 -1
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +12 -0
- lightning_sdk/lightning_cloud/openapi/models/deploymenttemplates_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/id_visibility_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/model_id_versions_body.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/project_id_multimachinejobs_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/project_id_snowflake_body.py +15 -67
- lightning_sdk/lightning_cloud/openapi/models/query_query_id_body.py +17 -69
- lightning_sdk/lightning_cloud/openapi/models/snowflake_export_body.py +29 -81
- lightning_sdk/lightning_cloud/openapi/models/snowflake_query_body.py +17 -69
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_file_url_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_files_response.py +17 -17
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_files_url_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_project_balance_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_list_multi_machine_job_events_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_metrics_stream.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_model_file.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_event.py +331 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_event_type.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_fault_tolerance.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_fault_tolerance_strategy.py +105 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_status.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_rule_resource.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_snowflake_data_connection.py +29 -81
- lightning_sdk/lightning_cloud/openapi/models/v1_system_metrics.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_trainium_system_metrics.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_metrics_stream_visibility_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +27 -53
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_deployment_image_request.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_deployment_image_response.py +97 -0
- lightning_sdk/lightning_cloud/rest_client.py +2 -0
- lightning_sdk/mmt/__init__.py +3 -0
- lightning_sdk/{_mmt → mmt}/base.py +20 -14
- lightning_sdk/{_mmt → mmt}/mmt.py +46 -17
- lightning_sdk/mmt/v1.py +129 -0
- lightning_sdk/{_mmt → mmt}/v2.py +16 -21
- lightning_sdk/plugin.py +43 -16
- lightning_sdk/services/file_endpoint.py +11 -5
- lightning_sdk/studio.py +16 -9
- lightning_sdk/teamspace.py +21 -8
- lightning_sdk/utils/resolve.py +18 -0
- {lightning_sdk-0.1.41.dist-info → lightning_sdk-0.1.42.dist-info}/METADATA +3 -1
- {lightning_sdk-0.1.41.dist-info → lightning_sdk-0.1.42.dist-info}/RECORD +72 -59
- lightning_sdk/_mmt/__init__.py +0 -3
- lightning_sdk/_mmt/v1.py +0 -69
- {lightning_sdk-0.1.41.dist-info → lightning_sdk-0.1.42.dist-info}/LICENSE +0 -0
- {lightning_sdk-0.1.41.dist-info → lightning_sdk-0.1.42.dist-info}/WHEEL +0 -0
- {lightning_sdk-0.1.41.dist-info → lightning_sdk-0.1.42.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-0.1.41.dist-info → lightning_sdk-0.1.42.dist-info}/top_level.txt +0 -0
lightning_sdk/job/v2.py
CHANGED
|
@@ -22,6 +22,15 @@ class _JobV2(_BaseJob):
|
|
|
22
22
|
*,
|
|
23
23
|
_fetch_job: bool = True,
|
|
24
24
|
) -> None:
|
|
25
|
+
"""Fetch already existing jobs.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
name: the name of the job
|
|
29
|
+
teamspace: the teamspace the job is part of
|
|
30
|
+
org: the name of the organization owning the :param`teamspace` in case it is owned by an org
|
|
31
|
+
user: the name of the user owning the :param`teamspace`
|
|
32
|
+
in case it is owned directly by a user instead of an org.
|
|
33
|
+
"""
|
|
25
34
|
self._job_api = JobApiV2()
|
|
26
35
|
super().__init__(name=name, teamspace=teamspace, org=org, user=user, _fetch_job=_fetch_job)
|
|
27
36
|
|
|
@@ -33,12 +42,40 @@ class _JobV2(_BaseJob):
|
|
|
33
42
|
image: Optional[str] = None,
|
|
34
43
|
env: Optional[Dict[str, str]] = None,
|
|
35
44
|
interruptible: bool = False,
|
|
36
|
-
|
|
45
|
+
cloud_account: Optional[str] = None,
|
|
37
46
|
image_credentials: Optional[str] = None,
|
|
38
|
-
|
|
47
|
+
cloud_account_auth: bool = False,
|
|
39
48
|
artifacts_local: Optional[str] = None,
|
|
40
49
|
artifacts_remote: Optional[str] = None,
|
|
41
50
|
) -> "_JobV2":
|
|
51
|
+
"""Submit a new job to the Lightning AI platform.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
55
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
56
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
57
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
58
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
59
|
+
env: Environment variables to set inside the job.
|
|
60
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
61
|
+
cloud_account: The cloud account to run the job on.
|
|
62
|
+
Defaults to the studio cloud account if running with studio compute env.
|
|
63
|
+
If not provided will fall back to the teamspaces default cloud account.
|
|
64
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
65
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
66
|
+
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
67
|
+
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
68
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
69
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
70
|
+
Only supported for jobs with a docker image compute environment.
|
|
71
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
72
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
73
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
74
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
75
|
+
within it.
|
|
76
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
77
|
+
Only supported for jobs with a docker image compute environment.
|
|
78
|
+
"""
|
|
42
79
|
# Command is required if Studio is provided to know what to run
|
|
43
80
|
# Image is mutually exclusive with Studio
|
|
44
81
|
# Command is optional for Image
|
|
@@ -59,7 +96,7 @@ class _JobV2(_BaseJob):
|
|
|
59
96
|
submitted = self._job_api.submit_job(
|
|
60
97
|
name=self.name,
|
|
61
98
|
command=command,
|
|
62
|
-
|
|
99
|
+
cloud_account=cloud_account,
|
|
63
100
|
teamspace_id=self._teamspace.id,
|
|
64
101
|
studio_id=studio_id,
|
|
65
102
|
image=image,
|
|
@@ -67,7 +104,7 @@ class _JobV2(_BaseJob):
|
|
|
67
104
|
interruptible=interruptible,
|
|
68
105
|
env=env,
|
|
69
106
|
image_credentials=image_credentials,
|
|
70
|
-
|
|
107
|
+
cloud_account_auth=cloud_account_auth,
|
|
71
108
|
artifacts_local=artifacts_local,
|
|
72
109
|
artifacts_remote=artifacts_remote,
|
|
73
110
|
)
|
|
@@ -76,9 +113,14 @@ class _JobV2(_BaseJob):
|
|
|
76
113
|
return self
|
|
77
114
|
|
|
78
115
|
def stop(self) -> None:
|
|
116
|
+
"""Stop the job. If the job is already stopped, this is a no-op. This is blocking until the job is stopped."""
|
|
79
117
|
self._job_api.stop_job(job_id=self._guaranteed_job.id, teamspace_id=self._teamspace.id)
|
|
80
118
|
|
|
81
119
|
def delete(self) -> None:
|
|
120
|
+
"""Delete the job.
|
|
121
|
+
|
|
122
|
+
Caution: This also deletes all artifacts created by the job.
|
|
123
|
+
"""
|
|
82
124
|
self._job_api.delete_job(
|
|
83
125
|
job_id=self._guaranteed_job.id,
|
|
84
126
|
teamspace_id=self._teamspace.id,
|
|
@@ -91,28 +133,20 @@ class _JobV2(_BaseJob):
|
|
|
91
133
|
self._update_internal_job()
|
|
92
134
|
return self._job
|
|
93
135
|
|
|
94
|
-
@property
|
|
95
|
-
def _guaranteed_job(self) -> Any:
|
|
96
|
-
"""Guarantees that the job was fetched at some point before returning it.
|
|
97
|
-
|
|
98
|
-
Doesn't guarantee to have the lastest version of the job. Use _latest_job for that.
|
|
99
|
-
"""
|
|
100
|
-
if getattr(self, "_job", None) is None:
|
|
101
|
-
self._update_internal_job()
|
|
102
|
-
|
|
103
|
-
return self._job
|
|
104
|
-
|
|
105
136
|
@property
|
|
106
137
|
def status(self) -> "Status":
|
|
138
|
+
"""The current status of the job."""
|
|
107
139
|
return self._job_api._job_state_to_external(self._latest_job.state)
|
|
108
140
|
|
|
109
141
|
@property
|
|
110
142
|
def machine(self) -> "Machine":
|
|
143
|
+
"""The machine type the job is running on."""
|
|
111
144
|
# only fetch the job it it hasn't been fetched yet as machine cannot change over time
|
|
112
145
|
return self._job_api._get_job_machine_from_spec(self._guaranteed_job.spec)
|
|
113
146
|
|
|
114
147
|
@property
|
|
115
148
|
def artifact_path(self) -> Optional[str]:
|
|
149
|
+
"""The path to the artifacts of the job within the distributed teamspace filesystem."""
|
|
116
150
|
if self._guaranteed_job.spec.image != "":
|
|
117
151
|
if self._guaranteed_job.spec.artifacts_destination != "":
|
|
118
152
|
splits = self._guaranteed_job.spec.artifacts_destination.split(":")
|
|
@@ -123,12 +157,14 @@ class _JobV2(_BaseJob):
|
|
|
123
157
|
|
|
124
158
|
@property
|
|
125
159
|
def snapshot_path(self) -> Optional[str]:
|
|
160
|
+
"""The path to the snapshot of the Studio used to create the job within the distributed teamspace filesystem."""
|
|
126
161
|
if self._guaranteed_job.spec.image != "":
|
|
127
162
|
return None
|
|
128
163
|
return f"/teamspace/jobs/{self._guaranteed_job.name}/snapshot"
|
|
129
164
|
|
|
130
165
|
@property
|
|
131
166
|
def share_path(self) -> Optional[str]:
|
|
167
|
+
"""The path to the share of the job within the distributed teamspace filesystem."""
|
|
132
168
|
raise NotImplementedError("Not implemented yet")
|
|
133
169
|
|
|
134
170
|
def _update_internal_job(self) -> None:
|
lightning_sdk/job/work.py
CHANGED
|
@@ -1,33 +1,62 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, Optional
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Optional, Protocol
|
|
2
2
|
|
|
3
3
|
from lightning_sdk.api.job_api import JobApiV1
|
|
4
4
|
|
|
5
5
|
if TYPE_CHECKING:
|
|
6
|
-
from lightning_sdk.
|
|
6
|
+
from lightning_sdk.status import Status
|
|
7
7
|
from lightning_sdk.teamspace import Teamspace
|
|
8
8
|
from lightning_sdk.machine import Machine
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
class _WorkHolder(Protocol):
|
|
12
|
+
@property
|
|
13
|
+
def _id(self) -> str:
|
|
14
|
+
...
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def name(self) -> str:
|
|
18
|
+
...
|
|
19
|
+
|
|
20
|
+
def _name_filter(self, name: str) -> str:
|
|
21
|
+
...
|
|
22
|
+
|
|
23
|
+
|
|
11
24
|
class Work:
|
|
12
|
-
def __init__(self, work_id: str, job:
|
|
25
|
+
def __init__(self, work_id: str, job: _WorkHolder, teamspace: "Teamspace") -> None:
|
|
13
26
|
self._id = work_id
|
|
14
27
|
self._job = job
|
|
15
28
|
self._teamspace = teamspace
|
|
16
29
|
self._job_api = JobApiV1()
|
|
17
|
-
self._work =
|
|
30
|
+
self._work = None
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def _latest_work(self) -> Any:
|
|
34
|
+
self._work = self._job_api.get_work(work_id=self._id, job_id=self._job._id, teamspace_id=self._teamspace.id)
|
|
35
|
+
return self._work
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def _guaranteed_work(self) -> Any:
|
|
39
|
+
if self._work is None:
|
|
40
|
+
return self._latest_work
|
|
41
|
+
|
|
42
|
+
return self._work
|
|
18
43
|
|
|
19
44
|
@property
|
|
20
45
|
def id(self) -> str:
|
|
21
|
-
return self.
|
|
46
|
+
return self._guaranteed_work.id
|
|
22
47
|
|
|
23
48
|
@property
|
|
24
49
|
def name(self) -> str:
|
|
25
|
-
return self._job._name_filter(self.
|
|
50
|
+
return self._job._name_filter(self._guaranteed_work.name)
|
|
26
51
|
|
|
27
52
|
@property
|
|
28
53
|
def machine(self) -> "Machine":
|
|
29
|
-
return self._job_api.get_machine_from_work(self.
|
|
54
|
+
return self._job_api.get_machine_from_work(self._guaranteed_work)
|
|
30
55
|
|
|
31
56
|
@property
|
|
32
57
|
def artifact_path(self) -> Optional[str]:
|
|
33
58
|
return f"/teamspace/jobs/{self._job.name}/{self.name}"
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def status(self) -> "Status":
|
|
62
|
+
return self._job_api.get_status_from_work(self._latest_work)
|
|
@@ -125,6 +125,7 @@ from lightning_sdk.lightning_cloud.openapi.models.id_start_body import IdStartBo
|
|
|
125
125
|
from lightning_sdk.lightning_cloud.openapi.models.id_storage_body import IdStorageBody
|
|
126
126
|
from lightning_sdk.lightning_cloud.openapi.models.id_uploads_body import IdUploadsBody
|
|
127
127
|
from lightning_sdk.lightning_cloud.openapi.models.id_uploads_body1 import IdUploadsBody1
|
|
128
|
+
from lightning_sdk.lightning_cloud.openapi.models.id_visibility_body import IdVisibilityBody
|
|
128
129
|
from lightning_sdk.lightning_cloud.openapi.models.jobs_id_body import JobsIdBody
|
|
129
130
|
from lightning_sdk.lightning_cloud.openapi.models.jobs_id_body1 import JobsIdBody1
|
|
130
131
|
from lightning_sdk.lightning_cloud.openapi.models.jobs_id_body2 import JobsIdBody2
|
|
@@ -445,6 +446,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_get_long_running_command_in
|
|
|
445
446
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_model_file_upload_urls_response import V1GetModelFileUploadUrlsResponse
|
|
446
447
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_model_file_url_response import V1GetModelFileUrlResponse
|
|
447
448
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_model_files_response import V1GetModelFilesResponse
|
|
449
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_get_model_files_url_response import V1GetModelFilesUrlResponse
|
|
448
450
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_project_artifact_response import V1GetProjectArtifactResponse
|
|
449
451
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_project_balance_response import V1GetProjectBalanceResponse
|
|
450
452
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_project_compute_usage_response import V1GetProjectComputeUsageResponse
|
|
@@ -558,6 +560,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_memberships_response i
|
|
|
558
560
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_metrics_streams_response import V1ListMetricsStreamsResponse
|
|
559
561
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_model_versions_response import V1ListModelVersionsResponse
|
|
560
562
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_models_response import V1ListModelsResponse
|
|
563
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_list_multi_machine_job_events_response import V1ListMultiMachineJobEventsResponse
|
|
561
564
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_multi_machine_jobs_response import V1ListMultiMachineJobsResponse
|
|
562
565
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_new_features_for_user_response import V1ListNewFeaturesForUserResponse
|
|
563
566
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_org_members_response import V1ListOrgMembersResponse
|
|
@@ -612,9 +615,14 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_metrics_stream import V1Met
|
|
|
612
615
|
from lightning_sdk.lightning_cloud.openapi.models.v1_metrics_tags import V1MetricsTags
|
|
613
616
|
from lightning_sdk.lightning_cloud.openapi.models.v1_metrics_tracker import V1MetricsTracker
|
|
614
617
|
from lightning_sdk.lightning_cloud.openapi.models.v1_model import V1Model
|
|
618
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_model_file import V1ModelFile
|
|
615
619
|
from lightning_sdk.lightning_cloud.openapi.models.v1_model_version_archive import V1ModelVersionArchive
|
|
616
620
|
from lightning_sdk.lightning_cloud.openapi.models.v1_mount_target import V1MountTarget
|
|
617
621
|
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job import V1MultiMachineJob
|
|
622
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job_event import V1MultiMachineJobEvent
|
|
623
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job_event_type import V1MultiMachineJobEventType
|
|
624
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job_fault_tolerance import V1MultiMachineJobFaultTolerance
|
|
625
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job_fault_tolerance_strategy import V1MultiMachineJobFaultToleranceStrategy
|
|
618
626
|
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job_state import V1MultiMachineJobState
|
|
619
627
|
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job_status import V1MultiMachineJobStatus
|
|
620
628
|
from lightning_sdk.lightning_cloud.openapi.models.v1_named_get_logger_metrics import V1NamedGetLoggerMetrics
|
|
@@ -724,6 +732,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_system_metrics import V1Sys
|
|
|
724
732
|
from lightning_sdk.lightning_cloud.openapi.models.v1_system_metrics_list import V1SystemMetricsList
|
|
725
733
|
from lightning_sdk.lightning_cloud.openapi.models.v1_telemetry import V1Telemetry
|
|
726
734
|
from lightning_sdk.lightning_cloud.openapi.models.v1_timestamp_code_telemetry import V1TimestampCodeTelemetry
|
|
735
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_trainium_system_metrics import V1TrainiumSystemMetrics
|
|
727
736
|
from lightning_sdk.lightning_cloud.openapi.models.v1_transaction import V1Transaction
|
|
728
737
|
from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_org_balance_response import V1TransferOrgBalanceResponse
|
|
729
738
|
from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_project_balance_response import V1TransferProjectBalanceResponse
|
|
@@ -740,6 +749,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_accelerators
|
|
|
740
749
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_availability_request import V1UpdateClusterAvailabilityRequest
|
|
741
750
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_index_response import V1UpdateIndexResponse
|
|
742
751
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_lit_page_response import V1UpdateLitPageResponse
|
|
752
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_update_metrics_stream_visibility_response import V1UpdateMetricsStreamVisibilityResponse
|
|
743
753
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_model_visibility_response import V1UpdateModelVisibilityResponse
|
|
744
754
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_project_cluster_accelerators_response import V1UpdateProjectClusterAcceleratorsResponse
|
|
745
755
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_shared_metrics_stream_response import V1UpdateSharedMetricsStreamResponse
|
|
@@ -769,6 +779,8 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_user_slurm_job_action_respo
|
|
|
769
779
|
from lightning_sdk.lightning_cloud.openapi.models.v1_validate_assistant_status_response import V1ValidateAssistantStatusResponse
|
|
770
780
|
from lightning_sdk.lightning_cloud.openapi.models.v1_validate_auto_join_domain_response import V1ValidateAutoJoinDomainResponse
|
|
771
781
|
from lightning_sdk.lightning_cloud.openapi.models.v1_validate_data_connection_response import V1ValidateDataConnectionResponse
|
|
782
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_validate_deployment_image_request import V1ValidateDeploymentImageRequest
|
|
783
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_validate_deployment_image_response import V1ValidateDeploymentImageResponse
|
|
772
784
|
from lightning_sdk.lightning_cloud.openapi.models.v1_validate_managed_endpoint_request import V1ValidateManagedEndpointRequest
|
|
773
785
|
from lightning_sdk.lightning_cloud.openapi.models.v1_validate_managed_endpoint_response import V1ValidateManagedEndpointResponse
|
|
774
786
|
from lightning_sdk.lightning_cloud.openapi.models.v1_validate_managed_model_response import V1ValidateManagedModelResponse
|
|
@@ -145,7 +145,7 @@ class JobsServiceApi(object):
|
|
|
145
145
|
collection_formats=collection_formats)
|
|
146
146
|
|
|
147
147
|
def jobs_service_create_deployment(self, body: 'CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs', project_id: 'str', **kwargs) -> 'V1Deployment': # noqa: E501
|
|
148
|
-
"""
|
|
148
|
+
"""jobs_service_create_deployment # noqa: E501
|
|
149
149
|
|
|
150
150
|
This method makes a synchronous HTTP request by default. To make an
|
|
151
151
|
asynchronous HTTP request, please pass async_req=True
|
|
@@ -167,7 +167,7 @@ class JobsServiceApi(object):
|
|
|
167
167
|
return data
|
|
168
168
|
|
|
169
169
|
def jobs_service_create_deployment_with_http_info(self, body: 'CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs', project_id: 'str', **kwargs) -> 'V1Deployment': # noqa: E501
|
|
170
|
-
"""
|
|
170
|
+
"""jobs_service_create_deployment # noqa: E501
|
|
171
171
|
|
|
172
172
|
This method makes a synchronous HTTP request by default. To make an
|
|
173
173
|
asynchronous HTTP request, please pass async_req=True
|
|
@@ -2600,7 +2600,8 @@ class JobsServiceApi(object):
|
|
|
2600
2600
|
:param str cloudspace_id:
|
|
2601
2601
|
:param str user_id:
|
|
2602
2602
|
:param str deployment_id:
|
|
2603
|
-
:param
|
|
2603
|
+
:param str multi_machine_job_id:
|
|
2604
|
+
:param bool standalone: Whether to list standalone jobs, not part of a deployment or mmt.
|
|
2604
2605
|
:param str page_token:
|
|
2605
2606
|
:param int limit:
|
|
2606
2607
|
:param str state:
|
|
@@ -2628,7 +2629,8 @@ class JobsServiceApi(object):
|
|
|
2628
2629
|
:param str cloudspace_id:
|
|
2629
2630
|
:param str user_id:
|
|
2630
2631
|
:param str deployment_id:
|
|
2631
|
-
:param
|
|
2632
|
+
:param str multi_machine_job_id:
|
|
2633
|
+
:param bool standalone: Whether to list standalone jobs, not part of a deployment or mmt.
|
|
2632
2634
|
:param str page_token:
|
|
2633
2635
|
:param int limit:
|
|
2634
2636
|
:param str state:
|
|
@@ -2637,7 +2639,7 @@ class JobsServiceApi(object):
|
|
|
2637
2639
|
returns the request thread.
|
|
2638
2640
|
"""
|
|
2639
2641
|
|
|
2640
|
-
all_params = ['project_id', 'cloudspace_id', 'user_id', 'deployment_id', 'standalone', 'page_token', 'limit', 'state'] # noqa: E501
|
|
2642
|
+
all_params = ['project_id', 'cloudspace_id', 'user_id', 'deployment_id', 'multi_machine_job_id', 'standalone', 'page_token', 'limit', 'state'] # noqa: E501
|
|
2641
2643
|
all_params.append('async_req')
|
|
2642
2644
|
all_params.append('_return_http_data_only')
|
|
2643
2645
|
all_params.append('_preload_content')
|
|
@@ -2670,6 +2672,8 @@ class JobsServiceApi(object):
|
|
|
2670
2672
|
query_params.append(('userId', params['user_id'])) # noqa: E501
|
|
2671
2673
|
if 'deployment_id' in params:
|
|
2672
2674
|
query_params.append(('deploymentId', params['deployment_id'])) # noqa: E501
|
|
2675
|
+
if 'multi_machine_job_id' in params:
|
|
2676
|
+
query_params.append(('multiMachineJobId', params['multi_machine_job_id'])) # noqa: E501
|
|
2673
2677
|
if 'standalone' in params:
|
|
2674
2678
|
query_params.append(('standalone', params['standalone'])) # noqa: E501
|
|
2675
2679
|
if 'page_token' in params:
|
|
@@ -2708,6 +2712,115 @@ class JobsServiceApi(object):
|
|
|
2708
2712
|
_request_timeout=params.get('_request_timeout'),
|
|
2709
2713
|
collection_formats=collection_formats)
|
|
2710
2714
|
|
|
2715
|
+
def jobs_service_list_multi_machine_job_events(self, project_id: 'str', id: 'str', **kwargs) -> 'V1ListMultiMachineJobEventsResponse': # noqa: E501
|
|
2716
|
+
"""jobs_service_list_multi_machine_job_events # noqa: E501
|
|
2717
|
+
|
|
2718
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
2719
|
+
asynchronous HTTP request, please pass async_req=True
|
|
2720
|
+
>>> thread = api.jobs_service_list_multi_machine_job_events(project_id, id, async_req=True)
|
|
2721
|
+
>>> result = thread.get()
|
|
2722
|
+
|
|
2723
|
+
:param async_req bool
|
|
2724
|
+
:param str project_id: (required)
|
|
2725
|
+
:param str id: (required)
|
|
2726
|
+
:param str release_id:
|
|
2727
|
+
:param str limit:
|
|
2728
|
+
:return: V1ListMultiMachineJobEventsResponse
|
|
2729
|
+
If the method is called asynchronously,
|
|
2730
|
+
returns the request thread.
|
|
2731
|
+
"""
|
|
2732
|
+
kwargs['_return_http_data_only'] = True
|
|
2733
|
+
if kwargs.get('async_req'):
|
|
2734
|
+
return self.jobs_service_list_multi_machine_job_events_with_http_info(project_id, id, **kwargs) # noqa: E501
|
|
2735
|
+
else:
|
|
2736
|
+
(data) = self.jobs_service_list_multi_machine_job_events_with_http_info(project_id, id, **kwargs) # noqa: E501
|
|
2737
|
+
return data
|
|
2738
|
+
|
|
2739
|
+
def jobs_service_list_multi_machine_job_events_with_http_info(self, project_id: 'str', id: 'str', **kwargs) -> 'V1ListMultiMachineJobEventsResponse': # noqa: E501
|
|
2740
|
+
"""jobs_service_list_multi_machine_job_events # noqa: E501
|
|
2741
|
+
|
|
2742
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
2743
|
+
asynchronous HTTP request, please pass async_req=True
|
|
2744
|
+
>>> thread = api.jobs_service_list_multi_machine_job_events_with_http_info(project_id, id, async_req=True)
|
|
2745
|
+
>>> result = thread.get()
|
|
2746
|
+
|
|
2747
|
+
:param async_req bool
|
|
2748
|
+
:param str project_id: (required)
|
|
2749
|
+
:param str id: (required)
|
|
2750
|
+
:param str release_id:
|
|
2751
|
+
:param str limit:
|
|
2752
|
+
:return: V1ListMultiMachineJobEventsResponse
|
|
2753
|
+
If the method is called asynchronously,
|
|
2754
|
+
returns the request thread.
|
|
2755
|
+
"""
|
|
2756
|
+
|
|
2757
|
+
all_params = ['project_id', 'id', 'release_id', 'limit'] # noqa: E501
|
|
2758
|
+
all_params.append('async_req')
|
|
2759
|
+
all_params.append('_return_http_data_only')
|
|
2760
|
+
all_params.append('_preload_content')
|
|
2761
|
+
all_params.append('_request_timeout')
|
|
2762
|
+
|
|
2763
|
+
params = locals()
|
|
2764
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
2765
|
+
if key not in all_params:
|
|
2766
|
+
raise TypeError(
|
|
2767
|
+
"Got an unexpected keyword argument '%s'"
|
|
2768
|
+
" to method jobs_service_list_multi_machine_job_events" % key
|
|
2769
|
+
)
|
|
2770
|
+
params[key] = val
|
|
2771
|
+
del params['kwargs']
|
|
2772
|
+
# verify the required parameter 'project_id' is set
|
|
2773
|
+
if ('project_id' not in params or
|
|
2774
|
+
params['project_id'] is None):
|
|
2775
|
+
raise ValueError("Missing the required parameter `project_id` when calling `jobs_service_list_multi_machine_job_events`") # noqa: E501
|
|
2776
|
+
# verify the required parameter 'id' is set
|
|
2777
|
+
if ('id' not in params or
|
|
2778
|
+
params['id'] is None):
|
|
2779
|
+
raise ValueError("Missing the required parameter `id` when calling `jobs_service_list_multi_machine_job_events`") # noqa: E501
|
|
2780
|
+
|
|
2781
|
+
collection_formats = {}
|
|
2782
|
+
|
|
2783
|
+
path_params = {}
|
|
2784
|
+
if 'project_id' in params:
|
|
2785
|
+
path_params['projectId'] = params['project_id'] # noqa: E501
|
|
2786
|
+
if 'id' in params:
|
|
2787
|
+
path_params['id'] = params['id'] # noqa: E501
|
|
2788
|
+
|
|
2789
|
+
query_params = []
|
|
2790
|
+
if 'release_id' in params:
|
|
2791
|
+
query_params.append(('releaseId', params['release_id'])) # noqa: E501
|
|
2792
|
+
if 'limit' in params:
|
|
2793
|
+
query_params.append(('limit', params['limit'])) # noqa: E501
|
|
2794
|
+
|
|
2795
|
+
header_params = {}
|
|
2796
|
+
|
|
2797
|
+
form_params = []
|
|
2798
|
+
local_var_files = {}
|
|
2799
|
+
|
|
2800
|
+
body_params = None
|
|
2801
|
+
# HTTP header `Accept`
|
|
2802
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
2803
|
+
['application/json']) # noqa: E501
|
|
2804
|
+
|
|
2805
|
+
# Authentication setting
|
|
2806
|
+
auth_settings = [] # noqa: E501
|
|
2807
|
+
|
|
2808
|
+
return self.api_client.call_api(
|
|
2809
|
+
'/v1/projects/{projectId}/multi-machine-jobs/{id}/events', 'GET',
|
|
2810
|
+
path_params,
|
|
2811
|
+
query_params,
|
|
2812
|
+
header_params,
|
|
2813
|
+
body=body_params,
|
|
2814
|
+
post_params=form_params,
|
|
2815
|
+
files=local_var_files,
|
|
2816
|
+
response_type='V1ListMultiMachineJobEventsResponse', # noqa: E501
|
|
2817
|
+
auth_settings=auth_settings,
|
|
2818
|
+
async_req=params.get('async_req'),
|
|
2819
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
2820
|
+
_preload_content=params.get('_preload_content', True),
|
|
2821
|
+
_request_timeout=params.get('_request_timeout'),
|
|
2822
|
+
collection_formats=collection_formats)
|
|
2823
|
+
|
|
2711
2824
|
def jobs_service_list_multi_machine_jobs(self, project_id: 'str', **kwargs) -> 'V1ListMultiMachineJobsResponse': # noqa: E501
|
|
2712
2825
|
"""jobs_service_list_multi_machine_jobs # noqa: E501
|
|
2713
2826
|
|
|
@@ -3611,3 +3724,100 @@ class JobsServiceApi(object):
|
|
|
3611
3724
|
_preload_content=params.get('_preload_content', True),
|
|
3612
3725
|
_request_timeout=params.get('_request_timeout'),
|
|
3613
3726
|
collection_formats=collection_formats)
|
|
3727
|
+
|
|
3728
|
+
def jobs_service_validate_deployment_image(self, body: 'V1ValidateDeploymentImageRequest', **kwargs) -> 'V1ValidateDeploymentImageResponse': # noqa: E501
|
|
3729
|
+
"""Job deployments # noqa: E501
|
|
3730
|
+
|
|
3731
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
3732
|
+
asynchronous HTTP request, please pass async_req=True
|
|
3733
|
+
>>> thread = api.jobs_service_validate_deployment_image(body, async_req=True)
|
|
3734
|
+
>>> result = thread.get()
|
|
3735
|
+
|
|
3736
|
+
:param async_req bool
|
|
3737
|
+
:param V1ValidateDeploymentImageRequest body: (required)
|
|
3738
|
+
:return: V1ValidateDeploymentImageResponse
|
|
3739
|
+
If the method is called asynchronously,
|
|
3740
|
+
returns the request thread.
|
|
3741
|
+
"""
|
|
3742
|
+
kwargs['_return_http_data_only'] = True
|
|
3743
|
+
if kwargs.get('async_req'):
|
|
3744
|
+
return self.jobs_service_validate_deployment_image_with_http_info(body, **kwargs) # noqa: E501
|
|
3745
|
+
else:
|
|
3746
|
+
(data) = self.jobs_service_validate_deployment_image_with_http_info(body, **kwargs) # noqa: E501
|
|
3747
|
+
return data
|
|
3748
|
+
|
|
3749
|
+
def jobs_service_validate_deployment_image_with_http_info(self, body: 'V1ValidateDeploymentImageRequest', **kwargs) -> 'V1ValidateDeploymentImageResponse': # noqa: E501
|
|
3750
|
+
"""Job deployments # noqa: E501
|
|
3751
|
+
|
|
3752
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
3753
|
+
asynchronous HTTP request, please pass async_req=True
|
|
3754
|
+
>>> thread = api.jobs_service_validate_deployment_image_with_http_info(body, async_req=True)
|
|
3755
|
+
>>> result = thread.get()
|
|
3756
|
+
|
|
3757
|
+
:param async_req bool
|
|
3758
|
+
:param V1ValidateDeploymentImageRequest body: (required)
|
|
3759
|
+
:return: V1ValidateDeploymentImageResponse
|
|
3760
|
+
If the method is called asynchronously,
|
|
3761
|
+
returns the request thread.
|
|
3762
|
+
"""
|
|
3763
|
+
|
|
3764
|
+
all_params = ['body'] # noqa: E501
|
|
3765
|
+
all_params.append('async_req')
|
|
3766
|
+
all_params.append('_return_http_data_only')
|
|
3767
|
+
all_params.append('_preload_content')
|
|
3768
|
+
all_params.append('_request_timeout')
|
|
3769
|
+
|
|
3770
|
+
params = locals()
|
|
3771
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
3772
|
+
if key not in all_params:
|
|
3773
|
+
raise TypeError(
|
|
3774
|
+
"Got an unexpected keyword argument '%s'"
|
|
3775
|
+
" to method jobs_service_validate_deployment_image" % key
|
|
3776
|
+
)
|
|
3777
|
+
params[key] = val
|
|
3778
|
+
del params['kwargs']
|
|
3779
|
+
# verify the required parameter 'body' is set
|
|
3780
|
+
if ('body' not in params or
|
|
3781
|
+
params['body'] is None):
|
|
3782
|
+
raise ValueError("Missing the required parameter `body` when calling `jobs_service_validate_deployment_image`") # noqa: E501
|
|
3783
|
+
|
|
3784
|
+
collection_formats = {}
|
|
3785
|
+
|
|
3786
|
+
path_params = {}
|
|
3787
|
+
|
|
3788
|
+
query_params = []
|
|
3789
|
+
|
|
3790
|
+
header_params = {}
|
|
3791
|
+
|
|
3792
|
+
form_params = []
|
|
3793
|
+
local_var_files = {}
|
|
3794
|
+
|
|
3795
|
+
body_params = None
|
|
3796
|
+
if 'body' in params:
|
|
3797
|
+
body_params = params['body']
|
|
3798
|
+
# HTTP header `Accept`
|
|
3799
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
3800
|
+
['application/json']) # noqa: E501
|
|
3801
|
+
|
|
3802
|
+
# HTTP header `Content-Type`
|
|
3803
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
3804
|
+
['application/json']) # noqa: E501
|
|
3805
|
+
|
|
3806
|
+
# Authentication setting
|
|
3807
|
+
auth_settings = [] # noqa: E501
|
|
3808
|
+
|
|
3809
|
+
return self.api_client.call_api(
|
|
3810
|
+
'/v1/deployments/validate', 'POST',
|
|
3811
|
+
path_params,
|
|
3812
|
+
query_params,
|
|
3813
|
+
header_params,
|
|
3814
|
+
body=body_params,
|
|
3815
|
+
post_params=form_params,
|
|
3816
|
+
files=local_var_files,
|
|
3817
|
+
response_type='V1ValidateDeploymentImageResponse', # noqa: E501
|
|
3818
|
+
auth_settings=auth_settings,
|
|
3819
|
+
async_req=params.get('async_req'),
|
|
3820
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
3821
|
+
_preload_content=params.get('_preload_content', True),
|
|
3822
|
+
_request_timeout=params.get('_request_timeout'),
|
|
3823
|
+
collection_formats=collection_formats)
|