lightning-sdk 0.2.9__py3-none-any.whl → 0.2.11__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.
Files changed (50) hide show
  1. lightning_sdk/__init__.py +1 -1
  2. lightning_sdk/api/deployment_api.py +3 -0
  3. lightning_sdk/api/lit_container_api.py +19 -2
  4. lightning_sdk/api/teamspace_api.py +47 -18
  5. lightning_sdk/api/utils.py +1 -1
  6. lightning_sdk/cli/entrypoint.py +2 -2
  7. lightning_sdk/cli/serve.py +143 -16
  8. lightning_sdk/cli/upload.py +4 -1
  9. lightning_sdk/deployment/deployment.py +9 -3
  10. lightning_sdk/lightning_cloud/openapi/__init__.py +5 -0
  11. lightning_sdk/lightning_cloud/openapi/api/cloud_space_service_api.py +98 -1
  12. lightning_sdk/lightning_cloud/openapi/models/__init__.py +5 -0
  13. lightning_sdk/lightning_cloud/openapi/models/cluster_id_capacityreservations_body.py +55 -3
  14. lightning_sdk/lightning_cloud/openapi/models/create.py +53 -1
  15. lightning_sdk/lightning_cloud/openapi/models/orgs_id_body.py +55 -3
  16. lightning_sdk/lightning_cloud/openapi/models/update.py +27 -1
  17. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space.py +53 -1
  18. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_cold_start_metrics_stats.py +357 -0
  19. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_template_config.py +29 -3
  20. lightning_sdk/lightning_cloud/openapi/models/v1_cloudflare_v1.py +227 -0
  21. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_accelerator.py +27 -1
  22. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_capacity_reservation.py +55 -3
  23. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_security_options.py +53 -1
  24. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +27 -1
  25. lightning_sdk/lightning_cloud/openapi/models/v1_create_cloud_space_environment_template_request.py +29 -3
  26. lightning_sdk/lightning_cloud/openapi/models/v1_create_cluster_capacity_reservation_response.py +27 -1
  27. lightning_sdk/lightning_cloud/openapi/models/v1_data_connection.py +27 -1
  28. lightning_sdk/lightning_cloud/openapi/models/v1_gcp_direct_vpc.py +149 -0
  29. lightning_sdk/lightning_cloud/openapi/models/v1_get_cloud_space_cold_start_metrics_stats_response.py +123 -0
  30. lightning_sdk/lightning_cloud/openapi/models/v1_get_user_response.py +53 -1
  31. lightning_sdk/lightning_cloud/openapi/models/v1_google_cloud_direct_v1.py +17 -17
  32. lightning_sdk/lightning_cloud/openapi/models/v1_organization.py +55 -3
  33. lightning_sdk/lightning_cloud/openapi/models/v1_project_cluster_binding.py +27 -1
  34. lightning_sdk/lightning_cloud/openapi/models/v1_r2_data_connection.py +253 -0
  35. lightning_sdk/lightning_cloud/openapi/models/v1_update_user_request.py +27 -1
  36. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +50 -24
  37. lightning_sdk/lightning_cloud/openapi/models/v1_validate_data_connection_response.py +27 -1
  38. lightning_sdk/lightning_cloud/openapi/models/v1_weka_data_connection.py +29 -55
  39. lightning_sdk/lightning_cloud/openapi/models/validate.py +27 -1
  40. lightning_sdk/lit_container.py +12 -2
  41. lightning_sdk/models.py +38 -9
  42. lightning_sdk/serve.py +6 -0
  43. lightning_sdk/teamspace.py +16 -2
  44. lightning_sdk/utils/resolve.py +11 -4
  45. {lightning_sdk-0.2.9.dist-info → lightning_sdk-0.2.11.dist-info}/METADATA +1 -1
  46. {lightning_sdk-0.2.9.dist-info → lightning_sdk-0.2.11.dist-info}/RECORD +50 -45
  47. {lightning_sdk-0.2.9.dist-info → lightning_sdk-0.2.11.dist-info}/LICENSE +0 -0
  48. {lightning_sdk-0.2.9.dist-info → lightning_sdk-0.2.11.dist-info}/WHEEL +0 -0
  49. {lightning_sdk-0.2.9.dist-info → lightning_sdk-0.2.11.dist-info}/entry_points.txt +0 -0
  50. {lightning_sdk-0.2.9.dist-info → lightning_sdk-0.2.11.dist-info}/top_level.txt +0 -0
@@ -63,8 +63,8 @@ class V1UserFeatures(object):
63
63
  'default_one_cluster': 'bool',
64
64
  'deployment_alerts': 'bool',
65
65
  'deployment_persistent_disk': 'bool',
66
- 'deployment_reservations': 'bool',
67
66
  'dgx_cloud': 'bool',
67
+ 'doc_helper_chat': 'bool',
68
68
  'docs_agent': 'bool',
69
69
  'drive_v2': 'bool',
70
70
  'enable_storage_limits': 'bool',
@@ -85,6 +85,7 @@ class V1UserFeatures(object):
85
85
  'multiple_studio_versions': 'bool',
86
86
  'org_admin_alerts': 'bool',
87
87
  'org_level_member_permissions': 'bool',
88
+ 'org_usage_limits': 'bool',
88
89
  'pipelines': 'bool',
89
90
  'plugin_distributed': 'bool',
90
91
  'plugin_inference': 'bool',
@@ -140,8 +141,8 @@ class V1UserFeatures(object):
140
141
  'default_one_cluster': 'defaultOneCluster',
141
142
  'deployment_alerts': 'deploymentAlerts',
142
143
  'deployment_persistent_disk': 'deploymentPersistentDisk',
143
- 'deployment_reservations': 'deploymentReservations',
144
144
  'dgx_cloud': 'dgxCloud',
145
+ 'doc_helper_chat': 'docHelperChat',
145
146
  'docs_agent': 'docsAgent',
146
147
  'drive_v2': 'driveV2',
147
148
  'enable_storage_limits': 'enableStorageLimits',
@@ -162,6 +163,7 @@ class V1UserFeatures(object):
162
163
  'multiple_studio_versions': 'multipleStudioVersions',
163
164
  'org_admin_alerts': 'orgAdminAlerts',
164
165
  'org_level_member_permissions': 'orgLevelMemberPermissions',
166
+ 'org_usage_limits': 'orgUsageLimits',
165
167
  'pipelines': 'pipelines',
166
168
  'plugin_distributed': 'pluginDistributed',
167
169
  'plugin_inference': 'pluginInference',
@@ -194,7 +196,7 @@ class V1UserFeatures(object):
194
196
  'weka': 'weka'
195
197
  }
196
198
 
197
- def __init__(self, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, auto_join_orgs: 'bool' =None, b2c_experience: 'bool' =None, byoc_litcr: '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, cloud_space_environment_templates: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, cost_attribution_settings: 'bool' =None, custom_app_domain: 'bool' =None, custom_instance_types: 'bool' =None, datasets: 'bool' =None, default_one_cluster: 'bool' =None, deployment_alerts: 'bool' =None, deployment_persistent_disk: 'bool' =None, deployment_reservations: 'bool' =None, dgx_cloud: 'bool' =None, docs_agent: 'bool' =None, drive_v2: 'bool' =None, enable_storage_limits: 'bool' =None, enterprise_compute_admin: 'bool' =None, fair_share: 'bool' =None, featured_studios_admin: 'bool' =None, filestore: 'bool' =None, inactive_notify_delete: 'bool' =None, instant_capacity_reservation: 'bool' =None, job_artifacts_v2: 'bool' =None, lambda_labs: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, marketplace: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, multicloud_saas: 'bool' =None, multiple_studio_versions: 'bool' =None, org_admin_alerts: 'bool' =None, org_level_member_permissions: 'bool' =None, pipelines: '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_service: 'bool' =None, plugin_sweeps: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, project_selector: 'bool' =None, publish_pipelines: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, security_docs: 'bool' =None, show_dev_admin: 'bool' =None, single_wallet: 'bool' =None, slurm: 'bool' =None, slurm_machine_selector: 'bool' =None, stop_ide_container_on_shutdown: 'bool' =None, studio_config: 'bool' =None, studio_on_stop: 'bool' =None, studio_version_visibility: 'bool' =None, studios_dashboard: 'bool' =None, studios_dashboard_system_metrics: 'bool' =None, teamspace_storage_tab: 'bool' =None, trainium2: 'bool' =None, use_rclone_mounts_only: 'bool' =None, vultr: 'bool' =None, weka: 'bool' =None): # noqa: E501
199
+ def __init__(self, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, auto_join_orgs: 'bool' =None, b2c_experience: 'bool' =None, byoc_litcr: '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, cloud_space_environment_templates: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, cost_attribution_settings: 'bool' =None, custom_app_domain: 'bool' =None, custom_instance_types: 'bool' =None, datasets: 'bool' =None, default_one_cluster: 'bool' =None, deployment_alerts: 'bool' =None, deployment_persistent_disk: 'bool' =None, dgx_cloud: 'bool' =None, doc_helper_chat: 'bool' =None, docs_agent: 'bool' =None, drive_v2: 'bool' =None, enable_storage_limits: 'bool' =None, enterprise_compute_admin: 'bool' =None, fair_share: 'bool' =None, featured_studios_admin: 'bool' =None, filestore: 'bool' =None, inactive_notify_delete: 'bool' =None, instant_capacity_reservation: 'bool' =None, job_artifacts_v2: 'bool' =None, lambda_labs: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, marketplace: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, multicloud_saas: 'bool' =None, multiple_studio_versions: 'bool' =None, org_admin_alerts: 'bool' =None, org_level_member_permissions: 'bool' =None, org_usage_limits: 'bool' =None, pipelines: '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_service: 'bool' =None, plugin_sweeps: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, project_selector: 'bool' =None, publish_pipelines: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, security_docs: 'bool' =None, show_dev_admin: 'bool' =None, single_wallet: 'bool' =None, slurm: 'bool' =None, slurm_machine_selector: 'bool' =None, stop_ide_container_on_shutdown: 'bool' =None, studio_config: 'bool' =None, studio_on_stop: 'bool' =None, studio_version_visibility: 'bool' =None, studios_dashboard: 'bool' =None, studios_dashboard_system_metrics: 'bool' =None, teamspace_storage_tab: 'bool' =None, trainium2: 'bool' =None, use_rclone_mounts_only: 'bool' =None, vultr: 'bool' =None, weka: 'bool' =None): # noqa: E501
198
200
  """V1UserFeatures - a model defined in Swagger""" # noqa: E501
199
201
  self._affiliate_links = None
200
202
  self._agents_v2 = None
@@ -218,8 +220,8 @@ class V1UserFeatures(object):
218
220
  self._default_one_cluster = None
219
221
  self._deployment_alerts = None
220
222
  self._deployment_persistent_disk = None
221
- self._deployment_reservations = None
222
223
  self._dgx_cloud = None
224
+ self._doc_helper_chat = None
223
225
  self._docs_agent = None
224
226
  self._drive_v2 = None
225
227
  self._enable_storage_limits = None
@@ -240,6 +242,7 @@ class V1UserFeatures(object):
240
242
  self._multiple_studio_versions = None
241
243
  self._org_admin_alerts = None
242
244
  self._org_level_member_permissions = None
245
+ self._org_usage_limits = None
243
246
  self._pipelines = None
244
247
  self._plugin_distributed = None
245
248
  self._plugin_inference = None
@@ -315,10 +318,10 @@ class V1UserFeatures(object):
315
318
  self.deployment_alerts = deployment_alerts
316
319
  if deployment_persistent_disk is not None:
317
320
  self.deployment_persistent_disk = deployment_persistent_disk
318
- if deployment_reservations is not None:
319
- self.deployment_reservations = deployment_reservations
320
321
  if dgx_cloud is not None:
321
322
  self.dgx_cloud = dgx_cloud
323
+ if doc_helper_chat is not None:
324
+ self.doc_helper_chat = doc_helper_chat
322
325
  if docs_agent is not None:
323
326
  self.docs_agent = docs_agent
324
327
  if drive_v2 is not None:
@@ -359,6 +362,8 @@ class V1UserFeatures(object):
359
362
  self.org_admin_alerts = org_admin_alerts
360
363
  if org_level_member_permissions is not None:
361
364
  self.org_level_member_permissions = org_level_member_permissions
365
+ if org_usage_limits is not None:
366
+ self.org_usage_limits = org_usage_limits
362
367
  if pipelines is not None:
363
368
  self.pipelines = pipelines
364
369
  if plugin_distributed is not None:
@@ -883,46 +888,46 @@ class V1UserFeatures(object):
883
888
  self._deployment_persistent_disk = deployment_persistent_disk
884
889
 
885
890
  @property
886
- def deployment_reservations(self) -> 'bool':
887
- """Gets the deployment_reservations of this V1UserFeatures. # noqa: E501
891
+ def dgx_cloud(self) -> 'bool':
892
+ """Gets the dgx_cloud of this V1UserFeatures. # noqa: E501
888
893
 
889
894
 
890
- :return: The deployment_reservations of this V1UserFeatures. # noqa: E501
895
+ :return: The dgx_cloud of this V1UserFeatures. # noqa: E501
891
896
  :rtype: bool
892
897
  """
893
- return self._deployment_reservations
898
+ return self._dgx_cloud
894
899
 
895
- @deployment_reservations.setter
896
- def deployment_reservations(self, deployment_reservations: 'bool'):
897
- """Sets the deployment_reservations of this V1UserFeatures.
900
+ @dgx_cloud.setter
901
+ def dgx_cloud(self, dgx_cloud: 'bool'):
902
+ """Sets the dgx_cloud of this V1UserFeatures.
898
903
 
899
904
 
900
- :param deployment_reservations: The deployment_reservations of this V1UserFeatures. # noqa: E501
905
+ :param dgx_cloud: The dgx_cloud of this V1UserFeatures. # noqa: E501
901
906
  :type: bool
902
907
  """
903
908
 
904
- self._deployment_reservations = deployment_reservations
909
+ self._dgx_cloud = dgx_cloud
905
910
 
906
911
  @property
907
- def dgx_cloud(self) -> 'bool':
908
- """Gets the dgx_cloud of this V1UserFeatures. # noqa: E501
912
+ def doc_helper_chat(self) -> 'bool':
913
+ """Gets the doc_helper_chat of this V1UserFeatures. # noqa: E501
909
914
 
910
915
 
911
- :return: The dgx_cloud of this V1UserFeatures. # noqa: E501
916
+ :return: The doc_helper_chat of this V1UserFeatures. # noqa: E501
912
917
  :rtype: bool
913
918
  """
914
- return self._dgx_cloud
919
+ return self._doc_helper_chat
915
920
 
916
- @dgx_cloud.setter
917
- def dgx_cloud(self, dgx_cloud: 'bool'):
918
- """Sets the dgx_cloud of this V1UserFeatures.
921
+ @doc_helper_chat.setter
922
+ def doc_helper_chat(self, doc_helper_chat: 'bool'):
923
+ """Sets the doc_helper_chat of this V1UserFeatures.
919
924
 
920
925
 
921
- :param dgx_cloud: The dgx_cloud of this V1UserFeatures. # noqa: E501
926
+ :param doc_helper_chat: The doc_helper_chat of this V1UserFeatures. # noqa: E501
922
927
  :type: bool
923
928
  """
924
929
 
925
- self._dgx_cloud = dgx_cloud
930
+ self._doc_helper_chat = doc_helper_chat
926
931
 
927
932
  @property
928
933
  def docs_agent(self) -> 'bool':
@@ -1344,6 +1349,27 @@ class V1UserFeatures(object):
1344
1349
 
1345
1350
  self._org_level_member_permissions = org_level_member_permissions
1346
1351
 
1352
+ @property
1353
+ def org_usage_limits(self) -> 'bool':
1354
+ """Gets the org_usage_limits of this V1UserFeatures. # noqa: E501
1355
+
1356
+
1357
+ :return: The org_usage_limits of this V1UserFeatures. # noqa: E501
1358
+ :rtype: bool
1359
+ """
1360
+ return self._org_usage_limits
1361
+
1362
+ @org_usage_limits.setter
1363
+ def org_usage_limits(self, org_usage_limits: 'bool'):
1364
+ """Sets the org_usage_limits of this V1UserFeatures.
1365
+
1366
+
1367
+ :param org_usage_limits: The org_usage_limits of this V1UserFeatures. # noqa: E501
1368
+ :type: bool
1369
+ """
1370
+
1371
+ self._org_usage_limits = org_usage_limits
1372
+
1347
1373
  @property
1348
1374
  def pipelines(self) -> 'bool':
1349
1375
  """Gets the pipelines of this V1UserFeatures. # noqa: E501
@@ -45,6 +45,7 @@ class V1ValidateDataConnectionResponse(object):
45
45
  'efs': 'V1EfsConfig',
46
46
  'gcp': 'V1GcpDataConnection',
47
47
  'gcs_folder': 'V1GCSFolderDataConnection',
48
+ 'r2': 'V1R2DataConnection',
48
49
  's3_folder': 'V1S3FolderDataConnection'
49
50
  }
50
51
 
@@ -53,15 +54,17 @@ class V1ValidateDataConnectionResponse(object):
53
54
  'efs': 'efs',
54
55
  'gcp': 'gcp',
55
56
  'gcs_folder': 'gcsFolder',
57
+ 'r2': 'r2',
56
58
  's3_folder': 's3Folder'
57
59
  }
58
60
 
59
- def __init__(self, aws: 'V1AwsDataConnection' =None, efs: 'V1EfsConfig' =None, gcp: 'V1GcpDataConnection' =None, gcs_folder: 'V1GCSFolderDataConnection' =None, s3_folder: 'V1S3FolderDataConnection' =None): # noqa: E501
61
+ def __init__(self, aws: 'V1AwsDataConnection' =None, efs: 'V1EfsConfig' =None, gcp: 'V1GcpDataConnection' =None, gcs_folder: 'V1GCSFolderDataConnection' =None, r2: 'V1R2DataConnection' =None, s3_folder: 'V1S3FolderDataConnection' =None): # noqa: E501
60
62
  """V1ValidateDataConnectionResponse - a model defined in Swagger""" # noqa: E501
61
63
  self._aws = None
62
64
  self._efs = None
63
65
  self._gcp = None
64
66
  self._gcs_folder = None
67
+ self._r2 = None
65
68
  self._s3_folder = None
66
69
  self.discriminator = None
67
70
  if aws is not None:
@@ -72,6 +75,8 @@ class V1ValidateDataConnectionResponse(object):
72
75
  self.gcp = gcp
73
76
  if gcs_folder is not None:
74
77
  self.gcs_folder = gcs_folder
78
+ if r2 is not None:
79
+ self.r2 = r2
75
80
  if s3_folder is not None:
76
81
  self.s3_folder = s3_folder
77
82
 
@@ -159,6 +164,27 @@ class V1ValidateDataConnectionResponse(object):
159
164
 
160
165
  self._gcs_folder = gcs_folder
161
166
 
167
+ @property
168
+ def r2(self) -> 'V1R2DataConnection':
169
+ """Gets the r2 of this V1ValidateDataConnectionResponse. # noqa: E501
170
+
171
+
172
+ :return: The r2 of this V1ValidateDataConnectionResponse. # noqa: E501
173
+ :rtype: V1R2DataConnection
174
+ """
175
+ return self._r2
176
+
177
+ @r2.setter
178
+ def r2(self, r2: 'V1R2DataConnection'):
179
+ """Sets the r2 of this V1ValidateDataConnectionResponse.
180
+
181
+
182
+ :param r2: The r2 of this V1ValidateDataConnectionResponse. # noqa: E501
183
+ :type: V1R2DataConnection
184
+ """
185
+
186
+ self._r2 = r2
187
+
162
188
  @property
163
189
  def s3_folder(self) -> 'V1S3FolderDataConnection':
164
190
  """Gets the s3_folder of this V1ValidateDataConnectionResponse. # noqa: E501
@@ -42,38 +42,33 @@ class V1WekaDataConnection(object):
42
42
  """
43
43
  swagger_types = {
44
44
  'backend_ips': 'list[str]',
45
- 'cores': 'int',
46
45
  'file_system_name': 'str',
47
- 'management_ip': 'str',
48
- 'memory_mb': 'int'
46
+ 'memory_mb': 'int',
47
+ 'readonly': 'bool'
49
48
  }
50
49
 
51
50
  attribute_map = {
52
51
  'backend_ips': 'backendIps',
53
- 'cores': 'cores',
54
52
  'file_system_name': 'fileSystemName',
55
- 'management_ip': 'managementIp',
56
- 'memory_mb': 'memoryMb'
53
+ 'memory_mb': 'memoryMb',
54
+ 'readonly': 'readonly'
57
55
  }
58
56
 
59
- def __init__(self, backend_ips: 'list[str]' =None, cores: 'int' =None, file_system_name: 'str' =None, management_ip: 'str' =None, memory_mb: 'int' =None): # noqa: E501
57
+ def __init__(self, backend_ips: 'list[str]' =None, file_system_name: 'str' =None, memory_mb: 'int' =None, readonly: 'bool' =None): # noqa: E501
60
58
  """V1WekaDataConnection - a model defined in Swagger""" # noqa: E501
61
59
  self._backend_ips = None
62
- self._cores = None
63
60
  self._file_system_name = None
64
- self._management_ip = None
65
61
  self._memory_mb = None
62
+ self._readonly = None
66
63
  self.discriminator = None
67
64
  if backend_ips is not None:
68
65
  self.backend_ips = backend_ips
69
- if cores is not None:
70
- self.cores = cores
71
66
  if file_system_name is not None:
72
67
  self.file_system_name = file_system_name
73
- if management_ip is not None:
74
- self.management_ip = management_ip
75
68
  if memory_mb is not None:
76
69
  self.memory_mb = memory_mb
70
+ if readonly is not None:
71
+ self.readonly = readonly
77
72
 
78
73
  @property
79
74
  def backend_ips(self) -> 'list[str]':
@@ -96,27 +91,6 @@ class V1WekaDataConnection(object):
96
91
 
97
92
  self._backend_ips = backend_ips
98
93
 
99
- @property
100
- def cores(self) -> 'int':
101
- """Gets the cores of this V1WekaDataConnection. # noqa: E501
102
-
103
-
104
- :return: The cores of this V1WekaDataConnection. # noqa: E501
105
- :rtype: int
106
- """
107
- return self._cores
108
-
109
- @cores.setter
110
- def cores(self, cores: 'int'):
111
- """Sets the cores of this V1WekaDataConnection.
112
-
113
-
114
- :param cores: The cores of this V1WekaDataConnection. # noqa: E501
115
- :type: int
116
- """
117
-
118
- self._cores = cores
119
-
120
94
  @property
121
95
  def file_system_name(self) -> 'str':
122
96
  """Gets the file_system_name of this V1WekaDataConnection. # noqa: E501
@@ -138,27 +112,6 @@ class V1WekaDataConnection(object):
138
112
 
139
113
  self._file_system_name = file_system_name
140
114
 
141
- @property
142
- def management_ip(self) -> 'str':
143
- """Gets the management_ip of this V1WekaDataConnection. # noqa: E501
144
-
145
-
146
- :return: The management_ip of this V1WekaDataConnection. # noqa: E501
147
- :rtype: str
148
- """
149
- return self._management_ip
150
-
151
- @management_ip.setter
152
- def management_ip(self, management_ip: 'str'):
153
- """Sets the management_ip of this V1WekaDataConnection.
154
-
155
-
156
- :param management_ip: The management_ip of this V1WekaDataConnection. # noqa: E501
157
- :type: str
158
- """
159
-
160
- self._management_ip = management_ip
161
-
162
115
  @property
163
116
  def memory_mb(self) -> 'int':
164
117
  """Gets the memory_mb of this V1WekaDataConnection. # noqa: E501
@@ -180,6 +133,27 @@ class V1WekaDataConnection(object):
180
133
 
181
134
  self._memory_mb = memory_mb
182
135
 
136
+ @property
137
+ def readonly(self) -> 'bool':
138
+ """Gets the readonly of this V1WekaDataConnection. # noqa: E501
139
+
140
+
141
+ :return: The readonly of this V1WekaDataConnection. # noqa: E501
142
+ :rtype: bool
143
+ """
144
+ return self._readonly
145
+
146
+ @readonly.setter
147
+ def readonly(self, readonly: 'bool'):
148
+ """Sets the readonly of this V1WekaDataConnection.
149
+
150
+
151
+ :param readonly: The readonly of this V1WekaDataConnection. # noqa: E501
152
+ :type: bool
153
+ """
154
+
155
+ self._readonly = readonly
156
+
183
157
  def to_dict(self) -> dict:
184
158
  """Returns the model properties as a dict"""
185
159
  result = {}
@@ -48,6 +48,7 @@ class Validate(object):
48
48
  'filestore': 'V1FilestoreDataConnection',
49
49
  'gcp': 'V1GcpDataConnection',
50
50
  'gcs_folder': 'V1GCSFolderDataConnection',
51
+ 'r2': 'V1R2DataConnection',
51
52
  's3_folder': 'V1S3FolderDataConnection'
52
53
  }
53
54
 
@@ -59,10 +60,11 @@ class Validate(object):
59
60
  'filestore': 'filestore',
60
61
  'gcp': 'gcp',
61
62
  'gcs_folder': 'gcsFolder',
63
+ 'r2': 'r2',
62
64
  's3_folder': 's3Folder'
63
65
  }
64
66
 
65
- def __init__(self, aws: 'V1AwsDataConnection' =None, check_is_public: 'bool' =None, cluster_ids: 'list[str]' =None, efs: 'V1EfsConfig' =None, filestore: 'V1FilestoreDataConnection' =None, gcp: 'V1GcpDataConnection' =None, gcs_folder: 'V1GCSFolderDataConnection' =None, s3_folder: 'V1S3FolderDataConnection' =None): # noqa: E501
67
+ def __init__(self, aws: 'V1AwsDataConnection' =None, check_is_public: 'bool' =None, cluster_ids: 'list[str]' =None, efs: 'V1EfsConfig' =None, filestore: 'V1FilestoreDataConnection' =None, gcp: 'V1GcpDataConnection' =None, gcs_folder: 'V1GCSFolderDataConnection' =None, r2: 'V1R2DataConnection' =None, s3_folder: 'V1S3FolderDataConnection' =None): # noqa: E501
66
68
  """Validate - a model defined in Swagger""" # noqa: E501
67
69
  self._aws = None
68
70
  self._check_is_public = None
@@ -71,6 +73,7 @@ class Validate(object):
71
73
  self._filestore = None
72
74
  self._gcp = None
73
75
  self._gcs_folder = None
76
+ self._r2 = None
74
77
  self._s3_folder = None
75
78
  self.discriminator = None
76
79
  if aws is not None:
@@ -87,6 +90,8 @@ class Validate(object):
87
90
  self.gcp = gcp
88
91
  if gcs_folder is not None:
89
92
  self.gcs_folder = gcs_folder
93
+ if r2 is not None:
94
+ self.r2 = r2
90
95
  if s3_folder is not None:
91
96
  self.s3_folder = s3_folder
92
97
 
@@ -237,6 +242,27 @@ class Validate(object):
237
242
 
238
243
  self._gcs_folder = gcs_folder
239
244
 
245
+ @property
246
+ def r2(self) -> 'V1R2DataConnection':
247
+ """Gets the r2 of this Validate. # noqa: E501
248
+
249
+
250
+ :return: The r2 of this Validate. # noqa: E501
251
+ :rtype: V1R2DataConnection
252
+ """
253
+ return self._r2
254
+
255
+ @r2.setter
256
+ def r2(self, r2: 'V1R2DataConnection'):
257
+ """Sets the r2 of this Validate.
258
+
259
+
260
+ :param r2: The r2 of this Validate. # noqa: E501
261
+ :type: V1R2DataConnection
262
+ """
263
+
264
+ self._r2 = r2
265
+
240
266
  @property
241
267
  def s3_folder(self) -> 'V1S3FolderDataConnection':
242
268
  """Gets the s3_folder of this Validate. # noqa: E501
@@ -80,7 +80,8 @@ class LitContainer:
80
80
  tag: str = "latest",
81
81
  cloud_account: Optional[str] = None,
82
82
  platform: Optional[str] = "linux/amd64",
83
- ) -> None:
83
+ return_final_dict: bool = False,
84
+ ) -> Optional[Dict]:
84
85
  """Upload a container to the docker registry.
85
86
 
86
87
  Args:
@@ -91,15 +92,24 @@ class LitContainer:
91
92
  tag: The tag to use for the container.
92
93
  cloud_account: The cloud account where the container is stored.
93
94
  platform: The platform the container is meant to run on.
95
+ return_final_dict: Instructs function to return metadata about container location in platform.
94
96
  """
95
97
  try:
96
98
  teamspace = _resolve_teamspace(teamspace=teamspace, org=org, user=user)
97
99
  except Exception as e:
98
100
  raise ValueError(f"Could not resolve teamspace: {e}") from e
99
101
 
100
- resp = self._api.upload_container(container, teamspace, tag, cloud_account, platform=platform)
102
+ resp = self._api.upload_container(
103
+ container, teamspace, tag, cloud_account, platform=platform, return_final_dict=return_final_dict
104
+ )
105
+
106
+ final_dict = None
101
107
  for line in resp:
102
108
  print(line)
109
+ if return_final_dict and isinstance(line, dict) and line.get("finish") is True:
110
+ final_dict = line
111
+
112
+ return final_dict if return_final_dict else None
103
113
 
104
114
  def download_container(
105
115
  self,
lightning_sdk/models.py CHANGED
@@ -4,6 +4,7 @@ from pathlib import Path
4
4
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
5
5
 
6
6
  from lightning_sdk.api import OrgApi, TeamspaceApi, UserApi
7
+ from lightning_sdk.lightning_cloud.openapi import V1ModelVersionArchive
7
8
  from lightning_sdk.lightning_cloud.openapi.models import V1Membership, V1OwnerType
8
9
  from lightning_sdk.lightning_cloud.openapi.rest import ApiException
9
10
  from lightning_sdk.user import User
@@ -85,7 +86,7 @@ def _extend_model_name_with_teamspace(name: str) -> str:
85
86
  return f"{teamspace.owner.name}/{teamspace.name}/{name}"
86
87
 
87
88
 
88
- def _parse_model_name_and_version(name: str) -> Tuple[str, str, str, str]:
89
+ def _parse_org_teamspace_model_version(name: str) -> Tuple[str, str, str, Optional[str]]:
89
90
  """Parse the name argument into its components."""
90
91
  try:
91
92
  org_name, teamspace_name, model_name = name.split("/")
@@ -119,19 +120,14 @@ def download_model(
119
120
  progress_bar: Whether to show a progress bar when downloading.
120
121
  """
121
122
  name = _extend_model_name_with_teamspace(name)
122
- teamspace_owner_name, teamspace_name, model_name, version = _parse_model_name_and_version(name)
123
- if version is None:
124
- version = "default"
125
-
126
- download_dir = Path(download_dir)
127
-
123
+ teamspace_owner_name, teamspace_name, model_name, version = _parse_org_teamspace_model_version(name)
128
124
  api = TeamspaceApi()
129
125
 
130
126
  try:
131
127
  return api.download_model_files(
132
128
  name=model_name,
133
129
  version=version,
134
- download_dir=download_dir,
130
+ download_dir=Path(download_dir),
135
131
  teamspace_name=teamspace_name,
136
132
  teamspace_owner_name=teamspace_owner_name,
137
133
  progress_bar=progress_bar,
@@ -160,9 +156,11 @@ def upload_model(
160
156
  cloud_account: The name of the cloud account to store the Model in.
161
157
  If not provided, the default cloud account for the Teamspace will be used.
162
158
  progress_bar: Whether to show a progress bar for the upload.
159
+ metadata: Metadata to attach to the uploaded model.
160
+ If not provided, an empty dictionary will be used.
163
161
  """
164
162
  name = _extend_model_name_with_teamspace(name)
165
- org_name, teamspace_name, model_name, version = _parse_model_name_and_version(name)
163
+ org_name, teamspace_name, model_name, version = _parse_org_teamspace_model_version(name)
166
164
  teamspace = _get_teamspace(name=teamspace_name, organization=org_name)
167
165
  return teamspace.upload_model(
168
166
  path=path,
@@ -172,3 +170,34 @@ def upload_model(
172
170
  progress_bar=progress_bar,
173
171
  metadata=metadata,
174
172
  )
173
+
174
+
175
+ def delete_model(
176
+ name: str,
177
+ ) -> None:
178
+ """Delete a model or a version of model.
179
+
180
+ Args:
181
+ name: The name of the model you want to delete or with specified version it deltes only that version.
182
+ This should have the format <ORGANIZATION-NAME>/<TEAMSPACE-NAME>/<MODEL-NAME> for full model deletion
183
+ or <ORGANIZATION-NAME>/<TEAMSPACE-NAME>/<MODEL-NAME>:<VERSION> for version deletion.
184
+ """
185
+ name = _extend_model_name_with_teamspace(name)
186
+ org_name, teamspace_name, model_name, version = _parse_org_teamspace_model_version(name)
187
+ teamspace = _get_teamspace(name=teamspace_name, organization=org_name)
188
+ teamspace.delete_model(name=f"{model_name}:{version}" if version else model_name)
189
+
190
+
191
+ def list_model_versions(
192
+ name: str,
193
+ ) -> List[V1ModelVersionArchive]:
194
+ """List all versions of a model.
195
+
196
+ Args:
197
+ name: The name of the model you want to list versions for.
198
+ This should have the format <ORGANIZATION-NAME>/<TEAMSPACE-NAME>/<MODEL-NAME>.
199
+ """
200
+ name = _extend_model_name_with_teamspace(name)
201
+ org_name, teamspace_name, model_name, _ = _parse_org_teamspace_model_version(name)
202
+ teamspace = _get_teamspace(name=teamspace_name, organization=org_name)
203
+ return teamspace.list_model_versions(name=model_name)
lightning_sdk/serve.py CHANGED
@@ -248,6 +248,8 @@ Update [underline]{os.path.abspath("Dockerfile")}[/underline] to add any additio
248
248
  cloud_account: Optional[str] = None,
249
249
  port: Optional[int] = 8000,
250
250
  include_credentials: Optional[bool] = True,
251
+ cloudspace_id: Optional[str] = None,
252
+ from_onboarding: bool = False,
251
253
  ) -> dict:
252
254
  """Run a deployment on the cloud. If the deployment already exists, it will be updated.
253
255
 
@@ -264,6 +266,8 @@ Update [underline]{os.path.abspath("Dockerfile")}[/underline] to add any additio
264
266
  cloud_account: The cloud account to run the deployment on. Defaults to None.
265
267
  port: The port to run the deployment on. Defaults to 8000.
266
268
  include_credentials: Whether to include credentials in the deployment. Defaults to True.
269
+ cloudspace_id: Connect to a Studio.
270
+ from_onboarding: Deployment created during onboarding.
267
271
 
268
272
  Returns:
269
273
  dict: The deployment and the URL of the deployment.
@@ -297,6 +301,8 @@ Update [underline]{os.path.abspath("Dockerfile")}[/underline] to add any additio
297
301
  cloud_account=cloud_account,
298
302
  ports=[port],
299
303
  include_credentials=include_credentials,
304
+ cloudspace_id=cloudspace_id,
305
+ from_onboarding=from_onboarding,
300
306
  )
301
307
 
302
308
  return {"deployment": deployment, "url": url}
@@ -6,7 +6,7 @@ from typing import TYPE_CHECKING, List, Optional, Tuple, Union
6
6
  import lightning_sdk
7
7
  from lightning_sdk.agents import Agent
8
8
  from lightning_sdk.api import TeamspaceApi
9
- from lightning_sdk.lightning_cloud.openapi import V1ProjectClusterBinding
9
+ from lightning_sdk.lightning_cloud.openapi import V1Model, V1ModelVersionArchive, V1ProjectClusterBinding
10
10
  from lightning_sdk.machine import Machine
11
11
  from lightning_sdk.models import UploadedModelInfo
12
12
  from lightning_sdk.organization import Organization
@@ -262,6 +262,8 @@ class Teamspace:
262
262
  Args:
263
263
  path: Path to the model file or folder to upload.
264
264
  name: Name tag of the model to upload.
265
+ version: Version tag of the model to upload.
266
+ If not provided, the ``vX`` version will be used where X is running index.
265
267
  cloud_account: The name of the cloud account to store the Model in.
266
268
  If not provided, the default cloud account for the Teamspace will be used.
267
269
  progress_bar: Whether to show a progress bar for the upload.
@@ -315,7 +317,7 @@ class Teamspace:
315
317
  teamspace_id=self.id,
316
318
  progress_bar=progress_bar,
317
319
  )
318
- self._teamspace_api.complete_model_upload(
320
+ self._teamspace_api._complete_model_upload(
319
321
  model_id=model.model_id,
320
322
  version=model.version,
321
323
  teamspace_id=self.id,
@@ -387,6 +389,18 @@ class Teamspace:
387
389
  name, version = _parse_model_and_version(name)
388
390
  self._teamspace_api.delete_model(name=name, version=version, teamspace_id=self.id)
389
391
 
392
+ def list_models(self) -> List[V1Model]:
393
+ """List all models in the model store."""
394
+ return self._teamspace_api.list_models(teamspace_id=self.id)
395
+
396
+ def list_model_versions(self, name: str) -> List[V1ModelVersionArchive]:
397
+ """List all versions of a model in the model store."""
398
+ if ":" in name:
399
+ raise ValueError(
400
+ "Model name should not contain a version tag. Please provide the model name without a version."
401
+ )
402
+ return self._teamspace_api.list_model_versions(teamspace_id=self.id, model_name=name)
403
+
390
404
 
391
405
  def _list_files(path: Union[str, Path]) -> Tuple[List[Path], List[str]]:
392
406
  """List all folders in a directory and return them as a list and relative path."""
@@ -179,16 +179,23 @@ def skip_studio_init() -> Generator[None, None, None]:
179
179
  Studio._skip_init = prev_studio_init_state
180
180
 
181
181
 
182
- def _parse_model_and_version(name: str) -> Tuple[str, str]:
182
+ def _parse_model_and_version(name: str) -> Tuple[str, Optional[str]]:
183
+ """Parse the model name and version from the given string.
184
+
185
+ >>> _parse_model_and_version("org/teamspace/modelname")
186
+ ('org/teamspace/modelname', None)
187
+ >>> _parse_model_and_version("org/teamspace/modelname:version")
188
+ ('org/teamspace/modelname', 'version')
189
+ """
183
190
  parts = name.split(":")
184
191
  if len(parts) == 1:
185
- return parts[0], "default"
192
+ return parts[0], None
186
193
  if len(parts) == 2:
187
194
  return parts[0], parts[1]
188
195
  # The rest of the validation for name and version happens in the backend
189
196
  raise ValueError(
190
- "Model version is expected to be in the format `entity/modelname:version` separated by a"
191
- f" single colon, but got: {name}"
197
+ "Model version is expected to be in the format `entity/modelname:version` separated by a single colon,"
198
+ f" but got: {name}"
192
199
  )
193
200
 
194
201