lightning-sdk 0.1.3__py3-none-any.whl → 0.1.46__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lightning_sdk/__init__.py +12 -2
- lightning_sdk/agents.py +46 -0
- lightning_sdk/ai_hub.py +185 -0
- lightning_sdk/api/__init__.py +4 -0
- lightning_sdk/api/agents_api.py +107 -0
- lightning_sdk/api/ai_hub_api.py +130 -0
- lightning_sdk/api/deployment_api.py +574 -0
- lightning_sdk/api/job_api.py +308 -0
- lightning_sdk/api/mmt_api.py +188 -0
- lightning_sdk/api/org_api.py +1 -3
- lightning_sdk/api/studio_api.py +172 -81
- lightning_sdk/api/teamspace_api.py +219 -20
- lightning_sdk/api/user_api.py +24 -9
- lightning_sdk/api/utils.py +429 -48
- lightning_sdk/cli/ai_hub.py +49 -0
- lightning_sdk/cli/download.py +132 -0
- lightning_sdk/cli/entrypoint.py +11 -3
- lightning_sdk/cli/run.py +206 -0
- lightning_sdk/cli/serve.py +218 -0
- lightning_sdk/cli/studios_menu.py +78 -0
- lightning_sdk/cli/upload.py +79 -89
- lightning_sdk/constants.py +29 -1
- lightning_sdk/deployment/__init__.py +25 -0
- lightning_sdk/deployment/deployment.py +389 -0
- lightning_sdk/helpers.py +49 -0
- lightning_sdk/job/__init__.py +5 -0
- lightning_sdk/job/base.py +295 -0
- lightning_sdk/job/job.py +266 -0
- lightning_sdk/job/v1.py +241 -0
- lightning_sdk/job/v2.py +193 -0
- lightning_sdk/job/work.py +72 -0
- lightning_sdk/lightning_cloud/__version__.py +1 -1
- lightning_sdk/lightning_cloud/cli/__main__.py +15 -13
- lightning_sdk/lightning_cloud/env.py +1 -0
- lightning_sdk/lightning_cloud/login.py +12 -8
- lightning_sdk/lightning_cloud/openapi/__init__.py +288 -42
- lightning_sdk/lightning_cloud/openapi/api/__init__.py +10 -0
- lightning_sdk/lightning_cloud/openapi/api/analytics_service_api.py +141 -0
- lightning_sdk/lightning_cloud/openapi/api/assistants_service_api.py +1075 -227
- lightning_sdk/lightning_cloud/openapi/api/billing_service_api.py +9 -1
- lightning_sdk/lightning_cloud/openapi/api/cloud_space_service_api.py +992 -233
- lightning_sdk/lightning_cloud/openapi/api/cluster_service_api.py +883 -120
- lightning_sdk/lightning_cloud/openapi/api/data_connection_service_api.py +10 -5
- lightning_sdk/lightning_cloud/openapi/api/deployment_templates_service_api.py +756 -0
- lightning_sdk/lightning_cloud/openapi/api/endpoint_service_api.py +422 -1
- lightning_sdk/lightning_cloud/openapi/api/experiments_service_api.py +242 -0
- lightning_sdk/lightning_cloud/openapi/api/file_system_service_api.py +674 -0
- lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +3823 -0
- lightning_sdk/lightning_cloud/openapi/api/lightningapp_instance_service_api.py +158 -594
- lightning_sdk/lightning_cloud/openapi/api/lightningapp_v2_service_api.py +0 -1086
- lightning_sdk/lightning_cloud/openapi/api/lightningwork_service_api.py +113 -0
- lightning_sdk/lightning_cloud/openapi/api/lit_logger_service_api.py +1753 -0
- lightning_sdk/lightning_cloud/openapi/api/lit_registry_service_api.py +242 -0
- lightning_sdk/lightning_cloud/openapi/api/models_store_api.py +1423 -108
- lightning_sdk/lightning_cloud/openapi/api/organizations_service_api.py +421 -1
- lightning_sdk/lightning_cloud/openapi/api/profiler_service_api.py +663 -0
- lightning_sdk/lightning_cloud/openapi/api/projects_service_api.py +5 -1
- lightning_sdk/lightning_cloud/openapi/api/secret_service_api.py +478 -1
- lightning_sdk/lightning_cloud/openapi/api/slurm_jobs_user_service_api.py +9 -5
- lightning_sdk/lightning_cloud/openapi/api/snowflake_service_api.py +686 -0
- lightning_sdk/lightning_cloud/openapi/api/storage_service_api.py +1094 -0
- lightning_sdk/lightning_cloud/openapi/api/studio_jobs_service_api.py +4 -4
- lightning_sdk/lightning_cloud/openapi/api/user_service_api.py +1081 -34
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +278 -40
- lightning_sdk/lightning_cloud/openapi/models/affiliatelinks_id_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/agentmanagedendpoints_id_body.py +305 -0
- lightning_sdk/lightning_cloud/openapi/models/{assistants_id_body.py → agents_id_body.py} +201 -71
- lightning_sdk/lightning_cloud/openapi/models/app_id_works_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/approveautojoindomain_domain_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/apps_id_body1.py +107 -3
- lightning_sdk/lightning_cloud/openapi/models/assistant_id_conversations_body.py +1 -27
- lightning_sdk/lightning_cloud/openapi/models/{v1_get_cluster_health_response.py → captures_id_body.py} +16 -16
- lightning_sdk/lightning_cloud/openapi/models/cloud_space_id_versionpublications_body1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/cloudspace_id_runs_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/cloudspaces_id_body.py +58 -6
- lightning_sdk/lightning_cloud/openapi/models/cluster_id_capacityblock_body.py +253 -0
- lightning_sdk/lightning_cloud/openapi/models/cluster_id_capacityreservations_body.py +55 -3
- lightning_sdk/lightning_cloud/openapi/models/cluster_id_proxies_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/create.py +157 -1
- lightning_sdk/lightning_cloud/openapi/models/create_deployment_request_defines_a_spec_for_the_job_that_allows_for_autoscaling_jobs.py +383 -0
- lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +565 -0
- lightning_sdk/lightning_cloud/openapi/models/deploymenttemplates_id_body.py +513 -0
- lightning_sdk/lightning_cloud/openapi/models/endpoints_id_body.py +43 -17
- lightning_sdk/lightning_cloud/openapi/models/experiment_name_variant_name_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/externalv1_cloud_space_instance_status.py +107 -1
- lightning_sdk/lightning_cloud/openapi/models/externalv1_lightningapp_instance.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/externalv1_user_status.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/fileendpoints_id_body.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/id_codeconfig_body.py +29 -55
- lightning_sdk/lightning_cloud/openapi/models/id_engage_body.py +3 -29
- lightning_sdk/lightning_cloud/openapi/models/id_engage_body1.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/id_execute_body.py +3 -55
- lightning_sdk/lightning_cloud/openapi/models/id_execute_body1.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/id_get_body.py +133 -3
- lightning_sdk/lightning_cloud/openapi/models/id_index_body.py +67 -15
- lightning_sdk/lightning_cloud/openapi/models/id_index_body2.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/id_index_body3.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/id_reportlogsactivity_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/id_start_body.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/id_storage_body.py +52 -26
- lightning_sdk/lightning_cloud/openapi/models/id_visibility_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/jobs_id_body1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/jobs_id_body2.py +17 -43
- lightning_sdk/lightning_cloud/openapi/models/jobs_id_body3.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/litloggermetrics_id_body.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/litpages_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/loggermetrics_id_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/metrics_stream_id_loggerartifacts_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/metricsstream_create_body.py +383 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_cloud_space_id_list.py → metricsstream_delete_body.py} +10 -10
- lightning_sdk/lightning_cloud/openapi/models/metricsstream_id_body.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_upload_model_response.py → model_id_versions_body.py} +25 -51
- lightning_sdk/lightning_cloud/openapi/models/model_id_visibility_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/models_model_id_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/multimachinejobs_id_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/org_id_memberships_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/orgs_id_body.py +183 -1
- lightning_sdk/lightning_cloud/openapi/models/profiler_captures_body.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/profiler_enabled_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/project_id_agentmanagedendpoints_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/{project_id_assistants_body.py → project_id_agents_body.py} +159 -55
- lightning_sdk/lightning_cloud/openapi/models/project_id_cloudspaces_body.py +71 -19
- lightning_sdk/lightning_cloud/openapi/models/project_id_fileendpoints_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/project_id_jobs_body.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/project_id_litregistry_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/project_id_memberships_body.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/{v1_upload_model_request.py → project_id_models_body.py} +70 -70
- lightning_sdk/lightning_cloud/openapi/models/project_id_multimachinejobs_body.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/project_id_secrets_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/project_id_snowflake_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/projects_id_body.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/query_query_id_body.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/secrets_id_body1.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/servers_server_id_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/service_artifact_artifact_kind.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/serviceexecution_id_body.py +43 -43
- lightning_sdk/lightning_cloud/openapi/models/slurm_jobs_body.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/snowflake_export_body.py +305 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_download_model_response.py → snowflake_query_body.py} +51 -51
- lightning_sdk/lightning_cloud/openapi/models/storage_complete_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/update.py +105 -1
- lightning_sdk/lightning_cloud/openapi/models/upload_id_complete_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/upload_id_parts_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/user_id_affiliatelinks_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_accelerator_quota_info.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_ack_user_storage_violation_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_add_job_timing_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_affiliate_link.py +435 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_agent_job.py +131 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_api_pricing_spec.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_app_type.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_append_logger_metrics_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_approve_auto_join_domain_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_assign_variant_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_assistant.py +131 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_assistant_knowledge_item_status.py +253 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_assistant_knowledge_status.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_assistant_model_status.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_auto_join_domain_validation.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_auto_join_org_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_autoscaling_spec.py +305 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_autoscaling_target_metric.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_aws_direct_v1.py +133 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_batch_update_lightningwork_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cancellation_metadata.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_capacity_block_offering.py +383 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_check_snowflake_connection_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_checkbox.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space.py +136 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_code_version.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_instance_config.py +1 -53
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_instance_startup_status.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/{v1_cluster_log_service.py → v1_cloud_space_session.py} +49 -49
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_version.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_accelerator.py +445 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_capacity_reservation.py +55 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_names.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_proxy.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_resource_tag.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_security_options.py +357 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +157 -107
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_state.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_status.py +17 -43
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_tagging_options.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_type.py +0 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_command_argument.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_complete_model_upload_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_complete_multi_part_upload_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_completed_part.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_conversation.py +15 -15
- lightning_sdk/lightning_cloud/openapi/models/v1_conversation_response_chunk.py +26 -26
- lightning_sdk/lightning_cloud/openapi/models/v1_count_metrics_streams_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_create_checkout_session_request.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_cluster_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_deployment_template_request.py +539 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_create_multi_part_upload_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_create_organization_request.py +159 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_create_project_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_shared_metrics_stream_request.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_create_shared_metrics_stream_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_create_snowflake_connection_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_create_user_secret_request.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_data_connection.py +365 -1
- lightning_sdk/lightning_cloud/openapi/models/{v1_cluster_performance_profile.py → v1_data_connection_state.py} +11 -9
- lightning_sdk/lightning_cloud/openapi/models/v1_data_path.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_affiliate_link_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_cloud_space_session_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_cluster_proxy_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_deployment_release_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_azure_cluster_driver_status.py → v1_delete_deployment_response.py} +6 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_index_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_byom_cluster_driver.py → v1_delete_job_response.py} +6 -6
- lightning_sdk/lightning_cloud/openapi/models/{v1_delete_lightningapp_v2_response.py → v1_delete_logger_artifact_response.py} +6 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_managed_endpoint_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_metrics_stream_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_multi_machine_job_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_profiler_capture_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_delete_lightningapp_release_response.py → v1_delete_shared_metrics_stream_response.py} +6 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +617 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_api.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_event.py +357 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_event_type.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_metrics.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_performance.py +305 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_release.py +331 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_spec.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_state.py +105 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_status.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/{appsv2_id_body.py → v1_deployment_strategy.py} +39 -39
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template.py +721 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_engagement_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_gallery_response.py +591 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_parameter.py +435 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_parameter_placement.py +106 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_parameter_type.py +106 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_summary.py +591 -0
- lightning_sdk/lightning_cloud/openapi/models/{instance_type_availability.py → v1_deployment_template_type.py} +10 -10
- lightning_sdk/lightning_cloud/openapi/models/{v1_get_lightningapp_source_code_download_url_response.py → v1_download_job_logs_response.py} +10 -10
- lightning_sdk/lightning_cloud/openapi/models/v1_download_service_execution_artifact_response.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_ebs.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_efs_config.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_endpoint.py +53 -27
- lightning_sdk/lightning_cloud/openapi/models/v1_endpoint_auth.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_endpoint_type.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_execute_cloud_space_command_response.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_execute_in_cloud_space_session_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_execute_snowflake_query_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_experiment.py +409 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_export_snowflake_query_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_file_endpoint.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/{v1_instance_spec.py → v1_filesystem_app.py} +85 -59
- lightning_sdk/lightning_cloud/openapi/models/v1_filesystem_cloud_space.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_filesystem_dataset.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_filesystem_job.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_filesystem_slurm_job.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_filesystem_snowflake_connection.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_filesystem_work.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_find_capacity_block_offering_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_gcp_data_connection.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_gcs_folder_data_connection.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_affiliate_link_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_list_cluster_instance_types_response.py → v1_get_deployment_routing_telemetry_aggregated_response.py} +23 -23
- lightning_sdk/lightning_cloud/openapi/models/v1_get_deployment_routing_telemetry_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_folder_index_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/{v1_cluster_driver_status.py → v1_get_job_stats_response.py} +39 -39
- lightning_sdk/lightning_cloud/openapi/models/v1_get_job_system_metrics_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_lightningapp_instance_open_ports_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_logger_metrics_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_file_upload_urls_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_file_url_response.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_files_response.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_files_url_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_lightningwork_cluster_driver.py → v1_get_project_artifact_response.py} +33 -14
- lightning_sdk/lightning_cloud/openapi/models/v1_get_project_balance_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_project_storage_metadata_response.py +383 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_service_execution_status_response.py +67 -15
- lightning_sdk/lightning_cloud/openapi/models/v1_get_snowflake_query_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_user_balance_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_user_response.py +105 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_user_storage_breakdown_response.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_user_storage_response.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_google_cloud_direct_v1.py +163 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_google_cloud_direct_v1_status.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_header.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_external_kubeconfig.py → v1_health_check_exec.py} +21 -21
- lightning_sdk/lightning_cloud/openapi/models/v1_health_check_http_get.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_ids_logger_metrics.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_input.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_interrupt_server_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_job.py +697 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_job_health_check_config.py +253 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_job_log_entry.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_job_logs_page.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_job_logs_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_job_spec.py +669 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_job_timing.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_joinable_organization.py +331 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_knowledge_configuration.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_lambda_labs_direct_v1.py +125 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_lightning_run.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_lightningapp_instance_spec.py +105 -27
- lightning_sdk/lightning_cloud/openapi/models/v1_lightningapp_instance_status.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_lightningwork_spec.py +27 -27
- lightning_sdk/lightning_cloud/openapi/models/v1_lightningwork_status.py +81 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_list_affiliate_links_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_cloud_space_python_versions_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_cloud_space_sessions_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_cloud_space_tags_response.py +6 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_list_cluster_availabilities_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_cluster_proxies_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_deployment_events_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_deployment_releases_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_deployment_tags_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_deployment_templates_response.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_deployments_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_experiments_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_filesystem_apps_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_filesystem_cloud_spaces_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_filesystem_datasets_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_filesystem_jobs_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_filesystem_slurm_jobs_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_filesystem_snowflake_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_list_lightningapps_v2_response.py → v1_list_jobs_response.py} +31 -31
- lightning_sdk/lightning_cloud/openapi/models/v1_list_joinable_organizations_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_logger_artifact_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_metrics_streams_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_multi_machine_job_events_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_multi_machine_jobs_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_new_features_for_user_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_profiler_captures_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_project_locked_resources_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_published_cloud_spaces_response.py +3 -29
- lightning_sdk/lightning_cloud/openapi/models/v1_list_published_deployment_templates_response.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_service_execution_lightningapp_instances_response.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_lit_page.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_lit_registry_project.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_lit_repository.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_locked_resource.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_logger_artifact.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_machines_selector.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_magic_link_login_request.py +81 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_magic_link_login_response.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_managed_endpoint.py +175 -19
- lightning_sdk/lightning_cloud/openapi/models/v1_managed_model.py +305 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_managed_model_abilities.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_membership.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_message.py +138 -8
- lightning_sdk/lightning_cloud/openapi/models/v1_message_content.py +6 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_message_content_type.py +103 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_metadata.py +131 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_metric_value.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_metrics.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_metrics_stream.py +799 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_metrics_tags.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_metrics_tracker.py +383 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_model.py +95 -17
- lightning_sdk/lightning_cloud/openapi/models/v1_model_file.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_model_version_archive.py +131 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_mount_target.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job.py +487 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_event.py +331 -0
- lightning_sdk/lightning_cloud/openapi/models/{get_cluster_health_response_health_status.py → v1_multi_machine_job_event_type.py} +9 -9
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_fault_tolerance.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_fault_tolerance_strategy.py +105 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_state.py +108 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_multi_machine_job_status.py +305 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_named_get_logger_metrics.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_new_feature.py +383 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_onboarding_event_request.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_onboarding_event_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_organization.py +209 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_parameterization_spec.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_path_telemetry.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_phase_type.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_profiler_capture.py +357 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_profiler_enabled_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_project.py +131 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_project_membership.py +263 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_project_settings.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_project_storage.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_published_cloud_space_response.py +188 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_purchase_capacity_block_response.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_query_param.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_query_result.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_query_result_row.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_refresh_path_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_regional_load_balancer.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_report_logs_activity_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_request_cluster_access_request.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_request_cluster_access_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/{v1_cloud_space_tag.py → v1_resource_tag.py} +18 -18
- lightning_sdk/lightning_cloud/openapi/models/v1_resource_visibility.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_resources.py +37 -11
- lightning_sdk/lightning_cloud/openapi/models/v1_restore_deployment_release_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_rolling_update_strategy.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_rule_condition.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_rule_resource.py +11 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_s3_folder_data_connection.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_search_job_logs_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_secret.py +107 -3
- lightning_sdk/lightning_cloud/openapi/models/{v1_lightningapp_cluster_driver.py → v1_secret_type.py} +10 -9
- lightning_sdk/lightning_cloud/openapi/models/v1_select.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_server_check_in_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_service_artifact.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_service_execution.py +43 -43
- lightning_sdk/lightning_cloud/openapi/models/v1_should_start_syncing_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_signed_url.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_slurm_job.py +131 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_slurm_node.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_slurm_v1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_snowflake_data_connection.py +253 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_status_code_telemetry.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_storage_asset.py +253 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_storage_asset_type.py +105 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_studio_job_app.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_system_info.py +617 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_telemetry.py +331 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_timestamp_code_telemetry.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_transaction.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_transfer_user_balance_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_update_billing_subscription_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_update_cluster_accelerators_request.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_index_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_metrics_stream_visibility_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_model_visibility_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_shared_metrics_stream_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_snowflake_query_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_user_request.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_update_user_viewed_new_features_request.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_user_viewed_new_features_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_upstream_cloud_space.py +97 -19
- lightning_sdk/lightning_cloud/openapi/models/v1_upstream_job.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_usage.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_usage_details.py +107 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +1006 -330
- lightning_sdk/lightning_cloud/openapi/models/v1_user_requested_compute_config.py +45 -45
- lightning_sdk/lightning_cloud/openapi/models/v1_user_requested_flow_compute_config.py +29 -29
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_assistant_status_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_auto_join_domain_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_data_connection_response.py +107 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_deployment_image_request.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_deployment_image_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_managed_endpoint_request.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_managed_endpoint_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_validate_managed_model_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_volume.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_vultr_direct_v1.py +125 -0
- lightning_sdk/lightning_cloud/openapi/models/validate.py +97 -19
- lightning_sdk/lightning_cloud/openapi/models/validateautojoindomain_domain_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/version_uploads_body.py +123 -0
- lightning_sdk/lightning_cloud/rest_client.py +47 -23
- lightning_sdk/lightning_cloud/source_code/logs_socket_api.py +1 -1
- lightning_sdk/lightning_cloud/source_code/tar.py +1 -3
- lightning_sdk/lightning_cloud/utils/data_connection.py +145 -7
- lightning_sdk/machine.py +17 -4
- lightning_sdk/mmt/__init__.py +4 -0
- lightning_sdk/mmt/base.py +288 -0
- lightning_sdk/mmt/mmt.py +282 -0
- lightning_sdk/mmt/v1.py +185 -0
- lightning_sdk/mmt/v2.py +193 -0
- lightning_sdk/models.py +153 -0
- lightning_sdk/organization.py +1 -1
- lightning_sdk/plugin.py +207 -41
- lightning_sdk/services/__init__.py +2 -1
- lightning_sdk/services/file_endpoint.py +116 -213
- lightning_sdk/services/finetune/__init__.py +13 -15
- lightning_sdk/services/utilities.py +99 -26
- lightning_sdk/status.py +2 -1
- lightning_sdk/studio.py +90 -17
- lightning_sdk/teamspace.py +189 -11
- lightning_sdk/user.py +1 -1
- lightning_sdk/utils/__init__.py +0 -0
- lightning_sdk/utils/dynamic.py +61 -0
- lightning_sdk/utils/enum.py +116 -0
- lightning_sdk/{utils.py → utils/resolve.py} +41 -4
- lightning_sdk-0.1.46.dist-info/LICENSE +21 -0
- {lightning_sdk-0.1.3.dist-info → lightning_sdk-0.1.46.dist-info}/METADATA +30 -4
- {lightning_sdk-0.1.3.dist-info → lightning_sdk-0.1.46.dist-info}/RECORD +482 -204
- {lightning_sdk-0.1.3.dist-info → lightning_sdk-0.1.46.dist-info}/WHEEL +1 -1
- lightning_sdk/lightning_cloud/openapi/models/app_id_releases_body.py +0 -541
- lightning_sdk/lightning_cloud/openapi/models/id_endpoint_body.py +0 -409
- lightning_sdk/lightning_cloud/openapi/models/id_get_body1.py +0 -333
- lightning_sdk/lightning_cloud/openapi/models/project_id_appsv2_body.py +0 -201
- lightning_sdk/lightning_cloud/openapi/models/v1_aws_cluster_driver_spec.py +0 -1039
- lightning_sdk/lightning_cloud/openapi/models/v1_aws_cluster_secondary_region_spec.py +0 -253
- lightning_sdk/lightning_cloud/openapi/models/v1_azure_cluster_driver_spec.py +0 -227
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_driver.py +0 -175
- lightning_sdk/lightning_cloud/openapi/models/v1_container_resources.py +0 -201
- lightning_sdk/lightning_cloud/openapi/models/v1_eks_custer_driver_status.py +0 -387
- lightning_sdk/lightning_cloud/openapi/models/v1_instance_type.py +0 -305
- lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_cluster_driver.py +0 -359
- lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_cluster_status.py +0 -279
- lightning_sdk/lightning_cloud/openapi/models/v1_lightningapp_release.py +0 -697
- lightning_sdk/lightning_cloud/openapi/models/v1_lightningapp_v2.py +0 -331
- lightning_sdk/services/uploader.py +0 -123
- {lightning_sdk-0.1.3.dist-info → lightning_sdk-0.1.46.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-0.1.3.dist-info → lightning_sdk-0.1.46.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
from typing import TYPE_CHECKING, Dict, Optional, Protocol, Tuple, Union
|
|
3
|
+
|
|
4
|
+
if TYPE_CHECKING:
|
|
5
|
+
from lightning_sdk.machine import Machine
|
|
6
|
+
from lightning_sdk.organization import Organization
|
|
7
|
+
from lightning_sdk.status import Status
|
|
8
|
+
from lightning_sdk.studio import Studio
|
|
9
|
+
from lightning_sdk.teamspace import Teamspace
|
|
10
|
+
from lightning_sdk.user import User
|
|
11
|
+
|
|
12
|
+
from lightning_sdk.job.base import _BaseJob
|
|
13
|
+
from lightning_sdk.utils.resolve import _resolve_deprecated_cluster
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class MMTMachine(Protocol):
|
|
17
|
+
"""A single machine in multi-machine training."""
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def name(self) -> str:
|
|
21
|
+
"""The Name of the individual machine. Usually corresponds to the rank."""
|
|
22
|
+
...
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def machine(self) -> "Machine":
|
|
26
|
+
"""The actual machine type this node is running on."""
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def artifact_path(self) -> Optional[str]:
|
|
31
|
+
"""The path to the artifacts of this job."""
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def status(self) -> "Status":
|
|
36
|
+
"""The status of this job."""
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def logs(self) -> str:
|
|
41
|
+
"""The logs of the given machine."""
|
|
42
|
+
...
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class _BaseMMT(_BaseJob):
|
|
46
|
+
"""Base interface to all job types."""
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def run(
|
|
50
|
+
cls,
|
|
51
|
+
name: str,
|
|
52
|
+
machine: "Machine",
|
|
53
|
+
num_machines: int,
|
|
54
|
+
command: Optional[str] = None,
|
|
55
|
+
studio: Union["Studio", str, None] = None,
|
|
56
|
+
image: Optional[str] = None,
|
|
57
|
+
teamspace: Union[str, "Teamspace", None] = None,
|
|
58
|
+
org: Union[str, "Organization", None] = None,
|
|
59
|
+
user: Union[str, "User", None] = None,
|
|
60
|
+
cloud_account: Optional[str] = None,
|
|
61
|
+
env: Optional[Dict[str, str]] = None,
|
|
62
|
+
interruptible: bool = False,
|
|
63
|
+
image_credentials: Optional[str] = None,
|
|
64
|
+
cloud_account_auth: bool = False,
|
|
65
|
+
artifacts_local: Optional[str] = None,
|
|
66
|
+
artifacts_remote: Optional[str] = None,
|
|
67
|
+
cluster: Optional[str] = None, # deprecated in favor of cloud_account
|
|
68
|
+
) -> "_BaseMMT":
|
|
69
|
+
"""Run async workloads using a docker image across multiple machines.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
name: The name of the job. Needs to be unique within the teamspace.
|
|
73
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
74
|
+
num_machine: The number of machines to run on.
|
|
75
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
76
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
77
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
78
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
79
|
+
teamspace: The teamspace the job should be associated with. Defaults to the current teamspace.
|
|
80
|
+
org: The organization owning the teamspace (if any). Defaults to the current organization.
|
|
81
|
+
user: The user owning the teamspace (if any). Defaults to the current user.
|
|
82
|
+
cloud_account: The cloud account to run the job on.
|
|
83
|
+
Defaults to the studio cloud account if running with studio compute env.
|
|
84
|
+
If not provided will fall back to the teamspaces default cloud account.
|
|
85
|
+
env: Environment variables to set inside the job.
|
|
86
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
87
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
88
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
89
|
+
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
90
|
+
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
91
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
92
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
93
|
+
Only supported for jobs with a docker image compute environment.
|
|
94
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
95
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
96
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
97
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
98
|
+
within it.
|
|
99
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
100
|
+
Only supported for jobs with a docker image compute environment.
|
|
101
|
+
"""
|
|
102
|
+
from lightning_sdk.studio import Studio
|
|
103
|
+
|
|
104
|
+
cloud_account = _resolve_deprecated_cluster(cloud_account, cluster)
|
|
105
|
+
|
|
106
|
+
if num_machines <= 1:
|
|
107
|
+
raise ValueError("Multi-Machine training cannot be run with less than 2 Machines")
|
|
108
|
+
|
|
109
|
+
if not name:
|
|
110
|
+
raise ValueError("A job needs to have a name!")
|
|
111
|
+
|
|
112
|
+
if image is None:
|
|
113
|
+
if not isinstance(studio, Studio):
|
|
114
|
+
studio = Studio(
|
|
115
|
+
name=studio, teamspace=teamspace, org=org, user=user, cloud_account=cloud_account, create_ok=False
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
# studio is a Studio instance at this point
|
|
119
|
+
if teamspace is None:
|
|
120
|
+
teamspace = studio.teamspace
|
|
121
|
+
else:
|
|
122
|
+
teamspace_name = teamspace if isinstance(teamspace, str) else teamspace.name
|
|
123
|
+
|
|
124
|
+
if studio.teamspace.name != teamspace_name:
|
|
125
|
+
raise ValueError(
|
|
126
|
+
"Studio teamspace does not match provided teamspace. "
|
|
127
|
+
"Can only run jobs with Studio envs in the teamspace of that Studio."
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
if cloud_account is None:
|
|
131
|
+
cloud_account = studio.cloud_account
|
|
132
|
+
|
|
133
|
+
if cloud_account != studio.cloud_account:
|
|
134
|
+
raise ValueError(
|
|
135
|
+
"Studio cloud_account does not match provided cloud_account. "
|
|
136
|
+
"Can only run jobs with Studio envs in the same cloud_account."
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
if image_credentials is not None:
|
|
140
|
+
raise ValueError("image_credentials is only supported when using a custom image")
|
|
141
|
+
|
|
142
|
+
if cloud_account_auth:
|
|
143
|
+
raise ValueError("cloud_account_auth is only supported when using a custom image")
|
|
144
|
+
|
|
145
|
+
if artifacts_local is not None or artifacts_remote is not None:
|
|
146
|
+
raise ValueError(
|
|
147
|
+
"Specifying artifacts persistence is supported for docker images only. "
|
|
148
|
+
"Other jobs will automatically persist artifacts to the teamspace distributed filesystem."
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
else:
|
|
152
|
+
if studio is not None:
|
|
153
|
+
raise RuntimeError(
|
|
154
|
+
"image and studio are mutually exclusive as both define the environment to run the job in"
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
# they either need to specified both or none of them
|
|
158
|
+
if bool(artifacts_local) != bool(artifacts_remote):
|
|
159
|
+
raise ValueError("Artifact persistence requires both artifacts_local and artifacts_remote to be set")
|
|
160
|
+
|
|
161
|
+
if artifacts_remote and len(artifacts_remote.split(":")) != 3:
|
|
162
|
+
raise ValueError(
|
|
163
|
+
"Artifact persistence requires exactly three arguments separated by colon of kind "
|
|
164
|
+
f"<CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>, got {artifacts_local}"
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
inst = cls(name=name, teamspace=teamspace, org=org, user=user, _fetch_job=False)
|
|
168
|
+
inst._submit(
|
|
169
|
+
num_machines=num_machines,
|
|
170
|
+
machine=machine,
|
|
171
|
+
cloud_account=cloud_account,
|
|
172
|
+
command=command,
|
|
173
|
+
studio=studio,
|
|
174
|
+
image=image,
|
|
175
|
+
env=env,
|
|
176
|
+
interruptible=interruptible,
|
|
177
|
+
image_credentials=image_credentials,
|
|
178
|
+
cloud_account_auth=cloud_account_auth,
|
|
179
|
+
artifacts_local=artifacts_local,
|
|
180
|
+
artifacts_remote=artifacts_remote,
|
|
181
|
+
)
|
|
182
|
+
return inst
|
|
183
|
+
|
|
184
|
+
@abstractmethod
|
|
185
|
+
def _submit(
|
|
186
|
+
self,
|
|
187
|
+
num_machines: int,
|
|
188
|
+
machine: "Machine",
|
|
189
|
+
command: Optional[str] = None,
|
|
190
|
+
studio: Optional["Studio"] = None,
|
|
191
|
+
image: Optional[str] = None,
|
|
192
|
+
env: Optional[Dict[str, str]] = None,
|
|
193
|
+
interruptible: bool = False,
|
|
194
|
+
cloud_account: Optional[str] = None,
|
|
195
|
+
image_credentials: Optional[str] = None,
|
|
196
|
+
cloud_account_auth: bool = False,
|
|
197
|
+
artifacts_local: Optional[str] = None,
|
|
198
|
+
artifacts_remote: Optional[str] = None,
|
|
199
|
+
) -> None:
|
|
200
|
+
"""Submit a new multi-machine job to the Lightning AI platform.
|
|
201
|
+
|
|
202
|
+
Args:
|
|
203
|
+
num_machines: The number of machines to run on.
|
|
204
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
205
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
206
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
207
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
208
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
209
|
+
env: Environment variables to set inside the job.
|
|
210
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
211
|
+
cloud_account: The cloud account to run the job on.
|
|
212
|
+
Defaults to the studio cloud account if running with studio compute env.
|
|
213
|
+
If not provided will fall back to the teamspaces default cloud account.
|
|
214
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
215
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
216
|
+
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
217
|
+
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
218
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
219
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
220
|
+
Only supported for jobs with a docker image compute environment.
|
|
221
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
222
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
223
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
224
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
225
|
+
within it.
|
|
226
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
227
|
+
Only supported for jobs with a docker image compute environment.
|
|
228
|
+
"""
|
|
229
|
+
|
|
230
|
+
@property
|
|
231
|
+
@abstractmethod
|
|
232
|
+
def machines(self) -> Tuple[MMTMachine, ...]:
|
|
233
|
+
"""Returns the sub-jobs for each individual instance."""
|
|
234
|
+
|
|
235
|
+
@property
|
|
236
|
+
@abstractmethod
|
|
237
|
+
def machine(self) -> "Machine":
|
|
238
|
+
"""Returns the machine type this job is running on."""
|
|
239
|
+
|
|
240
|
+
@abstractmethod
|
|
241
|
+
def stop(self) -> None:
|
|
242
|
+
"""Stops the job."""
|
|
243
|
+
|
|
244
|
+
@abstractmethod
|
|
245
|
+
def delete(self) -> None:
|
|
246
|
+
"""Deletes the job.
|
|
247
|
+
|
|
248
|
+
Caution: This also deletes all artifacts and snapshots associated with the job.
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
@property
|
|
252
|
+
@abstractmethod
|
|
253
|
+
def status(self) -> "Status":
|
|
254
|
+
"""The current status of the job."""
|
|
255
|
+
|
|
256
|
+
@property
|
|
257
|
+
@abstractmethod
|
|
258
|
+
def artifact_path(self) -> Optional[str]:
|
|
259
|
+
"""Path to the artifacts created by the job within the distributed teamspace filesystem."""
|
|
260
|
+
|
|
261
|
+
@property
|
|
262
|
+
@abstractmethod
|
|
263
|
+
def snapshot_path(self) -> Optional[str]:
|
|
264
|
+
"""Path to the studio snapshot used to create the job within the distributed teamspace filesystem."""
|
|
265
|
+
|
|
266
|
+
@property
|
|
267
|
+
def share_path(self) -> Optional[str]:
|
|
268
|
+
"""Path to the jobs share path."""
|
|
269
|
+
return None
|
|
270
|
+
|
|
271
|
+
@property
|
|
272
|
+
def name(self) -> str:
|
|
273
|
+
"""The job's name."""
|
|
274
|
+
return self._name
|
|
275
|
+
|
|
276
|
+
@property
|
|
277
|
+
def teamspace(self) -> "Teamspace":
|
|
278
|
+
"""The teamspace the job is part of."""
|
|
279
|
+
return self._teamspace
|
|
280
|
+
|
|
281
|
+
@property
|
|
282
|
+
def logs(self) -> str:
|
|
283
|
+
"""Logs of the rank 0 machine."""
|
|
284
|
+
return self.machines[0].logs
|
|
285
|
+
|
|
286
|
+
@abstractmethod
|
|
287
|
+
def _update_internal_job(self) -> None:
|
|
288
|
+
pass
|
lightning_sdk/mmt/mmt.py
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
from contextlib import suppress
|
|
2
|
+
from functools import lru_cache
|
|
3
|
+
from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union
|
|
4
|
+
|
|
5
|
+
from lightning_sdk.api.user_api import UserApi
|
|
6
|
+
from lightning_sdk.job.job import _has_jobs_v2
|
|
7
|
+
from lightning_sdk.mmt.base import MMTMachine, _BaseMMT
|
|
8
|
+
from lightning_sdk.mmt.v1 import _MMTV1
|
|
9
|
+
from lightning_sdk.mmt.v2 import _MMTV2
|
|
10
|
+
from lightning_sdk.utils.resolve import _setup_logger
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from lightning_sdk.machine import Machine
|
|
14
|
+
from lightning_sdk.organization import Organization
|
|
15
|
+
from lightning_sdk.status import Status
|
|
16
|
+
from lightning_sdk.studio import Studio
|
|
17
|
+
from lightning_sdk.teamspace import Teamspace
|
|
18
|
+
from lightning_sdk.user import User
|
|
19
|
+
|
|
20
|
+
_logger = _setup_logger(__name__)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@lru_cache(maxsize=None)
|
|
24
|
+
def _has_mmt_v2() -> bool:
|
|
25
|
+
# users need both mmtv2 and jobsv2 flags in order for mmtv2 to work correctly
|
|
26
|
+
if not _has_jobs_v2():
|
|
27
|
+
return False
|
|
28
|
+
|
|
29
|
+
api = UserApi()
|
|
30
|
+
try:
|
|
31
|
+
return api._get_feature_flags().mmt_v2
|
|
32
|
+
except Exception:
|
|
33
|
+
return False
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class MMT(_BaseMMT):
|
|
37
|
+
"""Class to submit and manage multi-machine jobs on the Lightning AI Platform."""
|
|
38
|
+
|
|
39
|
+
_force_v1: (
|
|
40
|
+
bool
|
|
41
|
+
) = False # required for studio plugin still working correctly as v2 currently does not support the studio env
|
|
42
|
+
|
|
43
|
+
def __init__(
|
|
44
|
+
self,
|
|
45
|
+
name: str,
|
|
46
|
+
teamspace: Union[str, "Teamspace", None] = None,
|
|
47
|
+
org: Union[str, "Organization", None] = None,
|
|
48
|
+
user: Union[str, "User", None] = None,
|
|
49
|
+
*,
|
|
50
|
+
_fetch_job: bool = True,
|
|
51
|
+
) -> None:
|
|
52
|
+
"""Fetch already existing jobs.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
name: the name of the job
|
|
56
|
+
teamspace: the teamspace the job is part of
|
|
57
|
+
org: the name of the organization owning the :param`teamspace` in case it is owned by an org
|
|
58
|
+
user: the name of the user owning the :param`teamspace`
|
|
59
|
+
in case it is owned directly by a user instead of an org.
|
|
60
|
+
"""
|
|
61
|
+
internal_mmt_cls = _MMTV2 if _has_mmt_v2() and not self._force_v1 else _MMTV1
|
|
62
|
+
|
|
63
|
+
self._internal_mmt = internal_mmt_cls(
|
|
64
|
+
name=name,
|
|
65
|
+
teamspace=teamspace,
|
|
66
|
+
org=org,
|
|
67
|
+
user=user,
|
|
68
|
+
_fetch_job=_fetch_job,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def run(
|
|
73
|
+
cls,
|
|
74
|
+
name: str,
|
|
75
|
+
num_machines: int,
|
|
76
|
+
machine: "Machine",
|
|
77
|
+
command: Optional[str] = None,
|
|
78
|
+
studio: Union["Studio", str, None] = None,
|
|
79
|
+
image: Union[str, None] = None,
|
|
80
|
+
teamspace: Union[str, "Teamspace", None] = None,
|
|
81
|
+
org: Union[str, "Organization", None] = None,
|
|
82
|
+
user: Union[str, "User", None] = None,
|
|
83
|
+
cloud_account: Optional[str] = None,
|
|
84
|
+
env: Optional[Dict[str, str]] = None,
|
|
85
|
+
interruptible: bool = False,
|
|
86
|
+
image_credentials: Optional[str] = None,
|
|
87
|
+
cloud_account_auth: bool = False,
|
|
88
|
+
artifacts_local: Optional[str] = None,
|
|
89
|
+
artifacts_remote: Optional[str] = None,
|
|
90
|
+
cluster: Optional[str] = None, # deprecated in favor of cloud_account
|
|
91
|
+
) -> "MMT":
|
|
92
|
+
"""Run async workloads using a docker image across multiple machines.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
name: The name of the job. Needs to be unique within the teamspace.
|
|
96
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
97
|
+
num_machine: The number of machines to run on.
|
|
98
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
99
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
100
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
101
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
102
|
+
teamspace: The teamspace the job should be associated with. Defaults to the current teamspace.
|
|
103
|
+
org: The organization owning the teamspace (if any). Defaults to the current organization.
|
|
104
|
+
user: The user owning the teamspace (if any). Defaults to the current user.
|
|
105
|
+
cloud_account: The cloud account to run the job on.
|
|
106
|
+
Defaults to the studio cloud account if running with studio compute env.
|
|
107
|
+
If not provided will fall back to the teamspaces default cloud account.
|
|
108
|
+
env: Environment variables to set inside the job.
|
|
109
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
110
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
111
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
112
|
+
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
113
|
+
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
114
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
115
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
116
|
+
Only supported for jobs with a docker image compute environment.
|
|
117
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
118
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
119
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
120
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
121
|
+
within it.
|
|
122
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
123
|
+
Only supported for jobs with a docker image compute environment.
|
|
124
|
+
"""
|
|
125
|
+
ret_val = super().run(
|
|
126
|
+
name=name,
|
|
127
|
+
num_machines=num_machines,
|
|
128
|
+
machine=machine,
|
|
129
|
+
command=command,
|
|
130
|
+
studio=studio,
|
|
131
|
+
image=image,
|
|
132
|
+
teamspace=teamspace,
|
|
133
|
+
org=org,
|
|
134
|
+
user=user,
|
|
135
|
+
cloud_account=cloud_account,
|
|
136
|
+
env=env,
|
|
137
|
+
interruptible=interruptible,
|
|
138
|
+
image_credentials=image_credentials,
|
|
139
|
+
cloud_account_auth=cloud_account_auth,
|
|
140
|
+
artifacts_local=artifacts_local,
|
|
141
|
+
artifacts_remote=artifacts_remote,
|
|
142
|
+
cluster=cluster, # deprecated in favor of cloud_account
|
|
143
|
+
)
|
|
144
|
+
# required for typing with "MMT"
|
|
145
|
+
assert isinstance(ret_val, cls)
|
|
146
|
+
|
|
147
|
+
msg = "Multi-Machine Job was successfully launched."
|
|
148
|
+
|
|
149
|
+
with suppress(NotImplementedError):
|
|
150
|
+
msg += f" View it at {ret_val.link}"
|
|
151
|
+
|
|
152
|
+
_logger.info(msg)
|
|
153
|
+
return ret_val
|
|
154
|
+
|
|
155
|
+
def _submit(
|
|
156
|
+
self,
|
|
157
|
+
num_machines: int,
|
|
158
|
+
machine: "Machine",
|
|
159
|
+
command: Optional[str] = None,
|
|
160
|
+
studio: Optional["Studio"] = None,
|
|
161
|
+
image: Optional[str] = None,
|
|
162
|
+
env: Optional[Dict[str, str]] = None,
|
|
163
|
+
interruptible: bool = False,
|
|
164
|
+
cloud_account: Optional[str] = None,
|
|
165
|
+
image_credentials: Optional[str] = None,
|
|
166
|
+
cloud_account_auth: bool = False,
|
|
167
|
+
artifacts_local: Optional[str] = None,
|
|
168
|
+
artifacts_remote: Optional[str] = None,
|
|
169
|
+
) -> "MMT":
|
|
170
|
+
"""Submit a new multi-machine job to the Lightning AI platform.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
num_machines: The number of machines to run on.
|
|
174
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
175
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
176
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
177
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
178
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
179
|
+
env: Environment variables to set inside the job.
|
|
180
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
181
|
+
cloud_account: The cloud account to run the job on.
|
|
182
|
+
Defaults to the studio cloud account if running with studio compute env.
|
|
183
|
+
If not provided will fall back to the teamspaces default cloud account.
|
|
184
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
185
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
186
|
+
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
187
|
+
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
188
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
189
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
190
|
+
Only supported for jobs with a docker image compute environment.
|
|
191
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
192
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
193
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
194
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
195
|
+
within it.
|
|
196
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
197
|
+
Only supported for jobs with a docker image compute environment.
|
|
198
|
+
"""
|
|
199
|
+
self._job = self._internal_mmt._submit(
|
|
200
|
+
num_machines=num_machines,
|
|
201
|
+
machine=machine,
|
|
202
|
+
cloud_account=cloud_account,
|
|
203
|
+
command=command,
|
|
204
|
+
studio=studio,
|
|
205
|
+
image=image,
|
|
206
|
+
env=env,
|
|
207
|
+
interruptible=interruptible,
|
|
208
|
+
image_credentials=image_credentials,
|
|
209
|
+
cloud_account_auth=cloud_account_auth,
|
|
210
|
+
artifacts_local=artifacts_local,
|
|
211
|
+
artifacts_remote=artifacts_remote,
|
|
212
|
+
)
|
|
213
|
+
return self
|
|
214
|
+
|
|
215
|
+
def stop(self) -> None:
|
|
216
|
+
"""Stops the job."""
|
|
217
|
+
return self._internal_mmt.stop()
|
|
218
|
+
|
|
219
|
+
def delete(self) -> None:
|
|
220
|
+
"""Deletes the job.
|
|
221
|
+
|
|
222
|
+
Caution: This also deletes all artifacts and snapshots associated with the job.
|
|
223
|
+
"""
|
|
224
|
+
return self._internal_mmt.delete()
|
|
225
|
+
|
|
226
|
+
@property
|
|
227
|
+
def status(self) -> "Status":
|
|
228
|
+
"""The current status of the job (accumulated over all machines)."""
|
|
229
|
+
return self._internal_mmt.status
|
|
230
|
+
|
|
231
|
+
@property
|
|
232
|
+
def machines(self) -> Tuple[MMTMachine, ...]:
|
|
233
|
+
"""Returns the sub-jobs for each individual instance."""
|
|
234
|
+
return self._internal_mmt.machines
|
|
235
|
+
|
|
236
|
+
@property
|
|
237
|
+
def machine(self) -> "Machine":
|
|
238
|
+
"""Returns the machine type this job is running on."""
|
|
239
|
+
return self._internal_mmt.machine
|
|
240
|
+
|
|
241
|
+
@property
|
|
242
|
+
def artifact_path(self) -> Optional[str]:
|
|
243
|
+
"""Path to the artifacts created by the job within the distributed teamspace filesystem."""
|
|
244
|
+
return self._internal_mmt.artifact_path
|
|
245
|
+
|
|
246
|
+
@property
|
|
247
|
+
def snapshot_path(self) -> Optional[str]:
|
|
248
|
+
"""Path to the studio snapshot used to create the job within the distributed teamspace filesystem."""
|
|
249
|
+
return self._internal_mmt.snapshot_path
|
|
250
|
+
|
|
251
|
+
@property
|
|
252
|
+
def share_path(self) -> Optional[str]:
|
|
253
|
+
"""Path to the jobs share path."""
|
|
254
|
+
return None
|
|
255
|
+
|
|
256
|
+
def _update_internal_job(self) -> None:
|
|
257
|
+
return self._internal_mmt._update_internal_job()
|
|
258
|
+
|
|
259
|
+
@property
|
|
260
|
+
def name(self) -> str:
|
|
261
|
+
"""The job's name."""
|
|
262
|
+
return self._internal_mmt.name
|
|
263
|
+
|
|
264
|
+
@property
|
|
265
|
+
def teamspace(self) -> "Teamspace":
|
|
266
|
+
"""The teamspace the job is part of."""
|
|
267
|
+
return self._internal_mmt._teamspace
|
|
268
|
+
|
|
269
|
+
@property
|
|
270
|
+
def link(self) -> str:
|
|
271
|
+
return self._internal_mmt.link
|
|
272
|
+
|
|
273
|
+
def __getattr__(self, key: str) -> Any:
|
|
274
|
+
"""Forward the attribute lookup to the internal job implementation."""
|
|
275
|
+
try:
|
|
276
|
+
return getattr(super(), key)
|
|
277
|
+
except AttributeError:
|
|
278
|
+
return getattr(self._internal_mmt, key)
|
|
279
|
+
|
|
280
|
+
@property
|
|
281
|
+
def _guaranteed_job(self) -> Any:
|
|
282
|
+
return self._internal_mmt._guaranteed_job
|