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.
- polyaxon/_auxiliaries/default_scheduling.py +17 -7
- polyaxon/_auxiliaries/init.py +14 -6
- polyaxon/_auxiliaries/sidecar.py +10 -8
- polyaxon/_cli/artifacts.py +96 -11
- polyaxon/_cli/components.py +96 -11
- polyaxon/_cli/config.py +31 -0
- polyaxon/_cli/dashboard.py +12 -2
- polyaxon/_cli/init.py +1 -1
- polyaxon/_cli/models.py +96 -11
- polyaxon/_cli/operations.py +133 -58
- polyaxon/_cli/project_versions.py +139 -6
- polyaxon/_cli/projects.py +23 -9
- polyaxon/_cli/run.py +43 -9
- polyaxon/_cli/services/agent.py +2 -2
- polyaxon/_cli/version.py +4 -1
- polyaxon/_client/mixin.py +39 -0
- polyaxon/_client/project.py +218 -23
- polyaxon/_client/run.py +84 -27
- polyaxon/_compiler/contexts/contexts.py +4 -0
- polyaxon/_compiler/contexts/ray_job.py +4 -2
- polyaxon/_compiler/resolver/agent.py +22 -10
- polyaxon/_compiler/resolver/runtime.py +7 -3
- polyaxon/_constants/metadata.py +1 -0
- polyaxon/_contexts/keys.py +1 -0
- polyaxon/_contexts/paths.py +1 -1
- polyaxon/_deploy/operators/compose.py +1 -27
- 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 +2 -7
- polyaxon/_deploy/schemas/operators.py +8 -8
- polyaxon/_deploy/schemas/proxy.py +9 -8
- 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 +75 -66
- polyaxon/_deploy/schemas/ssl.py +3 -3
- polyaxon/_deploy/schemas/ui.py +10 -6
- 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/_env_vars/getters/owner_entity.py +4 -2
- polyaxon/_env_vars/getters/project.py +4 -2
- polyaxon/_env_vars/getters/run.py +5 -2
- polyaxon/_env_vars/keys.py +3 -0
- 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 +43 -25
- polyaxon/_flow/events/__init__.py +1 -1
- polyaxon/_flow/hooks/__init__.py +11 -11
- polyaxon/_flow/init/__init__.py +41 -25
- polyaxon/_flow/io/io.py +57 -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 +57 -41
- polyaxon/_flow/optimization/__init__.py +2 -2
- polyaxon/_flow/params/params.py +10 -9
- 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/async_manager.py +1 -1
- polyaxon/_fs/fs.py +1 -1
- polyaxon/_fs/watcher.py +26 -27
- polyaxon/_k8s/converter/base/base.py +2 -1
- polyaxon/_k8s/converter/base/main.py +1 -0
- polyaxon/_k8s/converter/common/accelerators.py +7 -4
- polyaxon/_k8s/converter/converters/ray_job.py +4 -2
- polyaxon/_k8s/custom_resources/dask_job.py +3 -0
- polyaxon/_k8s/custom_resources/kubeflow/common.py +4 -1
- polyaxon/_k8s/custom_resources/ray_job.py +3 -0
- polyaxon/_k8s/custom_resources/setter.py +1 -1
- polyaxon/_k8s/executor/async_executor.py +2 -0
- polyaxon/_k8s/k8s_validation.py +1 -1
- polyaxon/_k8s/logging/async_monitor.py +82 -11
- polyaxon/_k8s/manager/async_manager.py +15 -0
- polyaxon/_k8s/manager/manager.py +16 -1
- polyaxon/_local_process/__init__.py +0 -0
- polyaxon/_local_process/agent.py +6 -0
- polyaxon/_local_process/converter/__init__.py +1 -0
- polyaxon/_local_process/converter/base/__init__.py +1 -0
- polyaxon/_local_process/converter/base/base.py +140 -0
- polyaxon/_local_process/converter/base/containers.py +66 -0
- polyaxon/_local_process/converter/base/env_vars.py +253 -0
- polyaxon/_local_process/converter/base/init.py +414 -0
- polyaxon/_local_process/converter/base/main.py +74 -0
- polyaxon/_local_process/converter/base/mounts.py +82 -0
- polyaxon/_local_process/converter/converters/__init__.py +8 -0
- polyaxon/_local_process/converter/converters/job.py +40 -0
- polyaxon/_local_process/converter/converters/service.py +41 -0
- polyaxon/_local_process/converter/mixins.py +38 -0
- polyaxon/_local_process/executor.py +132 -0
- polyaxon/_local_process/process_types.py +42 -0
- polyaxon/_polyaxonfile/specs/compiled_operation.py +1 -1
- polyaxon/_polyaxonfile/specs/libs/parser.py +1 -1
- polyaxon/_polyaxonfile/specs/libs/validator.py +1 -1
- polyaxon/_polyaxonfile/specs/operation.py +1 -1
- polyaxon/_polyaxonfile/specs/sections.py +8 -0
- polyaxon/_pql/manager.py +1 -1
- polyaxon/_runner/agent/async_agent.py +25 -11
- polyaxon/_runner/agent/base_agent.py +19 -10
- polyaxon/_runner/agent/sync_agent.py +24 -10
- polyaxon/_runner/converter/converter.py +12 -4
- polyaxon/_runner/executor.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 +13 -9
- polyaxon/_schemas/lifecycle.py +23 -23
- 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 +222 -43
- 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 +85 -85
- polyaxon/_sdk/api/presets_v1_api.py +15 -15
- polyaxon/_sdk/api/project_dashboards_v1_api.py +29 -29
- polyaxon/_sdk/api/project_searches_v1_api.py +29 -29
- polyaxon/_sdk/api/projects_v1_api.py +284 -107
- polyaxon/_sdk/api/queues_v1_api.py +19 -19
- polyaxon/_sdk/api/runs_v1_api.py +313 -359
- polyaxon/_sdk/api/searches_v1_api.py +15 -15
- polyaxon/_sdk/api/service_accounts_v1_api.py +31 -31
- polyaxon/_sdk/api/tags_v1_api.py +17 -17
- polyaxon/_sdk/api/teams_v1_api.py +2854 -402
- polyaxon/_sdk/api/users_v1_api.py +254 -78
- polyaxon/_sdk/api/versions_v1_api.py +7 -7
- polyaxon/_sdk/async_client/api_client.py +4 -0
- polyaxon/_sdk/schemas/__init__.py +1 -1
- polyaxon/_sdk/schemas/v1_activity.py +8 -8
- polyaxon/_sdk/schemas/v1_agent.py +18 -16
- 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 -1
- 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 +16 -9
- polyaxon/_sdk/schemas/v1_project.py +17 -17
- polyaxon/_sdk/schemas/v1_project_settings.py +12 -10
- 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 -7
- polyaxon/_sdk/schemas/v1_service_account.py +9 -9
- polyaxon/_sdk/schemas/v1_settings_catalog.py +4 -3
- polyaxon/_sdk/schemas/v1_tag.py +6 -6
- polyaxon/_sdk/schemas/v1_team.py +11 -8
- 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 -7
- polyaxon/_sdk/schemas/v1_user_access.py +17 -0
- 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/_sidecar/container/__init__.py +39 -20
- polyaxon/_sidecar/container/monitors/logs.py +10 -13
- polyaxon/_sidecar/ignore.py +0 -1
- polyaxon/_utils/cli_constants.py +2 -0
- polyaxon/_utils/fqn_utils.py +25 -2
- polyaxon/_utils/test_utils.py +2 -1
- polyaxon/pkg.py +1 -1
- polyaxon/schemas.py +1 -1
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/METADATA +43 -43
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/RECORD +269 -252
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/WHEEL +1 -1
- polyaxon/_sdk/schemas/v1_project_user_access.py +0 -10
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/LICENSE +0 -0
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/entry_points.txt +0 -0
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/top_level.txt +0 -0
@@ -4,11 +4,11 @@ from polyaxon._schemas.base import BaseSchemaModel
|
|
4
4
|
|
5
5
|
|
6
6
|
class OperatorsConfig(BaseSchemaModel):
|
7
|
-
tfjob: Optional[bool]
|
8
|
-
pytorchjob: Optional[bool]
|
9
|
-
paddlejob: Optional[bool]
|
10
|
-
mpijob: Optional[bool]
|
11
|
-
mxjob: Optional[bool]
|
12
|
-
xgbjob: Optional[bool]
|
13
|
-
daskjob: Optional[bool]
|
14
|
-
rayjob: Optional[bool]
|
7
|
+
tfjob: Optional[bool] = None
|
8
|
+
pytorchjob: Optional[bool] = None
|
9
|
+
paddlejob: Optional[bool] = None
|
10
|
+
mpijob: Optional[bool] = None
|
11
|
+
mxjob: Optional[bool] = None
|
12
|
+
xgbjob: Optional[bool] = None
|
13
|
+
daskjob: Optional[bool] = None
|
14
|
+
rayjob: Optional[bool] = None
|
@@ -6,11 +6,12 @@ from polyaxon._schemas.base import BaseSchemaModel
|
|
6
6
|
|
7
7
|
|
8
8
|
class ProxyConfig(BaseSchemaModel):
|
9
|
-
enabled: Optional[bool]
|
10
|
-
use_in_ops: Optional[bool] = Field(alias="useInOps")
|
11
|
-
http_proxy: Optional[StrictStr] = Field(alias="httpProxy")
|
12
|
-
https_proxy: Optional[StrictStr] = Field(alias="httpsProxy")
|
13
|
-
no_proxy: Optional[StrictStr] = Field(alias="noProxy")
|
14
|
-
port: Optional[StrictInt]
|
15
|
-
host: Optional[StrictStr]
|
16
|
-
|
9
|
+
enabled: Optional[bool] = None
|
10
|
+
use_in_ops: Optional[bool] = Field(alias="useInOps", default=None)
|
11
|
+
http_proxy: Optional[StrictStr] = Field(alias="httpProxy", default=None)
|
12
|
+
https_proxy: Optional[StrictStr] = Field(alias="httpsProxy", default=None)
|
13
|
+
no_proxy: Optional[StrictStr] = Field(alias="noProxy", default=None)
|
14
|
+
port: Optional[StrictInt] = None
|
15
|
+
host: Optional[StrictStr] = None
|
16
|
+
protocol: Optional[StrictStr] = None
|
17
|
+
kind: Optional[StrictStr] = None
|
polyaxon/_deploy/schemas/rbac.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
from typing import Optional
|
2
2
|
|
3
|
-
from clipped.compact.pydantic import StrictStr,
|
3
|
+
from clipped.compact.pydantic import NAME_REGEX, StrictStr, patter_constr
|
4
4
|
from clipped.types.email import EmailStr
|
5
5
|
|
6
|
-
from polyaxon._schemas.base import
|
6
|
+
from polyaxon._schemas.base import BaseSchemaModel
|
7
7
|
|
8
8
|
|
9
9
|
class RootUserConfig(BaseSchemaModel):
|
10
|
-
username: Optional[
|
11
|
-
password: Optional[StrictStr]
|
12
|
-
email: Optional[EmailStr]
|
10
|
+
username: Optional[patter_constr(pattern=NAME_REGEX)] = None # type: ignore[valid-type]
|
11
|
+
password: Optional[StrictStr] = None
|
12
|
+
email: Optional[EmailStr] = None
|
@@ -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,114 +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(
|
28
|
-
|
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
|
+
)
|
30
|
+
service_account_annotations: Optional[Dict] = Field(
|
31
|
+
alias="serviceAccountAnnotations", default=None
|
32
|
+
)
|
33
|
+
is_replica: Optional[bool] = Field(alias="isReplica", default=None)
|
29
34
|
|
30
35
|
|
31
36
|
class OperatorServiceConfig(DeploymentService):
|
32
|
-
skip_crd: Optional[bool] = Field(alias="skipCRD")
|
37
|
+
skip_crd: Optional[bool] = Field(alias="skipCRD", default=None)
|
33
38
|
|
34
39
|
|
35
40
|
class BaseService(BaseSchemaModel):
|
36
|
-
name: Optional[StrictStr]
|
37
|
-
type: Optional[ServiceTypes]
|
38
|
-
port: Optional[StrictInt]
|
39
|
-
target_port: Optional[StrictInt] = Field(alias="targetPort")
|
40
|
-
node_port: Optional[StrictInt] = Field(alias="nodePort")
|
41
|
-
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
|
42
47
|
|
43
48
|
class Config:
|
44
|
-
extra =
|
49
|
+
extra = "allow"
|
45
50
|
|
46
51
|
|
47
52
|
class ApiServiceConfig(DeploymentService):
|
48
|
-
service: Optional[BaseService]
|
53
|
+
service: Optional[BaseService] = None
|
49
54
|
|
50
55
|
|
51
56
|
class HooksConfig(DeploymentService):
|
52
|
-
load_fixtures: Optional[bool] = Field(alias="loadFixtures")
|
53
|
-
tables: Optional[bool] = Field(alias="tables")
|
54
|
-
sync_db: Optional[bool] = Field(alias="syncdb")
|
55
|
-
admin_user: Optional[bool] = Field(alias="adminUser")
|
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)
|
56
62
|
|
57
63
|
|
58
64
|
class ThirdPartyService(DeploymentService):
|
59
|
-
persistence: Optional[Dict]
|
65
|
+
persistence: Optional[Dict] = None
|
60
66
|
|
61
67
|
class Config:
|
62
|
-
extra =
|
68
|
+
extra = "allow"
|
63
69
|
|
64
70
|
|
65
71
|
class PostgresqlConfig(ThirdPartyService):
|
66
|
-
auth: Optional[Dict]
|
67
|
-
conn_max_age: Optional[StrictInt] = Field(alias="connMaxAge")
|
72
|
+
auth: Optional[Dict] = None
|
73
|
+
conn_max_age: Optional[StrictInt] = Field(alias="connMaxAge", default=None)
|
68
74
|
|
69
75
|
|
70
76
|
class RedisConfig(ThirdPartyService):
|
71
|
-
image: Optional[Dict] # type: ignore[assignment]
|
72
|
-
non_broker: Optional[bool] = Field(alias="nonBroker")
|
73
|
-
use_password: Optional[bool] = Field(alias="usePassword")
|
74
|
-
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
|
75
81
|
|
76
82
|
|
77
83
|
class RabbitmqConfig(ThirdPartyService):
|
78
|
-
auth: Optional[Dict]
|
84
|
+
auth: Optional[Dict] = None
|
79
85
|
|
80
86
|
|
81
87
|
class ExternalService(BaseSchemaModel):
|
82
|
-
user: Optional[StrictStr]
|
83
|
-
password: Optional[StrictStr]
|
84
|
-
host: Optional[StrictStr]
|
85
|
-
port: Optional[StrictInt]
|
86
|
-
database: Optional[StrictStr]
|
87
|
-
use_password: Optional[bool] = Field(alias="usePassword")
|
88
|
-
conn_max_age: Optional[StrictInt] = Field(alias="connMaxAge")
|
89
|
-
pgbouncer: Optional[Dict]
|
90
|
-
options: Optional[Dict]
|
91
|
-
use_resolver: Optional[bool] = Field(alias="useResolver")
|
92
|
-
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)
|
93
99
|
|
94
100
|
|
95
101
|
class ExternalBackend(BaseSchemaModel):
|
96
|
-
enabled: Optional[bool]
|
97
|
-
backend: Optional[StrictStr]
|
98
|
-
|
102
|
+
enabled: Optional[bool] = None
|
103
|
+
backend: Optional[StrictStr] = None
|
104
|
+
url: Optional[StrictStr] = None
|
105
|
+
options: Optional[Dict] = None
|
99
106
|
|
100
107
|
|
101
108
|
class AuthServicesConfig(BaseSchemaModel):
|
102
|
-
github: Optional[ExternalBackend]
|
103
|
-
gitlab: Optional[ExternalBackend]
|
104
|
-
bitbucket: Optional[ExternalBackend]
|
105
|
-
google: Optional[ExternalBackend]
|
106
|
-
okta: Optional[ExternalBackend]
|
107
|
-
onelogin: Optional[ExternalBackend]
|
108
|
-
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
|
109
116
|
|
110
117
|
|
111
118
|
class ExternalServicesConfig(BaseSchemaModel):
|
112
|
-
redis: Optional[ExternalService]
|
113
|
-
rabbitmq: Optional[ExternalService]
|
114
|
-
postgresql: Optional[ExternalService]
|
115
|
-
gateway: Optional[ExternalService]
|
116
|
-
api: Optional[ExternalService]
|
117
|
-
transactions: Optional[ExternalBackend]
|
118
|
-
analytics: Optional[ExternalBackend]
|
119
|
-
metrics: Optional[ExternalBackend]
|
120
|
-
errors: Optional[ExternalBackend]
|
121
|
-
auth: Optional[AuthServicesConfig]
|
122
|
-
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,9 +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")
|
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"]
|
@@ -5,7 +5,7 @@ from clipped.utils.strings import validate_slug
|
|
5
5
|
|
6
6
|
from polyaxon._constants.globals import DEFAULT
|
7
7
|
from polyaxon._env_vars.getters.user import get_local_owner
|
8
|
-
from polyaxon._utils.fqn_utils import get_entity_info
|
8
|
+
from polyaxon._utils.fqn_utils import get_entity_info, split_owner_team_space
|
9
9
|
from polyaxon.exceptions import PolyaxonClientException, PolyaxonSchemaError
|
10
10
|
|
11
11
|
|
@@ -31,6 +31,8 @@ def resolve_entity_info(entity: str, entity_name: str, is_cli: bool = False):
|
|
31
31
|
if not owner:
|
32
32
|
owner = settings.AUTH_CONFIG.username if settings.AUTH_CONFIG else None
|
33
33
|
|
34
|
+
owner, team = split_owner_team_space(owner)
|
35
|
+
|
34
36
|
if not all([owner, entity_value]):
|
35
37
|
message = "Please provide a valid {}.".format(entity_name)
|
36
38
|
if is_cli:
|
@@ -49,4 +51,4 @@ def resolve_entity_info(entity: str, entity_name: str, is_cli: bool = False):
|
|
49
51
|
entity_name, entity_value
|
50
52
|
)
|
51
53
|
)
|
52
|
-
return owner, entity_value
|
54
|
+
return owner, team, entity_value
|
@@ -7,7 +7,7 @@ from polyaxon._constants.globals import DEFAULT
|
|
7
7
|
from polyaxon._env_vars.getters.user import get_local_owner
|
8
8
|
from polyaxon._managers.project import ProjectConfigManager
|
9
9
|
from polyaxon._utils.cache import get_local_project
|
10
|
-
from polyaxon._utils.fqn_utils import get_entity_info
|
10
|
+
from polyaxon._utils.fqn_utils import get_entity_info, split_owner_team_space
|
11
11
|
from polyaxon.exceptions import PolyaxonClientException, PolyaxonSchemaError
|
12
12
|
|
13
13
|
|
@@ -52,6 +52,8 @@ def get_project_or_local(project=None, is_cli: bool = False):
|
|
52
52
|
if not owner and (not settings.CLI_CONFIG or settings.CLI_CONFIG.is_community):
|
53
53
|
owner = DEFAULT
|
54
54
|
|
55
|
+
owner, team = split_owner_team_space(owner)
|
56
|
+
|
55
57
|
if not all([owner, project_name]):
|
56
58
|
error_message = get_project_error_message(owner, project_name)
|
57
59
|
if is_cli:
|
@@ -79,4 +81,4 @@ def get_project_or_local(project=None, is_cli: bool = False):
|
|
79
81
|
sys.exit(1)
|
80
82
|
else:
|
81
83
|
raise PolyaxonSchemaError(error_message)
|
82
|
-
return owner, project_name
|
84
|
+
return owner, team, project_name
|
@@ -37,9 +37,9 @@ def get_run_or_local(run_uuid=None, is_cli: bool = False):
|
|
37
37
|
|
38
38
|
|
39
39
|
def get_project_run_or_local(project=None, run_uuid=None, is_cli: bool = True):
|
40
|
-
|
40
|
+
owner, team, project_name = get_project_or_local(project, is_cli=is_cli)
|
41
41
|
run_uuid = get_run_or_local(run_uuid, is_cli=is_cli)
|
42
|
-
return
|
42
|
+
return owner, team, project_name, run_uuid
|
43
43
|
|
44
44
|
|
45
45
|
def get_collect_artifacts(arg: Optional[bool] = None, default: Optional[bool] = None):
|
@@ -74,7 +74,10 @@ def get_run_info(run_instance: Optional[str] = None):
|
|
74
74
|
"Could not get run info, "
|
75
75
|
"please make sure this is run is correctly started by Polyaxon."
|
76
76
|
)
|
77
|
+
return get_run_info_from_instance(run_instance)
|
77
78
|
|
79
|
+
|
80
|
+
def get_run_info_from_instance(run_instance: str):
|
78
81
|
parts = run_instance.split(".")
|
79
82
|
if not len(parts) == 4:
|
80
83
|
raise PolyaxonClientException(
|
polyaxon/_env_vars/keys.py
CHANGED
@@ -141,6 +141,7 @@ ENV_KEYS_PROXY_AUTH_USE_RESOLVER = "POLYAXON_PROXY_AUTH_USE_RESOLVER"
|
|
141
141
|
ENV_KEYS_PROXY_HAS_FORWARD_PROXY = "POLYAXON_PROXY_HAS_FORWARD_PROXY"
|
142
142
|
ENV_KEYS_PROXY_FORWARD_PROXY_PORT = "POLYAXON_PROXY_FORWARD_PROXY_PORT"
|
143
143
|
ENV_KEYS_PROXY_FORWARD_PROXY_HOST = "POLYAXON_PROXY_FORWARD_PROXY_HOST"
|
144
|
+
ENV_KEYS_PROXY_FORWARD_PROXY_PROTOCOL = "POLYAXON_PROXY_FORWARD_PROXY_PROTOCOL"
|
144
145
|
ENV_KEYS_PROXY_FORWARD_PROXY_KIND = "POLYAXON_PROXY_FORWARD_PROXY_KIND"
|
145
146
|
ENV_KEYS_UI_IN_SANDBOX = "POLYAXON_UI_IN_SANDBOX"
|
146
147
|
ENV_KEYS_UI_ADMIN_ENABLED = "POLYAXON_UI_ADMIN_ENABLED"
|
@@ -148,6 +149,8 @@ ENV_KEYS_UI_ASSETS_VERSION = "POLYAXON_UI_ASSETS_VERSION"
|
|
148
149
|
ENV_KEYS_UI_ENABLED = "POLYAXON_UI_ENABLED"
|
149
150
|
ENV_KEYS_UI_OFFLINE = "POLYAXON_UI_OFFLINE"
|
150
151
|
ENV_KEYS_UI_BASE_URL = "POLYAXON_UI_BASE_URL"
|
152
|
+
ENV_KEYS_UI_SINGLE_URL = "POLYAXON_UI_SINGLE_URL"
|
153
|
+
ENV_KEYS_UI_DEFAULT_STREAMS_URL = "POLYAXON_UI_DEFAULT_STREAMS_URL"
|
151
154
|
ENV_KEYS_STATIC_URL = "POLYAXON_STATIC_URL"
|
152
155
|
ENV_KEYS_DNS_USE_RESOLVER = "POLYAXON_DNS_USE_RESOLVER"
|
153
156
|
ENV_KEYS_DNS_CUSTOM_CLUSTER = "POLYAXON_DNS_CUSTOM_CLUSTER"
|