polyaxon 2.1.0rc9__py3-none-any.whl → 2.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. polyaxon/_auxiliaries/default_scheduling.py +17 -7
  2. polyaxon/_auxiliaries/init.py +14 -6
  3. polyaxon/_auxiliaries/sidecar.py +10 -8
  4. polyaxon/_cli/artifacts.py +96 -11
  5. polyaxon/_cli/components.py +96 -11
  6. polyaxon/_cli/config.py +31 -0
  7. polyaxon/_cli/dashboard.py +12 -2
  8. polyaxon/_cli/init.py +1 -1
  9. polyaxon/_cli/models.py +96 -11
  10. polyaxon/_cli/operations.py +133 -58
  11. polyaxon/_cli/project_versions.py +139 -6
  12. polyaxon/_cli/projects.py +23 -9
  13. polyaxon/_cli/run.py +43 -9
  14. polyaxon/_cli/services/agent.py +2 -2
  15. polyaxon/_cli/version.py +4 -1
  16. polyaxon/_client/mixin.py +39 -0
  17. polyaxon/_client/project.py +218 -23
  18. polyaxon/_client/run.py +84 -27
  19. polyaxon/_compiler/contexts/contexts.py +4 -0
  20. polyaxon/_compiler/contexts/ray_job.py +4 -2
  21. polyaxon/_compiler/resolver/agent.py +22 -10
  22. polyaxon/_compiler/resolver/runtime.py +7 -3
  23. polyaxon/_constants/metadata.py +1 -0
  24. polyaxon/_contexts/keys.py +1 -0
  25. polyaxon/_contexts/paths.py +1 -1
  26. polyaxon/_deploy/operators/compose.py +1 -27
  27. polyaxon/_deploy/schemas/auth.py +3 -3
  28. polyaxon/_deploy/schemas/celery.py +10 -8
  29. polyaxon/_deploy/schemas/deployment.py +148 -115
  30. polyaxon/_deploy/schemas/email.py +8 -8
  31. polyaxon/_deploy/schemas/ingress.py +7 -7
  32. polyaxon/_deploy/schemas/intervals.py +2 -7
  33. polyaxon/_deploy/schemas/operators.py +8 -8
  34. polyaxon/_deploy/schemas/proxy.py +9 -8
  35. polyaxon/_deploy/schemas/rbac.py +1 -1
  36. polyaxon/_deploy/schemas/root_user.py +5 -5
  37. polyaxon/_deploy/schemas/security_context.py +25 -15
  38. polyaxon/_deploy/schemas/service.py +75 -66
  39. polyaxon/_deploy/schemas/ssl.py +3 -3
  40. polyaxon/_deploy/schemas/ui.py +10 -6
  41. polyaxon/_docker/builder/builder.py +4 -1
  42. polyaxon/_docker/converter/base/containers.py +4 -7
  43. polyaxon/_docker/converter/base/env_vars.py +5 -5
  44. polyaxon/_docker/converter/base/mounts.py +2 -2
  45. polyaxon/_docker/docker_types.py +57 -30
  46. polyaxon/_env_vars/getters/owner_entity.py +4 -2
  47. polyaxon/_env_vars/getters/project.py +4 -2
  48. polyaxon/_env_vars/getters/run.py +5 -2
  49. polyaxon/_env_vars/keys.py +3 -0
  50. polyaxon/_flow/__init__.py +3 -2
  51. polyaxon/_flow/builds/__init__.py +8 -8
  52. polyaxon/_flow/cache/__init__.py +4 -4
  53. polyaxon/_flow/component/base.py +25 -18
  54. polyaxon/_flow/component/component.py +4 -3
  55. polyaxon/_flow/early_stopping/__init__.py +1 -1
  56. polyaxon/_flow/early_stopping/policies.py +12 -10
  57. polyaxon/_flow/environment/__init__.py +43 -25
  58. polyaxon/_flow/events/__init__.py +1 -1
  59. polyaxon/_flow/hooks/__init__.py +11 -11
  60. polyaxon/_flow/init/__init__.py +41 -25
  61. polyaxon/_flow/io/io.py +57 -47
  62. polyaxon/_flow/joins/__init__.py +5 -5
  63. polyaxon/_flow/matrix/bayes.py +23 -17
  64. polyaxon/_flow/matrix/grid_search.py +16 -7
  65. polyaxon/_flow/matrix/hyperband.py +10 -10
  66. polyaxon/_flow/matrix/hyperopt.py +14 -9
  67. polyaxon/_flow/matrix/iterative.py +14 -8
  68. polyaxon/_flow/matrix/mapping.py +4 -4
  69. polyaxon/_flow/matrix/params.py +138 -77
  70. polyaxon/_flow/matrix/random_search.py +10 -5
  71. polyaxon/_flow/matrix/tuner.py +4 -4
  72. polyaxon/_flow/mounts/artifacts_mounts.py +1 -1
  73. polyaxon/_flow/notifications/__init__.py +1 -1
  74. polyaxon/_flow/operations/base.py +10 -8
  75. polyaxon/_flow/operations/compiled_operation.py +5 -4
  76. polyaxon/_flow/operations/operation.py +57 -41
  77. polyaxon/_flow/optimization/__init__.py +2 -2
  78. polyaxon/_flow/params/params.py +10 -9
  79. polyaxon/_flow/plugins/__init__.py +19 -13
  80. polyaxon/_flow/run/dag.py +12 -9
  81. polyaxon/_flow/run/dask/dask.py +4 -4
  82. polyaxon/_flow/run/dask/replica.py +17 -11
  83. polyaxon/_flow/run/job.py +17 -11
  84. polyaxon/_flow/run/kubeflow/mpi_job.py +10 -5
  85. polyaxon/_flow/run/kubeflow/mx_job.py +25 -9
  86. polyaxon/_flow/run/kubeflow/paddle_job.py +16 -9
  87. polyaxon/_flow/run/kubeflow/pytorch_job.py +24 -17
  88. polyaxon/_flow/run/kubeflow/replica.py +17 -11
  89. polyaxon/_flow/run/kubeflow/scheduling_policy.py +7 -5
  90. polyaxon/_flow/run/kubeflow/tf_job.py +15 -8
  91. polyaxon/_flow/run/kubeflow/xgboost_job.py +9 -4
  92. polyaxon/_flow/run/ray/ray.py +9 -6
  93. polyaxon/_flow/run/ray/replica.py +25 -16
  94. polyaxon/_flow/run/resources.py +14 -13
  95. polyaxon/_flow/run/service.py +4 -4
  96. polyaxon/_flow/schedules/cron.py +4 -4
  97. polyaxon/_flow/schedules/interval.py +4 -4
  98. polyaxon/_flow/templates/__init__.py +3 -3
  99. polyaxon/_flow/termination/__init__.py +3 -3
  100. polyaxon/_fs/async_manager.py +1 -1
  101. polyaxon/_fs/fs.py +1 -1
  102. polyaxon/_fs/watcher.py +26 -27
  103. polyaxon/_k8s/converter/base/base.py +2 -1
  104. polyaxon/_k8s/converter/base/main.py +1 -0
  105. polyaxon/_k8s/converter/common/accelerators.py +7 -4
  106. polyaxon/_k8s/converter/converters/ray_job.py +4 -2
  107. polyaxon/_k8s/custom_resources/dask_job.py +3 -0
  108. polyaxon/_k8s/custom_resources/kubeflow/common.py +4 -1
  109. polyaxon/_k8s/custom_resources/ray_job.py +3 -0
  110. polyaxon/_k8s/custom_resources/setter.py +1 -1
  111. polyaxon/_k8s/executor/async_executor.py +2 -0
  112. polyaxon/_k8s/k8s_validation.py +1 -1
  113. polyaxon/_k8s/logging/async_monitor.py +82 -11
  114. polyaxon/_k8s/manager/async_manager.py +15 -0
  115. polyaxon/_k8s/manager/manager.py +16 -1
  116. polyaxon/_local_process/__init__.py +0 -0
  117. polyaxon/_local_process/agent.py +6 -0
  118. polyaxon/_local_process/converter/__init__.py +1 -0
  119. polyaxon/_local_process/converter/base/__init__.py +1 -0
  120. polyaxon/_local_process/converter/base/base.py +140 -0
  121. polyaxon/_local_process/converter/base/containers.py +66 -0
  122. polyaxon/_local_process/converter/base/env_vars.py +253 -0
  123. polyaxon/_local_process/converter/base/init.py +414 -0
  124. polyaxon/_local_process/converter/base/main.py +74 -0
  125. polyaxon/_local_process/converter/base/mounts.py +82 -0
  126. polyaxon/_local_process/converter/converters/__init__.py +8 -0
  127. polyaxon/_local_process/converter/converters/job.py +40 -0
  128. polyaxon/_local_process/converter/converters/service.py +41 -0
  129. polyaxon/_local_process/converter/mixins.py +38 -0
  130. polyaxon/_local_process/executor.py +132 -0
  131. polyaxon/_local_process/process_types.py +42 -0
  132. polyaxon/_polyaxonfile/specs/compiled_operation.py +1 -1
  133. polyaxon/_polyaxonfile/specs/libs/parser.py +1 -1
  134. polyaxon/_polyaxonfile/specs/libs/validator.py +1 -1
  135. polyaxon/_polyaxonfile/specs/operation.py +1 -1
  136. polyaxon/_polyaxonfile/specs/sections.py +8 -0
  137. polyaxon/_pql/manager.py +1 -1
  138. polyaxon/_runner/agent/async_agent.py +25 -11
  139. polyaxon/_runner/agent/base_agent.py +19 -10
  140. polyaxon/_runner/agent/sync_agent.py +24 -10
  141. polyaxon/_runner/converter/converter.py +12 -4
  142. polyaxon/_runner/executor.py +1 -1
  143. polyaxon/_schemas/agent.py +69 -37
  144. polyaxon/_schemas/authentication.py +4 -4
  145. polyaxon/_schemas/base.py +26 -2
  146. polyaxon/_schemas/checks.py +3 -3
  147. polyaxon/_schemas/cli.py +4 -6
  148. polyaxon/_schemas/client.py +20 -18
  149. polyaxon/_schemas/compatibility.py +4 -4
  150. polyaxon/_schemas/container_resources.py +1 -1
  151. polyaxon/_schemas/home.py +3 -3
  152. polyaxon/_schemas/installation.py +13 -9
  153. polyaxon/_schemas/lifecycle.py +23 -23
  154. polyaxon/_schemas/log_handler.py +2 -2
  155. polyaxon/_schemas/services.py +26 -14
  156. polyaxon/_schemas/types/artifacts.py +3 -3
  157. polyaxon/_schemas/types/dockerfile.py +14 -12
  158. polyaxon/_schemas/types/event.py +2 -2
  159. polyaxon/_schemas/types/file.py +3 -3
  160. polyaxon/_schemas/types/git.py +12 -4
  161. polyaxon/_schemas/types/tensorboard.py +14 -8
  162. polyaxon/_schemas/user.py +3 -3
  163. polyaxon/_schemas/version.py +2 -2
  164. polyaxon/_sdk/api/agents_v1_api.py +222 -43
  165. polyaxon/_sdk/api/artifacts_stores_v1_api.py +3 -3
  166. polyaxon/_sdk/api/auth_v1_api.py +13 -13
  167. polyaxon/_sdk/api/connections_v1_api.py +15 -15
  168. polyaxon/_sdk/api/dashboards_v1_api.py +15 -15
  169. polyaxon/_sdk/api/organizations_v1_api.py +85 -85
  170. polyaxon/_sdk/api/presets_v1_api.py +15 -15
  171. polyaxon/_sdk/api/project_dashboards_v1_api.py +29 -29
  172. polyaxon/_sdk/api/project_searches_v1_api.py +29 -29
  173. polyaxon/_sdk/api/projects_v1_api.py +284 -107
  174. polyaxon/_sdk/api/queues_v1_api.py +19 -19
  175. polyaxon/_sdk/api/runs_v1_api.py +313 -359
  176. polyaxon/_sdk/api/searches_v1_api.py +15 -15
  177. polyaxon/_sdk/api/service_accounts_v1_api.py +31 -31
  178. polyaxon/_sdk/api/tags_v1_api.py +17 -17
  179. polyaxon/_sdk/api/teams_v1_api.py +2854 -402
  180. polyaxon/_sdk/api/users_v1_api.py +254 -78
  181. polyaxon/_sdk/api/versions_v1_api.py +7 -7
  182. polyaxon/_sdk/async_client/api_client.py +4 -0
  183. polyaxon/_sdk/schemas/__init__.py +1 -1
  184. polyaxon/_sdk/schemas/v1_activity.py +8 -8
  185. polyaxon/_sdk/schemas/v1_agent.py +18 -16
  186. polyaxon/_sdk/schemas/v1_agent_state_response.py +4 -4
  187. polyaxon/_sdk/schemas/v1_agent_state_response_agent_state.py +10 -10
  188. polyaxon/_sdk/schemas/v1_agent_status_body_request.py +3 -3
  189. polyaxon/_sdk/schemas/v1_analytics_spec.py +4 -4
  190. polyaxon/_sdk/schemas/v1_artifact_tree.py +3 -3
  191. polyaxon/_sdk/schemas/v1_auth.py +1 -1
  192. polyaxon/_sdk/schemas/v1_cloning.py +3 -3
  193. polyaxon/_sdk/schemas/v1_connection_response.py +9 -9
  194. polyaxon/_sdk/schemas/v1_dashboard.py +9 -9
  195. polyaxon/_sdk/schemas/v1_dashboard_spec.py +5 -1
  196. polyaxon/_sdk/schemas/v1_entities_tags.py +2 -2
  197. polyaxon/_sdk/schemas/v1_entities_transfer.py +2 -2
  198. polyaxon/_sdk/schemas/v1_entity_notification_body.py +7 -7
  199. polyaxon/_sdk/schemas/v1_entity_stage_body_request.py +5 -5
  200. polyaxon/_sdk/schemas/v1_entity_status_body_request.py +5 -5
  201. polyaxon/_sdk/schemas/v1_events_response.py +2 -2
  202. polyaxon/_sdk/schemas/v1_list_activities_response.py +4 -4
  203. polyaxon/_sdk/schemas/v1_list_agents_response.py +4 -4
  204. polyaxon/_sdk/schemas/v1_list_bookmarks_response.py +4 -4
  205. polyaxon/_sdk/schemas/v1_list_connections_response.py +4 -4
  206. polyaxon/_sdk/schemas/v1_list_dashboards_response.py +4 -4
  207. polyaxon/_sdk/schemas/v1_list_organization_members_response.py +4 -4
  208. polyaxon/_sdk/schemas/v1_list_organizations_response.py +4 -4
  209. polyaxon/_sdk/schemas/v1_list_presets_response.py +4 -4
  210. polyaxon/_sdk/schemas/v1_list_project_versions_response.py +4 -4
  211. polyaxon/_sdk/schemas/v1_list_projects_response.py +4 -4
  212. polyaxon/_sdk/schemas/v1_list_queues_response.py +4 -4
  213. polyaxon/_sdk/schemas/v1_list_run_artifacts_response.py +4 -4
  214. polyaxon/_sdk/schemas/v1_list_run_connections_response.py +4 -4
  215. polyaxon/_sdk/schemas/v1_list_run_edges_response.py +4 -4
  216. polyaxon/_sdk/schemas/v1_list_runs_response.py +4 -4
  217. polyaxon/_sdk/schemas/v1_list_searches_response.py +4 -4
  218. polyaxon/_sdk/schemas/v1_list_service_accounts_response.py +4 -4
  219. polyaxon/_sdk/schemas/v1_list_tags_response.py +4 -4
  220. polyaxon/_sdk/schemas/v1_list_team_members_response.py +4 -4
  221. polyaxon/_sdk/schemas/v1_list_teams_response.py +4 -4
  222. polyaxon/_sdk/schemas/v1_list_token_response.py +4 -4
  223. polyaxon/_sdk/schemas/v1_operation_body.py +8 -8
  224. polyaxon/_sdk/schemas/v1_organization.py +16 -16
  225. polyaxon/_sdk/schemas/v1_organization_member.py +6 -6
  226. polyaxon/_sdk/schemas/v1_password_change.py +3 -3
  227. polyaxon/_sdk/schemas/v1_pipeline.py +3 -3
  228. polyaxon/_sdk/schemas/v1_preset.py +16 -9
  229. polyaxon/_sdk/schemas/v1_project.py +17 -17
  230. polyaxon/_sdk/schemas/v1_project_settings.py +12 -10
  231. polyaxon/_sdk/schemas/v1_project_version.py +20 -20
  232. polyaxon/_sdk/schemas/v1_queue.py +12 -12
  233. polyaxon/_sdk/schemas/v1_run.py +38 -38
  234. polyaxon/_sdk/schemas/v1_run_connection.py +3 -3
  235. polyaxon/_sdk/schemas/v1_run_edge.py +5 -5
  236. polyaxon/_sdk/schemas/v1_run_edge_lineage.py +3 -3
  237. polyaxon/_sdk/schemas/v1_run_edges_graph.py +1 -1
  238. polyaxon/_sdk/schemas/v1_run_reference_catalog.py +4 -4
  239. polyaxon/_sdk/schemas/v1_run_settings.py +9 -9
  240. polyaxon/_sdk/schemas/v1_search.py +10 -10
  241. polyaxon/_sdk/schemas/v1_search_spec.py +14 -14
  242. polyaxon/_sdk/schemas/v1_section_spec.py +12 -7
  243. polyaxon/_sdk/schemas/v1_service_account.py +9 -9
  244. polyaxon/_sdk/schemas/v1_settings_catalog.py +4 -3
  245. polyaxon/_sdk/schemas/v1_tag.py +6 -6
  246. polyaxon/_sdk/schemas/v1_team.py +11 -8
  247. polyaxon/_sdk/schemas/v1_team_member.py +6 -6
  248. polyaxon/_sdk/schemas/v1_team_settings.py +2 -2
  249. polyaxon/_sdk/schemas/v1_token.py +10 -10
  250. polyaxon/_sdk/schemas/v1_trial_start.py +6 -6
  251. polyaxon/_sdk/schemas/v1_user.py +6 -7
  252. polyaxon/_sdk/schemas/v1_user_access.py +17 -0
  253. polyaxon/_sdk/schemas/v1_user_email.py +1 -1
  254. polyaxon/_sdk/schemas/v1_user_singup.py +5 -5
  255. polyaxon/_sdk/schemas/v1_uuids.py +1 -1
  256. polyaxon/_sidecar/container/__init__.py +39 -20
  257. polyaxon/_sidecar/container/monitors/logs.py +10 -13
  258. polyaxon/_sidecar/ignore.py +0 -1
  259. polyaxon/_utils/cli_constants.py +2 -0
  260. polyaxon/_utils/fqn_utils.py +25 -2
  261. polyaxon/_utils/test_utils.py +2 -1
  262. polyaxon/pkg.py +1 -1
  263. polyaxon/schemas.py +1 -1
  264. {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/METADATA +43 -43
  265. {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/RECORD +269 -252
  266. {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/WHEEL +1 -1
  267. polyaxon/_sdk/schemas/v1_project_user_access.py +0 -10
  268. {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/LICENSE +0 -0
  269. {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/entry_points.txt +0 -0
  270. {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/top_level.txt +0 -0
@@ -9,8 +9,8 @@ from clipped.config.schema import BaseAllowSchemaModel
9
9
  class V1LogHandler(BaseAllowSchemaModel):
10
10
  _IDENTIFIER = "log_handler"
11
11
 
12
- dsn: Optional[StrictStr]
13
- environment: Optional[StrictStr]
12
+ dsn: Optional[StrictStr] = None
13
+ environment: Optional[StrictStr] = None
14
14
 
15
15
  @property
16
16
  def decoded_dsn(self):
@@ -1,6 +1,12 @@
1
1
  from typing import Dict, List, Optional, Union
2
2
 
3
- from clipped.compact.pydantic import Field, StrictStr, validator
3
+ from clipped.compact.pydantic import (
4
+ Field,
5
+ StrictStr,
6
+ field_validator,
7
+ validation_always,
8
+ validation_before,
9
+ )
4
10
 
5
11
  from polyaxon._containers.pull_policy import PullPolicy
6
12
  from polyaxon._k8s import k8s_schemas, k8s_validation
@@ -14,25 +20,31 @@ class BaseServiceConfig(BaseSchemaModel):
14
20
  "tolerations",
15
21
  }
16
22
 
17
- image: Optional[StrictStr]
18
- image_tag: Optional[StrictStr] = Field(alias="imageTag")
19
- image_pull_policy: Optional[PullPolicy] = Field(alias="imagePullPolicy")
20
- resources: Optional[Union[k8s_schemas.V1ResourceRequirements, Dict]]
21
- node_selector: Optional[Dict[StrictStr, StrictStr]] = Field(alias="nodeSelector")
22
- affinity: Optional[Union[k8s_schemas.V1Affinity, Dict]]
23
- tolerations: Optional[List[Union[k8s_schemas.V1Toleration, Dict]]]
24
- image_pull_secrets: Optional[List[StrictStr]] = Field(alias="imagePullSecrets")
25
- hpa: Optional[Dict]
26
-
27
- @validator("resources", always=True, pre=True)
23
+ image: Optional[StrictStr] = None
24
+ image_tag: Optional[StrictStr] = Field(default=None, alias="imageTag")
25
+ image_pull_policy: Optional[PullPolicy] = Field(
26
+ default=None, alias="imagePullPolicy"
27
+ )
28
+ resources: Optional[Union[k8s_schemas.V1ResourceRequirements, Dict]] = None
29
+ node_selector: Optional[Dict[StrictStr, StrictStr]] = Field(
30
+ default=None, alias="nodeSelector"
31
+ )
32
+ affinity: Optional[Union[k8s_schemas.V1Affinity, Dict]] = None
33
+ tolerations: Optional[List[Union[k8s_schemas.V1Toleration, Dict]]] = None
34
+ image_pull_secrets: Optional[List[StrictStr]] = Field(
35
+ default=None, alias="imagePullSecrets"
36
+ )
37
+ hpa: Optional[Dict] = None
38
+
39
+ @field_validator("resources", **validation_always, **validation_before)
28
40
  def validate_resources(cls, v):
29
41
  return k8s_validation.validate_k8s_resource_requirements(v)
30
42
 
31
- @validator("affinity", always=True, pre=True)
43
+ @field_validator("affinity", **validation_always, **validation_before)
32
44
  def validate_affinity(cls, v):
33
45
  return k8s_validation.validate_k8s_affinity(v)
34
46
 
35
- @validator("tolerations", always=True, pre=True)
47
+ @field_validator("tolerations", **validation_always, **validation_before)
36
48
  def validate_tolerations(cls, v):
37
49
  if not v:
38
50
  return v
@@ -154,6 +154,6 @@ class V1ArtifactsType(BaseTypeConfig):
154
154
 
155
155
  _IDENTIFIER = "artifacts"
156
156
 
157
- files: Optional[Union[List[Union[str, List[str]]], RefField]]
158
- dirs: Optional[Union[List[Union[str, List[str]]], RefField]]
159
- workers: Optional[Union[StrictInt, RefField]]
157
+ files: Optional[Union[List[Union[str, List[str]]], RefField]] = None
158
+ dirs: Optional[Union[List[Union[str, List[str]]], RefField]] = None
159
+ workers: Optional[Union[StrictInt, RefField]] = None
@@ -1,6 +1,6 @@
1
1
  from typing import Any, Dict, List, Optional, Tuple, Union
2
2
 
3
- from clipped.compact.pydantic import Field, StrictStr, validator
3
+ from clipped.compact.pydantic import Field, StrictStr, field_validator
4
4
  from clipped.config.schema import skip_partial
5
5
  from clipped.types.docker_image import validate_image
6
6
  from clipped.types.ref_or_obj import RefField
@@ -179,31 +179,33 @@ class V1DockerfileType(BaseTypeConfig):
179
179
  _IDENTIFIER = "dockerfile"
180
180
 
181
181
  image: StrictStr
182
- env: Optional[Union[Dict[StrictStr, Any], RefField]]
183
- path: Optional[Union[List[StrictStr], RefField]]
182
+ env: Optional[
183
+ Union[Dict[str, Any], List[Union[Tuple[str, str], List[str]]], RefField]
184
+ ] = None
185
+ path: Optional[Union[List[StrictStr], RefField]] = None
184
186
  copy_: Optional[
185
187
  Union[
186
188
  List[Union[StrictStr, List[StrictStr], Tuple[StrictStr, StrictStr]]],
187
189
  RefField,
188
190
  ]
189
- ] = Field(alias="copy")
191
+ ] = Field(alias="copy", default=None)
190
192
  post_run_copy: Optional[
191
193
  Union[
192
194
  List[Union[StrictStr, List[StrictStr], Tuple[StrictStr, StrictStr]]],
193
195
  RefField,
194
196
  ]
195
- ] = Field(alias="postRunCopy")
196
- run: Optional[Union[List[StrictStr], RefField]]
197
- lang_env: Optional[StrictStr] = Field(alias="langEnv")
198
- uid: Optional[Union[int, RefField]]
199
- gid: Optional[Union[int, RefField]]
200
- username: Optional[StrictStr]
197
+ ] = Field(alias="postRunCopy", default=None)
198
+ run: Optional[Union[List[StrictStr], RefField]] = None
199
+ lang_env: Optional[StrictStr] = Field(alias="langEnv", default=None)
200
+ uid: Optional[Union[int, RefField]] = None
201
+ gid: Optional[Union[int, RefField]] = None
202
+ username: Optional[StrictStr] = None
201
203
  filename: Optional[StrictStr] = Field(default=POLYAXON_DOCKERFILE_NAME)
202
204
  workdir: Optional[StrictStr] = Field(default=POLYAXON_DOCKER_WORKDIR)
203
- workdir_path: Optional[StrictStr] = Field(alias="workdirPath")
205
+ workdir_path: Optional[StrictStr] = Field(alias="workdirPath", default=None)
204
206
  shell: Optional[StrictStr] = Field(default=POLYAXON_DOCKER_SHELL)
205
207
 
206
- @validator("image")
208
+ @field_validator("image")
207
209
  @skip_partial
208
210
  def check_image(cls, image):
209
211
  validate_image(image)
@@ -8,5 +8,5 @@ from polyaxon._schemas.types.base import BaseTypeConfig
8
8
  class V1EventType(BaseTypeConfig):
9
9
  _IDENTIFIER = "event"
10
10
 
11
- name: Optional[StrictStr]
12
- kind: Optional[StrictStr]
11
+ name: Optional[StrictStr] = None
12
+ kind: Optional[StrictStr] = None
@@ -143,7 +143,7 @@ class V1FileType(BaseTypeConfig):
143
143
 
144
144
  _IDENTIFIER = "file"
145
145
 
146
- kind: Optional[Union[V1ArtifactKind, RefField]]
146
+ kind: Optional[Union[V1ArtifactKind, RefField]] = None
147
147
  content: StrictStr
148
- filename: Optional[StrictStr]
149
- chmod: Optional[StrictStr]
148
+ filename: Optional[StrictStr] = None
149
+ chmod: Optional[StrictStr] = None
@@ -1,10 +1,13 @@
1
- from typing import List, Optional, Union
1
+ from typing import TYPE_CHECKING, List, Optional, Union
2
2
 
3
3
  from clipped.compact.pydantic import StrictStr
4
4
  from clipped.types.ref_or_obj import RefField
5
5
 
6
6
  from polyaxon._schemas.types.base import BaseTypeConfig
7
7
 
8
+ if TYPE_CHECKING:
9
+ from polyaxon._connections import V1GitConnection
10
+
8
11
 
9
12
  class V1GitType(BaseTypeConfig):
10
13
  """Git type allows you to pass a git repo as a parameter.
@@ -124,11 +127,16 @@ class V1GitType(BaseTypeConfig):
124
127
 
125
128
  _IDENTIFIER = "git"
126
129
 
127
- url: Optional[StrictStr]
128
- revision: Optional[StrictStr]
129
- flags: Optional[Union[List[StrictStr], RefField]]
130
+ url: Optional[StrictStr] = None
131
+ revision: Optional[StrictStr] = None
132
+ flags: Optional[Union[List[StrictStr], RefField]] = None
130
133
 
131
134
  def get_name(self):
132
135
  if self.url:
133
136
  return self.url.split("/")[-1].split(".")[0]
134
137
  return None
138
+
139
+ def to_connection(self) -> "V1GitConnection":
140
+ from polyaxon._connections import V1GitConnection
141
+
142
+ return V1GitConnection(url=self.url, revision=self.revision, flags=self.flags)
@@ -1,6 +1,12 @@
1
1
  from typing import List, Optional, Union
2
2
 
3
- from clipped.compact.pydantic import Field, StrictInt, StrictStr, validator
3
+ from clipped.compact.pydantic import (
4
+ Field,
5
+ StrictInt,
6
+ StrictStr,
7
+ field_validator,
8
+ validation_before,
9
+ )
4
10
  from clipped.config.constants import PARAM_REGEX
5
11
  from clipped.types.ref_or_obj import RefField
6
12
  from clipped.types.uuids import UUIDStr
@@ -129,14 +135,14 @@ class V1TensorboardType(BaseTypeConfig):
129
135
 
130
136
  _IDENTIFIER = "tensorboard"
131
137
 
132
- port: Optional[Union[StrictInt, RefField]]
133
- uuids: Optional[Union[List[UUIDStr], RefField]]
134
- use_names: Optional[Union[bool, RefField]] = Field(alias="useNames")
135
- path_prefix: Optional[StrictStr] = Field(alias="pathPrefix")
136
- plugins: Optional[Union[List[StrictStr], RefField]]
138
+ port: Optional[Union[StrictInt, RefField]] = None
139
+ uuids: Optional[Union[List[UUIDStr], RefField]] = None
140
+ use_names: Optional[Union[bool, RefField]] = Field(alias="useNames", default=None)
141
+ path_prefix: Optional[StrictStr] = Field(alias="pathPrefix", default=None)
142
+ plugins: Optional[Union[List[StrictStr], RefField]] = None
137
143
 
138
- @validator("uuids", "plugins", pre=True)
139
- def validate_str_list(cls, v, field):
144
+ @field_validator("uuids", "plugins", **validation_before)
145
+ def validate_str_list(cls, v):
140
146
  if isinstance(v, str) and v is not None and not PARAM_REGEX.search(v):
141
147
  return to_list(v, check_str=True)
142
148
  return v
polyaxon/_schemas/user.py CHANGED
@@ -10,6 +10,6 @@ class UserConfig(BaseSchemaModel):
10
10
  _IDENTIFIER = "user"
11
11
 
12
12
  username: StrictStr
13
- email: Optional[EmailStr]
14
- name: Optional[StrictStr]
15
- theme: Optional[int]
13
+ email: Optional[EmailStr] = None
14
+ name: Optional[StrictStr] = None
15
+ theme: Optional[int] = None
@@ -6,5 +6,5 @@ from polyaxon._schemas.base import BaseSchemaModel
6
6
 
7
7
 
8
8
  class V1Version(BaseSchemaModel):
9
- min: Optional[StrictStr]
10
- latest: Optional[StrictStr]
9
+ min: Optional[StrictStr] = None
10
+ latest: Optional[StrictStr] = None