polyaxon 2.5.3__py3-none-any.whl → 2.6.0.post1__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.
- polyaxon/_auxiliaries/default_scheduling.py +17 -7
- polyaxon/_auxiliaries/init.py +14 -6
- polyaxon/_auxiliaries/sidecar.py +10 -8
- polyaxon/_compiler/resolver/agent.py +10 -9
- polyaxon/_deploy/schemas/auth.py +3 -3
- polyaxon/_deploy/schemas/celery.py +10 -8
- polyaxon/_deploy/schemas/deployment.py +148 -115
- polyaxon/_deploy/schemas/email.py +8 -8
- polyaxon/_deploy/schemas/ingress.py +7 -7
- polyaxon/_deploy/schemas/intervals.py +3 -1
- polyaxon/_deploy/schemas/operators.py +8 -8
- polyaxon/_deploy/schemas/proxy.py +9 -9
- polyaxon/_deploy/schemas/rbac.py +1 -1
- polyaxon/_deploy/schemas/root_user.py +5 -5
- polyaxon/_deploy/schemas/security_context.py +25 -15
- polyaxon/_deploy/schemas/service.py +73 -69
- polyaxon/_deploy/schemas/ssl.py +3 -3
- polyaxon/_deploy/schemas/ui.py +10 -8
- polyaxon/_docker/builder/builder.py +4 -1
- polyaxon/_docker/converter/base/containers.py +4 -7
- polyaxon/_docker/converter/base/env_vars.py +5 -5
- polyaxon/_docker/converter/base/mounts.py +2 -2
- polyaxon/_docker/docker_types.py +57 -30
- polyaxon/_flow/__init__.py +3 -2
- polyaxon/_flow/builds/__init__.py +8 -8
- polyaxon/_flow/cache/__init__.py +4 -4
- polyaxon/_flow/component/base.py +25 -18
- polyaxon/_flow/component/component.py +4 -3
- polyaxon/_flow/early_stopping/__init__.py +1 -1
- polyaxon/_flow/early_stopping/policies.py +12 -10
- polyaxon/_flow/environment/__init__.py +42 -24
- polyaxon/_flow/hooks/__init__.py +11 -11
- polyaxon/_flow/init/__init__.py +41 -25
- polyaxon/_flow/io/io.py +59 -47
- polyaxon/_flow/joins/__init__.py +5 -5
- polyaxon/_flow/matrix/bayes.py +23 -17
- polyaxon/_flow/matrix/grid_search.py +16 -7
- polyaxon/_flow/matrix/hyperband.py +10 -10
- polyaxon/_flow/matrix/hyperopt.py +14 -9
- polyaxon/_flow/matrix/iterative.py +14 -8
- polyaxon/_flow/matrix/mapping.py +4 -4
- polyaxon/_flow/matrix/params.py +138 -77
- polyaxon/_flow/matrix/random_search.py +10 -5
- polyaxon/_flow/matrix/tuner.py +4 -4
- polyaxon/_flow/mounts/artifacts_mounts.py +1 -1
- polyaxon/_flow/notifications/__init__.py +1 -1
- polyaxon/_flow/operations/base.py +10 -8
- polyaxon/_flow/operations/compiled_operation.py +5 -4
- polyaxon/_flow/operations/operation.py +30 -22
- polyaxon/_flow/optimization/__init__.py +2 -2
- polyaxon/_flow/params/params.py +11 -10
- polyaxon/_flow/plugins/__init__.py +19 -13
- polyaxon/_flow/run/dag.py +12 -9
- polyaxon/_flow/run/dask/dask.py +4 -4
- polyaxon/_flow/run/dask/replica.py +17 -11
- polyaxon/_flow/run/job.py +17 -11
- polyaxon/_flow/run/kubeflow/mpi_job.py +10 -5
- polyaxon/_flow/run/kubeflow/mx_job.py +25 -9
- polyaxon/_flow/run/kubeflow/paddle_job.py +16 -9
- polyaxon/_flow/run/kubeflow/pytorch_job.py +24 -17
- polyaxon/_flow/run/kubeflow/replica.py +17 -11
- polyaxon/_flow/run/kubeflow/scheduling_policy.py +7 -5
- polyaxon/_flow/run/kubeflow/tf_job.py +15 -8
- polyaxon/_flow/run/kubeflow/xgboost_job.py +9 -4
- polyaxon/_flow/run/ray/ray.py +9 -6
- polyaxon/_flow/run/ray/replica.py +25 -16
- polyaxon/_flow/run/resources.py +14 -13
- polyaxon/_flow/run/service.py +4 -4
- polyaxon/_flow/schedules/cron.py +4 -4
- polyaxon/_flow/schedules/interval.py +4 -4
- polyaxon/_flow/templates/__init__.py +3 -3
- polyaxon/_flow/termination/__init__.py +3 -3
- polyaxon/_fs/watcher.py +26 -27
- polyaxon/_k8s/k8s_validation.py +1 -1
- polyaxon/_local_process/converter/base/containers.py +4 -7
- polyaxon/_local_process/converter/base/env_vars.py +5 -5
- polyaxon/_local_process/process_types.py +15 -12
- polyaxon/_polyaxonfile/specs/compiled_operation.py +1 -1
- polyaxon/_polyaxonfile/specs/libs/validator.py +1 -1
- polyaxon/_polyaxonfile/specs/operation.py +1 -1
- polyaxon/_runner/agent/sync_agent.py +1 -1
- polyaxon/_runner/converter/converter.py +1 -1
- polyaxon/_schemas/agent.py +69 -37
- polyaxon/_schemas/authentication.py +4 -4
- polyaxon/_schemas/base.py +26 -2
- polyaxon/_schemas/checks.py +3 -3
- polyaxon/_schemas/cli.py +4 -6
- polyaxon/_schemas/client.py +20 -18
- polyaxon/_schemas/compatibility.py +4 -4
- polyaxon/_schemas/container_resources.py +1 -1
- polyaxon/_schemas/home.py +3 -3
- polyaxon/_schemas/installation.py +8 -8
- polyaxon/_schemas/lifecycle.py +21 -21
- polyaxon/_schemas/log_handler.py +2 -2
- polyaxon/_schemas/services.py +26 -14
- polyaxon/_schemas/types/artifacts.py +3 -3
- polyaxon/_schemas/types/dockerfile.py +14 -12
- polyaxon/_schemas/types/event.py +2 -2
- polyaxon/_schemas/types/file.py +3 -3
- polyaxon/_schemas/types/git.py +12 -4
- polyaxon/_schemas/types/tensorboard.py +14 -8
- polyaxon/_schemas/user.py +3 -3
- polyaxon/_schemas/version.py +2 -2
- polyaxon/_sdk/api/agents_v1_api.py +45 -45
- polyaxon/_sdk/api/artifacts_stores_v1_api.py +3 -3
- polyaxon/_sdk/api/auth_v1_api.py +13 -13
- polyaxon/_sdk/api/connections_v1_api.py +15 -15
- polyaxon/_sdk/api/dashboards_v1_api.py +15 -15
- polyaxon/_sdk/api/organizations_v1_api.py +77 -77
- polyaxon/_sdk/api/presets_v1_api.py +15 -15
- polyaxon/_sdk/api/project_dashboards_v1_api.py +17 -17
- polyaxon/_sdk/api/project_searches_v1_api.py +17 -17
- polyaxon/_sdk/api/projects_v1_api.py +65 -65
- polyaxon/_sdk/api/queues_v1_api.py +19 -19
- polyaxon/_sdk/api/runs_v1_api.py +127 -127
- polyaxon/_sdk/api/searches_v1_api.py +15 -15
- polyaxon/_sdk/api/service_accounts_v1_api.py +27 -27
- polyaxon/_sdk/api/tags_v1_api.py +17 -17
- polyaxon/_sdk/api/teams_v1_api.py +51 -51
- polyaxon/_sdk/api/users_v1_api.py +25 -25
- polyaxon/_sdk/api/versions_v1_api.py +7 -7
- polyaxon/_sdk/schemas/v1_activity.py +8 -8
- polyaxon/_sdk/schemas/v1_agent.py +17 -17
- polyaxon/_sdk/schemas/v1_agent_state_response.py +4 -4
- polyaxon/_sdk/schemas/v1_agent_state_response_agent_state.py +10 -10
- polyaxon/_sdk/schemas/v1_agent_status_body_request.py +3 -3
- polyaxon/_sdk/schemas/v1_analytics_spec.py +4 -4
- polyaxon/_sdk/schemas/v1_artifact_tree.py +3 -3
- polyaxon/_sdk/schemas/v1_auth.py +1 -1
- polyaxon/_sdk/schemas/v1_cloning.py +3 -3
- polyaxon/_sdk/schemas/v1_connection_response.py +9 -9
- polyaxon/_sdk/schemas/v1_dashboard.py +9 -9
- polyaxon/_sdk/schemas/v1_dashboard_spec.py +5 -5
- polyaxon/_sdk/schemas/v1_entities_tags.py +2 -2
- polyaxon/_sdk/schemas/v1_entities_transfer.py +2 -2
- polyaxon/_sdk/schemas/v1_entity_notification_body.py +7 -7
- polyaxon/_sdk/schemas/v1_entity_stage_body_request.py +5 -5
- polyaxon/_sdk/schemas/v1_entity_status_body_request.py +5 -5
- polyaxon/_sdk/schemas/v1_events_response.py +2 -2
- polyaxon/_sdk/schemas/v1_list_activities_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_agents_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_bookmarks_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_connections_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_dashboards_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_organization_members_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_organizations_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_presets_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_project_versions_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_projects_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_queues_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_run_artifacts_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_run_connections_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_run_edges_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_runs_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_searches_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_service_accounts_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_tags_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_team_members_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_teams_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_token_response.py +4 -4
- polyaxon/_sdk/schemas/v1_operation_body.py +8 -8
- polyaxon/_sdk/schemas/v1_organization.py +16 -16
- polyaxon/_sdk/schemas/v1_organization_member.py +6 -6
- polyaxon/_sdk/schemas/v1_password_change.py +3 -3
- polyaxon/_sdk/schemas/v1_pipeline.py +3 -3
- polyaxon/_sdk/schemas/v1_preset.py +11 -11
- polyaxon/_sdk/schemas/v1_project.py +17 -17
- polyaxon/_sdk/schemas/v1_project_settings.py +11 -11
- polyaxon/_sdk/schemas/v1_project_version.py +20 -20
- polyaxon/_sdk/schemas/v1_queue.py +12 -12
- polyaxon/_sdk/schemas/v1_run.py +38 -38
- polyaxon/_sdk/schemas/v1_run_connection.py +3 -3
- polyaxon/_sdk/schemas/v1_run_edge.py +5 -5
- polyaxon/_sdk/schemas/v1_run_edge_lineage.py +3 -3
- polyaxon/_sdk/schemas/v1_run_edges_graph.py +1 -1
- polyaxon/_sdk/schemas/v1_run_reference_catalog.py +4 -4
- polyaxon/_sdk/schemas/v1_run_settings.py +9 -9
- polyaxon/_sdk/schemas/v1_search.py +10 -10
- polyaxon/_sdk/schemas/v1_search_spec.py +14 -14
- polyaxon/_sdk/schemas/v1_section_spec.py +12 -12
- polyaxon/_sdk/schemas/v1_service_account.py +9 -9
- polyaxon/_sdk/schemas/v1_settings_catalog.py +4 -4
- polyaxon/_sdk/schemas/v1_tag.py +6 -6
- polyaxon/_sdk/schemas/v1_team.py +11 -11
- polyaxon/_sdk/schemas/v1_team_member.py +6 -6
- polyaxon/_sdk/schemas/v1_team_settings.py +2 -2
- polyaxon/_sdk/schemas/v1_token.py +10 -10
- polyaxon/_sdk/schemas/v1_trial_start.py +6 -6
- polyaxon/_sdk/schemas/v1_user.py +6 -6
- polyaxon/_sdk/schemas/v1_user_access.py +7 -7
- polyaxon/_sdk/schemas/v1_user_email.py +1 -1
- polyaxon/_sdk/schemas/v1_user_singup.py +5 -5
- polyaxon/_sdk/schemas/v1_uuids.py +1 -1
- polyaxon/_utils/test_utils.py +2 -1
- polyaxon/pkg.py +1 -1
- {polyaxon-2.5.3.dist-info → polyaxon-2.6.0.post1.dist-info}/METADATA +10 -10
- {polyaxon-2.5.3.dist-info → polyaxon-2.6.0.post1.dist-info}/RECORD +201 -201
- {polyaxon-2.5.3.dist-info → polyaxon-2.6.0.post1.dist-info}/LICENSE +0 -0
- {polyaxon-2.5.3.dist-info → polyaxon-2.6.0.post1.dist-info}/WHEEL +0 -0
- {polyaxon-2.5.3.dist-info → polyaxon-2.6.0.post1.dist-info}/entry_points.txt +0 -0
- {polyaxon-2.5.3.dist-info → polyaxon-2.6.0.post1.dist-info}/top_level.txt +0 -0
@@ -1,27 +1,37 @@
|
|
1
1
|
from typing import Optional
|
2
2
|
|
3
|
-
from clipped.compact.pydantic import
|
3
|
+
from clipped.compact.pydantic import (
|
4
|
+
Field,
|
5
|
+
StrictInt,
|
6
|
+
StrictStr,
|
7
|
+
model_validator,
|
8
|
+
validation_after,
|
9
|
+
)
|
4
10
|
from clipped.config.schema import skip_partial
|
5
11
|
|
6
12
|
from polyaxon._schemas.base import BaseSchemaModel
|
7
13
|
|
8
14
|
|
9
|
-
def validate_security_context(user, group):
|
10
|
-
if any([user, group]) and not all([user, group]):
|
11
|
-
raise ValueError("Security context requires both `user` and `group` or none.")
|
12
|
-
|
13
|
-
|
14
15
|
class SecurityContextConfig(BaseSchemaModel):
|
15
|
-
enabled: Optional[bool]
|
16
|
-
run_as_user: Optional[StrictInt] = Field(alias="runAsUser")
|
17
|
-
run_as_group: Optional[StrictInt] = Field(alias="runAsGroup")
|
18
|
-
fs_group: Optional[StrictInt] = Field(alias="fsGroup")
|
19
|
-
fs_group_change_policy: Optional[StrictStr] = Field(
|
20
|
-
|
21
|
-
|
16
|
+
enabled: Optional[bool] = None
|
17
|
+
run_as_user: Optional[StrictInt] = Field(alias="runAsUser", default=None)
|
18
|
+
run_as_group: Optional[StrictInt] = Field(alias="runAsGroup", default=None)
|
19
|
+
fs_group: Optional[StrictInt] = Field(alias="fsGroup", default=None)
|
20
|
+
fs_group_change_policy: Optional[StrictStr] = Field(
|
21
|
+
alias="fsGroupChangePolicy", default=None
|
22
|
+
)
|
23
|
+
allow_privilege_escalation: Optional[bool] = Field(
|
24
|
+
alias="allowPrivilegeEscalation", default=None
|
25
|
+
)
|
26
|
+
run_as_non_root: Optional[bool] = Field(alias="runAsNonRoot", default=None)
|
22
27
|
|
23
|
-
@
|
28
|
+
@model_validator(**validation_after)
|
24
29
|
@skip_partial
|
25
30
|
def validate_security_context(cls, values):
|
26
|
-
|
31
|
+
user = cls.get_value_for_key("run_as_user", values)
|
32
|
+
group = cls.get_value_for_key("run_as_group", values)
|
33
|
+
if any([user, group]) and not all([user, group]):
|
34
|
+
raise ValueError(
|
35
|
+
"Security context requires both `user` and `group` or none."
|
36
|
+
)
|
27
37
|
return values
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from typing import Dict, List, Optional
|
2
2
|
|
3
|
-
from clipped.compact.pydantic import
|
3
|
+
from clipped.compact.pydantic import Field, StrictInt, StrictStr
|
4
4
|
|
5
5
|
from polyaxon._deploy.schemas.celery import CeleryConfig
|
6
6
|
from polyaxon._deploy.schemas.service_types import ServiceTypes
|
@@ -9,119 +9,123 @@ from polyaxon._schemas.services import BaseServiceConfig
|
|
9
9
|
|
10
10
|
|
11
11
|
class DeploymentService(BaseServiceConfig):
|
12
|
-
enabled: Optional[bool]
|
13
|
-
replicas: Optional[StrictInt]
|
14
|
-
concurrency: Optional[StrictInt]
|
15
|
-
per_core: Optional[bool] = Field(alias="perCore")
|
16
|
-
scheme: Optional[StrictStr]
|
12
|
+
enabled: Optional[bool] = None
|
13
|
+
replicas: Optional[StrictInt] = None
|
14
|
+
concurrency: Optional[StrictInt] = None
|
15
|
+
per_core: Optional[bool] = Field(alias="perCore", default=None)
|
16
|
+
scheme: Optional[StrictStr] = None
|
17
17
|
|
18
18
|
|
19
19
|
class WorkerServiceConfig(DeploymentService):
|
20
|
-
celery: Optional[CeleryConfig]
|
20
|
+
celery: Optional[CeleryConfig] = None
|
21
21
|
|
22
22
|
|
23
23
|
class AgentServiceConfig(DeploymentService):
|
24
|
-
instance: Optional[StrictStr]
|
25
|
-
token: Optional[StrictStr]
|
26
|
-
watch_cluster: Optional[bool] = Field(alias="watchCluster")
|
27
|
-
additional_namespaces: Optional[List[str]] = Field(
|
24
|
+
instance: Optional[StrictStr] = None
|
25
|
+
token: Optional[StrictStr] = None
|
26
|
+
watch_cluster: Optional[bool] = Field(alias="watchCluster", default=None)
|
27
|
+
additional_namespaces: Optional[List[str]] = Field(
|
28
|
+
alias="additionalNamespaces", default=None
|
29
|
+
)
|
28
30
|
service_account_annotations: Optional[Dict] = Field(
|
29
|
-
alias="serviceAccountAnnotations"
|
31
|
+
alias="serviceAccountAnnotations", default=None
|
30
32
|
)
|
31
|
-
is_replica: Optional[bool] = Field(alias="isReplica")
|
33
|
+
is_replica: Optional[bool] = Field(alias="isReplica", default=None)
|
32
34
|
|
33
35
|
|
34
36
|
class OperatorServiceConfig(DeploymentService):
|
35
|
-
skip_crd: Optional[bool] = Field(alias="skipCRD")
|
37
|
+
skip_crd: Optional[bool] = Field(alias="skipCRD", default=None)
|
36
38
|
|
37
39
|
|
38
40
|
class BaseService(BaseSchemaModel):
|
39
|
-
name: Optional[StrictStr]
|
40
|
-
type: Optional[ServiceTypes]
|
41
|
-
port: Optional[StrictInt]
|
42
|
-
target_port: Optional[StrictInt] = Field(alias="targetPort")
|
43
|
-
node_port: Optional[StrictInt] = Field(alias="nodePort")
|
44
|
-
annotations: Optional[Dict]
|
41
|
+
name: Optional[StrictStr] = None
|
42
|
+
type: Optional[ServiceTypes] = None
|
43
|
+
port: Optional[StrictInt] = None
|
44
|
+
target_port: Optional[StrictInt] = Field(alias="targetPort", default=None)
|
45
|
+
node_port: Optional[StrictInt] = Field(alias="nodePort", default=None)
|
46
|
+
annotations: Optional[Dict] = None
|
45
47
|
|
46
48
|
class Config:
|
47
|
-
extra =
|
49
|
+
extra = "allow"
|
48
50
|
|
49
51
|
|
50
52
|
class ApiServiceConfig(DeploymentService):
|
51
|
-
service: Optional[BaseService]
|
53
|
+
service: Optional[BaseService] = None
|
52
54
|
|
53
55
|
|
54
56
|
class HooksConfig(DeploymentService):
|
55
|
-
load_fixtures: Optional[bool] = Field(alias="loadFixtures")
|
56
|
-
tables: Optional[bool] = Field(alias="tables")
|
57
|
-
sync_db: Optional[bool] = Field(alias="syncdb")
|
58
|
-
admin_user: Optional[bool] = Field(alias="adminUser")
|
59
|
-
default_org: Optional[bool] = Field(alias="defaultOrg")
|
57
|
+
load_fixtures: Optional[bool] = Field(alias="loadFixtures", default=None)
|
58
|
+
tables: Optional[bool] = Field(alias="tables", default=None)
|
59
|
+
sync_db: Optional[bool] = Field(alias="syncdb", default=None)
|
60
|
+
admin_user: Optional[bool] = Field(alias="adminUser", default=None)
|
61
|
+
default_org: Optional[bool] = Field(alias="defaultOrg", default=None)
|
60
62
|
|
61
63
|
|
62
64
|
class ThirdPartyService(DeploymentService):
|
63
|
-
persistence: Optional[Dict]
|
65
|
+
persistence: Optional[Dict] = None
|
64
66
|
|
65
67
|
class Config:
|
66
|
-
extra =
|
68
|
+
extra = "allow"
|
67
69
|
|
68
70
|
|
69
71
|
class PostgresqlConfig(ThirdPartyService):
|
70
|
-
auth: Optional[Dict]
|
71
|
-
conn_max_age: Optional[StrictInt] = Field(alias="connMaxAge")
|
72
|
+
auth: Optional[Dict] = None
|
73
|
+
conn_max_age: Optional[StrictInt] = Field(alias="connMaxAge", default=None)
|
72
74
|
|
73
75
|
|
74
76
|
class RedisConfig(ThirdPartyService):
|
75
|
-
image: Optional[Dict] # type: ignore[assignment]
|
76
|
-
non_broker: Optional[bool] = Field(alias="nonBroker")
|
77
|
-
use_password: Optional[bool] = Field(alias="usePassword")
|
78
|
-
auth: Optional[Dict]
|
77
|
+
image: Optional[Dict] = None # type: ignore[assignment]
|
78
|
+
non_broker: Optional[bool] = Field(alias="nonBroker", default=None)
|
79
|
+
use_password: Optional[bool] = Field(alias="usePassword", default=None)
|
80
|
+
auth: Optional[Dict] = None
|
79
81
|
|
80
82
|
|
81
83
|
class RabbitmqConfig(ThirdPartyService):
|
82
|
-
auth: Optional[Dict]
|
84
|
+
auth: Optional[Dict] = None
|
83
85
|
|
84
86
|
|
85
87
|
class ExternalService(BaseSchemaModel):
|
86
|
-
user: Optional[StrictStr]
|
87
|
-
password: Optional[StrictStr]
|
88
|
-
host: Optional[StrictStr]
|
89
|
-
port: Optional[StrictInt]
|
90
|
-
database: Optional[StrictStr]
|
91
|
-
use_password: Optional[bool] = Field(alias="usePassword")
|
92
|
-
conn_max_age: Optional[StrictInt] = Field(alias="connMaxAge")
|
93
|
-
pgbouncer: Optional[Dict]
|
94
|
-
options: Optional[Dict]
|
95
|
-
use_resolver: Optional[bool] = Field(alias="useResolver")
|
96
|
-
corporate_proxy: Optional[StrictStr] = Field(alias="corporateProxy")
|
88
|
+
user: Optional[StrictStr] = None
|
89
|
+
password: Optional[StrictStr] = None
|
90
|
+
host: Optional[StrictStr] = None
|
91
|
+
port: Optional[StrictInt] = None
|
92
|
+
database: Optional[StrictStr] = None
|
93
|
+
use_password: Optional[bool] = Field(alias="usePassword", default=None)
|
94
|
+
conn_max_age: Optional[StrictInt] = Field(alias="connMaxAge", default=None)
|
95
|
+
pgbouncer: Optional[Dict] = None
|
96
|
+
options: Optional[Dict] = None
|
97
|
+
use_resolver: Optional[bool] = Field(alias="useResolver", default=None)
|
98
|
+
corporate_proxy: Optional[StrictStr] = Field(alias="corporateProxy", default=None)
|
97
99
|
|
98
100
|
|
99
101
|
class ExternalBackend(BaseSchemaModel):
|
100
|
-
enabled: Optional[bool]
|
101
|
-
backend: Optional[StrictStr]
|
102
|
-
url: Optional[StrictStr]
|
103
|
-
options: Optional[Dict]
|
102
|
+
enabled: Optional[bool] = None
|
103
|
+
backend: Optional[StrictStr] = None
|
104
|
+
url: Optional[StrictStr] = None
|
105
|
+
options: Optional[Dict] = None
|
104
106
|
|
105
107
|
|
106
108
|
class AuthServicesConfig(BaseSchemaModel):
|
107
|
-
github: Optional[ExternalBackend]
|
108
|
-
gitlab: Optional[ExternalBackend]
|
109
|
-
bitbucket: Optional[ExternalBackend]
|
110
|
-
google: Optional[ExternalBackend]
|
111
|
-
okta: Optional[ExternalBackend]
|
112
|
-
onelogin: Optional[ExternalBackend]
|
113
|
-
azuread: Optional[ExternalBackend]
|
109
|
+
github: Optional[ExternalBackend] = None
|
110
|
+
gitlab: Optional[ExternalBackend] = None
|
111
|
+
bitbucket: Optional[ExternalBackend] = None
|
112
|
+
google: Optional[ExternalBackend] = None
|
113
|
+
okta: Optional[ExternalBackend] = None
|
114
|
+
onelogin: Optional[ExternalBackend] = None
|
115
|
+
azuread: Optional[ExternalBackend] = None
|
114
116
|
|
115
117
|
|
116
118
|
class ExternalServicesConfig(BaseSchemaModel):
|
117
|
-
redis: Optional[ExternalService]
|
118
|
-
rabbitmq: Optional[ExternalService]
|
119
|
-
postgresql: Optional[ExternalService]
|
120
|
-
gateway: Optional[ExternalService]
|
121
|
-
api: Optional[ExternalService]
|
122
|
-
transactions: Optional[ExternalBackend]
|
123
|
-
analytics: Optional[ExternalBackend]
|
124
|
-
metrics: Optional[ExternalBackend]
|
125
|
-
errors: Optional[ExternalBackend]
|
126
|
-
auth: Optional[AuthServicesConfig]
|
127
|
-
allowed_versions: Optional[List[StrictStr]] = Field(
|
119
|
+
redis: Optional[ExternalService] = None
|
120
|
+
rabbitmq: Optional[ExternalService] = None
|
121
|
+
postgresql: Optional[ExternalService] = None
|
122
|
+
gateway: Optional[ExternalService] = None
|
123
|
+
api: Optional[ExternalService] = None
|
124
|
+
transactions: Optional[ExternalBackend] = None
|
125
|
+
analytics: Optional[ExternalBackend] = None
|
126
|
+
metrics: Optional[ExternalBackend] = None
|
127
|
+
errors: Optional[ExternalBackend] = None
|
128
|
+
auth: Optional[AuthServicesConfig] = None
|
129
|
+
allowed_versions: Optional[List[StrictStr]] = Field(
|
130
|
+
alias="allowedVersions", default=None
|
131
|
+
)
|
polyaxon/_deploy/schemas/ssl.py
CHANGED
@@ -6,6 +6,6 @@ from polyaxon._schemas.base import BaseSchemaModel
|
|
6
6
|
|
7
7
|
|
8
8
|
class SSLConfig(BaseSchemaModel):
|
9
|
-
enabled: Optional[bool]
|
10
|
-
secret_name: Optional[StrictStr] = Field(alias="secretName")
|
11
|
-
path: Optional[StrictStr]
|
9
|
+
enabled: Optional[bool] = None
|
10
|
+
secret_name: Optional[StrictStr] = Field(alias="secretName", default=None)
|
11
|
+
path: Optional[StrictStr] = None
|
polyaxon/_deploy/schemas/ui.py
CHANGED
@@ -6,11 +6,13 @@ from polyaxon._schemas.base import BaseSchemaModel
|
|
6
6
|
|
7
7
|
|
8
8
|
class UIConfig(BaseSchemaModel):
|
9
|
-
enabled: Optional[bool]
|
10
|
-
offline: Optional[bool]
|
11
|
-
static_url: Optional[StrictStr] = Field(alias="staticUrl")
|
12
|
-
base_url: Optional[StrictStr] = Field(alias="baseUrl")
|
13
|
-
assets_version: Optional[StrictStr] = Field(alias="assetsVersion")
|
14
|
-
admin_enabled: Optional[bool] = Field(alias="adminEnabled")
|
15
|
-
single_url: Optional[bool] = Field(alias="singleUrl")
|
16
|
-
default_streams_url: Optional[StrictStr] = Field(
|
9
|
+
enabled: Optional[bool] = None
|
10
|
+
offline: Optional[bool] = None
|
11
|
+
static_url: Optional[StrictStr] = Field(alias="staticUrl", default=None)
|
12
|
+
base_url: Optional[StrictStr] = Field(alias="baseUrl", default=None)
|
13
|
+
assets_version: Optional[StrictStr] = Field(alias="assetsVersion", default=None)
|
14
|
+
admin_enabled: Optional[bool] = Field(alias="adminEnabled", default=None)
|
15
|
+
single_url: Optional[bool] = Field(alias="singleUrl", default=None)
|
16
|
+
default_streams_url: Optional[StrictStr] = Field(
|
17
|
+
alias="defaultStreamsUrl", default=None
|
18
|
+
)
|
@@ -120,8 +120,11 @@ class DockerBuilder(DockerMixin):
|
|
120
120
|
if not self.registries:
|
121
121
|
return
|
122
122
|
for registry in self.registries:
|
123
|
+
username = (
|
124
|
+
registry.username if hasattr(registry, "username") else registry.user
|
125
|
+
)
|
123
126
|
self.docker.login(
|
124
|
-
username=
|
127
|
+
username=username,
|
125
128
|
password=registry.password,
|
126
129
|
registry=registry.host_port,
|
127
130
|
reauth=True,
|
@@ -49,11 +49,8 @@ class ContainerMixin(BaseConverter):
|
|
49
49
|
env: List[docker_types.V1EnvVar],
|
50
50
|
) -> List[docker_types.V1EnvVar]:
|
51
51
|
def sanitize_env_dict(d: Dict):
|
52
|
-
return docker_types.V1EnvVar(
|
53
|
-
|
54
|
-
d_k: sanitize_value(d_v, handle_dict=False)
|
55
|
-
for d_k, d_v in d.items()
|
56
|
-
}
|
52
|
+
return docker_types.V1EnvVar.make(
|
53
|
+
{d_k: sanitize_value(d_v, handle_dict=False) for d_k, d_v in d.items()}
|
57
54
|
)
|
58
55
|
|
59
56
|
results = []
|
@@ -63,8 +60,8 @@ class ContainerMixin(BaseConverter):
|
|
63
60
|
results.append(e)
|
64
61
|
elif isinstance(e, tuple):
|
65
62
|
if e[1] is not None:
|
66
|
-
e = docker_types.V1EnvVar(
|
67
|
-
|
63
|
+
e = docker_types.V1EnvVar.make(
|
64
|
+
(e[0], sanitize_value(e[1], handle_dict=False))
|
68
65
|
)
|
69
66
|
results.append(e)
|
70
67
|
elif isinstance(e, docker_types.V1EnvVar):
|
@@ -42,7 +42,7 @@ class EnvMixin(BaseConverter):
|
|
42
42
|
except (ValueError, TypeError) as e:
|
43
43
|
raise PolyaxonConverterError(e)
|
44
44
|
|
45
|
-
return docker_types.V1EnvVar(
|
45
|
+
return docker_types.V1EnvVar.make((name, value))
|
46
46
|
|
47
47
|
@staticmethod
|
48
48
|
def _get_from_json_resource(
|
@@ -59,7 +59,7 @@ class EnvMixin(BaseConverter):
|
|
59
59
|
except Exception as e:
|
60
60
|
raise PolyaxonConverterError from e
|
61
61
|
|
62
|
-
return [docker_types.V1EnvVar(
|
62
|
+
return [docker_types.V1EnvVar.make(k) for k in (secret_value.items())]
|
63
63
|
|
64
64
|
@classmethod
|
65
65
|
def _get_env_from_json_resources(
|
@@ -82,10 +82,10 @@ class EnvMixin(BaseConverter):
|
|
82
82
|
try:
|
83
83
|
secret_value = orjson_loads(secret)
|
84
84
|
except orjson.JSONDecodeError:
|
85
|
-
return docker_types.V1EnvVar(
|
85
|
+
return docker_types.V1EnvVar.make((key, secret))
|
86
86
|
|
87
87
|
value = secret_value.get(key)
|
88
|
-
return docker_types.V1EnvVar(
|
88
|
+
return docker_types.V1EnvVar.make((key, value))
|
89
89
|
|
90
90
|
@classmethod
|
91
91
|
def _get_items_from_json_resource(
|
@@ -104,7 +104,7 @@ class EnvMixin(BaseConverter):
|
|
104
104
|
for item in resource.items:
|
105
105
|
value = secret_value.get(item)
|
106
106
|
if value:
|
107
|
-
items_from.append(docker_types.V1EnvVar(
|
107
|
+
items_from.append(docker_types.V1EnvVar.make((item, value)))
|
108
108
|
return items_from
|
109
109
|
|
110
110
|
@classmethod
|
@@ -14,7 +14,7 @@ class MountsMixin(BaseConverter):
|
|
14
14
|
volume = f"{host_path}:{mount_path}"
|
15
15
|
if read_only:
|
16
16
|
volume += ":ro"
|
17
|
-
return docker_types.V1VolumeMount(
|
17
|
+
return docker_types.V1VolumeMount.make(("-v", volume))
|
18
18
|
|
19
19
|
@staticmethod
|
20
20
|
def _get_docker_mount(
|
@@ -23,7 +23,7 @@ class MountsMixin(BaseConverter):
|
|
23
23
|
mount = f"type=tmpfs,destination={mount_path}"
|
24
24
|
if read_only:
|
25
25
|
mount += ",ro"
|
26
|
-
return docker_types.V1VolumeMount(
|
26
|
+
return docker_types.V1VolumeMount.make(("--mount", mount))
|
27
27
|
|
28
28
|
@classmethod
|
29
29
|
def _get_config_volume(cls) -> docker_types.V1VolumeMount:
|
polyaxon/_docker/docker_types.py
CHANGED
@@ -1,47 +1,72 @@
|
|
1
1
|
from typing import Dict, List, Optional, Tuple, Union
|
2
2
|
|
3
|
-
from clipped.compact.pydantic import
|
3
|
+
from clipped.compact.pydantic import (
|
4
|
+
PYDANTIC_VERSION,
|
5
|
+
Field,
|
6
|
+
field_validator,
|
7
|
+
validation_always,
|
8
|
+
)
|
4
9
|
from clipped.utils.units import to_cpu_value, to_memory_bytes, to_unit_memory
|
5
10
|
|
6
|
-
from polyaxon._schemas.base import BaseSchemaModel
|
11
|
+
from polyaxon._schemas.base import BaseSchemaModel, RootModel
|
7
12
|
|
8
13
|
|
9
|
-
class V1EnvVar(
|
10
|
-
|
14
|
+
class V1EnvVar(RootModel):
|
15
|
+
if PYDANTIC_VERSION.startswith("2."):
|
16
|
+
root: Union[Tuple[str, str], Dict[str, str]]
|
17
|
+
else:
|
18
|
+
__root__: Union[Tuple[str, str], Dict[str, str]]
|
11
19
|
|
12
20
|
def to_cmd(self):
|
13
|
-
|
14
|
-
value = self.__root__
|
15
|
-
else:
|
16
|
-
value = self.__root__.items()
|
21
|
+
value = self.get_root()
|
17
22
|
return [f"{value[0]}={value[1]}"]
|
18
23
|
|
19
24
|
|
20
|
-
class V1VolumeMount(
|
21
|
-
|
25
|
+
class V1VolumeMount(RootModel):
|
26
|
+
if PYDANTIC_VERSION.startswith("2."):
|
27
|
+
root: Tuple[str, str]
|
28
|
+
else:
|
29
|
+
__root__: Tuple[str, str]
|
22
30
|
|
23
31
|
def to_cmd(self):
|
24
|
-
return list(self.
|
32
|
+
return list(self.get_root())
|
33
|
+
|
25
34
|
|
35
|
+
ROOT_TYPE = Union[
|
36
|
+
int,
|
37
|
+
str,
|
38
|
+
List[Union[int, str]],
|
39
|
+
Tuple[Union[int, str], Union[int, str]],
|
40
|
+
Dict[Union[int, str], Union[Union[int, str], Union[int, str]]],
|
41
|
+
]
|
26
42
|
|
27
|
-
|
28
|
-
|
43
|
+
|
44
|
+
class V1ContainerPort(RootModel):
|
45
|
+
if PYDANTIC_VERSION.startswith("2."):
|
46
|
+
root: ROOT_TYPE
|
47
|
+
else:
|
48
|
+
__root__: ROOT_TYPE
|
29
49
|
|
30
50
|
def to_cmd(self):
|
31
|
-
|
32
|
-
|
51
|
+
root = self.get_root()
|
52
|
+
if isinstance(root, (str, int)):
|
53
|
+
return [root]
|
33
54
|
|
34
|
-
if isinstance(
|
35
|
-
value =
|
55
|
+
if isinstance(root, (list, tuple)):
|
56
|
+
value = root
|
36
57
|
else:
|
37
|
-
value =
|
58
|
+
value = root.items()
|
38
59
|
return list(value[0])
|
39
60
|
|
40
61
|
|
41
62
|
class V1ResourceRequirements(BaseSchemaModel):
|
42
|
-
cpus: Optional[str]
|
43
|
-
memory: Optional[str]
|
44
|
-
gpus: Optional[str]
|
63
|
+
cpus: Optional[Union[str, float, int]] = None
|
64
|
+
memory: Optional[Union[str, float, int]] = None
|
65
|
+
gpus: Optional[str] = None
|
66
|
+
|
67
|
+
@field_validator("cpus", "memory", **validation_always)
|
68
|
+
def value_to_str(cls, v):
|
69
|
+
return str(v)
|
45
70
|
|
46
71
|
@staticmethod
|
47
72
|
def from_k8s_cpu(cpu: str) -> Union[str, float]:
|
@@ -68,15 +93,17 @@ class V1ResourceRequirements(BaseSchemaModel):
|
|
68
93
|
|
69
94
|
|
70
95
|
class V1Container(BaseSchemaModel):
|
71
|
-
image: Optional[str]
|
72
|
-
name: Optional[str]
|
73
|
-
command: Optional[List[str]]
|
74
|
-
args: Optional[List[str]]
|
75
|
-
env: Optional[List[V1EnvVar]]
|
76
|
-
volume_mounts: Optional[List[V1VolumeMount]] = Field(
|
77
|
-
|
78
|
-
|
79
|
-
|
96
|
+
image: Optional[str] = None
|
97
|
+
name: Optional[str] = None
|
98
|
+
command: Optional[List[str]] = None
|
99
|
+
args: Optional[List[str]] = None
|
100
|
+
env: Optional[List[V1EnvVar]] = None
|
101
|
+
volume_mounts: Optional[List[V1VolumeMount]] = Field(
|
102
|
+
alias="volumeMounts", default=None
|
103
|
+
)
|
104
|
+
resources: Optional[V1ResourceRequirements] = None
|
105
|
+
ports: Optional[List[V1ContainerPort]] = None
|
106
|
+
working_dir: Optional[str] = Field(alias="workingDir", default=None)
|
80
107
|
|
81
108
|
def get_cmd_args(self):
|
82
109
|
cmd_args = ["run", "--rm"]
|
polyaxon/_flow/__init__.py
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
from clipped.compact.pydantic import model_rebuild
|
2
|
+
|
1
3
|
from polyaxon._flow.builds import V1Build
|
2
4
|
from polyaxon._flow.cache import V1Cache
|
3
5
|
from polyaxon._flow.component import V1Component
|
@@ -106,5 +108,4 @@ from polyaxon._flow.termination import V1Termination
|
|
106
108
|
from polyaxon._flow.trigger_policies import V1TriggerPolicy
|
107
109
|
|
108
110
|
# Forward references for operations and components
|
109
|
-
V1Dag
|
110
|
-
V1Dag.update_forward_refs(V1Component=V1Component)
|
111
|
+
model_rebuild(V1Dag, V1Operation=V1Operation, V1Component=V1Component)
|
@@ -222,13 +222,13 @@ class V1Build(BaseSchemaModel):
|
|
222
222
|
|
223
223
|
_IDENTIFIER = "build"
|
224
224
|
hub_ref: StrictStr = Field(alias="hubRef")
|
225
|
-
connection: Optional[StrictStr]
|
226
|
-
presets: Optional[Union[List[StrictStr], RefField]]
|
227
|
-
queue: Optional[StrictStr]
|
228
|
-
namespace: Optional[StrictStr]
|
229
|
-
cache: Optional[Union[V1Cache, RefField]]
|
230
|
-
params: Optional[Dict[str, Union[V1Param, RefField]]]
|
231
|
-
run_patch: Optional[Dict[str, Any]] = Field(alias="runPatch")
|
225
|
+
connection: Optional[StrictStr] = None
|
226
|
+
presets: Optional[Union[List[StrictStr], RefField]] = None
|
227
|
+
queue: Optional[StrictStr] = None
|
228
|
+
namespace: Optional[StrictStr] = None
|
229
|
+
cache: Optional[Union[V1Cache, RefField]] = None
|
230
|
+
params: Optional[Dict[str, Union[V1Param, RefField]]] = None
|
231
|
+
run_patch: Optional[Dict[str, Any]] = Field(alias="runPatch", default=None)
|
232
232
|
patch_strategy: Optional[Union[PatchStrategy, RefField]] = Field(
|
233
|
-
alias="patchStrategy"
|
233
|
+
alias="patchStrategy", default=None
|
234
234
|
)
|
polyaxon/_flow/cache/__init__.py
CHANGED
@@ -99,7 +99,7 @@ class V1Cache(BaseSchemaModel):
|
|
99
99
|
|
100
100
|
_IDENTIFIER = "cache"
|
101
101
|
|
102
|
-
disable: Optional[BoolOrRef]
|
103
|
-
ttl: Optional[IntOrRef]
|
104
|
-
io: Optional[Union[List[StrictStr], RefField]]
|
105
|
-
sections: Optional[Union[List[CacheSection], RefField]]
|
102
|
+
disable: Optional[BoolOrRef] = None
|
103
|
+
ttl: Optional[IntOrRef] = None
|
104
|
+
io: Optional[Union[List[StrictStr], RefField]] = None
|
105
|
+
sections: Optional[Union[List[CacheSection], RefField]] = None
|
polyaxon/_flow/component/base.py
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
from typing import List, Optional, Union
|
2
2
|
|
3
|
-
from clipped.compact.pydantic import
|
3
|
+
from clipped.compact.pydantic import (
|
4
|
+
NAME_REGEX,
|
5
|
+
Field,
|
6
|
+
StrictStr,
|
7
|
+
field_validator,
|
8
|
+
patter_constr,
|
9
|
+
validation_before,
|
10
|
+
)
|
4
11
|
from clipped.types.ref_or_obj import BoolOrRef, FloatOrRef, RefField
|
5
12
|
from clipped.utils.lists import to_list
|
6
13
|
|
@@ -9,27 +16,27 @@ from polyaxon._flow.cache import V1Cache
|
|
9
16
|
from polyaxon._flow.hooks import V1Hook
|
10
17
|
from polyaxon._flow.plugins import V1Plugins
|
11
18
|
from polyaxon._flow.termination import V1Termination
|
12
|
-
from polyaxon._schemas.base import
|
19
|
+
from polyaxon._schemas.base import BaseSchemaModel
|
13
20
|
|
14
21
|
|
15
22
|
class BaseComponent(BaseSchemaModel):
|
16
|
-
version: Optional[float]
|
17
|
-
kind: Optional[StrictStr]
|
18
|
-
name: Optional[Union[
|
19
|
-
description: Optional[StrictStr]
|
20
|
-
tags: Optional[List[StrictStr]]
|
21
|
-
presets: Optional[List[StrictStr]]
|
22
|
-
queue: Optional[StrictStr]
|
23
|
-
namespace: Optional[StrictStr]
|
24
|
-
cache: Optional[Union[V1Cache, RefField]]
|
25
|
-
termination: Optional[Union[V1Termination, RefField]]
|
26
|
-
plugins: Optional[Union[V1Plugins, RefField]]
|
27
|
-
build: Optional[Union[V1Build, RefField]]
|
28
|
-
hooks: Optional[Union[List[V1Hook], RefField]]
|
29
|
-
is_approved: Optional[BoolOrRef] = Field(alias="isApproved")
|
30
|
-
cost: Optional[FloatOrRef]
|
23
|
+
version: Optional[float] = None
|
24
|
+
kind: Optional[StrictStr] = None
|
25
|
+
name: Optional[Union[patter_constr(pattern=NAME_REGEX), RefField]] = None
|
26
|
+
description: Optional[StrictStr] = None
|
27
|
+
tags: Optional[List[StrictStr]] = None
|
28
|
+
presets: Optional[List[StrictStr]] = None
|
29
|
+
queue: Optional[StrictStr] = None
|
30
|
+
namespace: Optional[StrictStr] = None
|
31
|
+
cache: Optional[Union[V1Cache, RefField]] = None
|
32
|
+
termination: Optional[Union[V1Termination, RefField]] = None
|
33
|
+
plugins: Optional[Union[V1Plugins, RefField]] = None
|
34
|
+
build: Optional[Union[V1Build, RefField]] = None
|
35
|
+
hooks: Optional[Union[List[V1Hook], RefField]] = None
|
36
|
+
is_approved: Optional[BoolOrRef] = Field(alias="isApproved", default=None)
|
37
|
+
cost: Optional[FloatOrRef] = None
|
31
38
|
|
32
|
-
@
|
39
|
+
@field_validator("tags", "presets", **validation_before)
|
33
40
|
def validate_str_list(cls, v):
|
34
41
|
if isinstance(v, str):
|
35
42
|
return to_list(v, check_str=True)
|
@@ -375,12 +375,13 @@ class V1Component(
|
|
375
375
|
"""
|
376
376
|
|
377
377
|
_IDENTIFIER = "component"
|
378
|
+
_CUSTOM_DUMP_FIELDS = {"run"}
|
378
379
|
|
379
380
|
kind: Literal[_IDENTIFIER] = _IDENTIFIER
|
380
|
-
inputs: Optional[List[V1IO]]
|
381
|
-
outputs: Optional[List[V1IO]]
|
381
|
+
inputs: Optional[List[V1IO]] = None
|
382
|
+
outputs: Optional[List[V1IO]] = None
|
382
383
|
run: Union[V1Runtime]
|
383
|
-
template: Optional[V1Template]
|
384
|
+
template: Optional[V1Template] = None
|
384
385
|
|
385
386
|
def get_run_kind(self):
|
386
387
|
return self.run.kind if self.run else None
|