lightning-sdk 0.1.50__py3-none-any.whl → 0.1.51__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 (39) hide show
  1. lightning_sdk/__init__.py +1 -1
  2. lightning_sdk/api/job_api.py +12 -7
  3. lightning_sdk/api/lit_container_api.py +24 -7
  4. lightning_sdk/api/mmt_api.py +12 -7
  5. lightning_sdk/api/utils.py +52 -0
  6. lightning_sdk/cli/run.py +60 -18
  7. lightning_sdk/cli/serve.py +1 -5
  8. lightning_sdk/cli/upload.py +33 -15
  9. lightning_sdk/helpers.py +1 -1
  10. lightning_sdk/job/base.py +12 -1
  11. lightning_sdk/job/job.py +27 -25
  12. lightning_sdk/job/v1.py +6 -2
  13. lightning_sdk/job/v2.py +12 -12
  14. lightning_sdk/lightning_cloud/login.py +4 -1
  15. lightning_sdk/lightning_cloud/openapi/__init__.py +3 -0
  16. lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +5 -1
  17. lightning_sdk/lightning_cloud/openapi/api/lit_registry_service_api.py +113 -0
  18. lightning_sdk/lightning_cloud/openapi/models/__init__.py +3 -0
  19. lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +27 -1
  20. lightning_sdk/lightning_cloud/openapi/models/litregistry_lit_repo_name_body.py +123 -0
  21. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +27 -1
  22. lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +27 -1
  23. lightning_sdk/lightning_cloud/openapi/models/v1_deployment_api.py +27 -1
  24. lightning_sdk/lightning_cloud/openapi/models/v1_job_spec.py +27 -1
  25. lightning_sdk/lightning_cloud/openapi/models/v1_path_mapping.py +175 -0
  26. lightning_sdk/lightning_cloud/openapi/models/v1_update_lit_repository_response.py +97 -0
  27. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +79 -79
  28. lightning_sdk/mmt/base.py +36 -26
  29. lightning_sdk/mmt/mmt.py +27 -25
  30. lightning_sdk/mmt/v1.py +4 -1
  31. lightning_sdk/mmt/v2.py +14 -13
  32. lightning_sdk/models.py +5 -4
  33. lightning_sdk/utils/resolve.py +7 -0
  34. {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.51.dist-info}/METADATA +2 -2
  35. {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.51.dist-info}/RECORD +39 -36
  36. {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.51.dist-info}/LICENSE +0 -0
  37. {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.51.dist-info}/WHEEL +0 -0
  38. {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.51.dist-info}/entry_points.txt +0 -0
  39. {lightning_sdk-0.1.50.dist-info → lightning_sdk-0.1.51.dist-info}/top_level.txt +0 -0
@@ -58,9 +58,9 @@ class V1UserFeatures(object):
58
58
  'custom_app_domain': 'bool',
59
59
  'custom_instance_types': 'bool',
60
60
  'default_one_cluster': 'bool',
61
+ 'deployment_alerts': 'bool',
61
62
  'deployment_customize_api': 'bool',
62
63
  'deployment_data_path': 'bool',
63
- 'deployment_gallery': 'bool',
64
64
  'deployment_persistent_disk': 'bool',
65
65
  'deployment_version_visibility': 'bool',
66
66
  'docs_agent': 'bool',
@@ -70,9 +70,9 @@ class V1UserFeatures(object):
70
70
  'enable_storage_limits': 'bool',
71
71
  'featured_studios_admin': 'bool',
72
72
  'filesystem_optimisation': 'bool',
73
- 'gcp': 'bool',
74
73
  'inference_job_deployment_plugin': 'bool',
75
74
  'instant_capacity_reservation': 'bool',
75
+ 'job_artifacts_v2': 'bool',
76
76
  'jobs_init': 'bool',
77
77
  'jobs_v2': 'bool',
78
78
  'landing_studios': 'bool',
@@ -82,7 +82,6 @@ class V1UserFeatures(object):
82
82
  'mmt_fault_tolerance': 'bool',
83
83
  'mmt_strategy_selector': 'bool',
84
84
  'mmt_v2': 'bool',
85
- 'model_store': 'bool',
86
85
  'multiple_deployment_versions': 'bool',
87
86
  'multiple_studio_versions': 'bool',
88
87
  'org_level_member_permissions': 'bool',
@@ -108,6 +107,7 @@ class V1UserFeatures(object):
108
107
  'restart_ide_on_hang': 'bool',
109
108
  'restartable_jobs': 'bool',
110
109
  'runnable_public_studio_page': 'bool',
110
+ 'security_docs': 'bool',
111
111
  'show_dev_admin': 'bool',
112
112
  'slurm': 'bool',
113
113
  'slurm_machine_selector': 'bool',
@@ -142,9 +142,9 @@ class V1UserFeatures(object):
142
142
  'custom_app_domain': 'customAppDomain',
143
143
  'custom_instance_types': 'customInstanceTypes',
144
144
  'default_one_cluster': 'defaultOneCluster',
145
+ 'deployment_alerts': 'deploymentAlerts',
145
146
  'deployment_customize_api': 'deploymentCustomizeApi',
146
147
  'deployment_data_path': 'deploymentDataPath',
147
- 'deployment_gallery': 'deploymentGallery',
148
148
  'deployment_persistent_disk': 'deploymentPersistentDisk',
149
149
  'deployment_version_visibility': 'deploymentVersionVisibility',
150
150
  'docs_agent': 'docsAgent',
@@ -154,9 +154,9 @@ class V1UserFeatures(object):
154
154
  'enable_storage_limits': 'enableStorageLimits',
155
155
  'featured_studios_admin': 'featuredStudiosAdmin',
156
156
  'filesystem_optimisation': 'filesystemOptimisation',
157
- 'gcp': 'gcp',
158
157
  'inference_job_deployment_plugin': 'inferenceJobDeploymentPlugin',
159
158
  'instant_capacity_reservation': 'instantCapacityReservation',
159
+ 'job_artifacts_v2': 'jobArtifactsV2',
160
160
  'jobs_init': 'jobsInit',
161
161
  'jobs_v2': 'jobsV2',
162
162
  'landing_studios': 'landingStudios',
@@ -166,7 +166,6 @@ class V1UserFeatures(object):
166
166
  'mmt_fault_tolerance': 'mmtFaultTolerance',
167
167
  'mmt_strategy_selector': 'mmtStrategySelector',
168
168
  'mmt_v2': 'mmtV2',
169
- 'model_store': 'modelStore',
170
169
  'multiple_deployment_versions': 'multipleDeploymentVersions',
171
170
  'multiple_studio_versions': 'multipleStudioVersions',
172
171
  'org_level_member_permissions': 'orgLevelMemberPermissions',
@@ -192,6 +191,7 @@ class V1UserFeatures(object):
192
191
  'restart_ide_on_hang': 'restartIdeOnHang',
193
192
  'restartable_jobs': 'restartableJobs',
194
193
  'runnable_public_studio_page': 'runnablePublicStudioPage',
194
+ 'security_docs': 'securityDocs',
195
195
  'show_dev_admin': 'showDevAdmin',
196
196
  'slurm': 'slurm',
197
197
  'slurm_machine_selector': 'slurmMachineSelector',
@@ -208,7 +208,7 @@ class V1UserFeatures(object):
208
208
  'writable_data_connections': 'writableDataConnections'
209
209
  }
210
210
 
211
- def __init__(self, advanced_deployment_autoscaling: 'bool' =None, 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, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: '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, default_one_cluster: 'bool' =None, deployment_customize_api: 'bool' =None, deployment_data_path: 'bool' =None, deployment_gallery: 'bool' =None, deployment_persistent_disk: 'bool' =None, deployment_version_visibility: 'bool' =None, docs_agent: 'bool' =None, drive_v2: 'bool' =None, enable_crypto_crackdown: 'bool' =None, enable_efs: 'bool' =None, enable_storage_limits: 'bool' =None, featured_studios_admin: 'bool' =None, filesystem_optimisation: 'bool' =None, gcp: 'bool' =None, inference_job_deployment_plugin: 'bool' =None, instant_capacity_reservation: 'bool' =None, jobs_init: 'bool' =None, jobs_v2: 'bool' =None, landing_studios: 'bool' =None, lightning_registry: 'bool' =None, lit_logger: 'bool' =None, lit_logger_storage_v2: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, mmt_v2: 'bool' =None, model_store: 'bool' =None, multiple_deployment_versions: 'bool' =None, multiple_studio_versions: 'bool' =None, org_level_member_permissions: 'bool' =None, pipelines: 'bool' =None, plugin_biz_chat: 'bool' =None, plugin_distributed: 'bool' =None, plugin_fiftyone: 'bool' =None, plugin_inference: 'bool' =None, plugin_label_studio: 'bool' =None, plugin_langflow: 'bool' =None, plugin_lightning_apps: 'bool' =None, plugin_lightning_apps_distributed: 'bool' =None, plugin_mage_ai: 'bool' =None, plugin_milvus: 'bool' =None, plugin_python_profiler: 'bool' =None, plugin_react: 'bool' =None, plugin_service: 'bool' =None, plugin_sweeps: 'bool' =None, plugin_weviate: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, project_selector: 'bool' =None, restart_ide_on_hang: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, show_dev_admin: 'bool' =None, slurm: 'bool' =None, slurm_machine_selector: 'bool' =None, snapshotter_service: 'bool' =None, snowflake_connection: 'bool' =None, spot_v2: 'bool' =None, studio_config: 'bool' =None, studio_on_stop: 'bool' =None, studio_version_visibility: 'bool' =None, teamspace_storage_tab: 'bool' =None, trainium2: 'bool' =None, use_rclone_mounts_only: 'bool' =None, vultr: 'bool' =None, writable_data_connections: 'bool' =None): # noqa: E501
211
+ def __init__(self, advanced_deployment_autoscaling: 'bool' =None, 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, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: '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, default_one_cluster: 'bool' =None, deployment_alerts: 'bool' =None, deployment_customize_api: 'bool' =None, deployment_data_path: 'bool' =None, deployment_persistent_disk: 'bool' =None, deployment_version_visibility: 'bool' =None, docs_agent: 'bool' =None, drive_v2: 'bool' =None, enable_crypto_crackdown: 'bool' =None, enable_efs: 'bool' =None, enable_storage_limits: 'bool' =None, featured_studios_admin: 'bool' =None, filesystem_optimisation: 'bool' =None, inference_job_deployment_plugin: 'bool' =None, instant_capacity_reservation: 'bool' =None, job_artifacts_v2: 'bool' =None, jobs_init: 'bool' =None, jobs_v2: 'bool' =None, landing_studios: 'bool' =None, lightning_registry: 'bool' =None, lit_logger: 'bool' =None, lit_logger_storage_v2: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, mmt_v2: 'bool' =None, multiple_deployment_versions: 'bool' =None, multiple_studio_versions: 'bool' =None, org_level_member_permissions: 'bool' =None, pipelines: 'bool' =None, plugin_biz_chat: 'bool' =None, plugin_distributed: 'bool' =None, plugin_fiftyone: 'bool' =None, plugin_inference: 'bool' =None, plugin_label_studio: 'bool' =None, plugin_langflow: 'bool' =None, plugin_lightning_apps: 'bool' =None, plugin_lightning_apps_distributed: 'bool' =None, plugin_mage_ai: 'bool' =None, plugin_milvus: 'bool' =None, plugin_python_profiler: 'bool' =None, plugin_react: 'bool' =None, plugin_service: 'bool' =None, plugin_sweeps: 'bool' =None, plugin_weviate: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, project_selector: 'bool' =None, restart_ide_on_hang: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, security_docs: 'bool' =None, show_dev_admin: 'bool' =None, slurm: 'bool' =None, slurm_machine_selector: 'bool' =None, snapshotter_service: 'bool' =None, snowflake_connection: 'bool' =None, spot_v2: 'bool' =None, studio_config: 'bool' =None, studio_on_stop: 'bool' =None, studio_version_visibility: 'bool' =None, teamspace_storage_tab: 'bool' =None, trainium2: 'bool' =None, use_rclone_mounts_only: 'bool' =None, vultr: 'bool' =None, writable_data_connections: 'bool' =None): # noqa: E501
212
212
  """V1UserFeatures - a model defined in Swagger""" # noqa: E501
213
213
  self._advanced_deployment_autoscaling = None
214
214
  self._affiliate_links = None
@@ -227,9 +227,9 @@ class V1UserFeatures(object):
227
227
  self._custom_app_domain = None
228
228
  self._custom_instance_types = None
229
229
  self._default_one_cluster = None
230
+ self._deployment_alerts = None
230
231
  self._deployment_customize_api = None
231
232
  self._deployment_data_path = None
232
- self._deployment_gallery = None
233
233
  self._deployment_persistent_disk = None
234
234
  self._deployment_version_visibility = None
235
235
  self._docs_agent = None
@@ -239,9 +239,9 @@ class V1UserFeatures(object):
239
239
  self._enable_storage_limits = None
240
240
  self._featured_studios_admin = None
241
241
  self._filesystem_optimisation = None
242
- self._gcp = None
243
242
  self._inference_job_deployment_plugin = None
244
243
  self._instant_capacity_reservation = None
244
+ self._job_artifacts_v2 = None
245
245
  self._jobs_init = None
246
246
  self._jobs_v2 = None
247
247
  self._landing_studios = None
@@ -251,7 +251,6 @@ class V1UserFeatures(object):
251
251
  self._mmt_fault_tolerance = None
252
252
  self._mmt_strategy_selector = None
253
253
  self._mmt_v2 = None
254
- self._model_store = None
255
254
  self._multiple_deployment_versions = None
256
255
  self._multiple_studio_versions = None
257
256
  self._org_level_member_permissions = None
@@ -277,6 +276,7 @@ class V1UserFeatures(object):
277
276
  self._restart_ide_on_hang = None
278
277
  self._restartable_jobs = None
279
278
  self._runnable_public_studio_page = None
279
+ self._security_docs = None
280
280
  self._show_dev_admin = None
281
281
  self._slurm = None
282
282
  self._slurm_machine_selector = None
@@ -326,12 +326,12 @@ class V1UserFeatures(object):
326
326
  self.custom_instance_types = custom_instance_types
327
327
  if default_one_cluster is not None:
328
328
  self.default_one_cluster = default_one_cluster
329
+ if deployment_alerts is not None:
330
+ self.deployment_alerts = deployment_alerts
329
331
  if deployment_customize_api is not None:
330
332
  self.deployment_customize_api = deployment_customize_api
331
333
  if deployment_data_path is not None:
332
334
  self.deployment_data_path = deployment_data_path
333
- if deployment_gallery is not None:
334
- self.deployment_gallery = deployment_gallery
335
335
  if deployment_persistent_disk is not None:
336
336
  self.deployment_persistent_disk = deployment_persistent_disk
337
337
  if deployment_version_visibility is not None:
@@ -350,12 +350,12 @@ class V1UserFeatures(object):
350
350
  self.featured_studios_admin = featured_studios_admin
351
351
  if filesystem_optimisation is not None:
352
352
  self.filesystem_optimisation = filesystem_optimisation
353
- if gcp is not None:
354
- self.gcp = gcp
355
353
  if inference_job_deployment_plugin is not None:
356
354
  self.inference_job_deployment_plugin = inference_job_deployment_plugin
357
355
  if instant_capacity_reservation is not None:
358
356
  self.instant_capacity_reservation = instant_capacity_reservation
357
+ if job_artifacts_v2 is not None:
358
+ self.job_artifacts_v2 = job_artifacts_v2
359
359
  if jobs_init is not None:
360
360
  self.jobs_init = jobs_init
361
361
  if jobs_v2 is not None:
@@ -374,8 +374,6 @@ class V1UserFeatures(object):
374
374
  self.mmt_strategy_selector = mmt_strategy_selector
375
375
  if mmt_v2 is not None:
376
376
  self.mmt_v2 = mmt_v2
377
- if model_store is not None:
378
- self.model_store = model_store
379
377
  if multiple_deployment_versions is not None:
380
378
  self.multiple_deployment_versions = multiple_deployment_versions
381
379
  if multiple_studio_versions is not None:
@@ -426,6 +424,8 @@ class V1UserFeatures(object):
426
424
  self.restartable_jobs = restartable_jobs
427
425
  if runnable_public_studio_page is not None:
428
426
  self.runnable_public_studio_page = runnable_public_studio_page
427
+ if security_docs is not None:
428
+ self.security_docs = security_docs
429
429
  if show_dev_admin is not None:
430
430
  self.show_dev_admin = show_dev_admin
431
431
  if slurm is not None:
@@ -812,6 +812,27 @@ class V1UserFeatures(object):
812
812
 
813
813
  self._default_one_cluster = default_one_cluster
814
814
 
815
+ @property
816
+ def deployment_alerts(self) -> 'bool':
817
+ """Gets the deployment_alerts of this V1UserFeatures. # noqa: E501
818
+
819
+
820
+ :return: The deployment_alerts of this V1UserFeatures. # noqa: E501
821
+ :rtype: bool
822
+ """
823
+ return self._deployment_alerts
824
+
825
+ @deployment_alerts.setter
826
+ def deployment_alerts(self, deployment_alerts: 'bool'):
827
+ """Sets the deployment_alerts of this V1UserFeatures.
828
+
829
+
830
+ :param deployment_alerts: The deployment_alerts of this V1UserFeatures. # noqa: E501
831
+ :type: bool
832
+ """
833
+
834
+ self._deployment_alerts = deployment_alerts
835
+
815
836
  @property
816
837
  def deployment_customize_api(self) -> 'bool':
817
838
  """Gets the deployment_customize_api of this V1UserFeatures. # noqa: E501
@@ -854,27 +875,6 @@ class V1UserFeatures(object):
854
875
 
855
876
  self._deployment_data_path = deployment_data_path
856
877
 
857
- @property
858
- def deployment_gallery(self) -> 'bool':
859
- """Gets the deployment_gallery of this V1UserFeatures. # noqa: E501
860
-
861
-
862
- :return: The deployment_gallery of this V1UserFeatures. # noqa: E501
863
- :rtype: bool
864
- """
865
- return self._deployment_gallery
866
-
867
- @deployment_gallery.setter
868
- def deployment_gallery(self, deployment_gallery: 'bool'):
869
- """Sets the deployment_gallery of this V1UserFeatures.
870
-
871
-
872
- :param deployment_gallery: The deployment_gallery of this V1UserFeatures. # noqa: E501
873
- :type: bool
874
- """
875
-
876
- self._deployment_gallery = deployment_gallery
877
-
878
878
  @property
879
879
  def deployment_persistent_disk(self) -> 'bool':
880
880
  """Gets the deployment_persistent_disk of this V1UserFeatures. # noqa: E501
@@ -1064,27 +1064,6 @@ class V1UserFeatures(object):
1064
1064
 
1065
1065
  self._filesystem_optimisation = filesystem_optimisation
1066
1066
 
1067
- @property
1068
- def gcp(self) -> 'bool':
1069
- """Gets the gcp of this V1UserFeatures. # noqa: E501
1070
-
1071
-
1072
- :return: The gcp of this V1UserFeatures. # noqa: E501
1073
- :rtype: bool
1074
- """
1075
- return self._gcp
1076
-
1077
- @gcp.setter
1078
- def gcp(self, gcp: 'bool'):
1079
- """Sets the gcp of this V1UserFeatures.
1080
-
1081
-
1082
- :param gcp: The gcp of this V1UserFeatures. # noqa: E501
1083
- :type: bool
1084
- """
1085
-
1086
- self._gcp = gcp
1087
-
1088
1067
  @property
1089
1068
  def inference_job_deployment_plugin(self) -> 'bool':
1090
1069
  """Gets the inference_job_deployment_plugin of this V1UserFeatures. # noqa: E501
@@ -1127,6 +1106,27 @@ class V1UserFeatures(object):
1127
1106
 
1128
1107
  self._instant_capacity_reservation = instant_capacity_reservation
1129
1108
 
1109
+ @property
1110
+ def job_artifacts_v2(self) -> 'bool':
1111
+ """Gets the job_artifacts_v2 of this V1UserFeatures. # noqa: E501
1112
+
1113
+
1114
+ :return: The job_artifacts_v2 of this V1UserFeatures. # noqa: E501
1115
+ :rtype: bool
1116
+ """
1117
+ return self._job_artifacts_v2
1118
+
1119
+ @job_artifacts_v2.setter
1120
+ def job_artifacts_v2(self, job_artifacts_v2: 'bool'):
1121
+ """Sets the job_artifacts_v2 of this V1UserFeatures.
1122
+
1123
+
1124
+ :param job_artifacts_v2: The job_artifacts_v2 of this V1UserFeatures. # noqa: E501
1125
+ :type: bool
1126
+ """
1127
+
1128
+ self._job_artifacts_v2 = job_artifacts_v2
1129
+
1130
1130
  @property
1131
1131
  def jobs_init(self) -> 'bool':
1132
1132
  """Gets the jobs_init of this V1UserFeatures. # noqa: E501
@@ -1316,27 +1316,6 @@ class V1UserFeatures(object):
1316
1316
 
1317
1317
  self._mmt_v2 = mmt_v2
1318
1318
 
1319
- @property
1320
- def model_store(self) -> 'bool':
1321
- """Gets the model_store of this V1UserFeatures. # noqa: E501
1322
-
1323
-
1324
- :return: The model_store of this V1UserFeatures. # noqa: E501
1325
- :rtype: bool
1326
- """
1327
- return self._model_store
1328
-
1329
- @model_store.setter
1330
- def model_store(self, model_store: 'bool'):
1331
- """Sets the model_store of this V1UserFeatures.
1332
-
1333
-
1334
- :param model_store: The model_store of this V1UserFeatures. # noqa: E501
1335
- :type: bool
1336
- """
1337
-
1338
- self._model_store = model_store
1339
-
1340
1319
  @property
1341
1320
  def multiple_deployment_versions(self) -> 'bool':
1342
1321
  """Gets the multiple_deployment_versions of this V1UserFeatures. # noqa: E501
@@ -1862,6 +1841,27 @@ class V1UserFeatures(object):
1862
1841
 
1863
1842
  self._runnable_public_studio_page = runnable_public_studio_page
1864
1843
 
1844
+ @property
1845
+ def security_docs(self) -> 'bool':
1846
+ """Gets the security_docs of this V1UserFeatures. # noqa: E501
1847
+
1848
+
1849
+ :return: The security_docs of this V1UserFeatures. # noqa: E501
1850
+ :rtype: bool
1851
+ """
1852
+ return self._security_docs
1853
+
1854
+ @security_docs.setter
1855
+ def security_docs(self, security_docs: 'bool'):
1856
+ """Sets the security_docs of this V1UserFeatures.
1857
+
1858
+
1859
+ :param security_docs: The security_docs of this V1UserFeatures. # noqa: E501
1860
+ :type: bool
1861
+ """
1862
+
1863
+ self._security_docs = security_docs
1864
+
1865
1865
  @property
1866
1866
  def show_dev_admin(self) -> 'bool':
1867
1867
  """Gets the show_dev_admin of this V1UserFeatures. # noqa: E501
lightning_sdk/mmt/base.py CHANGED
@@ -1,3 +1,4 @@
1
+ import warnings
1
2
  from abc import abstractmethod
2
3
  from typing import TYPE_CHECKING, Dict, List, Optional, Protocol, Tuple, Union
3
4
 
@@ -11,7 +12,7 @@ if TYPE_CHECKING:
11
12
  from lightning_sdk.user import User
12
13
 
13
14
  from lightning_sdk.job.base import _BaseJob
14
- from lightning_sdk.utils.resolve import _resolve_deprecated_cluster
15
+ from lightning_sdk.utils.resolve import _resolve_deprecated_cluster, in_studio
15
16
 
16
17
 
17
18
  class MMTMachine(Protocol):
@@ -67,9 +68,10 @@ class _BaseMMT(_BaseJob):
67
68
  interruptible: bool = False,
68
69
  image_credentials: Optional[str] = None,
69
70
  cloud_account_auth: bool = False,
70
- artifacts_local: Optional[str] = None,
71
- artifacts_remote: Optional[str] = None,
72
71
  entrypoint: str = "sh -c",
72
+ path_mappings: Optional[Dict[str, str]] = None,
73
+ artifacts_local: Optional[str] = None, # deprecated in favor of path_mappings
74
+ artifacts_remote: Optional[str] = None, # deprecated in favor of path_mappings
73
75
  cluster: Optional[str] = None, # deprecated in favor of cloud_account
74
76
  ) -> "_BaseMMT":
75
77
  """Run async workloads using a docker image across multiple machines.
@@ -94,21 +96,21 @@ class _BaseMMT(_BaseJob):
94
96
  This should be the name of the respective credentials secret created on the Lightning AI platform.
95
97
  cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
96
98
  Required if the registry is part of a cloud provider (e.g. ECR).
97
- artifacts_local: The path of inside the docker container, you want to persist images from.
98
- CAUTION: When setting this to "/", it will effectively erase your container.
99
- Only supported for jobs with a docker image compute environment.
100
- artifacts_remote: The remote storage to persist your artifacts to.
101
- Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
102
- PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
103
- E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
104
- within it.
105
- Note that the connection needs to be added to the teamspace already in order for it to be found.
106
- Only supported for jobs with a docker image compute environment.
107
99
  entrypoint: The entrypoint of your docker container. Defaults to `sh -c` which
108
100
  just runs the provided command in a standard shell.
109
101
  To use the pre-defined entrypoint of the provided image, set this to an empty string.
110
102
  Only applicable when submitting docker jobs.
103
+ path_mappings: Dictionary of path mappings. The keys are the path inside the container whereas the value
104
+ represents the data-connection name and the path inside that connection.
105
+ Should be of form
106
+ {
107
+ "<CONTAINER_PATH_1>": "<CONNECTION_NAME_1>:<PATH_WITHIN_CONNECTION_1>",
108
+ "<CONTAINER_PATH_2>": "<CONNECTION_NAME_2>"
109
+ }
110
+ If the path inside the connection is omitted it's assumed to be the root path of that connection.
111
+ Only applicable when submitting docker jobs.
111
112
  """
113
+ from lightning_sdk.lightning_cloud.openapi.rest import ApiException
112
114
  from lightning_sdk.studio import Studio
113
115
 
114
116
  cloud_account = _resolve_deprecated_cluster(cloud_account, cluster)
@@ -167,6 +169,13 @@ class _BaseMMT(_BaseJob):
167
169
  "image and studio are mutually exclusive as both define the environment to run the job in"
168
170
  )
169
171
 
172
+ if cloud_account is None and in_studio():
173
+ try:
174
+ resolve_studio = Studio(teamspace=teamspace, user=user, org=org)
175
+ cloud_account = resolve_studio.cloud_account
176
+ except (ValueError, ApiException):
177
+ warnings.warn("Could not infer cloud account from studio. Using teamspace default.")
178
+
170
179
  # they either need to specified both or none of them
171
180
  if bool(artifacts_local) != bool(artifacts_remote):
172
181
  raise ValueError("Artifact persistence requires both artifacts_local and artifacts_remote to be set")
@@ -189,9 +198,10 @@ class _BaseMMT(_BaseJob):
189
198
  interruptible=interruptible,
190
199
  image_credentials=image_credentials,
191
200
  cloud_account_auth=cloud_account_auth,
201
+ entrypoint=entrypoint,
202
+ path_mappings=path_mappings,
192
203
  artifacts_local=artifacts_local,
193
204
  artifacts_remote=artifacts_remote,
194
- entrypoint=entrypoint,
195
205
  )
196
206
  return inst
197
207
 
@@ -208,9 +218,10 @@ class _BaseMMT(_BaseJob):
208
218
  cloud_account: Optional[str] = None,
209
219
  image_credentials: Optional[str] = None,
210
220
  cloud_account_auth: bool = False,
211
- artifacts_local: Optional[str] = None,
212
- artifacts_remote: Optional[str] = None,
213
221
  entrypoint: str = "sh -c",
222
+ path_mappings: Optional[Dict[str, str]] = None,
223
+ artifacts_local: Optional[str] = None, # deprecated in favor of path_mappings
224
+ artifacts_remote: Optional[str] = None, # deprecated in favor of path_mappings
214
225
  ) -> None:
215
226
  """Submit a new multi-machine job to the Lightning AI platform.
216
227
 
@@ -230,19 +241,18 @@ class _BaseMMT(_BaseJob):
230
241
  This should be the name of the respective credentials secret created on the Lightning AI platform.
231
242
  cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
232
243
  Required if the registry is part of a cloud provider (e.g. ECR).
233
- artifacts_local: The path of inside the docker container, you want to persist images from.
234
- CAUTION: When setting this to "/", it will effectively erase your container.
235
- Only supported for jobs with a docker image compute environment.
236
- artifacts_remote: The remote storage to persist your artifacts to.
237
- Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
238
- PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
239
- E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
240
- within it.
241
- Note that the connection needs to be added to the teamspace already in order for it to be found.
242
- Only supported for jobs with a docker image compute environment.
243
244
  entrypoint: The entrypoint of your docker container. Defaults to sh -c.
244
245
  To use the pre-defined entrypoint of the provided image, set this to an empty string.
245
246
  Only applicable when submitting docker jobs.
247
+ path_mappings: Dictionary of path mappings. The keys are the path inside the container whereas the value
248
+ represents the data-connection name and the path inside that connection.
249
+ Should be of form
250
+ {
251
+ "<CONTAINER_PATH_1>": "<CONNECTION_NAME_1>:<PATH_WITHIN_CONNECTION_1>",
252
+ "<CONTAINER_PATH_2>": "<CONNECTION_NAME_2>"
253
+ }
254
+ If the path inside the connection is omitted it's assumed to be the root path of that connection.
255
+ Only applicable when submitting docker jobs.
246
256
  """
247
257
 
248
258
  @property
lightning_sdk/mmt/mmt.py CHANGED
@@ -109,9 +109,10 @@ class MMT(_BaseMMT):
109
109
  interruptible: bool = False,
110
110
  image_credentials: Optional[str] = None,
111
111
  cloud_account_auth: bool = False,
112
+ entrypoint: str = "sh -c",
113
+ path_mappings: Optional[Dict[str, str]] = None,
112
114
  artifacts_local: Optional[str] = None,
113
115
  artifacts_remote: Optional[str] = None,
114
- entrypoint: str = "sh -c",
115
116
  cluster: Optional[str] = None, # deprecated in favor of cloud_account
116
117
  ) -> "MMT":
117
118
  """Run async workloads using a docker image across multiple machines.
@@ -136,19 +137,18 @@ class MMT(_BaseMMT):
136
137
  This should be the name of the respective credentials secret created on the Lightning AI platform.
137
138
  cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
138
139
  Required if the registry is part of a cloud provider (e.g. ECR).
139
- artifacts_local: The path of inside the docker container, you want to persist images from.
140
- CAUTION: When setting this to "/", it will effectively erase your container.
141
- Only supported for jobs with a docker image compute environment.
142
- artifacts_remote: The remote storage to persist your artifacts to.
143
- Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
144
- PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
145
- E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
146
- within it.
147
- Note that the connection needs to be added to the teamspace already in order for it to be found.
148
- Only supported for jobs with a docker image compute environment.
149
140
  entrypoint: The entrypoint of your docker container. Defaults to sh -c.
150
141
  To use the pre-defined entrypoint of the provided image, set this to an empty string.
151
142
  Only applicable when submitting docker jobs.
143
+ path_mappings: Dictionary of path mappings. The keys are the path inside the container whereas the value
144
+ represents the data-connection name and the path inside that connection.
145
+ Should be of form
146
+ {
147
+ "<CONTAINER_PATH_1>": "<CONNECTION_NAME_1>:<PATH_WITHIN_CONNECTION_1>",
148
+ "<CONTAINER_PATH_2>": "<CONNECTION_NAME_2>"
149
+ }
150
+ If the path inside the connection is omitted it's assumed to be the root path of that connection.
151
+ Only applicable when submitting docker jobs.
152
152
  """
153
153
  ret_val = super().run(
154
154
  name=name,
@@ -165,9 +165,10 @@ class MMT(_BaseMMT):
165
165
  interruptible=interruptible,
166
166
  image_credentials=image_credentials,
167
167
  cloud_account_auth=cloud_account_auth,
168
+ entrypoint=entrypoint,
169
+ path_mappings=path_mappings,
168
170
  artifacts_local=artifacts_local,
169
171
  artifacts_remote=artifacts_remote,
170
- entrypoint=entrypoint,
171
172
  cluster=cluster, # deprecated in favor of cloud_account
172
173
  )
173
174
  # required for typing with "MMT"
@@ -190,9 +191,10 @@ class MMT(_BaseMMT):
190
191
  cloud_account: Optional[str] = None,
191
192
  image_credentials: Optional[str] = None,
192
193
  cloud_account_auth: bool = False,
193
- artifacts_local: Optional[str] = None,
194
- artifacts_remote: Optional[str] = None,
195
194
  entrypoint: str = "sh -c",
195
+ path_mappings: Optional[Dict[str, str]] = None,
196
+ artifacts_local: Optional[str] = None, # deprecated in favor of path_mappings
197
+ artifacts_remote: Optional[str] = None, # deprecated in favor of path_mappings
196
198
  ) -> "MMT":
197
199
  """Submit a new multi-machine job to the Lightning AI platform.
198
200
 
@@ -212,20 +214,19 @@ class MMT(_BaseMMT):
212
214
  This should be the name of the respective credentials secret created on the Lightning AI platform.
213
215
  cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
214
216
  Required if the registry is part of a cloud provider (e.g. ECR).
215
- artifacts_local: The path of inside the docker container, you want to persist images from.
216
- CAUTION: When setting this to "/", it will effectively erase your container.
217
- Only supported for jobs with a docker image compute environment.
218
- artifacts_remote: The remote storage to persist your artifacts to.
219
- Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
220
- PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
221
- E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
222
- within it.
223
- Note that the connection needs to be added to the teamspace already in order for it to be found.
224
- Only supported for jobs with a docker image compute environment.
225
217
  entrypoint: The entrypoint of your docker container. Defaults to `sh -c` which
226
218
  just runs the provided command in a standard shell.
227
219
  To use the pre-defined entrypoint of the provided image, set this to an empty string.
228
220
  Only applicable when submitting docker jobs.
221
+ path_mappings: Dictionary of path mappings. The keys are the path inside the container whereas the value
222
+ represents the data-connection name and the path inside that connection.
223
+ Should be of form
224
+ {
225
+ "<CONTAINER_PATH_1>": "<CONNECTION_NAME_1>:<PATH_WITHIN_CONNECTION_1>",
226
+ "<CONTAINER_PATH_2>": "<CONNECTION_NAME_2>"
227
+ }
228
+ If the path inside the connection is omitted it's assumed to be the root path of that connection.
229
+ Only applicable when submitting docker jobs.
229
230
  """
230
231
  self._job = self._internal_mmt._submit(
231
232
  num_machines=num_machines,
@@ -238,9 +239,10 @@ class MMT(_BaseMMT):
238
239
  interruptible=interruptible,
239
240
  image_credentials=image_credentials,
240
241
  cloud_account_auth=cloud_account_auth,
242
+ entrypoint=entrypoint,
243
+ path_mappings=path_mappings,
241
244
  artifacts_local=artifacts_local,
242
245
  artifacts_remote=artifacts_remote,
243
- entrypoint=entrypoint,
244
246
  )
245
247
  return self
246
248
 
lightning_sdk/mmt/v1.py CHANGED
@@ -52,9 +52,10 @@ class _MMTV1(_BaseMMT):
52
52
  cloud_account: Optional[str] = None,
53
53
  image_credentials: Optional[str] = None,
54
54
  cloud_account_auth: bool = False,
55
+ entrypoint: str = "sh -c",
56
+ path_mappings: Optional[Dict[str, str]] = None,
55
57
  artifacts_local: Optional[str] = None,
56
58
  artifacts_remote: Optional[str] = None,
57
- entrypoint: str = "sh -c",
58
59
  ) -> "_MMTV1":
59
60
  """Submit a new multi-machine job to the Lightning AI platform.
60
61
 
@@ -88,6 +89,8 @@ class _MMTV1(_BaseMMT):
88
89
  just runs the provided command in a standard shell.
89
90
  To use the pre-defined entrypoint of the provided image, set this to an empty string.
90
91
  Only applicable when submitting docker jobs.
92
+ path_mappings: The mappings from data connection inside your container (not supported)
93
+
91
94
  """
92
95
  if studio is None:
93
96
  raise ValueError("Studio is required for submitting jobs")
lightning_sdk/mmt/v2.py CHANGED
@@ -51,9 +51,10 @@ class _MMTV2(_BaseMMT):
51
51
  cloud_account: Optional[str] = None,
52
52
  image_credentials: Optional[str] = None,
53
53
  cloud_account_auth: bool = False,
54
- artifacts_local: Optional[str] = None,
55
- artifacts_remote: Optional[str] = None,
56
54
  entrypoint: str = "sh -c",
55
+ path_mappings: Optional[Dict[str, str]] = None,
56
+ artifacts_local: Optional[str] = None, # deprecated in favor of path_mappings
57
+ artifacts_remote: Optional[str] = None, # deprecated in favor of path_mappings
57
58
  ) -> "_MMTV2":
58
59
  """Submit a new multi-machine job to the Lightning AI platform.
59
60
 
@@ -73,20 +74,19 @@ class _MMTV2(_BaseMMT):
73
74
  This should be the name of the respective credentials secret created on the Lightning AI platform.
74
75
  cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
75
76
  Required if the registry is part of a cloud provider (e.g. ECR).
76
- artifacts_local: The path of inside the docker container, you want to persist images from.
77
- CAUTION: When setting this to "/", it will effectively erase your container.
78
- Only supported for jobs with a docker image compute environment.
79
- artifacts_remote: The remote storage to persist your artifacts to.
80
- Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
81
- PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
82
- E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
83
- within it.
84
- Note that the connection needs to be added to the teamspace already in order for it to be found.
85
- Only supported for jobs with a docker image compute environment.
86
77
  entrypoint: The entrypoint of your docker container. Defaults to `sh -c` which
87
78
  just runs the provided command in a standard shell.
88
79
  To use the pre-defined entrypoint of the provided image, set this to an empty string.
89
80
  Only applicable when submitting docker jobs.
81
+ path_mappings: Dictionary of path mappings. The keys are the path inside the container whereas the value
82
+ represents the data-connection name and the path inside that connection.
83
+ Should be of form
84
+ {
85
+ "<CONTAINER_PATH_1>": "<CONNECTION_NAME_1>:<PATH_WITHIN_CONNECTION_1>",
86
+ "<CONTAINER_PATH_2>": "<CONNECTION_NAME_2>"
87
+ }
88
+ If the path inside the connection is omitted it's assumed to be the root path of that connection.
89
+ Only applicable when submitting docker jobs.
90
90
  """
91
91
  # Command is required if Studio is provided to know what to run
92
92
  # Image is mutually exclusive with Studio
@@ -117,9 +117,10 @@ class _MMTV2(_BaseMMT):
117
117
  env=env,
118
118
  image_credentials=image_credentials,
119
119
  cloud_account_auth=cloud_account_auth,
120
+ entrypoint=entrypoint,
121
+ path_mappings=path_mappings,
120
122
  artifacts_local=artifacts_local,
121
123
  artifacts_remote=artifacts_remote,
122
- entrypoint=entrypoint,
123
124
  )
124
125
  self._job = submitted
125
126
  self._name = submitted.name
lightning_sdk/models.py CHANGED
@@ -121,10 +121,11 @@ def download_model(
121
121
  progress_bar=progress_bar,
122
122
  )
123
123
  except ApiException as e:
124
- # if we get an error, check if the teamspace actually exists (and print the list)
125
- # TODO: ideally this would match a specific error about teamspace not being found
126
- _ = _get_teamspace(name=teamspace_name, organization=teamspace_owner_name)
127
- raise e
124
+ if e.status == 404:
125
+ raise RuntimeError(
126
+ f"Model '{name}' not found. Either the model doesn't exist or you don't have access to it."
127
+ ) from None
128
+ raise RuntimeError(f"Error downloading model. Status code: {e.status}.") from None
128
129
 
129
130
 
130
131
  def upload_model(