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
lightning_sdk/helpers.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
import warnings
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
import requests
|
|
6
|
+
from packaging import version as packaging_version
|
|
7
|
+
|
|
8
|
+
__package_name__ = "lightning-sdk"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@functools.lru_cache(maxsize=1)
|
|
12
|
+
def _get_newer_version(curr_version: str) -> Optional[str]:
|
|
13
|
+
"""Check PyPI for newer versions of ``lightning-sdk``.
|
|
14
|
+
|
|
15
|
+
Returning the newest version if different from the current or ``None`` otherwise.
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
if packaging_version.parse(curr_version).is_prerelease:
|
|
19
|
+
return None
|
|
20
|
+
try:
|
|
21
|
+
response = requests.get(f"https://pypi.org/pypi/{__package_name__}/json")
|
|
22
|
+
response_json = response.json()
|
|
23
|
+
releases = response_json["releases"]
|
|
24
|
+
if curr_version not in releases:
|
|
25
|
+
# Always return None if not installed from PyPI (e.g. dev versions)
|
|
26
|
+
return None
|
|
27
|
+
latest_version = response_json["info"]["version"]
|
|
28
|
+
parsed_version = packaging_version.parse(latest_version)
|
|
29
|
+
is_invalid = response_json["info"]["yanked"] or parsed_version.is_devrelease or parsed_version.is_prerelease
|
|
30
|
+
return None if curr_version == latest_version or is_invalid else latest_version
|
|
31
|
+
except requests.exceptions.RequestException:
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _check_version_and_prompt_upgrade(curr_version: str) -> None:
|
|
36
|
+
"""Checks that the current version of ``lightning-sdk`` is the latest on PyPI.
|
|
37
|
+
|
|
38
|
+
If not, warn the user to upgrade ``lightning-sdk``.
|
|
39
|
+
|
|
40
|
+
"""
|
|
41
|
+
new_version = _get_newer_version(curr_version)
|
|
42
|
+
if new_version:
|
|
43
|
+
warnings.warn(
|
|
44
|
+
f"A newer version of {__package_name__} is available ({new_version}). "
|
|
45
|
+
f"Please consider upgrading with `pip install -U {__package_name__}`. "
|
|
46
|
+
"Not all functionalities of the platform can be guaranteed to work with the current version.",
|
|
47
|
+
UserWarning,
|
|
48
|
+
)
|
|
49
|
+
return
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
from lightning_sdk.utils.resolve import _resolve_deprecated_cluster, _resolve_teamspace
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from lightning_sdk.machine import Machine
|
|
8
|
+
from lightning_sdk.organization import Organization
|
|
9
|
+
from lightning_sdk.status import Status
|
|
10
|
+
from lightning_sdk.studio import Studio
|
|
11
|
+
from lightning_sdk.teamspace import Teamspace
|
|
12
|
+
from lightning_sdk.user import User
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class _BaseJob(ABC):
|
|
16
|
+
"""Base interface to all job types."""
|
|
17
|
+
|
|
18
|
+
def __init__(
|
|
19
|
+
self,
|
|
20
|
+
name: str,
|
|
21
|
+
teamspace: Union[str, "Teamspace", None] = None,
|
|
22
|
+
org: Union[str, "Organization", None] = None,
|
|
23
|
+
user: Union[str, "User", None] = None,
|
|
24
|
+
*,
|
|
25
|
+
_fetch_job: bool = True,
|
|
26
|
+
) -> None:
|
|
27
|
+
"""Fetch already existing jobs.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
name: the name of the job
|
|
31
|
+
teamspace: the teamspace the job is part of
|
|
32
|
+
org: the name of the organization owning the :param`teamspace` in case it is owned by an org
|
|
33
|
+
user: the name of the user owning the :param`teamspace`
|
|
34
|
+
in case it is owned directly by a user instead of an org.
|
|
35
|
+
"""
|
|
36
|
+
_teamspace = _resolve_teamspace(teamspace=teamspace, org=org, user=user)
|
|
37
|
+
if _teamspace is None:
|
|
38
|
+
raise ValueError(
|
|
39
|
+
"Cannot resolve the teamspace from provided arguments."
|
|
40
|
+
f" Got teamspace={teamspace}, org={org}, user={user}."
|
|
41
|
+
)
|
|
42
|
+
else:
|
|
43
|
+
self._teamspace = _teamspace
|
|
44
|
+
self._name = name
|
|
45
|
+
self._job = None
|
|
46
|
+
|
|
47
|
+
if _fetch_job:
|
|
48
|
+
self._update_internal_job()
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def run(
|
|
52
|
+
cls,
|
|
53
|
+
name: str,
|
|
54
|
+
machine: "Machine",
|
|
55
|
+
command: Optional[str] = None,
|
|
56
|
+
studio: Union["Studio", str, None] = None,
|
|
57
|
+
image: Optional[str] = None,
|
|
58
|
+
teamspace: Union[str, "Teamspace", None] = None,
|
|
59
|
+
org: Union[str, "Organization", None] = None,
|
|
60
|
+
user: Union[str, "User", None] = None,
|
|
61
|
+
cloud_account: Optional[str] = None,
|
|
62
|
+
env: Optional[Dict[str, str]] = None,
|
|
63
|
+
interruptible: bool = False,
|
|
64
|
+
image_credentials: Optional[str] = None,
|
|
65
|
+
cloud_account_auth: bool = False,
|
|
66
|
+
artifacts_local: Optional[str] = None,
|
|
67
|
+
artifacts_remote: Optional[str] = None,
|
|
68
|
+
cluster: Optional[str] = None, # deprecated in favor of cloud_account
|
|
69
|
+
) -> "_BaseJob":
|
|
70
|
+
"""Run async workloads using a docker image or a compute environment from your studio.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
name: The name of the job. Needs to be unique within the teamspace.
|
|
74
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
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 not name:
|
|
107
|
+
raise ValueError("A job needs to have a name!")
|
|
108
|
+
|
|
109
|
+
if image is None:
|
|
110
|
+
if not isinstance(studio, Studio):
|
|
111
|
+
studio = Studio(
|
|
112
|
+
name=studio, teamspace=teamspace, org=org, user=user, cloud_account=cloud_account, create_ok=False
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# studio is a Studio instance at this point
|
|
116
|
+
if teamspace is None:
|
|
117
|
+
teamspace = studio.teamspace
|
|
118
|
+
else:
|
|
119
|
+
teamspace_name = teamspace if isinstance(teamspace, str) else teamspace.name
|
|
120
|
+
|
|
121
|
+
if studio.teamspace.name != teamspace_name:
|
|
122
|
+
raise ValueError(
|
|
123
|
+
"Studio teamspace does not match provided teamspace. "
|
|
124
|
+
"Can only run jobs with Studio envs in the teamspace of that Studio."
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
if cloud_account is None:
|
|
128
|
+
cloud_account = studio.cloud_account
|
|
129
|
+
|
|
130
|
+
if cloud_account != studio.cloud_account:
|
|
131
|
+
raise ValueError(
|
|
132
|
+
"Studio cloud account does not match provided cloud account. "
|
|
133
|
+
"Can only run jobs with Studio envs in the same cloud account."
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
if image_credentials is not None:
|
|
137
|
+
raise ValueError("image_credentials is only supported when using a custom image")
|
|
138
|
+
|
|
139
|
+
if cloud_account_auth:
|
|
140
|
+
raise ValueError("cloud_account_auth is only supported when using a custom image")
|
|
141
|
+
|
|
142
|
+
if artifacts_local is not None or artifacts_remote is not None:
|
|
143
|
+
raise ValueError(
|
|
144
|
+
"Specifying artifacts persistence is supported for docker images only. "
|
|
145
|
+
"Other jobs will automatically persist artifacts to the teamspace distributed filesystem."
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
else:
|
|
149
|
+
if studio is not None:
|
|
150
|
+
raise RuntimeError(
|
|
151
|
+
"image and studio are mutually exclusive as both define the environment to run the job in"
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
# they either need to specified both or none of them
|
|
155
|
+
if bool(artifacts_local) != bool(artifacts_remote):
|
|
156
|
+
raise ValueError("Artifact persistence requires both artifacts_local and artifacts_remote to be set")
|
|
157
|
+
|
|
158
|
+
if artifacts_remote and len(artifacts_remote.split(":")) != 3:
|
|
159
|
+
raise ValueError(
|
|
160
|
+
"Artifact persistence requires exactly three arguments separated by colon of kind "
|
|
161
|
+
f"<CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>, got {artifacts_local}"
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
inst = cls(name=name, teamspace=teamspace, org=org, user=user, _fetch_job=False)
|
|
165
|
+
return inst._submit(
|
|
166
|
+
machine=machine,
|
|
167
|
+
cloud_account=cloud_account,
|
|
168
|
+
command=command,
|
|
169
|
+
studio=studio,
|
|
170
|
+
image=image,
|
|
171
|
+
env=env,
|
|
172
|
+
interruptible=interruptible,
|
|
173
|
+
image_credentials=image_credentials,
|
|
174
|
+
cloud_account_auth=cloud_account_auth,
|
|
175
|
+
artifacts_local=artifacts_local,
|
|
176
|
+
artifacts_remote=artifacts_remote,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
@abstractmethod
|
|
180
|
+
def _submit(
|
|
181
|
+
self,
|
|
182
|
+
machine: "Machine",
|
|
183
|
+
command: Optional[str] = None,
|
|
184
|
+
studio: Optional["Studio"] = None,
|
|
185
|
+
image: Optional[str] = None,
|
|
186
|
+
env: Optional[Dict[str, str]] = None,
|
|
187
|
+
interruptible: bool = False,
|
|
188
|
+
cloud_account: Optional[str] = None,
|
|
189
|
+
image_credentials: Optional[str] = None,
|
|
190
|
+
cloud_account_auth: bool = False,
|
|
191
|
+
artifacts_local: Optional[str] = None,
|
|
192
|
+
artifacts_remote: Optional[str] = None,
|
|
193
|
+
) -> "_BaseJob":
|
|
194
|
+
"""Submit a new job to the Lightning AI platform.
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
198
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
199
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
200
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
201
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
202
|
+
env: Environment variables to set inside the job.
|
|
203
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
204
|
+
cloud_account: The cloud account to run the job on.
|
|
205
|
+
Defaults to the studio cloud account if running with studio compute env.
|
|
206
|
+
If not provided will fall back to the teamspaces default cloud account.
|
|
207
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
208
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
209
|
+
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
210
|
+
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
211
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
212
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
213
|
+
Only supported for jobs with a docker image compute environment.
|
|
214
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
215
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
216
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
217
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
218
|
+
within it.
|
|
219
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
220
|
+
Only supported for jobs with a docker image compute environment.
|
|
221
|
+
"""
|
|
222
|
+
|
|
223
|
+
@abstractmethod
|
|
224
|
+
def stop(self) -> None:
|
|
225
|
+
"""Stops the job.
|
|
226
|
+
|
|
227
|
+
This is blocking until the job is stopped.
|
|
228
|
+
"""
|
|
229
|
+
|
|
230
|
+
@abstractmethod
|
|
231
|
+
def delete(self) -> None:
|
|
232
|
+
"""Deletes the job.
|
|
233
|
+
|
|
234
|
+
Caution: This also deletes all artifacts and snapshots associated with the job.
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
@property
|
|
238
|
+
@abstractmethod
|
|
239
|
+
def status(self) -> "Status":
|
|
240
|
+
"""The current status of the job."""
|
|
241
|
+
|
|
242
|
+
@property
|
|
243
|
+
@abstractmethod
|
|
244
|
+
def machine(self) -> "Machine":
|
|
245
|
+
"""The machine type the job is running on."""
|
|
246
|
+
|
|
247
|
+
@property
|
|
248
|
+
@abstractmethod
|
|
249
|
+
def artifact_path(self) -> Optional[str]:
|
|
250
|
+
"""Path to the artifacts created by the job within the distributed teamspace filesystem."""
|
|
251
|
+
|
|
252
|
+
@property
|
|
253
|
+
@abstractmethod
|
|
254
|
+
def snapshot_path(self) -> Optional[str]:
|
|
255
|
+
"""Path to the studio snapshot used to create the job within the distributed teamspace filesystem."""
|
|
256
|
+
|
|
257
|
+
@property
|
|
258
|
+
@abstractmethod
|
|
259
|
+
def share_path(self) -> Optional[str]:
|
|
260
|
+
"""Path to the jobs share path."""
|
|
261
|
+
|
|
262
|
+
@abstractmethod
|
|
263
|
+
def _update_internal_job(self) -> None:
|
|
264
|
+
pass
|
|
265
|
+
|
|
266
|
+
@property
|
|
267
|
+
def name(self) -> str:
|
|
268
|
+
"""The job's name."""
|
|
269
|
+
return self._name
|
|
270
|
+
|
|
271
|
+
@property
|
|
272
|
+
def teamspace(self) -> "Teamspace":
|
|
273
|
+
"""The teamspace the job is part of."""
|
|
274
|
+
return self._teamspace
|
|
275
|
+
|
|
276
|
+
@property
|
|
277
|
+
@abstractmethod
|
|
278
|
+
def logs(self) -> str:
|
|
279
|
+
"""The logs of the job."""
|
|
280
|
+
|
|
281
|
+
@property
|
|
282
|
+
def link(self) -> str:
|
|
283
|
+
"""A link to view the current job in the UI."""
|
|
284
|
+
return f"https://lightning.ai/{self.teamspace.owner.name}/{self.teamspace.name}/studios/{self._job_api.get_studio_name(self._guaranteed_job)}/app?app_id=jobs&job_name={self.name}"
|
|
285
|
+
|
|
286
|
+
@property
|
|
287
|
+
def _guaranteed_job(self) -> Any:
|
|
288
|
+
"""Guarantees that the job was fetched at some point before returning it.
|
|
289
|
+
|
|
290
|
+
Doesn't guarantee to have the lastest version of the job. Use _latest_job for that.
|
|
291
|
+
"""
|
|
292
|
+
if getattr(self, "_job", None) is None:
|
|
293
|
+
self._update_internal_job()
|
|
294
|
+
|
|
295
|
+
return self._job
|
lightning_sdk/job/job.py
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
from functools import lru_cache
|
|
2
|
+
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
from lightning_sdk.api.user_api import UserApi
|
|
5
|
+
from lightning_sdk.job.base import _BaseJob
|
|
6
|
+
from lightning_sdk.job.v1 import _JobV1
|
|
7
|
+
from lightning_sdk.job.v2 import _JobV2
|
|
8
|
+
from lightning_sdk.utils.resolve import _setup_logger
|
|
9
|
+
|
|
10
|
+
_logger = _setup_logger(__name__)
|
|
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
|
+
|
|
21
|
+
@lru_cache(maxsize=None)
|
|
22
|
+
def _has_jobs_v2() -> bool:
|
|
23
|
+
api = UserApi()
|
|
24
|
+
try:
|
|
25
|
+
return api._get_feature_flags().jobs_v2
|
|
26
|
+
except Exception:
|
|
27
|
+
return False
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Job(_BaseJob):
|
|
31
|
+
"""Class to submit and manage single-machine jobs on the Lightning AI Platform."""
|
|
32
|
+
|
|
33
|
+
_force_v1: bool = False
|
|
34
|
+
|
|
35
|
+
def __init__(
|
|
36
|
+
self,
|
|
37
|
+
name: str,
|
|
38
|
+
teamspace: Union[str, "Teamspace", None] = None,
|
|
39
|
+
org: Union[str, "Organization", None] = None,
|
|
40
|
+
user: Union[str, "User", None] = None,
|
|
41
|
+
*,
|
|
42
|
+
_fetch_job: bool = True,
|
|
43
|
+
) -> None:
|
|
44
|
+
"""Fetch already existing jobs.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
name: the name of the job
|
|
48
|
+
teamspace: the teamspace the job is part of
|
|
49
|
+
org: the name of the organization owning the :param`teamspace` in case it is owned by an org
|
|
50
|
+
user: the name of the user owning the :param`teamspace`
|
|
51
|
+
in case it is owned directly by a user instead of an org.
|
|
52
|
+
"""
|
|
53
|
+
internal_job_cls = _JobV2 if _has_jobs_v2() and not self._force_v1 else _JobV1
|
|
54
|
+
|
|
55
|
+
self._internal_job = internal_job_cls(
|
|
56
|
+
name=name,
|
|
57
|
+
teamspace=teamspace,
|
|
58
|
+
org=org,
|
|
59
|
+
user=user,
|
|
60
|
+
_fetch_job=_fetch_job,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def run(
|
|
65
|
+
cls,
|
|
66
|
+
name: str,
|
|
67
|
+
machine: "Machine",
|
|
68
|
+
command: Optional[str] = None,
|
|
69
|
+
studio: Union["Studio", str, None] = None,
|
|
70
|
+
image: Union[str, None] = None,
|
|
71
|
+
teamspace: Union[str, "Teamspace", None] = None,
|
|
72
|
+
org: Union[str, "Organization", None] = None,
|
|
73
|
+
user: Union[str, "User", None] = None,
|
|
74
|
+
cloud_account: Optional[str] = None,
|
|
75
|
+
env: Optional[Dict[str, str]] = None,
|
|
76
|
+
interruptible: bool = False,
|
|
77
|
+
image_credentials: Optional[str] = None,
|
|
78
|
+
cloud_account_auth: bool = False,
|
|
79
|
+
artifacts_local: Optional[str] = None,
|
|
80
|
+
artifacts_remote: Optional[str] = None,
|
|
81
|
+
cluster: Optional[str] = None, # deprecated in favor of cloud_account
|
|
82
|
+
) -> "Job":
|
|
83
|
+
"""Run async workloads using a docker image or a compute environment from your studio.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
name: The name of the job. Needs to be unique within the teamspace.
|
|
87
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
88
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
89
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
90
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
91
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
92
|
+
teamspace: The teamspace the job should be associated with. Defaults to the current teamspace.
|
|
93
|
+
org: The organization owning the teamspace (if any). Defaults to the current organization.
|
|
94
|
+
user: The user owning the teamspace (if any). Defaults to the current user.
|
|
95
|
+
cloud_account: The cloud acocunt to run the job on.
|
|
96
|
+
Defaults to the studio cloud account if running with studio compute env.
|
|
97
|
+
If not provided will fall back to the teamspaces default cloud account.
|
|
98
|
+
env: Environment variables to set inside the job.
|
|
99
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
100
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
101
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
102
|
+
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
103
|
+
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
104
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
105
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
106
|
+
Only supported for jobs with a docker image compute environment.
|
|
107
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
108
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
109
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
110
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
111
|
+
within it.
|
|
112
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
113
|
+
Only supported for jobs with a docker image compute environment.
|
|
114
|
+
"""
|
|
115
|
+
ret_val = super().run(
|
|
116
|
+
name=name,
|
|
117
|
+
machine=machine,
|
|
118
|
+
command=command,
|
|
119
|
+
studio=studio,
|
|
120
|
+
image=image,
|
|
121
|
+
teamspace=teamspace,
|
|
122
|
+
org=org,
|
|
123
|
+
user=user,
|
|
124
|
+
cloud_account=cloud_account,
|
|
125
|
+
env=env,
|
|
126
|
+
interruptible=interruptible,
|
|
127
|
+
image_credentials=image_credentials,
|
|
128
|
+
cloud_account_auth=cloud_account_auth,
|
|
129
|
+
artifacts_local=artifacts_local,
|
|
130
|
+
artifacts_remote=artifacts_remote,
|
|
131
|
+
cluster=cluster,
|
|
132
|
+
)
|
|
133
|
+
# required for typing with "Job"
|
|
134
|
+
assert isinstance(ret_val, cls)
|
|
135
|
+
|
|
136
|
+
_logger.info(f"Job was successfully launched. View it at {ret_val.link}")
|
|
137
|
+
return ret_val
|
|
138
|
+
|
|
139
|
+
def _submit(
|
|
140
|
+
self,
|
|
141
|
+
machine: "Machine",
|
|
142
|
+
command: Optional[str] = None,
|
|
143
|
+
studio: Optional["Studio"] = None,
|
|
144
|
+
image: Optional[str] = None,
|
|
145
|
+
env: Optional[Dict[str, str]] = None,
|
|
146
|
+
interruptible: bool = False,
|
|
147
|
+
cloud_account: Optional[str] = None,
|
|
148
|
+
image_credentials: Optional[str] = None,
|
|
149
|
+
cloud_account_auth: bool = False,
|
|
150
|
+
artifacts_local: Optional[str] = None,
|
|
151
|
+
artifacts_remote: Optional[str] = None,
|
|
152
|
+
) -> "Job":
|
|
153
|
+
"""Submit a new job to the Lightning AI platform.
|
|
154
|
+
|
|
155
|
+
Args:
|
|
156
|
+
machine: The machine type to run the job on. One of {", ".join(_MACHINE_VALUES)}.
|
|
157
|
+
command: The command to run inside your job. Required if using a studio. Optional if using an image.
|
|
158
|
+
If not provided for images, will run the container entrypoint and default command.
|
|
159
|
+
studio: The studio env to run the job with. Mutually exclusive with image.
|
|
160
|
+
image: The docker image to run the job with. Mutually exclusive with studio.
|
|
161
|
+
env: Environment variables to set inside the job.
|
|
162
|
+
interruptible: Whether the job should run on interruptible instances. They are cheaper but can be preempted.
|
|
163
|
+
cloud_account: The cloud account to run the job on.
|
|
164
|
+
Defaults to the studio cloud account if running with studio compute env.
|
|
165
|
+
If not provided will fall back to the teamspaces default cloud account.
|
|
166
|
+
image_credentials: The credentials used to pull the image. Required if the image is private.
|
|
167
|
+
This should be the name of the respective credentials secret created on the Lightning AI platform.
|
|
168
|
+
cloud_account_auth: Whether to authenticate with the cloud account to pull the image.
|
|
169
|
+
Required if the registry is part of a cloud provider (e.g. ECR).
|
|
170
|
+
artifacts_local: The path of inside the docker container, you want to persist images from.
|
|
171
|
+
CAUTION: When setting this to "/", it will effectively erase your container.
|
|
172
|
+
Only supported for jobs with a docker image compute environment.
|
|
173
|
+
artifacts_remote: The remote storage to persist your artifacts to.
|
|
174
|
+
Should be of format <CONNECTION_TYPE>:<CONNECTION_NAME>:<PATH_WITHIN_CONNECTION>.
|
|
175
|
+
PATH_WITHIN_CONNECTION hereby is a path relative to the connection's root.
|
|
176
|
+
E.g. efs:data:some-path would result in an EFS connection named `data` and to the path `some-path`
|
|
177
|
+
within it.
|
|
178
|
+
Note that the connection needs to be added to the teamspace already in order for it to be found.
|
|
179
|
+
Only supported for jobs with a docker image compute environment.
|
|
180
|
+
"""
|
|
181
|
+
self._job = self._internal_job._submit(
|
|
182
|
+
machine=machine,
|
|
183
|
+
cloud_account=cloud_account,
|
|
184
|
+
command=command,
|
|
185
|
+
studio=studio,
|
|
186
|
+
image=image,
|
|
187
|
+
env=env,
|
|
188
|
+
interruptible=interruptible,
|
|
189
|
+
image_credentials=image_credentials,
|
|
190
|
+
cloud_account_auth=cloud_account_auth,
|
|
191
|
+
artifacts_local=artifacts_local,
|
|
192
|
+
artifacts_remote=artifacts_remote,
|
|
193
|
+
)
|
|
194
|
+
return self
|
|
195
|
+
|
|
196
|
+
def stop(self) -> None:
|
|
197
|
+
"""Stops the job.
|
|
198
|
+
|
|
199
|
+
This is blocking until the job is stopped.
|
|
200
|
+
"""
|
|
201
|
+
return self._internal_job.stop()
|
|
202
|
+
|
|
203
|
+
def delete(self) -> None:
|
|
204
|
+
"""Deletes the job.
|
|
205
|
+
|
|
206
|
+
Caution: This also deletes all artifacts and snapshots associated with the job.
|
|
207
|
+
"""
|
|
208
|
+
return self._internal_job.delete()
|
|
209
|
+
|
|
210
|
+
@property
|
|
211
|
+
def status(self) -> "Status":
|
|
212
|
+
"""The current status of the job."""
|
|
213
|
+
return self._internal_job.status
|
|
214
|
+
|
|
215
|
+
@property
|
|
216
|
+
def machine(self) -> "Machine":
|
|
217
|
+
"""The machine type the job is running on."""
|
|
218
|
+
return self._internal_job.machine
|
|
219
|
+
|
|
220
|
+
@property
|
|
221
|
+
def artifact_path(self) -> Optional[str]:
|
|
222
|
+
"""Path to the artifacts created by the job within the distributed teamspace filesystem."""
|
|
223
|
+
return self._internal_job.artifact_path
|
|
224
|
+
|
|
225
|
+
@property
|
|
226
|
+
def snapshot_path(self) -> Optional[str]:
|
|
227
|
+
"""Path to the studio snapshot used to create the job within the distributed teamspace filesystem."""
|
|
228
|
+
return self._internal_job.snapshot_path
|
|
229
|
+
|
|
230
|
+
@property
|
|
231
|
+
def share_path(self) -> Optional[str]:
|
|
232
|
+
"""Path to the jobs share path."""
|
|
233
|
+
return self._internal_job.share_path
|
|
234
|
+
|
|
235
|
+
def _update_internal_job(self) -> None:
|
|
236
|
+
return self._internal_job._update_internal_job()
|
|
237
|
+
|
|
238
|
+
@property
|
|
239
|
+
def name(self) -> str:
|
|
240
|
+
"""The job's name."""
|
|
241
|
+
return self._internal_job.name
|
|
242
|
+
|
|
243
|
+
@property
|
|
244
|
+
def teamspace(self) -> "Teamspace":
|
|
245
|
+
"""The teamspace the job is part of."""
|
|
246
|
+
return self._internal_job._teamspace
|
|
247
|
+
|
|
248
|
+
@property
|
|
249
|
+
def logs(self) -> str:
|
|
250
|
+
"""The logs of the job."""
|
|
251
|
+
from lightning_sdk.status import Status
|
|
252
|
+
|
|
253
|
+
if self.status not in (Status.Failed, Status.Completed, Status.Stopped):
|
|
254
|
+
raise RuntimeError("Getting jobs logs while the job is pending or running is not supported yet!")
|
|
255
|
+
return self._internal_job.logs
|
|
256
|
+
|
|
257
|
+
def __getattr__(self, key: str) -> Any:
|
|
258
|
+
"""Forward the attribute lookup to the internal job implementation."""
|
|
259
|
+
try:
|
|
260
|
+
return getattr(super(), key)
|
|
261
|
+
except AttributeError:
|
|
262
|
+
return getattr(self._internal_job, key)
|
|
263
|
+
|
|
264
|
+
@property
|
|
265
|
+
def link(self) -> str:
|
|
266
|
+
return self._internal_job.link
|