truefoundry 0.5.10rc1__py3-none-any.whl → 0.5.11rc1__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.

Potentially problematic release.


This version of truefoundry might be problematic. Click here for more details.

Files changed (266) hide show
  1. truefoundry/__init__.py +19 -0
  2. truefoundry/_client.py +36 -0
  3. truefoundry/cli/display_util.py +1 -1
  4. truefoundry/common/utils.py +9 -0
  5. truefoundry/deploy/__init__.py +2 -2
  6. truefoundry/deploy/_autogen/models.py +1591 -0
  7. truefoundry/deploy/builder/__init__.py +1 -1
  8. truefoundry/deploy/builder/builders/dockerfile.py +1 -1
  9. truefoundry/deploy/builder/builders/tfy_notebook_buildpack/__init__.py +1 -1
  10. truefoundry/deploy/builder/builders/tfy_python_buildpack/__init__.py +1 -1
  11. truefoundry/deploy/builder/builders/tfy_python_buildpack/dockerfile_template.py +1 -1
  12. truefoundry/deploy/io/output_callback.py +13 -6
  13. truefoundry/deploy/io/rich_output_callback.py +8 -4
  14. truefoundry/deploy/lib/clients/servicefoundry_client.py +117 -138
  15. truefoundry/deploy/lib/dao/apply.py +2 -2
  16. truefoundry/deploy/lib/dao/delete.py +2 -2
  17. truefoundry/deploy/lib/model/entity.py +37 -24
  18. truefoundry/deploy/v2/lib/deploy.py +7 -7
  19. truefoundry/deploy/v2/lib/deploy_workflow.py +9 -9
  20. truefoundry/deploy/v2/lib/deployable_patched_models.py +1 -1
  21. truefoundry/deploy/v2/lib/patched_models.py +7 -7
  22. truefoundry/deploy/v2/lib/source.py +1 -1
  23. truefoundry/ml/__init__.py +2 -2
  24. truefoundry/ml/_autogen/client/__init__.py +457 -0
  25. truefoundry/ml/_autogen/client/api/__init__.py +16 -0
  26. truefoundry/ml/{autogen → _autogen}/client/api/auth_api.py +6 -6
  27. truefoundry/ml/{autogen → _autogen}/client/api/deprecated_api.py +12 -345
  28. truefoundry/ml/{autogen → _autogen}/client/api/experiments_api.py +89 -44
  29. truefoundry/ml/{autogen → _autogen}/client/api/generate_code_snippet_api.py +10 -10
  30. truefoundry/ml/{autogen → _autogen}/client/api/health_api.py +5 -5
  31. truefoundry/ml/{autogen → _autogen}/client/api/metrics_api.py +10 -10
  32. truefoundry/ml/{autogen → _autogen}/client/api/mlfoundry_artifacts_api.py +589 -197
  33. truefoundry/ml/{autogen → _autogen}/client/api/run_artifacts_api.py +14 -9
  34. truefoundry/ml/{autogen → _autogen}/client/api/runs_api.py +41 -41
  35. truefoundry/ml/{autogen → _autogen}/client/api_client.py +8 -8
  36. truefoundry/ml/{autogen → _autogen}/client/configuration.py +30 -58
  37. truefoundry/ml/{autogen → _autogen}/client/exceptions.py +2 -2
  38. truefoundry/ml/_autogen/client/models/__init__.py +428 -0
  39. truefoundry/ml/{autogen → _autogen}/client/models/agent_app.py +14 -7
  40. truefoundry/ml/{autogen/client/models/agent.py → _autogen/client/models/agent_manifest.py} +37 -35
  41. truefoundry/ml/{autogen/client/models/agent_open_api_tool.py → _autogen/client/models/agent_open_api_tool_manifest.py} +50 -37
  42. truefoundry/ml/{autogen → _autogen}/client/models/agent_open_api_tool_with_fqn.py +45 -32
  43. truefoundry/ml/{autogen → _autogen}/client/models/agent_with_fqn.py +32 -30
  44. truefoundry/ml/_autogen/client/models/apply_request_dto.py +75 -0
  45. truefoundry/ml/_autogen/client/models/apply_response_dto.py +79 -0
  46. truefoundry/ml/{autogen → _autogen}/client/models/artifact_dto.py +7 -5
  47. truefoundry/ml/{autogen/client/models/artifact_version_manifest.py → _autogen/client/models/artifact_manifest.py} +39 -31
  48. truefoundry/ml/_autogen/client/models/artifact_path.py +70 -0
  49. truefoundry/ml/{autogen → _autogen}/client/models/artifact_response_dto.py +3 -3
  50. truefoundry/ml/{autogen → _autogen}/client/models/artifact_type.py +3 -3
  51. truefoundry/ml/{autogen → _autogen}/client/models/artifact_version_dto.py +10 -18
  52. truefoundry/ml/{autogen → _autogen}/client/models/artifact_version_response_dto.py +5 -3
  53. truefoundry/ml/{autogen → _autogen}/client/models/artifact_version_serialization_format.py +2 -2
  54. truefoundry/ml/{autogen → _autogen}/client/models/artifact_version_status.py +2 -2
  55. truefoundry/ml/{autogen → _autogen}/client/models/assistant_message.py +6 -6
  56. truefoundry/ml/{autogen → _autogen}/client/models/authorize_user_for_model_request_dto.py +2 -2
  57. truefoundry/ml/{autogen → _autogen}/client/models/authorize_user_for_model_version_request_dto.py +2 -2
  58. truefoundry/ml/{autogen → _autogen}/client/models/blob_storage_reference.py +6 -9
  59. truefoundry/ml/{autogen → _autogen}/client/models/body_get_search_runs_get.py +2 -2
  60. truefoundry/ml/{autogen/client/models/chat_prompt.py → _autogen/client/models/chat_prompt_manifest.py} +39 -37
  61. truefoundry/ml/{autogen/client/models/chat_prompt_messages_inner.py → _autogen/client/models/chat_prompt_manifest_messages_inner.py} +15 -15
  62. truefoundry/ml/{autogen → _autogen}/client/models/columns_dto.py +2 -2
  63. truefoundry/ml/{autogen → _autogen}/client/models/command.py +2 -2
  64. truefoundry/ml/{autogen → _autogen}/client/models/content.py +4 -4
  65. truefoundry/ml/{autogen → _autogen}/client/models/content1.py +4 -4
  66. truefoundry/ml/{autogen → _autogen}/client/models/content2.py +5 -5
  67. truefoundry/ml/{autogen → _autogen}/client/models/content2_any_of_inner.py +4 -4
  68. truefoundry/ml/{autogen → _autogen}/client/models/create_artifact_request_dto.py +3 -3
  69. truefoundry/ml/{autogen → _autogen}/client/models/create_artifact_response_dto.py +2 -2
  70. truefoundry/ml/{autogen → _autogen}/client/models/create_artifact_version_request_dto.py +3 -3
  71. truefoundry/ml/{autogen → _autogen}/client/models/create_artifact_version_response_dto.py +2 -2
  72. truefoundry/ml/{autogen → _autogen}/client/models/create_dataset_request_dto.py +21 -5
  73. truefoundry/ml/{autogen → _autogen}/client/models/create_experiment_request_dto.py +3 -3
  74. truefoundry/ml/{autogen → _autogen}/client/models/create_experiment_response_dto.py +2 -2
  75. truefoundry/ml/{autogen → _autogen}/client/models/create_model_version_request_dto.py +4 -12
  76. truefoundry/ml/{autogen → _autogen}/client/models/create_multi_part_upload_for_dataset_request_dto.py +2 -2
  77. truefoundry/ml/{autogen → _autogen}/client/models/create_multi_part_upload_for_dataset_response_dto.py +3 -3
  78. truefoundry/ml/{autogen → _autogen}/client/models/create_multi_part_upload_request_dto.py +2 -2
  79. truefoundry/ml/{autogen → _autogen}/client/models/create_python_deployment_config_request_dto.py +2 -2
  80. truefoundry/ml/{autogen → _autogen}/client/models/create_python_deployment_config_response_dto.py +2 -2
  81. truefoundry/ml/{autogen → _autogen}/client/models/create_run_request_dto.py +3 -3
  82. truefoundry/ml/{autogen → _autogen}/client/models/create_run_response_dto.py +3 -3
  83. truefoundry/ml/{autogen → _autogen}/client/models/create_workflow_task_config_request_dto.py +2 -2
  84. truefoundry/ml/_autogen/client/models/data_directory_manifest.py +124 -0
  85. truefoundry/ml/{autogen → _autogen}/client/models/dataset_dto.py +15 -4
  86. truefoundry/ml/{autogen → _autogen}/client/models/dataset_response_dto.py +3 -3
  87. truefoundry/ml/{autogen → _autogen}/client/models/delete_artifact_versions_request_dto.py +2 -2
  88. truefoundry/ml/{autogen → _autogen}/client/models/delete_dataset_request_dto.py +2 -2
  89. truefoundry/ml/{autogen → _autogen}/client/models/delete_files_for_dataset_request_dto.py +2 -2
  90. truefoundry/ml/{autogen → _autogen}/client/models/delete_model_version_request_dto.py +2 -2
  91. truefoundry/ml/{autogen → _autogen}/client/models/delete_run_request.py +2 -2
  92. truefoundry/ml/{autogen → _autogen}/client/models/delete_tag_request_dto.py +2 -2
  93. truefoundry/ml/{autogen → _autogen}/client/models/experiment_dto.py +5 -5
  94. truefoundry/ml/{autogen → _autogen}/client/models/experiment_id_request_dto.py +2 -2
  95. truefoundry/ml/{autogen → _autogen}/client/models/experiment_response_dto.py +3 -3
  96. truefoundry/ml/{autogen → _autogen}/client/models/experiment_tag_dto.py +2 -2
  97. truefoundry/ml/{autogen → _autogen}/client/models/export_deployment_files_request_dto.py +3 -3
  98. truefoundry/ml/{autogen → _autogen}/client/models/external_blob_storage_source.py +17 -9
  99. truefoundry/ml/{autogen → _autogen}/client/models/fast_ai_framework.py +4 -7
  100. truefoundry/ml/{autogen → _autogen}/client/models/file_info_dto.py +6 -3
  101. truefoundry/ml/{autogen → _autogen}/client/models/finalize_artifact_version_request_dto.py +7 -15
  102. truefoundry/ml/{autogen → _autogen}/client/models/framework.py +17 -17
  103. truefoundry/ml/{autogen → _autogen}/client/models/get_artifact_version_aliases_response_dto.py +2 -2
  104. truefoundry/ml/{autogen → _autogen}/client/models/get_experiment_response_dto.py +4 -4
  105. truefoundry/ml/{autogen → _autogen}/client/models/get_latest_run_log_response_dto.py +3 -3
  106. truefoundry/ml/{autogen → _autogen}/client/models/get_metric_history_response.py +3 -3
  107. truefoundry/ml/{autogen → _autogen}/client/models/get_signed_url_for_dataset_write_request_dto.py +2 -2
  108. truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_artifact_version_read_request_dto.py +2 -2
  109. truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_artifact_version_read_response_dto.py +3 -3
  110. truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_artifact_version_write_request_dto.py +2 -2
  111. truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_artifact_version_write_response_dto.py +3 -3
  112. truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_dataset_read_request_dto.py +2 -2
  113. truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_dataset_read_response_dto.py +3 -3
  114. truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_dataset_write_response_dto.py +3 -3
  115. truefoundry/ml/{autogen → _autogen}/client/models/get_tenant_id_response_dto.py +2 -2
  116. truefoundry/ml/{autogen → _autogen}/client/models/gluon_framework.py +4 -6
  117. truefoundry/ml/{autogen → _autogen}/client/models/h2_o_framework.py +4 -6
  118. truefoundry/ml/{autogen → _autogen}/client/models/http_validation_error.py +3 -3
  119. truefoundry/ml/{autogen → _autogen}/client/models/image_content_part.py +6 -7
  120. truefoundry/ml/{autogen → _autogen}/client/models/image_url.py +4 -4
  121. truefoundry/ml/{autogen → _autogen}/client/models/infer_method_name.py +3 -3
  122. truefoundry/ml/{autogen → _autogen}/client/models/keras_framework.py +4 -6
  123. truefoundry/ml/{autogen → _autogen}/client/models/latest_run_log_dto.py +3 -3
  124. truefoundry/ml/{autogen → _autogen}/client/models/library_name.py +3 -3
  125. truefoundry/ml/{autogen → _autogen}/client/models/light_gbm_framework.py +4 -7
  126. truefoundry/ml/{autogen → _autogen}/client/models/list_artifact_versions_request_dto.py +4 -4
  127. truefoundry/ml/{autogen → _autogen}/client/models/list_artifact_versions_response_dto.py +5 -3
  128. truefoundry/ml/{autogen → _autogen}/client/models/list_artifacts_request_dto.py +3 -3
  129. truefoundry/ml/{autogen → _autogen}/client/models/list_artifacts_response_dto.py +3 -3
  130. truefoundry/ml/{autogen → _autogen}/client/models/list_colums_response_dto.py +3 -3
  131. truefoundry/ml/{autogen → _autogen}/client/models/list_datasets_request_dto.py +2 -2
  132. truefoundry/ml/{autogen → _autogen}/client/models/list_datasets_response_dto.py +3 -3
  133. truefoundry/ml/{autogen → _autogen}/client/models/list_experiments_response_dto.py +3 -3
  134. truefoundry/ml/{autogen → _autogen}/client/models/list_files_for_artifact_version_request_dto.py +2 -2
  135. truefoundry/ml/{autogen → _autogen}/client/models/list_files_for_artifact_versions_response_dto.py +3 -3
  136. truefoundry/ml/{autogen → _autogen}/client/models/list_files_for_dataset_request_dto.py +2 -2
  137. truefoundry/ml/{autogen → _autogen}/client/models/list_files_for_dataset_response_dto.py +3 -3
  138. truefoundry/ml/{autogen → _autogen}/client/models/list_latest_run_logs_response_dto.py +3 -3
  139. truefoundry/ml/{autogen → _autogen}/client/models/list_metric_history_request_dto.py +2 -2
  140. truefoundry/ml/{autogen → _autogen}/client/models/list_metric_history_response_dto.py +3 -3
  141. truefoundry/ml/{autogen → _autogen}/client/models/list_model_version_response_dto.py +3 -3
  142. truefoundry/ml/{autogen → _autogen}/client/models/list_model_versions_request_dto.py +3 -3
  143. truefoundry/ml/{autogen → _autogen}/client/models/list_models_request_dto.py +2 -2
  144. truefoundry/ml/{autogen → _autogen}/client/models/list_models_response_dto.py +3 -3
  145. truefoundry/ml/{autogen → _autogen}/client/models/list_run_artifacts_response_dto.py +3 -3
  146. truefoundry/ml/{autogen → _autogen}/client/models/list_run_logs_response_dto.py +3 -3
  147. truefoundry/ml/_autogen/client/models/local_artifact_source.py +91 -0
  148. truefoundry/ml/_autogen/client/models/local_model_source.py +77 -0
  149. truefoundry/ml/{autogen → _autogen}/client/models/log_batch_request_dto.py +5 -5
  150. truefoundry/ml/{autogen → _autogen}/client/models/log_metric_request_dto.py +2 -2
  151. truefoundry/ml/{autogen → _autogen}/client/models/log_param_request_dto.py +2 -2
  152. truefoundry/ml/_autogen/client/models/manifest.py +229 -0
  153. truefoundry/ml/_autogen/client/models/manifest1.py +217 -0
  154. truefoundry/ml/{autogen/client/models/internal_metadata.py → _autogen/client/models/manifest2.py} +68 -50
  155. truefoundry/ml/{autogen → _autogen}/client/models/method.py +3 -3
  156. truefoundry/ml/{autogen → _autogen}/client/models/metric_collection_dto.py +3 -3
  157. truefoundry/ml/{autogen → _autogen}/client/models/metric_dto.py +2 -2
  158. truefoundry/ml/{autogen → _autogen}/client/models/mime_type.py +3 -3
  159. truefoundry/ml/{autogen → _autogen}/client/models/model_configuration.py +8 -9
  160. truefoundry/ml/{autogen → _autogen}/client/models/model_dto.py +6 -6
  161. truefoundry/ml/{autogen/client/models/model_version_manifest.py → _autogen/client/models/model_manifest.py} +43 -35
  162. truefoundry/ml/{autogen → _autogen}/client/models/model_response_dto.py +3 -3
  163. truefoundry/ml/{autogen → _autogen}/client/models/model_server.py +2 -2
  164. truefoundry/ml/{autogen → _autogen}/client/models/model_version_dto.py +9 -11
  165. truefoundry/ml/{autogen → _autogen}/client/models/model_version_environment.py +5 -7
  166. truefoundry/ml/{autogen → _autogen}/client/models/model_version_response_dto.py +3 -3
  167. truefoundry/ml/{autogen → _autogen}/client/models/multi_part_upload_dto.py +4 -4
  168. truefoundry/ml/{autogen → _autogen}/client/models/multi_part_upload_response_dto.py +3 -3
  169. truefoundry/ml/{autogen → _autogen}/client/models/multi_part_upload_storage_provider.py +2 -2
  170. truefoundry/ml/{autogen → _autogen}/client/models/notify_artifact_version_failure_dto.py +2 -2
  171. truefoundry/ml/{autogen → _autogen}/client/models/onnx_framework.py +4 -6
  172. truefoundry/ml/{autogen → _autogen}/client/models/openapi_spec.py +4 -4
  173. truefoundry/ml/{autogen → _autogen}/client/models/paddle_framework.py +4 -7
  174. truefoundry/ml/{autogen → _autogen}/client/models/param_dto.py +2 -2
  175. truefoundry/ml/{autogen → _autogen}/client/models/parameters.py +4 -4
  176. truefoundry/ml/{autogen → _autogen}/client/models/py_torch_framework.py +4 -7
  177. truefoundry/ml/{autogen → _autogen}/client/models/resolve_agent_app_response_dto.py +3 -3
  178. truefoundry/ml/{autogen → _autogen}/client/models/restore_run_request_dto.py +2 -2
  179. truefoundry/ml/{autogen → _autogen}/client/models/run_data_dto.py +5 -5
  180. truefoundry/ml/{autogen → _autogen}/client/models/run_dto.py +4 -4
  181. truefoundry/ml/{autogen → _autogen}/client/models/run_info_dto.py +3 -3
  182. truefoundry/ml/{autogen → _autogen}/client/models/run_log_dto.py +2 -2
  183. truefoundry/ml/{autogen → _autogen}/client/models/run_log_input_dto.py +2 -2
  184. truefoundry/ml/{autogen → _autogen}/client/models/run_response_dto.py +3 -3
  185. truefoundry/ml/{autogen → _autogen}/client/models/run_tag_dto.py +2 -2
  186. truefoundry/ml/{autogen → _autogen}/client/models/search_runs_request_dto.py +2 -2
  187. truefoundry/ml/{autogen → _autogen}/client/models/search_runs_response_dto.py +3 -3
  188. truefoundry/ml/{autogen → _autogen}/client/models/set_experiment_tag_request_dto.py +2 -2
  189. truefoundry/ml/{autogen → _autogen}/client/models/set_tag_request_dto.py +2 -2
  190. truefoundry/ml/{autogen → _autogen}/client/models/signed_url_dto.py +3 -4
  191. truefoundry/ml/{autogen → _autogen}/client/models/sklearn_framework.py +9 -10
  192. truefoundry/ml/{autogen → _autogen}/client/models/sklearn_model_schema.py +7 -8
  193. truefoundry/ml/{autogen → _autogen}/client/models/sklearn_serialization_format.py +3 -3
  194. truefoundry/ml/{autogen → _autogen}/client/models/source.py +34 -9
  195. truefoundry/ml/{autogen → _autogen}/client/models/source1.py +5 -5
  196. truefoundry/ml/_autogen/client/models/source2.py +177 -0
  197. truefoundry/ml/{autogen → _autogen}/client/models/spa_cy_framework.py +4 -6
  198. truefoundry/ml/{autogen → _autogen}/client/models/stats_models_framework.py +4 -7
  199. truefoundry/ml/{autogen → _autogen}/client/models/stop.py +2 -2
  200. truefoundry/ml/{autogen → _autogen}/client/models/store_run_logs_request_dto.py +3 -3
  201. truefoundry/ml/{autogen → _autogen}/client/models/subject.py +3 -3
  202. truefoundry/ml/{autogen → _autogen}/client/models/subject_type.py +2 -2
  203. truefoundry/ml/{autogen → _autogen}/client/models/system_message.py +6 -8
  204. truefoundry/ml/{autogen → _autogen}/client/models/tensor_flow_framework.py +4 -7
  205. truefoundry/ml/{autogen → _autogen}/client/models/text.py +4 -4
  206. truefoundry/ml/{autogen → _autogen}/client/models/text_content_part.py +5 -5
  207. truefoundry/ml/{autogen → _autogen}/client/models/transformers_framework.py +8 -12
  208. truefoundry/ml/{autogen → _autogen}/client/models/trigger_job_run_config_request_dto.py +3 -3
  209. truefoundry/ml/{autogen → _autogen}/client/models/trigger_job_run_config_response_dto.py +2 -2
  210. truefoundry/ml/{autogen → _autogen}/client/models/true_foundry_managed_source.py +18 -12
  211. truefoundry/ml/{autogen → _autogen}/client/models/update_artifact_version_request_dto.py +5 -7
  212. truefoundry/ml/{autogen → _autogen}/client/models/update_dataset_request_dto.py +13 -3
  213. truefoundry/ml/{autogen → _autogen}/client/models/update_experiment_request_dto.py +2 -2
  214. truefoundry/ml/{autogen → _autogen}/client/models/update_model_version_request_dto.py +5 -7
  215. truefoundry/ml/{autogen → _autogen}/client/models/update_run_request_dto.py +2 -2
  216. truefoundry/ml/{autogen → _autogen}/client/models/update_run_response_dto.py +3 -3
  217. truefoundry/ml/{autogen → _autogen}/client/models/url.py +4 -4
  218. truefoundry/ml/{autogen → _autogen}/client/models/user_message.py +6 -6
  219. truefoundry/ml/{autogen → _autogen}/client/models/validate_external_storage_root_request_dto.py +2 -2
  220. truefoundry/ml/{autogen → _autogen}/client/models/validate_external_storage_root_response_dto.py +2 -2
  221. truefoundry/ml/{autogen → _autogen}/client/models/validation_error.py +3 -3
  222. truefoundry/ml/{autogen → _autogen}/client/models/validation_error_loc_inner.py +2 -2
  223. truefoundry/ml/{autogen → _autogen}/client/models/xg_boost_framework.py +7 -10
  224. truefoundry/ml/{autogen → _autogen}/client/models/xg_boost_model_schema.py +6 -7
  225. truefoundry/ml/{autogen → _autogen}/client/models/xg_boost_serialization_format.py +3 -3
  226. truefoundry/ml/{autogen → _autogen}/client/rest.py +3 -3
  227. truefoundry/ml/_autogen/client_README.md +359 -0
  228. truefoundry/ml/_autogen/entities/artifacts.py +558 -0
  229. truefoundry/ml/artifact/truefoundry_artifact_repo.py +1 -1
  230. truefoundry/ml/cli/commands/model_init.py +1 -1
  231. truefoundry/ml/clients/servicefoundry_client.py +7 -2
  232. truefoundry/ml/entities.py +1 -1
  233. truefoundry/ml/log_types/artifacts/artifact.py +22 -85
  234. truefoundry/ml/log_types/artifacts/dataset.py +5 -5
  235. truefoundry/ml/log_types/artifacts/general_artifact.py +1 -1
  236. truefoundry/ml/log_types/artifacts/model.py +12 -13
  237. truefoundry/ml/log_types/artifacts/utils.py +18 -2
  238. truefoundry/ml/log_types/image/image.py +1 -1
  239. truefoundry/ml/log_types/plot.py +1 -1
  240. truefoundry/ml/mlfoundry_api.py +2 -42
  241. truefoundry/ml/mlfoundry_run.py +1 -1
  242. truefoundry/ml/model_framework.py +3 -3
  243. truefoundry/ml/session.py +7 -4
  244. truefoundry/ml/validation_utils.py +1 -1
  245. truefoundry/workflow/map_task.py +5 -2
  246. {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.11rc1.dist-info}/METADATA +2 -1
  247. truefoundry-0.5.11rc1.dist-info/RECORD +377 -0
  248. truefoundry/deploy/auto_gen/models.py +0 -1915
  249. truefoundry/ml/autogen/client/__init__.py +0 -445
  250. truefoundry/ml/autogen/client/api/__init__.py +0 -16
  251. truefoundry/ml/autogen/client/models/__init__.py +0 -416
  252. truefoundry/ml/autogen/client/models/add_custom_metrics_to_model_version_request_dto.py +0 -69
  253. truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py +0 -69
  254. truefoundry/ml/autogen/client/models/manifest.py +0 -154
  255. truefoundry/ml/autogen/client_README.md +0 -361
  256. truefoundry/ml/autogen/entities/artifacts.py +0 -670
  257. truefoundry-0.5.10rc1.dist-info/RECORD +0 -370
  258. /truefoundry/ml/{autogen → _autogen}/__init__.py +0 -0
  259. /truefoundry/ml/{autogen → _autogen}/client/api_response.py +0 -0
  260. /truefoundry/ml/{autogen → _autogen}/models/__init__.py +0 -0
  261. /truefoundry/ml/{autogen → _autogen}/models/exceptions.py +0 -0
  262. /truefoundry/ml/{autogen → _autogen}/models/schema.py +0 -0
  263. /truefoundry/ml/{autogen → _autogen}/models/signature.py +0 -0
  264. /truefoundry/ml/{autogen → _autogen}/models/utils.py +0 -0
  265. {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.11rc1.dist-info}/WHEEL +0 -0
  266. {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.11rc1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,1591 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: application.json
3
+ # timestamp: 2025-03-10T17:05:18+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from enum import Enum
8
+ from typing import Any, Dict, List, Literal, Optional, Union
9
+
10
+ from truefoundry.pydantic_v1 import (
11
+ BaseModel,
12
+ Field,
13
+ PositiveFloat,
14
+ PositiveInt,
15
+ confloat,
16
+ conint,
17
+ constr,
18
+ )
19
+
20
+
21
+ class AMQPInputConfig(BaseModel):
22
+ """
23
+ Describes the configuration for the input AMQP worker
24
+ """
25
+
26
+ type: Literal["amqp"] = Field(..., description="")
27
+ url: constr(
28
+ regex=r"^(amqp|amqps?)://(?:[^:@]+(?::[^:@]+)?@)?([^/?]+)(?:/([^?]+))?/?([^?]+)?(?:\?(.*))?$"
29
+ ) = Field(..., description="AMQP Queue URL of Subscriber")
30
+ queue_name: str = Field(..., description="AMQP Queue Name")
31
+ wait_time_seconds: conint(ge=1) = Field(
32
+ 5, description="Wait timeout for long polling."
33
+ )
34
+
35
+
36
+ class AMQPMetricConfig(BaseModel):
37
+ type: Literal["amqp"] = Field(..., description="")
38
+ queue_length: conint(ge=1) = Field(
39
+ ...,
40
+ description="Upper limit of the number of backlog messages the auto-scaler will try to maintain per replica. If you set this number to 10 and have 30 messages in the stream and one replica, the auto-scaler will scale the number of replicas to 3.",
41
+ )
42
+
43
+
44
+ class AMQPOutputConfig(BaseModel):
45
+ """
46
+ Describes the configuration for the output AMQP worker
47
+ """
48
+
49
+ type: Literal["amqp"] = Field(..., description="")
50
+ url: constr(
51
+ regex=r"^(amqp|amqps?)://(?:[^:@]+(?::[^:@]+)?@)?([^/?]+)(?:/([^?]+))?/?([^?]+)?(?:\?(.*))?$"
52
+ ) = Field(..., description="AMQP Queue URL of Publisher")
53
+ routing_key: str = Field(..., description="AMQP Routing Key to publish to.")
54
+ exchange_name: Optional[str] = Field(None, description="AMQP Exchange Name")
55
+
56
+
57
+ class AWSAccessKeyAuth(BaseModel):
58
+ aws_access_key_id: str = Field(..., description="AWS Access Key ID")
59
+ aws_secret_access_key: str = Field(
60
+ ..., description="AWS Secret Access Key for the user to authenticate with"
61
+ )
62
+ aws_session_token: Optional[str] = Field(
63
+ None,
64
+ description="AWS Session Token, only required when using temporary credentials",
65
+ )
66
+
67
+
68
+ class AWSInferentia(BaseModel):
69
+ type: Literal["aws_inferentia"] = Field(..., description="")
70
+ name: Optional[str] = Field(
71
+ None,
72
+ description="Name of the AWS Inferentia Accccelerator. One of [INF1, INF2].\nThis field is required for Node Selector and can be ignored in Nodepool Selector.",
73
+ )
74
+ count: conint(ge=1, le=16) = Field(
75
+ ...,
76
+ description="Count of Inferentia accelerator chips to provide to the application",
77
+ )
78
+
79
+
80
+ class ArtifactsCacheVolume(BaseModel):
81
+ """
82
+ Describes the volume that will be used to cache the models
83
+ """
84
+
85
+ storage_class: str = Field(
86
+ ..., description="Storage class of the Volume where artifacts will be cached"
87
+ )
88
+ cache_size: conint(ge=1, le=1000) = Field(
89
+ 200,
90
+ description="Size of the Volume (in GB) where artifacts will be cached. Should be greater than twice the size of artifacts getting cached",
91
+ )
92
+
93
+
94
+ class AsyncProcessorSidecar(BaseModel):
95
+ destination_url: str = Field(..., description="URL for the processor to invoke")
96
+ request_timeout: conint(ge=1) = Field(
97
+ 10, description="Timeout for the invoke request in seconds"
98
+ )
99
+ sidecar_image: Optional[str] = Field(
100
+ None,
101
+ description="Image for the processor sidecar (This field will be deprecated in the future)",
102
+ )
103
+
104
+
105
+ class Autoshutdown(BaseModel):
106
+ wait_time: conint(ge=0) = Field(
107
+ 300,
108
+ description="The period to wait after the last received request before scaling the replicas to 0",
109
+ )
110
+
111
+
112
+ class BaseAutoscaling(BaseModel):
113
+ min_replicas: conint(ge=0) = Field(
114
+ 1, description="Minimum number of replicas to keep available"
115
+ )
116
+ max_replicas: conint(ge=1, le=500) = Field(
117
+ ..., description="Maximum number of replicas allowed for the component."
118
+ )
119
+ polling_interval: conint(ge=0) = Field(
120
+ 30, description="This is the interval to check each trigger on."
121
+ )
122
+
123
+
124
+ class BasicAuthCreds(BaseModel):
125
+ type: Literal["basic_auth"] = Field(..., description="")
126
+ username: str = Field(..., description="")
127
+ password: str = Field(..., description="")
128
+
129
+
130
+ class BlueGreen(BaseModel):
131
+ """
132
+ This strategy brings up the new release completely before switching the complete load to the new release.
133
+ This minimizes the time that two versions are serving traffic at the same time.
134
+ """
135
+
136
+ type: Literal["blue_green"] = Field(..., description="")
137
+ enable_auto_promotion: bool = Field(
138
+ False,
139
+ description="Promote the new release to handle the complete traffic. A manual promotion would be needed if this is disabled",
140
+ )
141
+ auto_promotion_seconds: conint(ge=0) = Field(
142
+ 30,
143
+ description="Promote the new release to handle the complete traffic after waiting for these many seconds",
144
+ )
145
+
146
+
147
+ class CPUUtilizationMetric(BaseModel):
148
+ type: Literal["cpu_utilization"] = Field(..., description="")
149
+ value: conint(ge=1, le=100) = Field(
150
+ ...,
151
+ description="Percentage of cpu request averaged over all replicas which the autoscaler should try to maintain",
152
+ )
153
+
154
+
155
+ class CanaryStep(BaseModel):
156
+ weight_percentage: conint(ge=0, le=100) = Field(
157
+ ...,
158
+ description="Percentage of total traffic to be shifted to the canary release.\nThe rest will continue to go to the existing deployment",
159
+ )
160
+ pause_duration: conint(ge=0) = Field(
161
+ 30,
162
+ description="Duration for which to pause the release. The release process will wait for these seconds before proceeding to the next step.\nIf this is not set, the step will pause indefinitely on this step",
163
+ )
164
+
165
+
166
+ class CronMetric(BaseModel):
167
+ type: Literal["cron"] = Field(..., description="")
168
+ desired_replicas: Optional[conint(ge=1)] = Field(
169
+ None,
170
+ description="Desired number of replicas during the given interval. Default value is max_replicas.",
171
+ )
172
+ start: str = Field(
173
+ ...,
174
+ description="Cron expression indicating the start of the cron schedule.\n```\n* * * * *\n| | | | |\n| | | | |___ day of week (0-6) (Sunday is 0)\n| | | |_____ month (1-12)\n| | |_______ day of month (1-31)\n| |_________ hour (0-23)\n|___________ minute (0-59)\n```",
175
+ )
176
+ end: str = Field(
177
+ ...,
178
+ description="Cron expression indicating the end of the cron schedule.\n```\n* * * * *\n| | | | |\n| | | | |___ day of week (0-6) (Sunday is 0)\n| | | |_____ month (1-12)\n| | |_______ day of month (1-31)\n| |_________ hour (0-23)\n|___________ minute (0-59)\n```",
179
+ )
180
+ timezone: str = Field(
181
+ "UTC",
182
+ description='Timezone against which the cron schedule will be calculated, e.g. "Asia/Tokyo". Default is machine\'s local time.\nhttps://docs.truefoundry.com/docs/list-of-supported-timezones',
183
+ )
184
+
185
+
186
+ class DockerFileBuild(BaseModel):
187
+ """
188
+ Describes that we are using a dockerfile to build our image
189
+ """
190
+
191
+ type: Literal["dockerfile"] = Field(..., description="")
192
+ dockerfile_path: str = Field(
193
+ "./Dockerfile",
194
+ description="The file path of the Dockerfile relative to project root path.",
195
+ )
196
+ build_context_path: str = Field(
197
+ "./",
198
+ description="Build context path for the Dockerfile relative to project root path.",
199
+ )
200
+ command: Optional[Union[str, List[str]]] = Field(
201
+ None,
202
+ description="Override the command to run when the container starts\nWhen deploying a Job, the command can be templatized by defining `params` and referencing them in command\nE.g. `python main.py --learning_rate {{learning_rate}}`",
203
+ )
204
+ build_args: Optional[Dict[str, str]] = Field(None, description="")
205
+
206
+
207
+ class DynamicVolumeConfig(BaseModel):
208
+ type: Literal["dynamic"] = Field(..., description="Volume Type for the volume.")
209
+ storage_class: str = Field(
210
+ ..., description="Name of the storage class to be used for the volume."
211
+ )
212
+ size: conint(ge=1, le=64000) = Field(..., description="Size of volume in Gi")
213
+
214
+
215
+ class Endpoint(BaseModel):
216
+ host: constr(
217
+ regex=r"^((([a-zA-Z0-9\-]{1,63}\.)([a-zA-Z0-9\-]{1,63}\.)*([A-Za-z]{1,63}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))$"
218
+ ) = Field(..., description="Host e.g. ai.example.com, app.truefoundry.com")
219
+ path: Optional[
220
+ constr(regex=r"^(/([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9]))*/$")
221
+ ] = Field(None, description="Path e.g. /v1/api/ml/, /v2/docs/")
222
+
223
+
224
+ class FlyteLaunchPlanID(BaseModel):
225
+ resourceType: Literal["LAUNCH_PLAN"]
226
+ name: str
227
+
228
+
229
+ class FlyteTaskID(BaseModel):
230
+ resourceType: Literal["TASK"]
231
+ name: str
232
+
233
+
234
+ class FlyteWorkflowID(BaseModel):
235
+ resourceType: Literal["WORKFLOW"]
236
+ name: str
237
+
238
+
239
+ class FlyteWorkflowTemplate(BaseModel):
240
+ id: FlyteWorkflowID
241
+
242
+
243
+ class GcpTPU(BaseModel):
244
+ type: Literal["gcp_tpu"] = Field(..., description="")
245
+ name: constr(regex=r"^tpu-[a-z\d\-]+$") = Field(
246
+ ...,
247
+ description="Name of the TPU Type. One of\n - `tpu-v4-podslice` (TPU v4, ct4p)\n - `tpu-v5-lite-device` (TPU v5e, ct5l)\n - `tpu-v5-lite-podslice` (TPU v5e, ct5lp)\n - `tpu-v5p-slice` (TPU v5p, ct5p)",
248
+ )
249
+ topology: constr(regex=r"^\d+x\d+(x\d+)?$") = Field(
250
+ ...,
251
+ description="Topology of the TPU slices. Currently only single-host topology is supported.\n Please refer to [TPUs on GKE docs](https://cloud.google.com/kubernetes-engine/docs/concepts/tpus#plan-tpu-configuration)\n Allowed Values:\n - `2x2x1` for `tpu-v4-podslice`\n - One of `1x1`, `2x2`, `2x4` for `tpu-v5-lite-device` and `tpu-v5-lite-podslice`\n - `2x2x1` for `tpu-v5p-slice`",
252
+ )
253
+
254
+
255
+ class GitHelmRepo(BaseModel):
256
+ type: Literal["git-helm-repo"] = Field(..., description="")
257
+ repo_url: constr(
258
+ regex=r"^(((https?|wss):\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*))$"
259
+ ) = Field(..., description="")
260
+ revision: str = Field(..., description="Branch/Commit SHA/Tag of the git repo.")
261
+ path: str = Field(..., description="Path to the chart.")
262
+ value_files: Optional[List[str]] = Field(
263
+ None,
264
+ description="Helm values files for overriding values in the helm chart.\nThe path is relative to the Path directory defined above",
265
+ )
266
+
267
+
268
+ class GitSource(BaseModel):
269
+ """
270
+ Describes that we are using code stored in a git repository to build our image
271
+ """
272
+
273
+ type: Literal["git"] = Field(..., description="")
274
+ repo_url: constr(
275
+ regex=r"^(http(s?)://)(github\.com|(.+@)*bitbucket\.org|gitlab\.com|(.*)@dev.azure.com).*$"
276
+ ) = Field(..., description="The repository URL.")
277
+ ref: str = Field(..., description="The commit SHA.")
278
+ branch_name: Optional[str] = Field(
279
+ None,
280
+ description="Selecting branch will select latest commit SHA of the branch.",
281
+ )
282
+
283
+
284
+ class HelmRepo(BaseModel):
285
+ type: Literal["helm-repo"] = Field(..., description="")
286
+ repo_url: constr(
287
+ regex=r"^(((https?|wss):\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*))$"
288
+ ) = Field(..., description="")
289
+ integration_fqn: Optional[str] = Field(
290
+ None,
291
+ description="FQN of the helm repo integration. If you can't find your integration here,\nadd it through the [Integrations](/integrations) page",
292
+ )
293
+ chart: str = Field(..., description="The helm chart name")
294
+ version: str = Field(..., description="Helm chart version")
295
+
296
+
297
+ class HttpProbe(BaseModel):
298
+ """
299
+ Describes the Instructions for assessing container health by executing an HTTP GET request.
300
+ To learn more you can go [here](https://docs.truefoundry.com/docs/liveness-readiness-probe)
301
+ """
302
+
303
+ type: Literal["http"] = Field(..., description="")
304
+ path: str = Field(..., description="Path to the health check endpoint")
305
+ port: conint(ge=0, le=65535) = Field(
306
+ ..., description="Listening port for the health check endpoint"
307
+ )
308
+ host: Optional[str] = Field(
309
+ None, description="Host name to connect to, defaults to the pod IP"
310
+ )
311
+ scheme: str = Field("HTTP", description="Scheme to use for connecting to the host")
312
+
313
+
314
+ class HuggingfaceArtifactSource(BaseModel):
315
+ """
316
+ Input for Artifact from Huggingface Model Hub
317
+ """
318
+
319
+ type: Literal["huggingface-hub"] = Field(..., description="")
320
+ model_id: str = Field(..., description="Model ID of the artifact to be downloaded")
321
+ revision: str = Field(..., description="Revision of the artifact to be downloaded")
322
+ ignore_patterns: List[str] = Field(
323
+ ["*.h5", "*.ot", "*.tflite", "*.msgpack"],
324
+ description="List of patterns to ignore while downloading the artifact",
325
+ )
326
+ download_path_env_variable: str = Field(
327
+ ...,
328
+ description="Environment variable which will contain the download path of the artifact",
329
+ )
330
+
331
+
332
+ class Image(BaseModel):
333
+ """
334
+ Describes that we are using a pre-built image stored in a Docker Image registry
335
+ """
336
+
337
+ type: Literal["image"] = Field(..., description="")
338
+ image_uri: constr(regex=r"^\S*$") = Field(
339
+ ...,
340
+ description="The image URI. Specify the name of the image and the tag.\nIf the image is in Dockerhub, you can skip registry-url (for e.g. `tensorflow/tensorflow`).\nYou can use an image from a private registry using Advanced fields",
341
+ )
342
+ docker_registry: Optional[str] = Field(
343
+ None,
344
+ description="FQN of the container registry. If you can't find your registry here,\nadd it through the [Integrations](/integrations?tab=docker-registry) page",
345
+ )
346
+ command: Optional[Union[str, List[str]]] = Field(
347
+ None,
348
+ description="Override the command to run when container starts.\nWhen deploying a Job, the command can be templatized by defining `params` and referencing them in command\nE.g. `python main.py --learning_rate {{learning_rate}}`",
349
+ )
350
+
351
+
352
+ class JobAlert(BaseModel):
353
+ """
354
+ Describes the configuration for the job alerts
355
+ """
356
+
357
+ notification_channel: constr(min_length=1) = Field(
358
+ ..., description="Specify the notification channel to send alerts to"
359
+ )
360
+ to_emails: Optional[List[constr(min_length=1)]] = Field(
361
+ None,
362
+ description="List of recipients' email addresses if the notification channel is Email.",
363
+ )
364
+ on_start: bool = Field(False, description="Send an alert when the job starts")
365
+ on_completion: bool = Field(
366
+ False, description="Send an alert when the job completes"
367
+ )
368
+ on_failure: bool = Field(True, description="Send an alert when the job fails")
369
+
370
+
371
+ class Claim(BaseModel):
372
+ key: str
373
+ values: List[str]
374
+
375
+
376
+ class JwtAuthConfig(BaseModel):
377
+ """
378
+ Configure JWT-based authentication using JWKS
379
+ """
380
+
381
+ type: Literal["jwt_auth"] = Field(..., description="")
382
+ integration_fqn: str = Field(
383
+ ...,
384
+ description="FQN of the JWT Auth integration. If you can't find your integration here,\nadd it through the [Integrations](/integrations) page",
385
+ )
386
+ enable_login: Optional[bool] = Field(
387
+ None, description="Enable login for the service"
388
+ )
389
+ claims: Optional[List[Claim]] = Field(
390
+ None, description="List of key-value pairs of claims to verify in the JWT token"
391
+ )
392
+
393
+
394
+ class KafkaMetricConfig(BaseModel):
395
+ type: Literal["kafka"] = Field(..., description="")
396
+ lag_threshold: conint(ge=1) = Field(
397
+ ...,
398
+ description="Upper limit of the number of backlog messages the auto-scaler will try to maintain per replica. If you set this number to 10 and have 30 messages in the stream and one replica, the auto-scaler will scale the number of replicas to 3.",
399
+ )
400
+
401
+
402
+ class KafkaSASLAuth(BaseModel):
403
+ username: str = Field(..., description="Username for SASL authentication")
404
+ password: str = Field(..., description="Password for SASL authentication")
405
+
406
+
407
+ class Kustomize(BaseModel):
408
+ patch: Optional[Dict[str, Any]] = Field(
409
+ None,
410
+ description="Content of kustomization.yaml to perform kustomize operation. Please do not include the `resources` section. It is filled in automatically",
411
+ )
412
+ additions: Optional[List[Dict[str, Any]]] = Field(
413
+ None,
414
+ description="Additional kubernetes manifests to be included in the application",
415
+ )
416
+
417
+
418
+ class LocalSource(BaseModel):
419
+ """
420
+ Describes that we are using code stored in a local developement environment to build our image
421
+ """
422
+
423
+ type: Literal["local"] = Field(..., description="")
424
+ project_root_path: str = Field("./", description="Local project root path.")
425
+ local_build: bool = Field(True, description="")
426
+
427
+
428
+ class Manual(BaseModel):
429
+ """
430
+ Trigger the job manually. [Docs](https://docs.truefoundry.com/docs/deploy-a-cron-job)
431
+ """
432
+
433
+ type: Literal["manual"] = Field(..., description="")
434
+
435
+
436
+ class NATSMetricConfig(BaseModel):
437
+ type: Literal["nats"] = Field(..., description="")
438
+ lag_threshold: conint(ge=1) = Field(
439
+ ...,
440
+ description="Upper limit of the number of backlog messages the auto-scaler will try to maintain per replica. If you set this number to 10 and have 30 messages in the stream and one replica, the auto-scaler will scale the number of replicas to 3.",
441
+ )
442
+
443
+
444
+ class NATSUserPasswordAuth(BaseModel):
445
+ """
446
+ NATS User Password Authentication
447
+ """
448
+
449
+ account_name: str = Field("$G", description="Name of the NATS account")
450
+ user: str = Field(..., description="User for NATS authentication")
451
+ password: str = Field(..., description="Password for NATS authentication")
452
+
453
+
454
+ class CapacityType(str, Enum):
455
+ """
456
+ Configure what type of nodes to run the app. By default no placement logic is applied.
457
+ "spot_fallback_on_demand" will try to place the application on spot nodes but will fallback to on-demand when spot nodes are not available.
458
+ "spot" will strictly place the application on spot nodes.
459
+ "on_demand" will strictly place the application on on-demand nodes.
460
+ """
461
+
462
+ spot_fallback_on_demand = "spot_fallback_on_demand"
463
+ spot = "spot"
464
+ on_demand = "on_demand"
465
+
466
+
467
+ class NodeSelector(BaseModel):
468
+ """
469
+ Constraints to select a Node - Specific GPU / Instance Families, On-Demand/Spot.
470
+ """
471
+
472
+ type: Literal["node_selector"] = Field(..., description="")
473
+ gpu_type: Optional[str] = Field(
474
+ None,
475
+ description="Name of the Nvidia GPU. One of [P4, P100, V100, T4, A10G, A100_40GB, A100_80GB]\nOne instance of the card contains the following amount of memory -\nP4: 8 GB, P100: 16 GB, V100: 16 GB, T4: 16 GB, A10G: 24 GB, A100_40GB: 40GB, A100_80GB: 80 GB",
476
+ )
477
+ instance_families: Optional[List[str]] = Field(
478
+ None,
479
+ description="Instance family of the underlying machine to use. Multiple instance families can be supplied.\nThe workload is guaranteed to be scheduled on one of them.",
480
+ )
481
+ capacity_type: Optional[CapacityType] = Field(
482
+ None,
483
+ description='Configure what type of nodes to run the app. By default no placement logic is applied.\n"spot_fallback_on_demand" will try to place the application on spot nodes but will fallback to on-demand when spot nodes are not available.\n"spot" will strictly place the application on spot nodes.\n"on_demand" will strictly place the application on on-demand nodes.',
484
+ )
485
+
486
+
487
+ class NodepoolSelector(BaseModel):
488
+ """
489
+ Specify one or more nodepools to run your application on.
490
+ """
491
+
492
+ type: Literal["nodepool_selector"] = Field(..., description="")
493
+ nodepools: Optional[List[str]] = Field(
494
+ None,
495
+ description="Nodepools where you want to run your workload. Multiple nodepools can be selected.\n The workload is guaranteed to be scheduled on one of the nodepool",
496
+ )
497
+
498
+
499
+ class NvidiaGPU(BaseModel):
500
+ type: Literal["nvidia_gpu"] = Field(..., description="")
501
+ name: Optional[str] = Field(
502
+ None,
503
+ description="Name of the Nvidia GPU. One of [P4, P100, V100, T4, A10G, A100_40GB, A100_80GB]\nThis field is required for Node Selector and can be ignored in Nodepool Selector.\nOne instance of the card contains the following amount of memory -\nP4: 8 GB, P100: 16 GB, V100: 16 GB, T4: 16 GB, A10G: 24 GB, A100_40GB: 40GB, A100_80GB: 80 GB",
504
+ )
505
+ count: conint(ge=1, le=16) = Field(
506
+ ...,
507
+ description="Count of GPUs to provide to the application\nNote the exact count and max count available for a given GPU type depends on cloud provider and cluster type.",
508
+ )
509
+
510
+
511
+ class Profile(str, Enum):
512
+ """
513
+ Name of the MIG profile to use. One of [1g.5gb, 2g.10gb, 3g.20gb, 1g.10gb, 2g.20gb, 3g.40gb]
514
+ """
515
+
516
+ field_1g_5gb = "1g.5gb"
517
+ field_2g_10gb = "2g.10gb"
518
+ field_3g_20gb = "3g.20gb"
519
+ field_1g_10gb = "1g.10gb"
520
+ field_2g_20gb = "2g.20gb"
521
+ field_3g_40gb = "3g.40gb"
522
+
523
+
524
+ class NvidiaMIGGPU(BaseModel):
525
+ type: Literal["nvidia_mig_gpu"] = Field(..., description="")
526
+ name: Optional[str] = Field(
527
+ None,
528
+ description="Name of the Nvidia GPU. One of [P4, P100, V100, T4, A10G, A100_40GB, A100_80GB]\nThis field is required for Node Selector and can be ignored in Nodepool Selector.\nOne instance of the card contains the following amount of memory -\nP4: 8 GB, P100: 16 GB, V100: 16 GB, T4: 16 GB, A10G: 24 GB, A100_40GB: 40GB, A100_80GB: 80 GB",
529
+ )
530
+ profile: Profile = Field(
531
+ ...,
532
+ description="Name of the MIG profile to use. One of [1g.5gb, 2g.10gb, 3g.20gb, 1g.10gb, 2g.20gb, 3g.40gb]",
533
+ )
534
+
535
+
536
+ class NvidiaTimeslicingGPU(BaseModel):
537
+ type: Literal["nvidia_timeslicing_gpu"] = Field(..., description="")
538
+ name: Optional[str] = Field(
539
+ None,
540
+ description="Name of the Nvidia GPU. One of [P4, P100, V100, T4, A10G, A100_40GB, A100_80GB]\nThis field is required for Node Selector and can be ignored in Nodepool Selector.\nOne instance of the card contains the following amount of memory -\nP4: 8 GB, P100: 16 GB, V100: 16 GB, T4: 16 GB, A10G: 24 GB, A100_40GB: 40GB, A100_80GB: 80 GB",
541
+ )
542
+ gpu_memory: conint(ge=1, le=200000) = Field(
543
+ ...,
544
+ description="Amount of GPU memory (in MB) to allocate. Please note, this limit is not being enforced today but will be in future. Applications are expected to operate in co-opertative mode",
545
+ )
546
+
547
+
548
+ class OCIRepo(BaseModel):
549
+ type: Literal["oci-repo"] = Field(..., description="")
550
+ oci_chart_url: constr(
551
+ regex=r"^(((oci):\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*))$"
552
+ ) = Field(..., description="")
553
+ integration_fqn: Optional[str] = Field(
554
+ None,
555
+ description="FQN of the container registry. If you can't find your registry here,\nadd it through the [Integrations](/integrations) page",
556
+ )
557
+ version: str = Field(..., description="Helm chart version")
558
+
559
+
560
+ class ParamType(str, Enum):
561
+ string = "string"
562
+ ml_repo = "ml_repo"
563
+
564
+
565
+ class Param(BaseModel):
566
+ name: constr(regex=r"^[a-z][a-z0-9\-_]{0,30}[a-z0-9]$") = Field(
567
+ ..., description="Name of the param"
568
+ )
569
+ description: Optional[constr(regex=r"^.{1,127}$")] = Field(
570
+ None, description="Description of param"
571
+ )
572
+ default: Optional[constr(regex=r"^.{0,127}$")] = Field(
573
+ None, description="Default value or placeholder"
574
+ )
575
+ param_type: ParamType = "string"
576
+
577
+
578
+ class Protocol(str, Enum):
579
+ """
580
+ Protocol for the port.
581
+ """
582
+
583
+ TCP = "TCP"
584
+ UDP = "UDP"
585
+
586
+
587
+ class AppProtocol(str, Enum):
588
+ """
589
+ Application Protocol for the port.
590
+ Select the application protocol used by your service. For most use cases, this should be `http`(HTTP/1.1).
591
+ If you are running a gRPC server, select the `grpc` option.
592
+ This is only applicable if `expose=true`.
593
+ """
594
+
595
+ http = "http"
596
+ grpc = "grpc"
597
+ tcp = "tcp"
598
+
599
+
600
+ class PythonBuild(BaseModel):
601
+ """
602
+ Describes that we are using python to build a container image with a specific python version and pip packages installed.
603
+ """
604
+
605
+ type: Literal["tfy-python-buildpack"] = Field(..., description="")
606
+ python_version: constr(regex=r"^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$") = Field(
607
+ "3.11",
608
+ description="Python version to run your application. Should be one of the tags listed on [Official Python Docker Page](https://hub.docker.com/_/python)",
609
+ )
610
+ build_context_path: str = Field(
611
+ "./", description="Build path relative to project root path."
612
+ )
613
+ requirements_path: Optional[str] = Field(
614
+ None,
615
+ description="Path to `requirements.txt` relative to\n`Path to build context`",
616
+ )
617
+ pip_packages: Optional[List[str]] = Field(
618
+ None,
619
+ description='Define pip package requirements.\nIn Python/YAML E.g. ["fastapi>=0.90,<1.0", "uvicorn"]',
620
+ )
621
+ apt_packages: Optional[List[str]] = Field(
622
+ None,
623
+ description='Debian packages to install via `apt get`.\nIn Python/YAML E.g. ["git", "ffmpeg", "htop"]',
624
+ )
625
+ command: Union[str, List[str]] = Field(
626
+ ...,
627
+ description="Command to run when the container starts.\nCommand will be set as the Entrypoint of the generated image.\nWhen deploying a Job, the command can be templatized by defining `params` and referencing them in command\nE.g. `python main.py --learning_rate {{learning_rate}}`",
628
+ )
629
+ cuda_version: Optional[
630
+ constr(
631
+ regex=r"^((\d+\.\d+(\.\d+)?-cudnn\d+-(runtime|devel)-ubuntu\d+\.\d+)|11\.0-cudnn8|11\.1-cudnn8|11\.2-cudnn8|11\.3-cudnn8|11\.4-cudnn8|11\.5-cudnn8|11\.6-cudnn8|11\.7-cudnn8|11\.8-cudnn8|12\.0-cudnn8|12\.1-cudnn8|12\.2-cudnn8)$"
632
+ )
633
+ ] = Field(
634
+ None,
635
+ description="Version of CUDA Toolkit and CUDNN to install in the image\nThese combinations are based off of publically available docker images on docker hub\nYou can also specify a valid tag of the form {cuda_version_number}-cudnn{cudnn_version_number}-{runtime|devel}-ubuntu{ubuntu_version}\nRefer https://hub.docker.com/r/nvidia/cuda/tags for valid set of values\nNote: We use deadsnakes ubuntu ppa to add Python that currently supports only Ubuntu 18.04, 20.04 and 22.04",
636
+ )
637
+
638
+
639
+ class RPSMetric(BaseModel):
640
+ type: Literal["rps"] = Field(..., description="")
641
+ value: PositiveFloat = Field(
642
+ ...,
643
+ description="Average request per second averaged over all replicas that autoscaler should try to maintain",
644
+ )
645
+
646
+
647
+ class RemoteSource(BaseModel):
648
+ """
649
+ Describes that we are using code stored in a remote respository to build our image
650
+ """
651
+
652
+ type: Literal["remote"] = Field(..., description="")
653
+ remote_uri: str = Field(..., description="Remote repository URI")
654
+
655
+
656
+ class Resources(BaseModel):
657
+ """
658
+ Configure resource allocations, specify node constraints and capacity types to improve performance and reduce expenses. [Docs](https://docs.truefoundry.com/docs/resources)
659
+ """
660
+
661
+ cpu_request: confloat(ge=0.001, le=256.0) = Field(
662
+ 0.2,
663
+ description="Requested CPU which determines the minimum cost incurred. The CPU usage can exceed the requested\namount, but not the value specified in the limit. 1 CPU means 1 CPU core. Fractional CPU can be requested\nlike `0.5` or `0.05`",
664
+ )
665
+ cpu_limit: confloat(ge=0.001, le=256.0) = Field(
666
+ 0.5,
667
+ description="CPU limit beyond which the usage cannot be exceeded. 1 CPU means 1 CPU core. Fractional CPU can be requested\nlike `0.5`. CPU limit should be >= cpu request.",
668
+ )
669
+ memory_request: conint(ge=1, le=2000000) = Field(
670
+ 200,
671
+ description="Requested memory which determines the minimum cost incurred. The unit of memory is in megabytes(MB).\nSo 1 means 1 MB and 2000 means 2GB.",
672
+ )
673
+ memory_limit: conint(ge=1, le=2000000) = Field(
674
+ 500,
675
+ description="Memory limit after which the application will be killed with an OOM error. The unit of memory is\nin megabytes(MB). So 1 means 1 MB and 2000 means 2GB. MemoryLimit should be greater than memory request.",
676
+ )
677
+ ephemeral_storage_request: conint(ge=1, le=2000000) = Field(
678
+ 1000,
679
+ description="Requested disk storage. The unit of memory is in megabytes(MB).\nThis is ephemeral storage and will be wiped out on pod restarts or eviction",
680
+ )
681
+ ephemeral_storage_limit: conint(ge=1, le=2000000) = Field(
682
+ 2000,
683
+ description="Disk storage limit. The unit of memory is in megabytes(MB). Exceeding this limit will result in eviction.\nIt should be greater than the request. This is ephemeral storage and will be wiped out on pod restarts or eviction",
684
+ )
685
+ gpu_count: Optional[conint(ge=0, le=16)] = Field(
686
+ None,
687
+ description="Count of GPUs to provide to the application\nNote the exact count and max count available for a given GPU type depends on cloud provider and cluster type.",
688
+ )
689
+ shared_memory_size: Optional[conint(ge=64, le=2000000)] = Field(
690
+ None,
691
+ description="Define the shared memory requirements for your workload. Machine learning libraries like Pytorch can use Shared Memory\nfor inter-process communication. If you use this, we will mount a `tmpfs` backed volume at the `/dev/shm` directory.\nAny usage will also count against the workload's memory limit (`resources.memory_limit`) along with your workload's memory usage.\nIf the overall usage goes above `resources.memory_limit` the user process may get killed.\nShared Memory Size cannot be more than the defined Memory Limit for the workload.",
692
+ )
693
+ node: Optional[Union[NodeSelector, NodepoolSelector]] = Field(
694
+ None,
695
+ description="This field determines how the underlying node resource is to be utilized",
696
+ )
697
+ devices: Optional[
698
+ List[
699
+ Union[NvidiaGPU, AWSInferentia, NvidiaMIGGPU, NvidiaTimeslicingGPU, GcpTPU]
700
+ ]
701
+ ] = Field(
702
+ None,
703
+ description="Define custom device or accelerator requirements for your workload. We currently support NVIDIA GPUs, AWS Inferentia Accelerators, Single Host TPU Slices.",
704
+ )
705
+
706
+
707
+ class Rolling(BaseModel):
708
+ """
709
+ This strategy updates the pods in a rolling fashion such that a subset of the
710
+ total pods are replaced with new version at one time.
711
+ A commonly used strategy can be to have maxUnavailablePercentage close to 0 so that there
712
+ is no downtime and keep the maxSurgePercentage to around 25%. If you are anyways running
713
+ a large number of pods, the service can often tolerate a few pods going down - so you
714
+ max maxUnavailablePercentage = 10 and maxSurgePercentage=0. You can read about it more
715
+ [here](https://spot.io/resources/kubernetes-autoscaling/5-kubernetes-deployment-strategies-roll-out-like-the-pros/)
716
+ """
717
+
718
+ type: Literal["rolling_update"] = Field(..., description="")
719
+ max_unavailable_percentage: conint(ge=0, le=100) = Field(
720
+ 25,
721
+ description="Percentage of total replicas that can be brought down at one time.\nFor a value of 25 when replicas are set to 12 this would mean minimum (25% of 12) = 3 pods might be unavailable during the deployment.\nSetting this to a higher value can help in speeding up the deployment process.",
722
+ )
723
+ max_surge_percentage: conint(ge=0, le=100) = Field(
724
+ 25,
725
+ description="Percentage of total replicas of updated image that can be brought up over the total replicas count.\nFor a value of 25 when replicas are set to 12 this would mean (12+(25% of 12) = 15) pods might be running at one time.\nSetting this to a higher value can help in speeding up the deployment process.",
726
+ )
727
+
728
+
729
+ class SQSInputConfig(BaseModel):
730
+ """
731
+ Describes the configuration for the input SQS worker
732
+ """
733
+
734
+ type: Literal["sqs"] = Field(..., description="")
735
+ queue_url: str = Field(..., description="AWS SQS Queue URL of Subscriber")
736
+ region_name: str = Field(..., description="AWS Region Name")
737
+ visibility_timeout: conint(ge=1, le=43200) = Field(
738
+ ...,
739
+ description="A period during which Amazon SQS prevents all consumers from receiving and processing the message. If one message takes 5 seconds to process, you can set this number to 7 or any number higher than 5. This will ensure that while the message is being processed, it will not be available to other replicas. For more information, see [here](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)",
740
+ )
741
+ wait_time_seconds: conint(ge=1, le=20) = Field(
742
+ 19,
743
+ description="Wait timeout for long polling. For more information, see [here](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html)",
744
+ )
745
+ auth: AWSAccessKeyAuth
746
+
747
+
748
+ class SQSOutputConfig(BaseModel):
749
+ """
750
+ Describes the configuration for the output SQS worker
751
+ """
752
+
753
+ type: Literal["sqs"] = Field(..., description="")
754
+ queue_url: str = Field(..., description="AWS SQS Queue URL of Publisher")
755
+ region_name: str = Field(..., description="AWS Region Name")
756
+ auth: AWSAccessKeyAuth
757
+
758
+
759
+ class SQSQueueMetricConfig(BaseModel):
760
+ type: Literal["sqs"] = Field(..., description="")
761
+ queue_length: conint(ge=1) = Field(
762
+ ...,
763
+ description="Upper limit of the number of backlog messages the auto-scaler will try to maintain per replica. If you set this number to 10 and have 30 messages in the queue and one replica, the auto-scaler will scale the number of replicas to 3.",
764
+ )
765
+
766
+
767
+ class ConcurrencyPolicy(str, Enum):
768
+ """
769
+ Choose whether to allow this job to run while another instance of the job is running, or to replace the currently running instance. Allow
770
+ will enable multiple instances of this job to run. Forbid will keep the current instance of the job running and stop a new instance from being run.
771
+ Replace will terminate any currently running instance of the job and start a new one.
772
+ """
773
+
774
+ Forbid = "Forbid"
775
+ Allow = "Allow"
776
+ Replace = "Replace"
777
+
778
+
779
+ class Schedule(BaseModel):
780
+ """
781
+ Run the job on a schedule. [Docs](https://docs.truefoundry.com/docs/deploy-a-cron-job)
782
+ """
783
+
784
+ type: Literal["scheduled"] = Field(..., description="")
785
+ schedule: str = Field(
786
+ ...,
787
+ description="Specify the schedule for this job to be run periodically in cron format.\n```\n* * * * *\n| | | | |\n| | | | |___ day of week (0-6) (Sunday is 0)\n| | | |_____ month (1-12)\n| | |_______ day of month (1-31)\n| |_________ hour (0-23)\n|___________ minute (0-59)\n```",
788
+ )
789
+ concurrency_policy: ConcurrencyPolicy = Field(
790
+ "Forbid",
791
+ description="Choose whether to allow this job to run while another instance of the job is running, or to replace the currently running instance. Allow\nwill enable multiple instances of this job to run. Forbid will keep the current instance of the job running and stop a new instance from being run.\nReplace will terminate any currently running instance of the job and start a new one.",
792
+ )
793
+ timezone: Optional[str] = Field(
794
+ None,
795
+ description='Timezone against which the cron schedule will be calculated, e.g. "Asia/Tokyo". Default is machine\'s local time.\nhttps://docs.truefoundry.com/docs/list-of-supported-timezones',
796
+ )
797
+
798
+
799
+ class SecretMount(BaseModel):
800
+ type: Literal["secret"] = Field(..., description="")
801
+ mount_path: constr(regex=r"^\/(?:[^/\n]+\/*)*[^/\n]+(\.[^/\n]+)?$") = Field(
802
+ ..., description="Absolute file path where the file will be created."
803
+ )
804
+ secret_fqn: constr(regex=r"^tfy-secret:\/\/.+:.+:.+$") = Field(
805
+ ..., description="The TrueFoundry secret whose value will be the file content."
806
+ )
807
+
808
+
809
+ class ServiceAutoscaling(BaseAutoscaling):
810
+ metrics: Union[CPUUtilizationMetric, RPSMetric, CronMetric] = Field(
811
+ ..., description="Metrics to use for the autoscaler"
812
+ )
813
+
814
+
815
+ class SparkDriverConfig(BaseModel):
816
+ ui_endpoint: Endpoint
817
+ resources: Optional[Resources] = None
818
+
819
+
820
+ class SparkExecutorDynamicScaling(BaseModel):
821
+ type: Literal["dynamic"] = Field(..., description="")
822
+ min: conint(ge=0, le=500) = Field(
823
+ 1, description="Minimum number of instances to start / scale down to"
824
+ )
825
+ max: conint(ge=0, le=500) = Field(
826
+ 1, description="Maximum number of instances to scale up to"
827
+ )
828
+
829
+
830
+ class SparkExecutorFixedInstances(BaseModel):
831
+ type: Literal["fixed"] = Field(..., description="")
832
+ count: conint(ge=0, le=500) = Field(1, description="Number of instances to start")
833
+
834
+
835
+ class StaticVolumeConfig(BaseModel):
836
+ type: Literal["static"] = Field(..., description="Volume Type for the volume.")
837
+ persistent_volume_name: str = Field(
838
+ ..., description="Persistent Volume Name of the volume to be used."
839
+ )
840
+
841
+
842
+ class StringDataMount(BaseModel):
843
+ type: Literal["string"] = Field(..., description="")
844
+ mount_path: constr(regex=r"^\/(?:[^/\n]+\/*)*[^/\n]+(\.[^/\n]+)?$") = Field(
845
+ ..., description="Absolute file path where the file will be created."
846
+ )
847
+ data: str = Field(..., description="The file content.")
848
+
849
+
850
+ class TaskDockerFileBuild(BaseModel):
851
+ """
852
+ Describes the configuration for the docker build for a task
853
+ """
854
+
855
+ type: Literal["task-dockerfile-build"] = Field(..., description="")
856
+ docker_registry: Optional[str] = Field(
857
+ None,
858
+ description="FQN of the container registry. If you can't find your registry here,\nadd it through the [Integrations](/integrations?tab=docker-registry) page",
859
+ )
860
+ dockerfile_path: str = Field(
861
+ "./Dockerfile",
862
+ description="The file path of the Dockerfile relative to project root path.",
863
+ )
864
+ build_args: Optional[Dict[str, str]] = Field(None, description="")
865
+
866
+
867
+ class TaskPythonBuild(BaseModel):
868
+ """
869
+ Describes the configuration for the python build for a task
870
+ """
871
+
872
+ type: Literal["task-python-build"] = Field(..., description="")
873
+ docker_registry: Optional[str] = Field(
874
+ None,
875
+ description="FQN of the container registry. If you can't find your registry here,\nadd it through the [Integrations](/integrations?tab=docker-registry) page",
876
+ )
877
+ python_version: constr(regex=r"^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$") = Field(
878
+ "3.11",
879
+ description="Python version to run your application. Should be one of the tags listed on [Official Python Docker Page](https://hub.docker.com/_/python)",
880
+ )
881
+ requirements_path: Optional[str] = Field(
882
+ None,
883
+ description="Path to `requirements.txt` relative to\n`Path to build context`",
884
+ )
885
+ pip_packages: Optional[List[str]] = Field(
886
+ None,
887
+ description='Define pip package requirements.\nIn Python/YAML E.g. ["fastapi>=0.90,<1.0", "uvicorn"]',
888
+ )
889
+ apt_packages: Optional[List[str]] = Field(
890
+ None,
891
+ description='Debian packages to install via `apt get`.\nIn Python/YAML E.g. ["git", "ffmpeg", "htop"]',
892
+ )
893
+ cuda_version: Optional[
894
+ constr(
895
+ regex=r"^((\d+\.\d+(\.\d+)?-cudnn\d+-(runtime|devel)-ubuntu\d+\.\d+)|11\.0-cudnn8|11\.1-cudnn8|11\.2-cudnn8|11\.3-cudnn8|11\.4-cudnn8|11\.5-cudnn8|11\.6-cudnn8|11\.7-cudnn8|11\.8-cudnn8|12\.0-cudnn8|12\.1-cudnn8|12\.2-cudnn8)$"
896
+ )
897
+ ] = Field(
898
+ None,
899
+ description="Version of CUDA Toolkit and CUDNN to install in the image\nThese combinations are based off of publically available docker images on docker hub\nYou can also specify a valid tag of the form {cuda_version_number}-cudnn{cudnn_version_number}-{runtime|devel}-ubuntu{ubuntu_version}\nRefer https://hub.docker.com/r/nvidia/cuda/tags for valid set of values\nNote: We use deadsnakes ubuntu ppa to add Python that currently supports only Ubuntu 18.04, 20.04 and 22.04",
900
+ )
901
+
902
+
903
+ class TrueFoundryArtifactSource(BaseModel):
904
+ """
905
+ Input for Artifact from TrueFoundry Artifact Registry
906
+ """
907
+
908
+ type: Literal["truefoundry-artifact"] = Field(..., description="")
909
+ artifact_version_fqn: str = Field(
910
+ ...,
911
+ description="Artifact or Model Version FQN of the artifact to be downloaded",
912
+ )
913
+ download_path_env_variable: str = Field(
914
+ ...,
915
+ description="Environment variable which will contain the download path of the artifact",
916
+ )
917
+
918
+
919
+ class TrueFoundryInteractiveLogin(BaseModel):
920
+ type: Literal["truefoundry_oauth"] = Field(..., description="")
921
+
922
+
923
+ class VolumeBrowser(BaseModel):
924
+ username: constr(regex=r"^[a-z][a-z0-9]{1,8}[a-z0-9]$") = Field(
925
+ ..., description="Username for logging in the volume browser."
926
+ )
927
+ password_secret_fqn: constr(regex=r"^tfy-secret:\/\/.+:.+:.+$") = Field(
928
+ ...,
929
+ description="TFY Secret containing the password for logging in the volume browser.",
930
+ )
931
+ endpoint: Endpoint
932
+ service_account: Optional[str] = Field(
933
+ None, description="Kubernetes Service account name for the volume browser."
934
+ )
935
+
936
+
937
+ class VolumeMount(BaseModel):
938
+ type: Literal["volume"] = Field(..., description="")
939
+ mount_path: constr(regex=r"^\/(?:[^/\n]+\/*)*[^/\n]+(\.[^/\n]+)?$") = Field(
940
+ ..., description="Absolute file path where the volume will be mounted."
941
+ )
942
+ sub_path: Optional[constr(regex=r"^(?:[^/\n]+/*)*[^/\n]+(\.[^/\n]+)?$")] = Field(
943
+ None,
944
+ description="Sub path within the volume to mount. Defaults to root of the volume.",
945
+ )
946
+ volume_fqn: constr(regex=r"^tfy-volume:\/\/.+:.+:.+$") = Field(
947
+ ..., description="The TrueFoundry volume that needs to be mounted."
948
+ )
949
+
950
+
951
+ class WorkbenchImage(BaseModel):
952
+ """
953
+ Workbench Image with persistent environment (Python 3.11.6)
954
+ """
955
+
956
+ image_uri: str = Field(
957
+ ...,
958
+ description="The image URI. Specify the name of the image and the tag.\nIf the image is in Dockerhub, you can skip registry-url (for e.g. `tensorflow/tensorflow`).\nYou can use an image from a private registry using Advanced fields",
959
+ )
960
+ build_script: Optional[constr(min_length=1, max_length=1024)] = Field(
961
+ None,
962
+ description="The build script to run when building the image.\nThis will be executed as the last step in the docker build process as the root user (RUN DEBIAN_FRONTEND=noninteractive bash -ex build_script.sh)",
963
+ )
964
+ docker_registry: Optional[str] = Field(
965
+ None,
966
+ description="FQN of the container registry. If you can't find your registry here,\nadd it through the [Integrations](/integrations?tab=docker-registry) page",
967
+ )
968
+
969
+
970
+ class ArtifactsDownload(BaseModel):
971
+ """
972
+ Download and cache models in a volume to enhance loading speeds and reduce costs by avoiding repeated downloads. [Docs](https://docs.truefoundry.com/docs/download-and-cache-models)
973
+ """
974
+
975
+ cache_volume: Optional[ArtifactsCacheVolume] = None
976
+ artifacts: List[Union[TrueFoundryArtifactSource, HuggingfaceArtifactSource]] = (
977
+ Field(..., description="List of artifacts to be cached")
978
+ )
979
+
980
+
981
+ class AsyncServiceAutoscaling(BaseAutoscaling):
982
+ metrics: Union[
983
+ SQSQueueMetricConfig,
984
+ NATSMetricConfig,
985
+ KafkaMetricConfig,
986
+ CronMetric,
987
+ AMQPMetricConfig,
988
+ ] = Field(..., description="Metrics to use for the autoscaler")
989
+
990
+
991
+ class BaseWorkbenchInput(BaseModel):
992
+ """
993
+ Describes the configuration for the service
994
+ """
995
+
996
+ name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
997
+ ...,
998
+ description="Name of the workbench. This uniquely identifies this workbench in the workspace.\n> Name can only contain alphanumeric characters and '-' and can be atmost 25 characters long",
999
+ )
1000
+ home_directory_size: conint(ge=5, le=64000) = Field(
1001
+ 20,
1002
+ description="Size of the home directory for the workbench (Persistent Storage)",
1003
+ )
1004
+ resources: Optional[Resources] = None
1005
+ env: Optional[Dict[str, str]] = Field(
1006
+ None,
1007
+ description="Configure environment variables to be injected in the service either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/environment-variables-and-secrets-jobs)",
1008
+ )
1009
+ mounts: Optional[List[Union[SecretMount, StringDataMount, VolumeMount]]] = Field(
1010
+ None,
1011
+ description="Configure data to be mounted to workbench pod(s) as a string, secret or volume. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-job)",
1012
+ )
1013
+ service_account: Optional[str] = Field(None, description="")
1014
+ kustomize: Optional[Kustomize] = None
1015
+ workspace_fqn: Optional[str] = Field(
1016
+ None, description="Fully qualified name of the workspace"
1017
+ )
1018
+
1019
+
1020
+ class Build(BaseModel):
1021
+ """
1022
+ Describes how we build our code into a Docker image.
1023
+ """
1024
+
1025
+ type: Literal["build"] = Field(..., description="")
1026
+ docker_registry: Optional[str] = Field(
1027
+ None,
1028
+ description="FQN of the container registry. If you can't find your registry here,\nadd it through the [Integrations](/integrations?tab=docker-registry) page",
1029
+ )
1030
+ build_source: Union[RemoteSource, GitSource, LocalSource] = Field(
1031
+ ..., description="Source code location."
1032
+ )
1033
+ build_spec: Union[DockerFileBuild, PythonBuild] = Field(
1034
+ ...,
1035
+ description="Instructions to build a container image out of the build source",
1036
+ )
1037
+
1038
+
1039
+ class Canary(BaseModel):
1040
+ """
1041
+ This strategy brings up the new release without bringing the older release down. Traffic is shifted from the older release to the newer release in a staged manner.
1042
+ This can help with verifying the health of the new release without shifting complete traffic.
1043
+ """
1044
+
1045
+ type: Literal["canary"] = Field(..., description="")
1046
+ steps: List[CanaryStep] = Field(
1047
+ ...,
1048
+ description="These steps would be executed in order to enable shifting of traffic slowly from stable to canary version",
1049
+ )
1050
+
1051
+
1052
+ class Codeserver(BaseWorkbenchInput):
1053
+ """
1054
+ Describes the configuration for the code server
1055
+ """
1056
+
1057
+ type: Literal["codeserver"] = Field(..., description="")
1058
+ image: WorkbenchImage
1059
+
1060
+
1061
+ class ContainerTaskConfig(BaseModel):
1062
+ type: Literal["container-task-config"] = Field(..., description="")
1063
+ image: Union[Build, Image] = Field(
1064
+ ...,
1065
+ description="Specify whether you want to deploy a Docker image or build and deploy from source code",
1066
+ )
1067
+ env: Optional[Dict[str, str]] = Field(
1068
+ None,
1069
+ description="Configure environment variables to be injected in the task either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1070
+ )
1071
+ resources: Optional[Resources] = None
1072
+ mounts: Optional[List[Union[SecretMount, StringDataMount, VolumeMount]]] = Field(
1073
+ None, description="Configure data to be mounted to Workflow pod(s) as a volume."
1074
+ )
1075
+ service_account: Optional[str] = Field(None, description="")
1076
+
1077
+
1078
+ class CoreNATSOutputConfig(BaseModel):
1079
+ """
1080
+ Describes the configuration for the output Core NATS worker
1081
+ """
1082
+
1083
+ type: Literal["core-nats"] = Field(..., description="")
1084
+ nats_url: str = Field(..., description="Output NATS URL")
1085
+ root_subject: constr(regex=r"^[a-zA-Z0-9][a-zA-Z0-9\-.]+[a-zA-Z0-9]$") = Field(
1086
+ ..., description="Root subject of output NATS"
1087
+ )
1088
+ auth: Optional[NATSUserPasswordAuth] = None
1089
+
1090
+
1091
+ class FlyteLaunchPlanSpec(BaseModel):
1092
+ workflowId: FlyteWorkflowID
1093
+
1094
+
1095
+ class FlyteWorkflow(BaseModel):
1096
+ template: FlyteWorkflowTemplate
1097
+ description: Optional[Any] = None
1098
+
1099
+
1100
+ class HealthProbe(BaseModel):
1101
+ """
1102
+ Describes the configuration for the Health Probe's
1103
+ To learn more you can go [here](https://docs.truefoundry.com/docs/liveness-readiness-probe)
1104
+ """
1105
+
1106
+ config: HttpProbe
1107
+ initial_delay_seconds: conint(ge=0, le=36000) = Field(
1108
+ 0,
1109
+ description="Time to wait after container has started before checking the endpoint",
1110
+ )
1111
+ period_seconds: conint(ge=1, le=36000) = Field(
1112
+ 10, description="How often to check the endpoint"
1113
+ )
1114
+ timeout_seconds: conint(ge=1, le=36000) = Field(
1115
+ 1,
1116
+ description="Time to wait for a response from the endpoint before considering it down",
1117
+ )
1118
+ success_threshold: conint(ge=1, le=100) = Field(
1119
+ 1,
1120
+ description="Number of successful responses from the endpoint before container is considered healthy",
1121
+ )
1122
+ failure_threshold: conint(ge=1, le=100) = Field(
1123
+ 3,
1124
+ description="Number of consecutive failures before the container is considered down",
1125
+ )
1126
+
1127
+
1128
+ class Helm(BaseModel):
1129
+ type: Literal["helm"] = Field(..., description="")
1130
+ name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
1131
+ ...,
1132
+ description="Name of the Helm deployment. This will be set as the release name of the chart you are deploying.",
1133
+ )
1134
+ labels: Optional[Dict[str, str]] = Field(
1135
+ None, description="Add labels to base argo app"
1136
+ )
1137
+ source: Union[HelmRepo, OCIRepo, GitHelmRepo] = Field(..., description="")
1138
+ values: Optional[Dict[str, Any]] = Field(
1139
+ None, description="Values file as block file"
1140
+ )
1141
+ kustomize: Optional[Kustomize] = None
1142
+ ignoreDifferences: Optional[List[Dict[str, Any]]] = None
1143
+ workspace_fqn: Optional[str] = Field(
1144
+ None, description="Fully qualified name of the workspace"
1145
+ )
1146
+
1147
+
1148
+ class Job(BaseModel):
1149
+ """
1150
+ Describes the configuration for the job
1151
+ """
1152
+
1153
+ type: Literal["job"] = Field(..., description="")
1154
+ name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
1155
+ ..., description="Name of the job"
1156
+ )
1157
+ image: Union[Build, Image] = Field(
1158
+ ...,
1159
+ description="Specify whether you want to deploy a Docker image or build and deploy from source code",
1160
+ )
1161
+ trigger: Union[Manual, Schedule] = Field(
1162
+ {"type": "manual"}, description="Specify the trigger"
1163
+ )
1164
+ trigger_on_deploy: bool = Field(
1165
+ False, description="Trigger the job after deploy immediately"
1166
+ )
1167
+ params: Optional[List[Param]] = Field(
1168
+ None, description="Configure params and pass it to create different job runs"
1169
+ )
1170
+ env: Optional[Dict[str, str]] = Field(
1171
+ None,
1172
+ description="Configure environment variables to be injected in the service either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1173
+ )
1174
+ resources: Optional[Resources] = None
1175
+ alerts: Optional[List[JobAlert]] = Field(
1176
+ None,
1177
+ description="Configure alerts to be sent when the job starts/fails/completes",
1178
+ )
1179
+ retries: conint(ge=0, le=10) = Field(
1180
+ 0,
1181
+ description="Specify the maximum number of attempts to retry a job before it is marked as failed.",
1182
+ )
1183
+ timeout: Optional[conint(le=432000, gt=0)] = Field(
1184
+ None, description="Job timeout in seconds."
1185
+ )
1186
+ concurrency_limit: Optional[PositiveInt] = Field(
1187
+ None, description="Number of runs that can run concurrently"
1188
+ )
1189
+ service_account: Optional[str] = Field(None, description="")
1190
+ mounts: Optional[List[Union[SecretMount, StringDataMount, VolumeMount]]] = Field(
1191
+ None,
1192
+ description="Configure data to be mounted to job pod(s) as a string, secret or volume. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-job)",
1193
+ )
1194
+ labels: Optional[Dict[str, str]] = Field(None, description="")
1195
+ kustomize: Optional[Kustomize] = None
1196
+ workspace_fqn: Optional[str] = Field(
1197
+ None, description="Fully qualified name of the workspace"
1198
+ )
1199
+
1200
+
1201
+ class KafkaInputConfig(BaseModel):
1202
+ """
1203
+ Describes the configuration for the input Kafka worker
1204
+ """
1205
+
1206
+ type: Literal["kafka"] = Field(..., description="")
1207
+ bootstrap_servers: str = Field(
1208
+ ...,
1209
+ description="'Kafka Bootstrap servers - Comma separated list of Kafka brokers \"hostname:port\" to connect to for bootstrap'",
1210
+ )
1211
+ topic_name: str = Field(..., description="Kafka topic to subscribe to")
1212
+ consumer_group: str = Field(
1213
+ ...,
1214
+ description="The name of the consumer group to join for dynamic partition assignment",
1215
+ )
1216
+ tls: bool = Field(True, description="TLS configuration for SASL authentication")
1217
+ wait_time_seconds: conint(ge=1, le=300) = Field(
1218
+ 10, description="Wait timeout for long polling."
1219
+ )
1220
+ auth: Optional[KafkaSASLAuth] = None
1221
+
1222
+
1223
+ class KafkaOutputConfig(BaseModel):
1224
+ """
1225
+ Describes the configuration for the output Kafka worker
1226
+ """
1227
+
1228
+ type: Literal["kafka"] = Field(..., description="")
1229
+ bootstrap_servers: str = Field(
1230
+ ...,
1231
+ description="'Kafka Bootstrap servers - Comma separated list of Kafka brokers \"hostname:port\" to connect to for bootstrap'",
1232
+ )
1233
+ topic_name: str = Field(..., description="Kafka topic to publish to")
1234
+ tls: bool = Field(True, description="TLS configuration for SASL authentication")
1235
+ auth: Optional[KafkaSASLAuth] = None
1236
+
1237
+
1238
+ class NATSInputConfig(BaseModel):
1239
+ """
1240
+ Describes the configuration for the input NATS worker
1241
+ """
1242
+
1243
+ type: Literal["nats"] = Field(..., description="")
1244
+ nats_url: str = Field(..., description="Input NATS URL")
1245
+ stream_name: str = Field(..., description="Name of the NATS stream")
1246
+ root_subject: constr(regex=r"^[a-zA-Z0-9][a-zA-Z0-9\-.]+[a-zA-Z0-9]$") = Field(
1247
+ ..., description="Root subject of input NATS"
1248
+ )
1249
+ consumer_name: constr(regex=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]+[a-zA-Z0-9]$") = Field(
1250
+ ..., description="Consumer name of input NATS"
1251
+ )
1252
+ wait_time_seconds: conint(ge=1, le=20) = Field(
1253
+ 19, description="Wait timeout for long polling."
1254
+ )
1255
+ nats_metrics_url: Optional[constr(regex=r"^(http(s?)://).*$")] = Field(
1256
+ None,
1257
+ description="URL for the NATS metrics endpoint. It is compulsory if you want to use NATS autoscaling.",
1258
+ )
1259
+ auth: Optional[NATSUserPasswordAuth] = None
1260
+
1261
+
1262
+ class NATSOutputConfig(BaseModel):
1263
+ """
1264
+ Describes the configuration for the output NATS worker
1265
+ """
1266
+
1267
+ type: Literal["nats"] = Field(..., description="")
1268
+ nats_url: str = Field(..., description="Output NATS URL")
1269
+ root_subject: constr(regex=r"^[a-zA-Z0-9][a-zA-Z0-9\-.]+[a-zA-Z0-9]$") = Field(
1270
+ ..., description="Root subject of output NATS"
1271
+ )
1272
+ auth: Optional[NATSUserPasswordAuth] = None
1273
+
1274
+
1275
+ class Notebook(BaseWorkbenchInput):
1276
+ """
1277
+ Describes the configuration for the service
1278
+ """
1279
+
1280
+ type: Literal["notebook"] = Field(..., description="")
1281
+ image: WorkbenchImage
1282
+ cull_timeout: conint(ge=5) = Field(
1283
+ 30,
1284
+ description="Stop the notebook instance after this much time in minutes of inactivity.\nThe notebook instance will be stopped even if the notebook is open in your browser, but nothing is running on the notebook.",
1285
+ )
1286
+
1287
+
1288
+ class Port(BaseModel):
1289
+ """
1290
+ Describes the ports the service should be exposed to.
1291
+ """
1292
+
1293
+ port: conint(ge=1, le=65535) = Field(80, description="Port number to expose.")
1294
+ protocol: Protocol = Field("TCP", description="Protocol for the port.")
1295
+ expose: bool = Field(True, description="Expose the port")
1296
+ app_protocol: AppProtocol = Field(
1297
+ "http",
1298
+ description="Application Protocol for the port.\nSelect the application protocol used by your service. For most use cases, this should be `http`(HTTP/1.1).\nIf you are running a gRPC server, select the `grpc` option.\nThis is only applicable if `expose=true`.",
1299
+ )
1300
+ host: Optional[
1301
+ constr(
1302
+ regex=r"^((([a-zA-Z0-9\-]{1,63}\.)([a-zA-Z0-9\-]{1,63}\.)*([A-Za-z]{1,63}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))$"
1303
+ )
1304
+ ] = Field(None, description="Host e.g. ai.example.com, app.truefoundry.com")
1305
+ path: Optional[
1306
+ constr(regex=r"^(/([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9]))*/$")
1307
+ ] = Field(None, description="Path e.g. /v1/api/ml/, /v2/docs/")
1308
+ rewrite_path_to: Optional[
1309
+ constr(regex=r"^(/([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9]))*/$")
1310
+ ] = Field(
1311
+ None,
1312
+ description="Rewrite the path prefix to a different path.\nIf `path` is `/v1/api` and `rewrite_path_to` is `/api`. The URI in the HTTP request `http://0.0.0.0:8080/v1/api/houses` will be rewritten to `http://0.0.0.0:8080/api/houses` before the request is forwarded your service.\nDefaults to `/`.\nThis is only applicable if `path` is given.",
1313
+ )
1314
+ auth: Optional[
1315
+ Union[BasicAuthCreds, JwtAuthConfig, TrueFoundryInteractiveLogin]
1316
+ ] = Field(None, description="Authentication method for inbound traffic")
1317
+
1318
+
1319
+ class PythonTaskConfig(BaseModel):
1320
+ """
1321
+ Describes the configuration for the python function task
1322
+ """
1323
+
1324
+ type: Literal["python-task-config"] = Field(..., description="")
1325
+ image: Union[TaskPythonBuild, TaskDockerFileBuild] = Field(
1326
+ ..., description="Specify the image spec for the task"
1327
+ )
1328
+ env: Optional[Dict[str, str]] = Field(
1329
+ None,
1330
+ description="Configure environment variables to be injected in the task either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1331
+ )
1332
+ resources: Optional[Resources] = None
1333
+ mounts: Optional[List[Union[SecretMount, StringDataMount, VolumeMount]]] = Field(
1334
+ None, description="Configure data to be mounted to Workflow pod(s) as a volume."
1335
+ )
1336
+ service_account: Optional[str] = Field(None, description="")
1337
+
1338
+
1339
+ class RStudio(BaseWorkbenchInput):
1340
+ """
1341
+ Describes the configuration for the Rstudio server
1342
+ """
1343
+
1344
+ type: Literal["rstudio"] = Field(..., description="")
1345
+ image: WorkbenchImage
1346
+
1347
+
1348
+ class SSHServer(BaseWorkbenchInput):
1349
+ """
1350
+ Describes the configuration for the ssh server
1351
+ """
1352
+
1353
+ type: Literal["ssh-server"] = Field(..., description="")
1354
+ image: WorkbenchImage
1355
+ ssh_public_key: str = Field(
1356
+ ...,
1357
+ description="Add Your SSH Public Key, this will be used to authenticate you to the SSH Server. \\\nYou can find it using `cat ~/.ssh/id_rsa.pub` in Mac/Linux or `type $home\\.ssh\\id_rsa.pub` in Windows Powershell. \\\nYou can also generate a new SSH key pair using `ssh-keygen -t rsa` in your local terminal. (same for both Mac/Linux and Windows Powershell)",
1358
+ )
1359
+ cull_timeout: Optional[conint(ge=5)] = Field(
1360
+ None,
1361
+ description="Stop the SSH Server instance after this much time in minutes of inactivity. The instance is considered active if there is at least one active SSH connection (a client connected to the SSH server), or if a background job is running using tmux or screen, or if the pod has restarted.",
1362
+ )
1363
+
1364
+
1365
+ class SparkExecutorConfig(BaseModel):
1366
+ instances: Union[SparkExecutorFixedInstances, SparkExecutorDynamicScaling] = Field(
1367
+ {"type": "fixed", "count": 1}, description=""
1368
+ )
1369
+ resources: Optional[Resources] = None
1370
+
1371
+
1372
+ class SparkJob(BaseModel):
1373
+ type: Literal["spark-job"] = Field(..., description="")
1374
+ name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
1375
+ ..., description="Name of the job"
1376
+ )
1377
+ image: Image
1378
+ spark_version: str = Field(
1379
+ "3.5.2",
1380
+ description="Spark version should match the spark version installed in the image.",
1381
+ )
1382
+ main_application_file: str = Field(
1383
+ ..., description="The main application file to be executed by the spark job."
1384
+ )
1385
+ arguments: Optional[str] = Field(
1386
+ None, description="Arguments to be passed to the main application file."
1387
+ )
1388
+ driver_config: SparkDriverConfig
1389
+ executor_config: SparkExecutorConfig
1390
+ env: Optional[Dict[str, Any]] = Field(
1391
+ None,
1392
+ description="Configure environment variables to be injected in the service either as plain text. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1393
+ )
1394
+ conf: Optional[Dict[str, Any]] = Field(
1395
+ None,
1396
+ description="Extra configuration properties to be passed to the spark job. [Docs](https://spark.apache.org/docs/latest/configuration.html)",
1397
+ )
1398
+ mounts: Optional[List[VolumeMount]] = Field(
1399
+ None,
1400
+ description="Configure volumes to be mounted to driver and executors. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-job)",
1401
+ )
1402
+ retries: conint(ge=0, le=10) = Field(
1403
+ 0,
1404
+ description="Specify the maximum number of attempts to retry a job before it is marked as failed.",
1405
+ )
1406
+ service_account: Optional[str] = Field(None, description="")
1407
+ workspace_fqn: Optional[str] = Field(
1408
+ None, description="Fully qualified name of the workspace"
1409
+ )
1410
+
1411
+
1412
+ class Volume(BaseModel):
1413
+ type: Literal["volume"] = Field(..., description="")
1414
+ name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
1415
+ ..., description="Name of the Volume. This will be set as the volume name."
1416
+ )
1417
+ config: Union[DynamicVolumeConfig, StaticVolumeConfig] = Field(..., description="")
1418
+ volume_browser: Optional[VolumeBrowser] = None
1419
+ workspace_fqn: Optional[str] = Field(
1420
+ None, description="Fully qualified name of the workspace"
1421
+ )
1422
+
1423
+
1424
+ class WorkerConfig(BaseModel):
1425
+ input_config: Union[
1426
+ SQSInputConfig, NATSInputConfig, KafkaInputConfig, AMQPInputConfig
1427
+ ] = Field(..., description="Input Config")
1428
+ output_config: Optional[
1429
+ Union[
1430
+ SQSOutputConfig,
1431
+ NATSOutputConfig,
1432
+ CoreNATSOutputConfig,
1433
+ KafkaOutputConfig,
1434
+ AMQPOutputConfig,
1435
+ ]
1436
+ ] = Field(None, description="Output Config")
1437
+ num_concurrent_workers: conint(ge=1, le=10) = Field(
1438
+ 1, description="Number of concurrent workers to spawn for the processor"
1439
+ )
1440
+
1441
+
1442
+ class BaseService(BaseModel):
1443
+ name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
1444
+ ...,
1445
+ description="Name of the service. This uniquely identifies this service in the workspace.\n> Name can only contain alphanumeric characters and '-' and can be atmost 25 characters long",
1446
+ )
1447
+ image: Union[Build, Image] = Field(
1448
+ ...,
1449
+ description="Specify whether you want to deploy a Docker image or build and deploy from source code",
1450
+ )
1451
+ artifacts_download: Optional[ArtifactsDownload] = None
1452
+ resources: Optional[Resources] = None
1453
+ env: Optional[Dict[str, str]] = Field(
1454
+ None,
1455
+ description="Configure environment variables to be injected in the service either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1456
+ )
1457
+ ports: List[Port] = Field(
1458
+ ...,
1459
+ description="Expose the deployment to make it accessible over the internet or keep it private. Implement authentication to restrict access. [Docs](https://docs.truefoundry.com/docs/define-ports-and-domains)",
1460
+ )
1461
+ service_account: Optional[str] = None
1462
+ mounts: Optional[List[Union[SecretMount, StringDataMount, VolumeMount]]] = Field(
1463
+ None,
1464
+ description="Configure data to be mounted to service pod(s) as a string, secret or volume. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-service)",
1465
+ )
1466
+ labels: Optional[Dict[str, str]] = Field(None, description="")
1467
+ kustomize: Optional[Kustomize] = None
1468
+ liveness_probe: Optional[HealthProbe] = None
1469
+ readiness_probe: Optional[HealthProbe] = None
1470
+ workspace_fqn: Optional[str] = Field(
1471
+ None, description="Fully qualified name of the workspace"
1472
+ )
1473
+
1474
+
1475
+ class FlyteLaunchPlan(BaseModel):
1476
+ id: FlyteLaunchPlanID
1477
+ spec: FlyteLaunchPlanSpec
1478
+ closure: Any
1479
+
1480
+
1481
+ class FlyteTaskCustom(BaseModel):
1482
+ truefoundry: Union[PythonTaskConfig, ContainerTaskConfig]
1483
+
1484
+
1485
+ class FlyteTaskTemplate(BaseModel):
1486
+ id: FlyteTaskID
1487
+ custom: FlyteTaskCustom
1488
+
1489
+
1490
+ class Service(BaseService):
1491
+ """
1492
+ Describes the configuration for the service
1493
+ """
1494
+
1495
+ type: Literal["service"] = Field(..., description="")
1496
+ replicas: Union[confloat(ge=0.0, le=500.0), ServiceAutoscaling] = Field(
1497
+ 1,
1498
+ description="Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing.",
1499
+ )
1500
+ auto_shutdown: Optional[Autoshutdown] = None
1501
+ allow_interception: bool = Field(
1502
+ False,
1503
+ description="Whether to allow intercepts to be applied for this service.\nThis would inject an additional sidecar in each pod of the service. Not recommended on production",
1504
+ )
1505
+ rollout_strategy: Optional[Union[Rolling, Canary, BlueGreen]] = Field(
1506
+ None,
1507
+ description="Strategy to dictate how a rollout should happen when a new release for this service is made [Docs](https://docs.truefoundry.com/docs/rollout-strategy)",
1508
+ )
1509
+
1510
+
1511
+ class AsyncService(BaseService):
1512
+ """
1513
+ Describes the configuration for the async-service
1514
+ """
1515
+
1516
+ type: Literal["async-service"] = Field(..., description="")
1517
+ replicas: Union[confloat(ge=0.0, le=500.0), AsyncServiceAutoscaling] = Field(
1518
+ 1,
1519
+ description="Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing.",
1520
+ )
1521
+ rollout_strategy: Optional[Rolling] = None
1522
+ worker_config: WorkerConfig
1523
+ sidecar: Optional[AsyncProcessorSidecar] = None
1524
+
1525
+
1526
+ class FlyteTask(BaseModel):
1527
+ template: FlyteTaskTemplate
1528
+ description: Optional[Any] = None
1529
+
1530
+
1531
+ class Workflow(BaseModel):
1532
+ """
1533
+ Describes the configuration for the worflow
1534
+ """
1535
+
1536
+ type: Literal["workflow"] = Field(..., description="")
1537
+ name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
1538
+ ..., description="Name of the workflow"
1539
+ )
1540
+ source: Union[LocalSource, RemoteSource] = Field(
1541
+ ..., description="Source Code for the workflow, either local or remote"
1542
+ )
1543
+ workflow_file_path: str = Field(
1544
+ ..., description="Path to the workflow file relative to the project root path"
1545
+ )
1546
+ flyte_entities: Optional[List[Union[FlyteTask, FlyteWorkflow, FlyteLaunchPlan]]] = (
1547
+ Field(None, description="")
1548
+ )
1549
+
1550
+
1551
+ class ApplicationSet(BaseModel):
1552
+ """
1553
+ Describes the configuration for the application set
1554
+ """
1555
+
1556
+ type: Literal["application-set"] = Field(..., description="")
1557
+ name: str = Field(..., description="Name of the application set.")
1558
+ components: Optional[List[Union[Service, AsyncService, Job, Helm]]] = Field(
1559
+ None, description="Array of components with their specifications."
1560
+ )
1561
+ template: Optional[str] = Field(
1562
+ None, description="Template to be used for the application set."
1563
+ )
1564
+ values: Optional[Dict[str, Any]] = Field(
1565
+ None,
1566
+ description="Values to be used to render components for the application set.",
1567
+ )
1568
+ workspace_fqn: Optional[str] = Field(
1569
+ None, description="Fully qualified name of the workspace"
1570
+ )
1571
+ convert_template_manifest: Optional[bool] = Field(
1572
+ None,
1573
+ description="Flag to indicate if the template manifest should be converted to TrueFoundry manifest",
1574
+ )
1575
+
1576
+
1577
+ class Application(BaseModel):
1578
+ __root__: Union[
1579
+ Service,
1580
+ AsyncService,
1581
+ Job,
1582
+ Notebook,
1583
+ Codeserver,
1584
+ SSHServer,
1585
+ RStudio,
1586
+ Helm,
1587
+ Volume,
1588
+ ApplicationSet,
1589
+ Workflow,
1590
+ SparkJob,
1591
+ ]