lightning-sdk 0.1.49__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 (42) hide show
  1. lightning_sdk/__init__.py +1 -1
  2. lightning_sdk/api/job_api.py +18 -13
  3. lightning_sdk/api/lit_container_api.py +41 -11
  4. lightning_sdk/api/mmt_api.py +18 -13
  5. lightning_sdk/api/utils.py +52 -0
  6. lightning_sdk/cli/download.py +20 -1
  7. lightning_sdk/cli/run.py +71 -21
  8. lightning_sdk/cli/serve.py +1 -5
  9. lightning_sdk/cli/upload.py +33 -15
  10. lightning_sdk/helpers.py +1 -1
  11. lightning_sdk/job/base.py +16 -5
  12. lightning_sdk/job/job.py +30 -27
  13. lightning_sdk/job/v1.py +9 -5
  14. lightning_sdk/job/v2.py +14 -14
  15. lightning_sdk/job/work.py +2 -2
  16. lightning_sdk/lightning_cloud/login.py +4 -1
  17. lightning_sdk/lightning_cloud/openapi/__init__.py +3 -0
  18. lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +5 -1
  19. lightning_sdk/lightning_cloud/openapi/api/lit_registry_service_api.py +113 -0
  20. lightning_sdk/lightning_cloud/openapi/models/__init__.py +3 -0
  21. lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +27 -1
  22. lightning_sdk/lightning_cloud/openapi/models/litregistry_lit_repo_name_body.py +123 -0
  23. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +27 -1
  24. lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +27 -1
  25. lightning_sdk/lightning_cloud/openapi/models/v1_deployment_api.py +27 -1
  26. lightning_sdk/lightning_cloud/openapi/models/v1_job_spec.py +27 -1
  27. lightning_sdk/lightning_cloud/openapi/models/v1_path_mapping.py +175 -0
  28. lightning_sdk/lightning_cloud/openapi/models/v1_update_lit_repository_response.py +97 -0
  29. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +79 -79
  30. lightning_sdk/lit_container.py +19 -0
  31. lightning_sdk/mmt/base.py +40 -30
  32. lightning_sdk/mmt/mmt.py +30 -26
  33. lightning_sdk/mmt/v1.py +6 -3
  34. lightning_sdk/mmt/v2.py +16 -15
  35. lightning_sdk/models.py +5 -4
  36. lightning_sdk/utils/resolve.py +7 -0
  37. {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.51.dist-info}/METADATA +2 -2
  38. {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.51.dist-info}/RECORD +42 -39
  39. {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.51.dist-info}/LICENSE +0 -0
  40. {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.51.dist-info}/WHEEL +0 -0
  41. {lightning_sdk-0.1.49.dist-info → lightning_sdk-0.1.51.dist-info}/entry_points.txt +0 -0
  42. {lightning_sdk-0.1.49.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
@@ -76,3 +76,22 @@ class LitContainer:
76
76
  resp = self._api.upload_container(container, teamspace, tag)
77
77
  for line in resp:
78
78
  print(line)
79
+
80
+ def download_container(
81
+ self, container: str, teamspace: str, org: Optional[str] = None, user: Optional[str] = None, tag: str = "latest"
82
+ ) -> None:
83
+ """Download a container from the docker registry.
84
+
85
+ Args:
86
+ container: The name of the container to download.
87
+ teamspace: The teamspace which contains the container.
88
+ org: The organization which contains the container.
89
+ user: The user which contains the container.
90
+ tag: The tag to use for the container.
91
+ """
92
+ try:
93
+ teamspace = _resolve_teamspace(teamspace=teamspace, org=org, user=user)
94
+ except Exception as e:
95
+ raise ValueError(f"Could not resolve teamspace: {e}") from e
96
+
97
+ return self._api.download_container(container, teamspace, tag)
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):
@@ -23,7 +24,7 @@ class MMTMachine(Protocol):
23
24
  ...
24
25
 
25
26
  @property
26
- def machine(self) -> "Machine":
27
+ def machine(self) -> Union["Machine", str]:
27
28
  """The actual machine type this node is running on."""
28
29
  ...
29
30
 
@@ -54,7 +55,7 @@ class _BaseMMT(_BaseJob):
54
55
  def run(
55
56
  cls,
56
57
  name: str,
57
- machine: "Machine",
58
+ machine: Union["Machine", str],
58
59
  num_machines: int,
59
60
  command: Optional[str] = None,
60
61
  studio: Union["Studio", str, None] = None,
@@ -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
 
@@ -199,7 +209,7 @@ class _BaseMMT(_BaseJob):
199
209
  def _submit(
200
210
  self,
201
211
  num_machines: int,
202
- machine: "Machine",
212
+ machine: Union["Machine", str],
203
213
  command: Optional[str] = None,
204
214
  studio: Optional["Studio"] = None,
205
215
  image: Optional[str] = None,
@@ -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
@@ -257,7 +267,7 @@ class _BaseMMT(_BaseJob):
257
267
 
258
268
  @property
259
269
  @abstractmethod
260
- def machine(self) -> "Machine":
270
+ def machine(self) -> Union["Machine", str]:
261
271
  """Returns the machine type this job is running on."""
262
272
 
263
273
  @abstractmethod
lightning_sdk/mmt/mmt.py CHANGED
@@ -97,7 +97,7 @@ class MMT(_BaseMMT):
97
97
  cls,
98
98
  name: str,
99
99
  num_machines: int,
100
- machine: "Machine",
100
+ machine: Union["Machine", str],
101
101
  command: Optional[str] = None,
102
102
  studio: Union["Studio", str, None] = None,
103
103
  image: Union[str, None] = None,
@@ -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,6 +165,8 @@ 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
172
  cluster=cluster, # deprecated in favor of cloud_account
@@ -180,7 +182,7 @@ class MMT(_BaseMMT):
180
182
  def _submit(
181
183
  self,
182
184
  num_machines: int,
183
- machine: "Machine",
185
+ machine: Union["Machine", str],
184
186
  command: Optional[str] = None,
185
187
  studio: Optional["Studio"] = None,
186
188
  image: Optional[str] = None,
@@ -189,9 +191,10 @@ class MMT(_BaseMMT):
189
191
  cloud_account: Optional[str] = None,
190
192
  image_credentials: Optional[str] = None,
191
193
  cloud_account_auth: bool = False,
192
- artifacts_local: Optional[str] = None,
193
- artifacts_remote: Optional[str] = None,
194
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
195
198
  ) -> "MMT":
196
199
  """Submit a new multi-machine job to the Lightning AI platform.
197
200
 
@@ -211,20 +214,19 @@ class MMT(_BaseMMT):
211
214
  This should be the name of the respective credentials secret created on the Lightning AI platform.
212
215
  cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
213
216
  Required if the registry is part of a cloud provider (e.g. ECR).
214
- artifacts_local: The path of inside the docker container, you want to persist images from.
215
- CAUTION: When setting this to "/", it will effectively erase your container.
216
- Only supported for jobs with a docker image compute environment.
217
- artifacts_remote: The remote storage to persist your artifacts to.
218
- Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
219
- PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
220
- E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
221
- within it.
222
- Note that the connection needs to be added to the teamspace already in order for it to be found.
223
- Only supported for jobs with a docker image compute environment.
224
217
  entrypoint: The entrypoint of your docker container. Defaults to `sh -c` which
225
218
  just runs the provided command in a standard shell.
226
219
  To use the pre-defined entrypoint of the provided image, set this to an empty string.
227
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.
228
230
  """
229
231
  self._job = self._internal_mmt._submit(
230
232
  num_machines=num_machines,
@@ -237,6 +239,8 @@ class MMT(_BaseMMT):
237
239
  interruptible=interruptible,
238
240
  image_credentials=image_credentials,
239
241
  cloud_account_auth=cloud_account_auth,
242
+ entrypoint=entrypoint,
243
+ path_mappings=path_mappings,
240
244
  artifacts_local=artifacts_local,
241
245
  artifacts_remote=artifacts_remote,
242
246
  )
@@ -264,7 +268,7 @@ class MMT(_BaseMMT):
264
268
  return self._internal_mmt.machines
265
269
 
266
270
  @property
267
- def machine(self) -> "Machine":
271
+ def machine(self) -> Union["Machine", str]:
268
272
  """Returns the machine type this job is running on."""
269
273
  return self._internal_mmt.machine
270
274