lightning-sdk 2025.10.14__py3-none-any.whl → 2025.10.22__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 +6 -3
- lightning_sdk/api/base_studio_api.py +13 -9
- lightning_sdk/api/license_api.py +26 -59
- lightning_sdk/api/studio_api.py +7 -2
- lightning_sdk/base_studio.py +30 -17
- lightning_sdk/cli/base_studio/list.py +1 -3
- lightning_sdk/cli/entrypoint.py +8 -34
- lightning_sdk/cli/studio/connect.py +42 -92
- lightning_sdk/cli/studio/create.py +23 -1
- lightning_sdk/cli/studio/start.py +12 -2
- lightning_sdk/cli/utils/get_base_studio.py +24 -0
- lightning_sdk/cli/utils/handle_machine_and_gpus_args.py +71 -0
- lightning_sdk/cli/utils/logging.py +121 -0
- lightning_sdk/cli/utils/ssh_connection.py +1 -1
- lightning_sdk/constants.py +1 -0
- lightning_sdk/helpers.py +53 -34
- lightning_sdk/lightning_cloud/login.py +260 -10
- lightning_sdk/lightning_cloud/openapi/__init__.py +10 -3
- lightning_sdk/lightning_cloud/openapi/api/auth_service_api.py +97 -0
- lightning_sdk/lightning_cloud/openapi/api/product_license_service_api.py +108 -108
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +10 -3
- lightning_sdk/lightning_cloud/openapi/models/create_machine_request_represents_the_request_to_create_a_machine.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/externalv1_cloud_space_instance_status.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/id_fork_body1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/license_key_validate_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_create_license_request.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_license_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_external_cluster_spec.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_cloud_space_transfer_estimate_response.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_incident.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_incident_detail.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_incident_event.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_license.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_list_product_licenses_response.py → v1_list_license_response.py} +16 -16
- lightning_sdk/lightning_cloud/openapi/models/v1_machine.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_slack_notifier.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_token_login_request.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_token_login_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_token_owner_type.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +53 -79
- lightning_sdk/lightning_cloud/openapi/models/{v1_product_license_check_response.py → v1_validate_license_response.py} +21 -21
- lightning_sdk/lightning_cloud/rest_client.py +48 -45
- lightning_sdk/machine.py +2 -0
- lightning_sdk/studio.py +14 -2
- lightning_sdk/utils/license.py +13 -0
- {lightning_sdk-2025.10.14.dist-info → lightning_sdk-2025.10.22.dist-info}/METADATA +1 -1
- {lightning_sdk-2025.10.14.dist-info → lightning_sdk-2025.10.22.dist-info}/RECORD +51 -41
- lightning_sdk/lightning_cloud/openapi/models/v1_product_license.py +0 -435
- lightning_sdk/services/license.py +0 -363
- {lightning_sdk-2025.10.14.dist-info → lightning_sdk-2025.10.22.dist-info}/LICENSE +0 -0
- {lightning_sdk-2025.10.14.dist-info → lightning_sdk-2025.10.22.dist-info}/WHEEL +0 -0
- {lightning_sdk-2025.10.14.dist-info → lightning_sdk-2025.10.22.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-2025.10.14.dist-info → lightning_sdk-2025.10.22.dist-info}/top_level.txt +0 -0
|
@@ -45,7 +45,6 @@ class V1UserFeatures(object):
|
|
|
45
45
|
'agents_v2': 'bool',
|
|
46
46
|
'ai_hub_monetization': 'bool',
|
|
47
47
|
'auto_fast_load': 'bool',
|
|
48
|
-
'auto_join_orgs': 'bool',
|
|
49
48
|
'b2c_experience': 'bool',
|
|
50
49
|
'byo_machine_type': 'bool',
|
|
51
50
|
'cap_add': 'list[str]',
|
|
@@ -87,10 +86,11 @@ class V1UserFeatures(object):
|
|
|
87
86
|
'f262': 'bool',
|
|
88
87
|
'f263': 'bool',
|
|
89
88
|
'f264': 'bool',
|
|
89
|
+
'f265': 'bool',
|
|
90
|
+
'f266': 'bool',
|
|
90
91
|
'fair_share': 'bool',
|
|
91
92
|
'featured_studios_admin': 'bool',
|
|
92
93
|
'gcs_connections_optimized': 'bool',
|
|
93
|
-
'instant_capacity_reservation': 'bool',
|
|
94
94
|
'job_artifacts_v2': 'bool',
|
|
95
95
|
'kubernetes_cluster_ui': 'bool',
|
|
96
96
|
'kubernetes_clusters': 'bool',
|
|
@@ -127,7 +127,6 @@ class V1UserFeatures(object):
|
|
|
127
127
|
'studio_config': 'bool',
|
|
128
128
|
'studio_sharing_v2': 'bool',
|
|
129
129
|
'studio_version_visibility': 'bool',
|
|
130
|
-
'trainium2': 'bool',
|
|
131
130
|
'vultr': 'bool',
|
|
132
131
|
'weka': 'bool',
|
|
133
132
|
'writable_s3_connections': 'bool'
|
|
@@ -138,7 +137,6 @@ class V1UserFeatures(object):
|
|
|
138
137
|
'agents_v2': 'agentsV2',
|
|
139
138
|
'ai_hub_monetization': 'aiHubMonetization',
|
|
140
139
|
'auto_fast_load': 'autoFastLoad',
|
|
141
|
-
'auto_join_orgs': 'autoJoinOrgs',
|
|
142
140
|
'b2c_experience': 'b2cExperience',
|
|
143
141
|
'byo_machine_type': 'byoMachineType',
|
|
144
142
|
'cap_add': 'capAdd',
|
|
@@ -180,10 +178,11 @@ class V1UserFeatures(object):
|
|
|
180
178
|
'f262': 'f262',
|
|
181
179
|
'f263': 'f263',
|
|
182
180
|
'f264': 'f264',
|
|
181
|
+
'f265': 'f265',
|
|
182
|
+
'f266': 'f266',
|
|
183
183
|
'fair_share': 'fairShare',
|
|
184
184
|
'featured_studios_admin': 'featuredStudiosAdmin',
|
|
185
185
|
'gcs_connections_optimized': 'gcsConnectionsOptimized',
|
|
186
|
-
'instant_capacity_reservation': 'instantCapacityReservation',
|
|
187
186
|
'job_artifacts_v2': 'jobArtifactsV2',
|
|
188
187
|
'kubernetes_cluster_ui': 'kubernetesClusterUi',
|
|
189
188
|
'kubernetes_clusters': 'kubernetesClusters',
|
|
@@ -220,19 +219,17 @@ class V1UserFeatures(object):
|
|
|
220
219
|
'studio_config': 'studioConfig',
|
|
221
220
|
'studio_sharing_v2': 'studioSharingV2',
|
|
222
221
|
'studio_version_visibility': 'studioVersionVisibility',
|
|
223
|
-
'trainium2': 'trainium2',
|
|
224
222
|
'vultr': 'vultr',
|
|
225
223
|
'weka': 'weka',
|
|
226
224
|
'writable_s3_connections': 'writableS3Connections'
|
|
227
225
|
}
|
|
228
226
|
|
|
229
|
-
def __init__(self, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None,
|
|
227
|
+
def __init__(self, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, b2c_experience: 'bool' =None, byo_machine_type: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: 'bool' =None, chat_models: 'bool' =None, cloudspace_schedules: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, control_center_monitoring: 'bool' =None, cost_attribution_settings: 'bool' =None, custom_app_domain: 'bool' =None, datasets: 'bool' =None, default_one_cluster: 'bool' =None, deployment_persistent_disk: 'bool' =None, drive_v2: 'bool' =None, enterprise_compute_admin: 'bool' =None, f227: 'bool' =None, f234: 'bool' =None, f236: 'bool' =None, f239: 'bool' =None, f240: 'bool' =None, f241: 'bool' =None, f243: 'bool' =None, f245: 'bool' =None, f247: 'bool' =None, f248: 'bool' =None, f250: 'bool' =None, f252: 'bool' =None, f253: 'bool' =None, f254: 'bool' =None, f255: 'bool' =None, f257: 'bool' =None, f258: 'bool' =None, f259: 'bool' =None, f260: 'bool' =None, f261: 'bool' =None, f262: 'bool' =None, f263: 'bool' =None, f264: 'bool' =None, f265: 'bool' =None, f266: 'bool' =None, fair_share: 'bool' =None, featured_studios_admin: 'bool' =None, gcs_connections_optimized: 'bool' =None, job_artifacts_v2: 'bool' =None, kubernetes_cluster_ui: 'bool' =None, kubernetes_clusters: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, marketplace: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, model_api_dashboard: 'bool' =None, multiple_studio_versions: 'bool' =None, nerf_fs_nonpaying: 'bool' =None, org_level_member_permissions: 'bool' =None, org_usage_limits: 'bool' =None, persistent_disk: 'bool' =None, plugin_distributed: 'bool' =None, plugin_inference: 'bool' =None, plugin_label_studio: 'bool' =None, plugin_langflow: 'bool' =None, plugin_python_profiler: 'bool' =None, plugin_sweeps: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, product_license: 'bool' =None, project_selector: 'bool' =None, publish_pipelines: 'bool' =None, reserved_machines_tab: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, security_docs: 'bool' =None, show_dev_admin: 'bool' =None, slurm: 'bool' =None, specialised_studios: 'bool' =None, storage_overuse_deletion: 'bool' =None, studio_config: 'bool' =None, studio_sharing_v2: 'bool' =None, studio_version_visibility: 'bool' =None, vultr: 'bool' =None, weka: 'bool' =None, writable_s3_connections: 'bool' =None): # noqa: E501
|
|
230
228
|
"""V1UserFeatures - a model defined in Swagger""" # noqa: E501
|
|
231
229
|
self._affiliate_links = None
|
|
232
230
|
self._agents_v2 = None
|
|
233
231
|
self._ai_hub_monetization = None
|
|
234
232
|
self._auto_fast_load = None
|
|
235
|
-
self._auto_join_orgs = None
|
|
236
233
|
self._b2c_experience = None
|
|
237
234
|
self._byo_machine_type = None
|
|
238
235
|
self._cap_add = None
|
|
@@ -274,10 +271,11 @@ class V1UserFeatures(object):
|
|
|
274
271
|
self._f262 = None
|
|
275
272
|
self._f263 = None
|
|
276
273
|
self._f264 = None
|
|
274
|
+
self._f265 = None
|
|
275
|
+
self._f266 = None
|
|
277
276
|
self._fair_share = None
|
|
278
277
|
self._featured_studios_admin = None
|
|
279
278
|
self._gcs_connections_optimized = None
|
|
280
|
-
self._instant_capacity_reservation = None
|
|
281
279
|
self._job_artifacts_v2 = None
|
|
282
280
|
self._kubernetes_cluster_ui = None
|
|
283
281
|
self._kubernetes_clusters = None
|
|
@@ -314,7 +312,6 @@ class V1UserFeatures(object):
|
|
|
314
312
|
self._studio_config = None
|
|
315
313
|
self._studio_sharing_v2 = None
|
|
316
314
|
self._studio_version_visibility = None
|
|
317
|
-
self._trainium2 = None
|
|
318
315
|
self._vultr = None
|
|
319
316
|
self._weka = None
|
|
320
317
|
self._writable_s3_connections = None
|
|
@@ -327,8 +324,6 @@ class V1UserFeatures(object):
|
|
|
327
324
|
self.ai_hub_monetization = ai_hub_monetization
|
|
328
325
|
if auto_fast_load is not None:
|
|
329
326
|
self.auto_fast_load = auto_fast_load
|
|
330
|
-
if auto_join_orgs is not None:
|
|
331
|
-
self.auto_join_orgs = auto_join_orgs
|
|
332
327
|
if b2c_experience is not None:
|
|
333
328
|
self.b2c_experience = b2c_experience
|
|
334
329
|
if byo_machine_type is not None:
|
|
@@ -411,14 +406,16 @@ class V1UserFeatures(object):
|
|
|
411
406
|
self.f263 = f263
|
|
412
407
|
if f264 is not None:
|
|
413
408
|
self.f264 = f264
|
|
409
|
+
if f265 is not None:
|
|
410
|
+
self.f265 = f265
|
|
411
|
+
if f266 is not None:
|
|
412
|
+
self.f266 = f266
|
|
414
413
|
if fair_share is not None:
|
|
415
414
|
self.fair_share = fair_share
|
|
416
415
|
if featured_studios_admin is not None:
|
|
417
416
|
self.featured_studios_admin = featured_studios_admin
|
|
418
417
|
if gcs_connections_optimized is not None:
|
|
419
418
|
self.gcs_connections_optimized = gcs_connections_optimized
|
|
420
|
-
if instant_capacity_reservation is not None:
|
|
421
|
-
self.instant_capacity_reservation = instant_capacity_reservation
|
|
422
419
|
if job_artifacts_v2 is not None:
|
|
423
420
|
self.job_artifacts_v2 = job_artifacts_v2
|
|
424
421
|
if kubernetes_cluster_ui is not None:
|
|
@@ -491,8 +488,6 @@ class V1UserFeatures(object):
|
|
|
491
488
|
self.studio_sharing_v2 = studio_sharing_v2
|
|
492
489
|
if studio_version_visibility is not None:
|
|
493
490
|
self.studio_version_visibility = studio_version_visibility
|
|
494
|
-
if trainium2 is not None:
|
|
495
|
-
self.trainium2 = trainium2
|
|
496
491
|
if vultr is not None:
|
|
497
492
|
self.vultr = vultr
|
|
498
493
|
if weka is not None:
|
|
@@ -584,27 +579,6 @@ class V1UserFeatures(object):
|
|
|
584
579
|
|
|
585
580
|
self._auto_fast_load = auto_fast_load
|
|
586
581
|
|
|
587
|
-
@property
|
|
588
|
-
def auto_join_orgs(self) -> 'bool':
|
|
589
|
-
"""Gets the auto_join_orgs of this V1UserFeatures. # noqa: E501
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
:return: The auto_join_orgs of this V1UserFeatures. # noqa: E501
|
|
593
|
-
:rtype: bool
|
|
594
|
-
"""
|
|
595
|
-
return self._auto_join_orgs
|
|
596
|
-
|
|
597
|
-
@auto_join_orgs.setter
|
|
598
|
-
def auto_join_orgs(self, auto_join_orgs: 'bool'):
|
|
599
|
-
"""Sets the auto_join_orgs of this V1UserFeatures.
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
:param auto_join_orgs: The auto_join_orgs of this V1UserFeatures. # noqa: E501
|
|
603
|
-
:type: bool
|
|
604
|
-
"""
|
|
605
|
-
|
|
606
|
-
self._auto_join_orgs = auto_join_orgs
|
|
607
|
-
|
|
608
582
|
@property
|
|
609
583
|
def b2c_experience(self) -> 'bool':
|
|
610
584
|
"""Gets the b2c_experience of this V1UserFeatures. # noqa: E501
|
|
@@ -1466,6 +1440,48 @@ class V1UserFeatures(object):
|
|
|
1466
1440
|
|
|
1467
1441
|
self._f264 = f264
|
|
1468
1442
|
|
|
1443
|
+
@property
|
|
1444
|
+
def f265(self) -> 'bool':
|
|
1445
|
+
"""Gets the f265 of this V1UserFeatures. # noqa: E501
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
:return: The f265 of this V1UserFeatures. # noqa: E501
|
|
1449
|
+
:rtype: bool
|
|
1450
|
+
"""
|
|
1451
|
+
return self._f265
|
|
1452
|
+
|
|
1453
|
+
@f265.setter
|
|
1454
|
+
def f265(self, f265: 'bool'):
|
|
1455
|
+
"""Sets the f265 of this V1UserFeatures.
|
|
1456
|
+
|
|
1457
|
+
|
|
1458
|
+
:param f265: The f265 of this V1UserFeatures. # noqa: E501
|
|
1459
|
+
:type: bool
|
|
1460
|
+
"""
|
|
1461
|
+
|
|
1462
|
+
self._f265 = f265
|
|
1463
|
+
|
|
1464
|
+
@property
|
|
1465
|
+
def f266(self) -> 'bool':
|
|
1466
|
+
"""Gets the f266 of this V1UserFeatures. # noqa: E501
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
:return: The f266 of this V1UserFeatures. # noqa: E501
|
|
1470
|
+
:rtype: bool
|
|
1471
|
+
"""
|
|
1472
|
+
return self._f266
|
|
1473
|
+
|
|
1474
|
+
@f266.setter
|
|
1475
|
+
def f266(self, f266: 'bool'):
|
|
1476
|
+
"""Sets the f266 of this V1UserFeatures.
|
|
1477
|
+
|
|
1478
|
+
|
|
1479
|
+
:param f266: The f266 of this V1UserFeatures. # noqa: E501
|
|
1480
|
+
:type: bool
|
|
1481
|
+
"""
|
|
1482
|
+
|
|
1483
|
+
self._f266 = f266
|
|
1484
|
+
|
|
1469
1485
|
@property
|
|
1470
1486
|
def fair_share(self) -> 'bool':
|
|
1471
1487
|
"""Gets the fair_share of this V1UserFeatures. # noqa: E501
|
|
@@ -1529,27 +1545,6 @@ class V1UserFeatures(object):
|
|
|
1529
1545
|
|
|
1530
1546
|
self._gcs_connections_optimized = gcs_connections_optimized
|
|
1531
1547
|
|
|
1532
|
-
@property
|
|
1533
|
-
def instant_capacity_reservation(self) -> 'bool':
|
|
1534
|
-
"""Gets the instant_capacity_reservation of this V1UserFeatures. # noqa: E501
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
:return: The instant_capacity_reservation of this V1UserFeatures. # noqa: E501
|
|
1538
|
-
:rtype: bool
|
|
1539
|
-
"""
|
|
1540
|
-
return self._instant_capacity_reservation
|
|
1541
|
-
|
|
1542
|
-
@instant_capacity_reservation.setter
|
|
1543
|
-
def instant_capacity_reservation(self, instant_capacity_reservation: 'bool'):
|
|
1544
|
-
"""Sets the instant_capacity_reservation of this V1UserFeatures.
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
:param instant_capacity_reservation: The instant_capacity_reservation of this V1UserFeatures. # noqa: E501
|
|
1548
|
-
:type: bool
|
|
1549
|
-
"""
|
|
1550
|
-
|
|
1551
|
-
self._instant_capacity_reservation = instant_capacity_reservation
|
|
1552
|
-
|
|
1553
1548
|
@property
|
|
1554
1549
|
def job_artifacts_v2(self) -> 'bool':
|
|
1555
1550
|
"""Gets the job_artifacts_v2 of this V1UserFeatures. # noqa: E501
|
|
@@ -2306,27 +2301,6 @@ class V1UserFeatures(object):
|
|
|
2306
2301
|
|
|
2307
2302
|
self._studio_version_visibility = studio_version_visibility
|
|
2308
2303
|
|
|
2309
|
-
@property
|
|
2310
|
-
def trainium2(self) -> 'bool':
|
|
2311
|
-
"""Gets the trainium2 of this V1UserFeatures. # noqa: E501
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
:return: The trainium2 of this V1UserFeatures. # noqa: E501
|
|
2315
|
-
:rtype: bool
|
|
2316
|
-
"""
|
|
2317
|
-
return self._trainium2
|
|
2318
|
-
|
|
2319
|
-
@trainium2.setter
|
|
2320
|
-
def trainium2(self, trainium2: 'bool'):
|
|
2321
|
-
"""Sets the trainium2 of this V1UserFeatures.
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
:param trainium2: The trainium2 of this V1UserFeatures. # noqa: E501
|
|
2325
|
-
:type: bool
|
|
2326
|
-
"""
|
|
2327
|
-
|
|
2328
|
-
self._trainium2 = trainium2
|
|
2329
|
-
|
|
2330
2304
|
@property
|
|
2331
2305
|
def vultr(self) -> 'bool':
|
|
2332
2306
|
"""Gets the vultr of this V1UserFeatures. # noqa: E501
|
|
@@ -28,7 +28,7 @@ if TYPE_CHECKING:
|
|
|
28
28
|
from datetime import datetime
|
|
29
29
|
from lightning_sdk.lightning_cloud.openapi.models import *
|
|
30
30
|
|
|
31
|
-
class
|
|
31
|
+
class V1ValidateLicenseResponse(object):
|
|
32
32
|
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
33
33
|
|
|
34
34
|
Do not edit the class manually.
|
|
@@ -41,40 +41,40 @@ class V1ProductLicenseCheckResponse(object):
|
|
|
41
41
|
and the value is json key in definition.
|
|
42
42
|
"""
|
|
43
43
|
swagger_types = {
|
|
44
|
-
'
|
|
44
|
+
'is_valid': 'bool'
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
attribute_map = {
|
|
48
|
-
'
|
|
48
|
+
'is_valid': 'isValid'
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
def __init__(self,
|
|
52
|
-
"""
|
|
53
|
-
self.
|
|
51
|
+
def __init__(self, is_valid: 'bool' =None): # noqa: E501
|
|
52
|
+
"""V1ValidateLicenseResponse - a model defined in Swagger""" # noqa: E501
|
|
53
|
+
self._is_valid = None
|
|
54
54
|
self.discriminator = None
|
|
55
|
-
if
|
|
56
|
-
self.
|
|
55
|
+
if is_valid is not None:
|
|
56
|
+
self.is_valid = is_valid
|
|
57
57
|
|
|
58
58
|
@property
|
|
59
|
-
def
|
|
60
|
-
"""Gets the
|
|
59
|
+
def is_valid(self) -> 'bool':
|
|
60
|
+
"""Gets the is_valid of this V1ValidateLicenseResponse. # noqa: E501
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
:return: The
|
|
63
|
+
:return: The is_valid of this V1ValidateLicenseResponse. # noqa: E501
|
|
64
64
|
:rtype: bool
|
|
65
65
|
"""
|
|
66
|
-
return self.
|
|
66
|
+
return self._is_valid
|
|
67
67
|
|
|
68
|
-
@
|
|
69
|
-
def
|
|
70
|
-
"""Sets the
|
|
68
|
+
@is_valid.setter
|
|
69
|
+
def is_valid(self, is_valid: 'bool'):
|
|
70
|
+
"""Sets the is_valid of this V1ValidateLicenseResponse.
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
:param
|
|
73
|
+
:param is_valid: The is_valid of this V1ValidateLicenseResponse. # noqa: E501
|
|
74
74
|
:type: bool
|
|
75
75
|
"""
|
|
76
76
|
|
|
77
|
-
self.
|
|
77
|
+
self._is_valid = is_valid
|
|
78
78
|
|
|
79
79
|
def to_dict(self) -> dict:
|
|
80
80
|
"""Returns the model properties as a dict"""
|
|
@@ -97,7 +97,7 @@ class V1ProductLicenseCheckResponse(object):
|
|
|
97
97
|
))
|
|
98
98
|
else:
|
|
99
99
|
result[attr] = value
|
|
100
|
-
if issubclass(
|
|
100
|
+
if issubclass(V1ValidateLicenseResponse, dict):
|
|
101
101
|
for key, value in self.items():
|
|
102
102
|
result[key] = value
|
|
103
103
|
|
|
@@ -111,13 +111,13 @@ class V1ProductLicenseCheckResponse(object):
|
|
|
111
111
|
"""For `print` and `pprint`"""
|
|
112
112
|
return self.to_str()
|
|
113
113
|
|
|
114
|
-
def __eq__(self, other: '
|
|
114
|
+
def __eq__(self, other: 'V1ValidateLicenseResponse') -> bool:
|
|
115
115
|
"""Returns true if both objects are equal"""
|
|
116
|
-
if not isinstance(other,
|
|
116
|
+
if not isinstance(other, V1ValidateLicenseResponse):
|
|
117
117
|
return False
|
|
118
118
|
|
|
119
119
|
return self.__dict__ == other.__dict__
|
|
120
120
|
|
|
121
|
-
def __ne__(self, other: '
|
|
121
|
+
def __ne__(self, other: 'V1ValidateLicenseResponse') -> bool:
|
|
122
122
|
"""Returns true if both objects are not equal"""
|
|
123
123
|
return not self == other
|
|
@@ -2,41 +2,43 @@ import functools
|
|
|
2
2
|
import logging
|
|
3
3
|
import time
|
|
4
4
|
from functools import wraps
|
|
5
|
-
from typing import Callable, Optional
|
|
5
|
+
from typing import Any, Callable, Optional
|
|
6
6
|
|
|
7
7
|
import urllib3
|
|
8
|
+
|
|
8
9
|
from lightning_sdk.lightning_cloud import env
|
|
9
10
|
from lightning_sdk.lightning_cloud.login import Auth
|
|
10
11
|
from lightning_sdk.lightning_cloud.openapi import (
|
|
11
12
|
ApiClient,
|
|
13
|
+
AssistantsServiceApi,
|
|
12
14
|
AuthServiceApi,
|
|
15
|
+
BillingServiceApi,
|
|
16
|
+
CloudSpaceEnvironmentTemplateServiceApi,
|
|
13
17
|
CloudSpaceServiceApi,
|
|
14
18
|
ClusterServiceApi,
|
|
15
19
|
Configuration,
|
|
16
20
|
DataConnectionServiceApi,
|
|
21
|
+
DatasetServiceApi,
|
|
22
|
+
DeploymentTemplatesServiceApi,
|
|
23
|
+
EndpointServiceApi,
|
|
24
|
+
JobsServiceApi,
|
|
17
25
|
LightningappInstanceServiceApi,
|
|
18
26
|
LightningappV2ServiceApi,
|
|
19
27
|
LightningworkServiceApi,
|
|
20
|
-
ProjectsServiceApi,
|
|
21
|
-
SecretServiceApi,
|
|
22
|
-
SSHPublicKeyServiceApi,
|
|
23
|
-
DatasetServiceApi,
|
|
24
|
-
OrganizationsServiceApi,
|
|
25
|
-
UserServiceApi,
|
|
26
|
-
BillingServiceApi,
|
|
27
|
-
EndpointServiceApi,
|
|
28
|
-
SlurmJobsUserServiceApi,
|
|
29
28
|
LitLoggerServiceApi,
|
|
30
|
-
JobsServiceApi,
|
|
31
|
-
AssistantsServiceApi,
|
|
32
|
-
StorageServiceApi,
|
|
33
|
-
DeploymentTemplatesServiceApi,
|
|
34
|
-
ModelsStoreApi,
|
|
35
29
|
LitRegistryServiceApi,
|
|
30
|
+
ModelsStoreApi,
|
|
31
|
+
OrganizationsServiceApi,
|
|
36
32
|
PipelinesServiceApi,
|
|
37
|
-
SchedulesServiceApi,
|
|
38
33
|
ProductLicenseServiceApi,
|
|
39
|
-
|
|
34
|
+
ProjectsServiceApi,
|
|
35
|
+
SchedulesServiceApi,
|
|
36
|
+
SDKCommandHistoryServiceApi,
|
|
37
|
+
SecretServiceApi,
|
|
38
|
+
SlurmJobsUserServiceApi,
|
|
39
|
+
SSHPublicKeyServiceApi,
|
|
40
|
+
StorageServiceApi,
|
|
41
|
+
UserServiceApi,
|
|
40
42
|
)
|
|
41
43
|
from lightning_sdk.lightning_cloud.openapi.rest import ApiException
|
|
42
44
|
from lightning_sdk.lightning_cloud.source_code.logs_socket_api import LightningLogsSocketAPI
|
|
@@ -76,34 +78,35 @@ def create_swagger_client(check_context: bool = True, with_auth: bool = True):
|
|
|
76
78
|
|
|
77
79
|
|
|
78
80
|
class GridRestClient(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
81
|
+
LightningLogsSocketAPI,
|
|
82
|
+
LightningappInstanceServiceApi,
|
|
83
|
+
LightningappV2ServiceApi,
|
|
84
|
+
AuthServiceApi,
|
|
85
|
+
CloudSpaceServiceApi,
|
|
86
|
+
ClusterServiceApi,
|
|
87
|
+
ProjectsServiceApi,
|
|
88
|
+
LightningworkServiceApi,
|
|
89
|
+
SecretServiceApi,
|
|
90
|
+
SSHPublicKeyServiceApi,
|
|
91
|
+
DataConnectionServiceApi,
|
|
92
|
+
DatasetServiceApi,
|
|
93
|
+
OrganizationsServiceApi,
|
|
94
|
+
UserServiceApi,
|
|
95
|
+
BillingServiceApi,
|
|
96
|
+
EndpointServiceApi,
|
|
97
|
+
SlurmJobsUserServiceApi,
|
|
98
|
+
LitLoggerServiceApi,
|
|
99
|
+
JobsServiceApi,
|
|
100
|
+
AssistantsServiceApi,
|
|
101
|
+
StorageServiceApi,
|
|
102
|
+
DeploymentTemplatesServiceApi,
|
|
103
|
+
ModelsStoreApi,
|
|
104
|
+
LitRegistryServiceApi,
|
|
105
|
+
PipelinesServiceApi,
|
|
106
|
+
SchedulesServiceApi,
|
|
107
|
+
ProductLicenseServiceApi,
|
|
108
|
+
CloudSpaceEnvironmentTemplateServiceApi,
|
|
109
|
+
SDKCommandHistoryServiceApi,
|
|
107
110
|
):
|
|
108
111
|
|
|
109
112
|
def __init__(self, api_client: Optional[ApiClient] = None, with_auth: bool = True):
|
lightning_sdk/machine.py
CHANGED
|
@@ -34,6 +34,7 @@ class Machine:
|
|
|
34
34
|
|
|
35
35
|
# supported GPU types
|
|
36
36
|
# supported T4 variations
|
|
37
|
+
T4_SMALL: ClassVar["Machine"]
|
|
37
38
|
T4: ClassVar["Machine"]
|
|
38
39
|
T4_X_2: ClassVar["Machine"]
|
|
39
40
|
T4_X_4: ClassVar["Machine"]
|
|
@@ -162,6 +163,7 @@ Machine.DATA_PREP_ULTRA = Machine(
|
|
|
162
163
|
|
|
163
164
|
# GPU machines
|
|
164
165
|
# available T4 machines
|
|
166
|
+
Machine.T4_SMALL = Machine(name="T4_SMALL", slug="lit-t4-1-small", family="T4", accelerator_count=1)
|
|
165
167
|
Machine.T4 = Machine(name="T4", slug="lit-t4-1", family="T4", accelerator_count=1)
|
|
166
168
|
Machine.T4_X_2 = Machine(name="T4_X_2", slug="lit-t4-2", family="T4", accelerator_count=2)
|
|
167
169
|
Machine.T4_X_4 = Machine(name="T4_X_4", slug="lit-t4-4", family="T4", accelerator_count=4)
|
lightning_sdk/studio.py
CHANGED
|
@@ -119,7 +119,7 @@ class Studio:
|
|
|
119
119
|
|
|
120
120
|
self._studio_type = None
|
|
121
121
|
if studio_type:
|
|
122
|
-
self._base_studio = BaseStudio()
|
|
122
|
+
self._base_studio = BaseStudio(teamspace=self._teamspace)
|
|
123
123
|
self._available_base_studios = self._base_studio.list()
|
|
124
124
|
for bst in self._available_base_studios:
|
|
125
125
|
if (
|
|
@@ -353,7 +353,10 @@ class Studio:
|
|
|
353
353
|
self._studio_api.delete_studio(self._studio.id, self._teamspace.id)
|
|
354
354
|
|
|
355
355
|
def duplicate(
|
|
356
|
-
self,
|
|
356
|
+
self,
|
|
357
|
+
target_teamspace: Optional[Union["Teamspace", str]] = None,
|
|
358
|
+
machine: Machine = Machine.CPU,
|
|
359
|
+
name: Optional[str] = None,
|
|
357
360
|
) -> "Studio":
|
|
358
361
|
"""Duplicates the existing Studio.
|
|
359
362
|
|
|
@@ -386,6 +389,7 @@ class Studio:
|
|
|
386
389
|
teamspace_id=self._teamspace.id,
|
|
387
390
|
target_teamspace_id=target_teamspace_id,
|
|
388
391
|
machine=machine,
|
|
392
|
+
new_name=name,
|
|
389
393
|
)
|
|
390
394
|
return Studio(**kwargs)
|
|
391
395
|
|
|
@@ -659,6 +663,14 @@ class Studio:
|
|
|
659
663
|
self._assistant_id = assistant.id
|
|
660
664
|
_logger.info(assistant_info)
|
|
661
665
|
|
|
666
|
+
def rename(self, new_name: str) -> None:
|
|
667
|
+
"""Renames the current Studio to the provided new name."""
|
|
668
|
+
if new_name == self._studio.name:
|
|
669
|
+
return
|
|
670
|
+
|
|
671
|
+
self._studio_api._update_cloudspace(self._studio, self._teamspace.id, "display_name", new_name)
|
|
672
|
+
self._update_studio_reference()
|
|
673
|
+
|
|
662
674
|
@property
|
|
663
675
|
def auto_sleep(self) -> bool:
|
|
664
676
|
"""Returns if a Studio has auto-sleep enabled."""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from functools import lru_cache
|
|
2
|
+
|
|
3
|
+
from lightning_sdk.api.license_api import LicenseApi
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class License:
|
|
7
|
+
def __init__(self, license_key: str, product_name: str) -> None:
|
|
8
|
+
self.license_key = license_key
|
|
9
|
+
self.product_name = product_name
|
|
10
|
+
|
|
11
|
+
@lru_cache(maxsize=1) # noqa: B019
|
|
12
|
+
def validate(self) -> bool:
|
|
13
|
+
return LicenseApi(self.license_key).validate_license(self.license_key, self.product_name)
|