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
polyaxon/_cli/models.py
CHANGED
@@ -11,6 +11,7 @@ from polyaxon._cli.project_versions import (
|
|
11
11
|
list_project_versions,
|
12
12
|
open_project_version_dashboard,
|
13
13
|
pull_one_or_many_project_versions,
|
14
|
+
push_one_or_many_project_versions,
|
14
15
|
register_project_version,
|
15
16
|
stage_project_version,
|
16
17
|
transfer_project_version,
|
@@ -68,7 +69,7 @@ def ls(ctx, project, query, sort, limit, offset):
|
|
68
69
|
\b
|
69
70
|
$ polyaxon models ls -p=acme/project-name
|
70
71
|
"""
|
71
|
-
owner, project_name = get_project_or_local(
|
72
|
+
owner, _, project_name = get_project_or_local(
|
72
73
|
project or ctx.obj.get("project"), is_cli=True
|
73
74
|
)
|
74
75
|
|
@@ -142,11 +143,12 @@ def register(
|
|
142
143
|
$ polyaxon models register -p owner/name -ver v1 --tags="tag1,tag2"
|
143
144
|
"""
|
144
145
|
version = version or ctx.obj.get("version")
|
145
|
-
owner, project_name = get_project_or_local(
|
146
|
+
owner, team, project_name = get_project_or_local(
|
146
147
|
project or ctx.obj.get("project"), is_cli=True
|
147
148
|
)
|
148
149
|
register_project_version(
|
149
150
|
owner=owner,
|
151
|
+
team=team,
|
150
152
|
project_name=project_name,
|
151
153
|
version=version,
|
152
154
|
kind=V1ProjectVersionKind.MODEL,
|
@@ -224,11 +226,12 @@ def copy(
|
|
224
226
|
$ polyaxon models copy -p owner/name -ver v1 --tags="tag1,tag2" --name new-v1
|
225
227
|
"""
|
226
228
|
version = version or ctx.obj.get("version")
|
227
|
-
owner, project_name = get_project_or_local(
|
229
|
+
owner, team, project_name = get_project_or_local(
|
228
230
|
project or ctx.obj.get("project"), is_cli=True
|
229
231
|
)
|
230
232
|
copy_project_version(
|
231
233
|
owner=owner,
|
234
|
+
team=team,
|
232
235
|
project_name=project_name,
|
233
236
|
version=version,
|
234
237
|
kind=V1ProjectVersionKind.MODEL,
|
@@ -261,11 +264,12 @@ def get(ctx, project, version):
|
|
261
264
|
$ polyaxon models get -p owner/my-project -ver rc12
|
262
265
|
"""
|
263
266
|
version = version or ctx.obj.get("version") or "latest"
|
264
|
-
owner, project_name = get_project_or_local(
|
267
|
+
owner, team, project_name = get_project_or_local(
|
265
268
|
project or ctx.obj.get("project"), is_cli=True
|
266
269
|
)
|
267
270
|
get_project_version(
|
268
271
|
owner=owner,
|
272
|
+
team=team,
|
269
273
|
project_name=project_name,
|
270
274
|
kind=V1ProjectVersionKind.MODEL,
|
271
275
|
version=version,
|
@@ -292,7 +296,7 @@ def stages(ctx, project, version):
|
|
292
296
|
$ polyaxon models stages -p owner/my-project -ver rc12
|
293
297
|
"""
|
294
298
|
version = version or ctx.obj.get("version") or "latest"
|
295
|
-
owner, project_name = get_project_or_local(
|
299
|
+
owner, _, project_name = get_project_or_local(
|
296
300
|
project or ctx.obj.get("project"), is_cli=True
|
297
301
|
)
|
298
302
|
get_project_version_stages(
|
@@ -331,7 +335,7 @@ def delete(ctx, project, version, yes):
|
|
331
335
|
$ polyaxon models get -p owner/my-project -ver rc12
|
332
336
|
"""
|
333
337
|
version = version or ctx.obj.get("version") or "latest"
|
334
|
-
owner, project_name = get_project_or_local(
|
338
|
+
owner, _, project_name = get_project_or_local(
|
335
339
|
project or ctx.obj.get("project"), is_cli=True
|
336
340
|
)
|
337
341
|
delete_project_version(
|
@@ -374,7 +378,7 @@ def update(ctx, project, version, name, description, tags):
|
|
374
378
|
$ polyaxon models update --tags="foo, bar"
|
375
379
|
"""
|
376
380
|
version = version or ctx.obj.get("version") or "latest"
|
377
|
-
owner, project_name = get_project_or_local(
|
381
|
+
owner, _, project_name = get_project_or_local(
|
378
382
|
project or ctx.obj.get("project"), is_cli=True
|
379
383
|
)
|
380
384
|
update_project_version(
|
@@ -422,7 +426,7 @@ def stage(ctx, project, version, to, reason, message):
|
|
422
426
|
$ polyaxon models stage -p acme/foobar -ver rc12 --to=staging --reason GithubAction --message="Use carefully!"
|
423
427
|
"""
|
424
428
|
version = version or ctx.obj.get("version") or "latest"
|
425
|
-
owner, project_name = get_project_or_local(
|
429
|
+
owner, _, project_name = get_project_or_local(
|
426
430
|
project or ctx.obj.get("project"), is_cli=True
|
427
431
|
)
|
428
432
|
stage_project_version(
|
@@ -460,7 +464,7 @@ def transfer(ctx, project, version, to_project):
|
|
460
464
|
$ polyaxon models transfer -p acme/foobar -ver rc12 --to-project=dest-project
|
461
465
|
"""
|
462
466
|
version = version or ctx.obj.get("version") or "latest"
|
463
|
-
owner, project_name = get_project_or_local(
|
467
|
+
owner, _, project_name = get_project_or_local(
|
464
468
|
project or ctx.obj.get("project"), is_cli=True
|
465
469
|
)
|
466
470
|
transfer_project_version(
|
@@ -529,7 +533,7 @@ def pull(
|
|
529
533
|
\b
|
530
534
|
$ polyaxon models pull -p acme/foobar -a --path /tmp/versions
|
531
535
|
"""
|
532
|
-
owner, project_name = get_project_or_local(
|
536
|
+
owner, _, project_name = get_project_or_local(
|
533
537
|
project or ctx.obj.get("project"), is_cli=True
|
534
538
|
)
|
535
539
|
pull_one_or_many_project_versions(
|
@@ -546,6 +550,86 @@ def pull(
|
|
546
550
|
)
|
547
551
|
|
548
552
|
|
553
|
+
@models.command()
|
554
|
+
@click.option(*OPTIONS_PROJECT["args"], **OPTIONS_PROJECT["kwargs"])
|
555
|
+
@click.option(*OPTIONS_MODEL_VERSION["args"], **OPTIONS_MODEL_VERSION["kwargs"])
|
556
|
+
@click.option(
|
557
|
+
"--all-versions",
|
558
|
+
"-a",
|
559
|
+
is_flag=True,
|
560
|
+
default=False,
|
561
|
+
help="To push all versions.",
|
562
|
+
)
|
563
|
+
@click.option(
|
564
|
+
"--clean",
|
565
|
+
"-c",
|
566
|
+
is_flag=True,
|
567
|
+
default=False,
|
568
|
+
help="To clean the version(s) local data after syncing.",
|
569
|
+
)
|
570
|
+
@click.option(
|
571
|
+
"--path",
|
572
|
+
"--path-from",
|
573
|
+
type=click.Path(exists=False),
|
574
|
+
help="Optional path where the model versions are persisted, "
|
575
|
+
"default value is taken from the env var: `POLYAXON_OFFLINE_ROOT`.",
|
576
|
+
)
|
577
|
+
@click.option(
|
578
|
+
"--reset-project",
|
579
|
+
is_flag=True,
|
580
|
+
default=False,
|
581
|
+
help="Optional, to ignore the owner/project of the local "
|
582
|
+
"version and use the owner/project provided or resolved from the current project.",
|
583
|
+
)
|
584
|
+
@click.option(
|
585
|
+
"--force",
|
586
|
+
is_flag=True,
|
587
|
+
default=False,
|
588
|
+
help="Flag to force register if the version already exists.",
|
589
|
+
)
|
590
|
+
@click.pass_context
|
591
|
+
@clean_outputs
|
592
|
+
def push(
|
593
|
+
ctx,
|
594
|
+
project,
|
595
|
+
version,
|
596
|
+
all_versions,
|
597
|
+
clean,
|
598
|
+
path,
|
599
|
+
reset_project,
|
600
|
+
force,
|
601
|
+
):
|
602
|
+
"""Push local packaged model version or multiple model versions to a remove server.
|
603
|
+
|
604
|
+
Uses /docs/core/cli/#caching
|
605
|
+
|
606
|
+
Examples:
|
607
|
+
|
608
|
+
\b
|
609
|
+
$ polyaxon models push -ver rc12
|
610
|
+
|
611
|
+
\b
|
612
|
+
$ polyaxon models push -p acme/foobar --path /tmp/versions
|
613
|
+
|
614
|
+
\b
|
615
|
+
$ polyaxon models pull -p acme/foobar -a --path /tmp/versions
|
616
|
+
"""
|
617
|
+
owner, _, project_name = get_project_or_local(
|
618
|
+
project or ctx.obj.get("project"), is_cli=True
|
619
|
+
)
|
620
|
+
push_one_or_many_project_versions(
|
621
|
+
owner=owner,
|
622
|
+
project_name=project_name,
|
623
|
+
kind=V1ProjectVersionKind.MODEL,
|
624
|
+
version=version,
|
625
|
+
all_versions=all_versions,
|
626
|
+
path=path,
|
627
|
+
clean=clean,
|
628
|
+
force=force,
|
629
|
+
reset_project=reset_project,
|
630
|
+
)
|
631
|
+
|
632
|
+
|
549
633
|
@models.command()
|
550
634
|
@click.option(*OPTIONS_PROJECT["args"], **OPTIONS_PROJECT["kwargs"])
|
551
635
|
@click.option(*OPTIONS_MODEL_VERSION["args"], **OPTIONS_MODEL_VERSION["kwargs"])
|
@@ -568,11 +652,12 @@ def pull(
|
|
568
652
|
def dashboard(ctx, project, version, yes, url):
|
569
653
|
"""Open this model version's dashboard details in browser."""
|
570
654
|
version = version or ctx.obj.get("version") or "latest"
|
571
|
-
owner, project_name = get_project_or_local(
|
655
|
+
owner, team, project_name = get_project_or_local(
|
572
656
|
project or ctx.obj.get("project"), is_cli=True
|
573
657
|
)
|
574
658
|
open_project_version_dashboard(
|
575
659
|
owner=owner,
|
660
|
+
team=team,
|
576
661
|
project_name=project_name,
|
577
662
|
kind=V1ProjectVersionKind.MODEL,
|
578
663
|
version=version,
|
polyaxon/_cli/operations.py
CHANGED
@@ -21,7 +21,11 @@ from clipped.utils.versions import compare_versions
|
|
21
21
|
from urllib3.exceptions import HTTPError
|
22
22
|
|
23
23
|
from polyaxon import settings
|
24
|
-
from polyaxon._cli.dashboard import
|
24
|
+
from polyaxon._cli.dashboard import (
|
25
|
+
get_dashboard,
|
26
|
+
get_dashboard_url,
|
27
|
+
get_project_subpath_url,
|
28
|
+
)
|
25
29
|
from polyaxon._cli.errors import handle_cli_error, is_in_ce
|
26
30
|
from polyaxon._cli.options import (
|
27
31
|
OPTIONS_NAME,
|
@@ -47,7 +51,7 @@ from polyaxon.api import (
|
|
47
51
|
REWRITE_SERVICES_V1,
|
48
52
|
SERVICES_V1,
|
49
53
|
)
|
50
|
-
from polyaxon.client import RunClient, V1Run, get_run_logs
|
54
|
+
from polyaxon.client import RunClient, V1Run, V1RunSettings, get_run_logs
|
51
55
|
from polyaxon.exceptions import (
|
52
56
|
ApiException,
|
53
57
|
PolyaxonClientException,
|
@@ -82,6 +86,14 @@ DEFAULT_EXCLUDE = [
|
|
82
86
|
]
|
83
87
|
|
84
88
|
|
89
|
+
def get_op_agent_host(runSettings: V1RunSettings):
|
90
|
+
host_kwargs = {}
|
91
|
+
if runSettings and runSettings.agent and runSettings.agent.url:
|
92
|
+
host_kwargs["host"] = runSettings.agent.url
|
93
|
+
|
94
|
+
return host_kwargs
|
95
|
+
|
96
|
+
|
85
97
|
def handle_run_statuses(status, conditions, table):
|
86
98
|
if not conditions:
|
87
99
|
return False
|
@@ -286,7 +298,7 @@ def ls(
|
|
286
298
|
else:
|
287
299
|
Printer.warning(f"Skipping run {uid}, offline data not found.")
|
288
300
|
else:
|
289
|
-
owner, project_name = get_project_or_local(
|
301
|
+
owner, _, project_name = get_project_or_local(
|
290
302
|
project or ctx.obj.get("project"), is_cli=True
|
291
303
|
)
|
292
304
|
|
@@ -431,7 +443,7 @@ def get(ctx, project, uid, offline, path, output):
|
|
431
443
|
sys.exit(1)
|
432
444
|
run_data = RunConfigManager.read_from_path(offline_path)
|
433
445
|
else:
|
434
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
446
|
+
owner, team, project_name, run_uuid = get_project_run_or_local(
|
435
447
|
project or ctx.obj.get("project"),
|
436
448
|
uid,
|
437
449
|
is_cli=True,
|
@@ -456,7 +468,9 @@ def get(ctx, project, uid, offline, path, output):
|
|
456
468
|
)
|
457
469
|
if output:
|
458
470
|
run_url = get_dashboard_url(
|
459
|
-
subpath="{}/
|
471
|
+
subpath="{}/runs/{}".format(
|
472
|
+
get_project_subpath_url(owner, team, project_name), run_uuid
|
473
|
+
)
|
460
474
|
)
|
461
475
|
config["url"] = run_url
|
462
476
|
handle_output(config, output)
|
@@ -529,7 +543,7 @@ def delete(ctx, project, uid, yes, offline, path):
|
|
529
543
|
return
|
530
544
|
|
531
545
|
# Resume normal flow
|
532
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
546
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
533
547
|
project or ctx.obj.get("project"),
|
534
548
|
uid or ctx.obj.get("run_uuid"),
|
535
549
|
is_cli=True,
|
@@ -624,7 +638,7 @@ def update(ctx, project, uid, name, description, tags, offline, path):
|
|
624
638
|
)
|
625
639
|
sys.exit(1)
|
626
640
|
else:
|
627
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
641
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
628
642
|
project or ctx.obj.get("project"),
|
629
643
|
uid or ctx.obj.get("run_uuid"),
|
630
644
|
is_cli=True,
|
@@ -663,7 +677,7 @@ def approve(ctx, project, uid):
|
|
663
677
|
\b
|
664
678
|
$ polyaxon ops approve --uid 8aac02e3a62a4f0aaa257c59da5eab80
|
665
679
|
"""
|
666
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
680
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
667
681
|
project or ctx.obj.get("project"),
|
668
682
|
uid or ctx.obj.get("run_uuid"),
|
669
683
|
is_cli=True,
|
@@ -710,7 +724,7 @@ def stop(ctx, project, uid, yes):
|
|
710
724
|
\b
|
711
725
|
$ polyaxon ops stop --uid 8aac02e3a62a4f0aaa257c59da5eab80
|
712
726
|
"""
|
713
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
727
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
714
728
|
project or ctx.obj.get("project"),
|
715
729
|
uid or ctx.obj.get("run_uuid"),
|
716
730
|
is_cli=True,
|
@@ -762,7 +776,7 @@ def skip(ctx, project, uid, yes):
|
|
762
776
|
\b
|
763
777
|
$ polyaxon ops skip --uid 8aac02e3a62a4f0aaa257c59da5eab80
|
764
778
|
"""
|
765
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
779
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
766
780
|
project or ctx.obj.get("project"),
|
767
781
|
uid or ctx.obj.get("run_uuid"),
|
768
782
|
is_cli=True,
|
@@ -866,7 +880,7 @@ def restart(
|
|
866
880
|
if polyaxonfile:
|
867
881
|
content = OperationSpecification.read(polyaxonfile, is_preset=True).to_json()
|
868
882
|
|
869
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
883
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
870
884
|
project or ctx.obj.get("project"),
|
871
885
|
uid or ctx.obj.get("run_uuid"),
|
872
886
|
is_cli=True,
|
@@ -951,7 +965,7 @@ def resume(
|
|
951
965
|
if polyaxonfile:
|
952
966
|
content = OperationSpecification.read(polyaxonfile, is_preset=True).to_json()
|
953
967
|
|
954
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
968
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
955
969
|
project or ctx.obj.get("project"),
|
956
970
|
uid or ctx.obj.get("run_uuid"),
|
957
971
|
is_cli=True,
|
@@ -994,7 +1008,7 @@ def invalidate(ctx, project, uid):
|
|
994
1008
|
\b
|
995
1009
|
$ polyaxon ops invalidate --uid 8aac02e3a62a4f0aaa257c59da5eab80
|
996
1010
|
"""
|
997
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
1011
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
998
1012
|
project or ctx.obj.get("project"),
|
999
1013
|
uid or ctx.obj.get("run_uuid"),
|
1000
1014
|
is_cli=True,
|
@@ -1020,7 +1034,7 @@ def invalidate(ctx, project, uid):
|
|
1020
1034
|
"--executor",
|
1021
1035
|
"-exc",
|
1022
1036
|
type=str,
|
1023
|
-
help="The
|
1037
|
+
help="The executor to use, possible values are: docker, k8s, process.",
|
1024
1038
|
)
|
1025
1039
|
@click.pass_context
|
1026
1040
|
@clean_outputs
|
@@ -1129,7 +1143,7 @@ def execute(ctx, project, uid, executor):
|
|
1129
1143
|
executor.create_from_run(response, default_auth=not is_in_ce())
|
1130
1144
|
|
1131
1145
|
def _execute_on_local_process(response: V1Run, run_client: RunClient):
|
1132
|
-
from polyaxon.
|
1146
|
+
from polyaxon._local_process.executor import Executor
|
1133
1147
|
|
1134
1148
|
run_client.log_status(
|
1135
1149
|
V1Statuses.STARTING,
|
@@ -1138,27 +1152,52 @@ def execute(ctx, project, uid, executor):
|
|
1138
1152
|
)
|
1139
1153
|
executor = Executor()
|
1140
1154
|
if not executor.manager.check():
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1155
|
+
run_client.log_failed(
|
1156
|
+
reason="CliProcessExecutor",
|
1157
|
+
message="Local process can't be used to run this operation.",
|
1158
|
+
)
|
1159
|
+
raise Printer.error(
|
1160
|
+
"Local process can't be used to run this operation.", sys_exit=True
|
1161
|
+
)
|
1162
|
+
|
1163
|
+
run_client.log_status(
|
1164
|
+
V1Statuses.RUNNING,
|
1165
|
+
reason="CliProcessExecutor",
|
1166
|
+
message="Operation is running",
|
1167
|
+
)
|
1168
|
+
|
1169
|
+
if V1RunKind.has_pipeline(response.kind):
|
1170
|
+
has_children = True
|
1171
|
+
while has_children:
|
1172
|
+
pipeline_runs = run_client.list_children(
|
1173
|
+
query="status:created", sort="created_at", limit=1
|
1174
|
+
)
|
1175
|
+
if pipeline_runs.results:
|
1176
|
+
current_run_client = RunClient(
|
1177
|
+
owner=owner,
|
1178
|
+
project=project_name,
|
1179
|
+
run_uuid=pipeline_runs.results[0].uuid,
|
1180
|
+
manual_exceptions_handling=True,
|
1181
|
+
)
|
1182
|
+
current_run_client.refresh_data()
|
1183
|
+
_prepare(current_run_client.run_data, current_run_client)
|
1184
|
+
_execute(current_run_client.run_data, current_run_client)
|
1185
|
+
else:
|
1186
|
+
has_children = False
|
1187
|
+
return
|
1188
|
+
else:
|
1189
|
+
result = executor.create_from_run(response, default_auth=not is_in_ce())
|
1190
|
+
if result["status"] == V1Statuses.SUCCEEDED:
|
1191
|
+
run_client.log_succeeded(
|
1192
|
+
reason="CliProcessExecutor", message="Operation was succeeded"
|
1193
|
+
)
|
1194
|
+
else:
|
1195
|
+
run_client.log_failed(
|
1196
|
+
reason="CliProcessExecutor",
|
1197
|
+
message="Operation failed.\n{}".format(result["message"]),
|
1198
|
+
)
|
1199
|
+
|
1200
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
1162
1201
|
project or ctx.obj.get("project"),
|
1163
1202
|
uid or ctx.obj.get("run_uuid"),
|
1164
1203
|
is_cli=True,
|
@@ -1282,7 +1321,7 @@ def statuses(ctx, project, uid, watch, offline, path):
|
|
1282
1321
|
sys.exit(1)
|
1283
1322
|
return
|
1284
1323
|
|
1285
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
1324
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
1286
1325
|
project or ctx.obj.get("project"),
|
1287
1326
|
uid or ctx.obj.get("run_uuid"),
|
1288
1327
|
is_cli=True,
|
@@ -1350,7 +1389,7 @@ def statuses(ctx, project, uid, watch, offline, path):
|
|
1350
1389
|
# )
|
1351
1390
|
# sys.exit(1)
|
1352
1391
|
#
|
1353
|
-
# owner, project_name, run_uuid = get_project_run_or_local(
|
1392
|
+
# owner, team, project_name, run_uuid = get_project_run_or_local(
|
1354
1393
|
# ctx.obj.get("project"), ctx.obj.get("run_uuid"), is_cli=True,
|
1355
1394
|
# )
|
1356
1395
|
#
|
@@ -1442,7 +1481,7 @@ def logs(ctx, project, uid, follow, hide_time, all_containers, all_info, offline
|
|
1442
1481
|
sys.exit(1)
|
1443
1482
|
return
|
1444
1483
|
|
1445
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
1484
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
1446
1485
|
project or ctx.obj.get("project"),
|
1447
1486
|
uid or ctx.obj.get("run_uuid"),
|
1448
1487
|
is_cli=True,
|
@@ -1488,7 +1527,7 @@ def inspect(ctx, project, uid):
|
|
1488
1527
|
\b
|
1489
1528
|
$ polyaxon ops inspect -p acme/project -uid 8aac02e3a62a4f0aaa257c59da5eab80
|
1490
1529
|
"""
|
1491
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
1530
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
1492
1531
|
project or ctx.obj.get("project"),
|
1493
1532
|
uid or ctx.obj.get("run_uuid"),
|
1494
1533
|
is_cli=True,
|
@@ -1547,7 +1586,7 @@ def shell(ctx, project, uid, command, pod, container):
|
|
1547
1586
|
"""
|
1548
1587
|
from polyaxon._vendor.shell_pty import PseudoTerminal
|
1549
1588
|
|
1550
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
1589
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
1551
1590
|
project or ctx.obj.get("project"),
|
1552
1591
|
uid or ctx.obj.get("run_uuid"),
|
1553
1592
|
is_cli=True,
|
@@ -1652,7 +1691,7 @@ def artifacts(
|
|
1652
1691
|
\b
|
1653
1692
|
$ polyaxon ops artifacts -uid 8aac02e3a62a4f0aaa257c59da5eab80 -l-kind model -l-kind env --path="this/path"
|
1654
1693
|
"""
|
1655
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
1694
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
1656
1695
|
project or ctx.obj.get("project"),
|
1657
1696
|
uid or ctx.obj.get("run_uuid"),
|
1658
1697
|
is_cli=True,
|
@@ -1812,9 +1851,12 @@ def artifacts(
|
|
1812
1851
|
default=False,
|
1813
1852
|
help="To set the run to failed if the upload fails.",
|
1814
1853
|
)
|
1854
|
+
@click.option(
|
1855
|
+
"--agent", "-ag", type=str, help="Optional, uuid reference of an agent to use."
|
1856
|
+
)
|
1815
1857
|
@click.pass_context
|
1816
1858
|
@clean_outputs
|
1817
|
-
def upload(ctx, project, uid, path_from, path_to, sync_failure):
|
1859
|
+
def upload(ctx, project, uid, path_from, path_to, sync_failure, agent):
|
1818
1860
|
"""Upload runs' artifacts.
|
1819
1861
|
|
1820
1862
|
Uses /docs/core/cli/#caching
|
@@ -1830,7 +1872,7 @@ def upload(ctx, project, uid, path_from, path_to, sync_failure):
|
|
1830
1872
|
\b
|
1831
1873
|
$ polyaxon ops upload -uid 8aac02e3a62a4f0aaa257c59da5eab80 --path-to="path/to/upload/to"
|
1832
1874
|
"""
|
1833
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
1875
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
1834
1876
|
project or ctx.obj.get("project"),
|
1835
1877
|
uid or ctx.obj.get("run_uuid"),
|
1836
1878
|
is_cli=True,
|
@@ -1845,7 +1887,7 @@ def upload(ctx, project, uid, path_from, path_to, sync_failure):
|
|
1845
1887
|
)
|
1846
1888
|
if is_file:
|
1847
1889
|
response = client.upload_artifact(
|
1848
|
-
filepath=path_from, path=path_to, overwrite=True
|
1890
|
+
filepath=path_from, path=path_to, overwrite=True, agent=agent
|
1849
1891
|
)
|
1850
1892
|
else:
|
1851
1893
|
response = client.upload_artifacts_dir(
|
@@ -1853,6 +1895,7 @@ def upload(ctx, project, uid, path_from, path_to, sync_failure):
|
|
1853
1895
|
path=path_to,
|
1854
1896
|
overwrite=True,
|
1855
1897
|
relative_to=path_from,
|
1898
|
+
agent=agent,
|
1856
1899
|
)
|
1857
1900
|
except (
|
1858
1901
|
ApiException,
|
@@ -1904,7 +1947,7 @@ def transfer(ctx, project, uid, to_project):
|
|
1904
1947
|
\b
|
1905
1948
|
$ polyaxon ops transfer -p acme/foobar -uid 8aac02e3a62a4f0aaa257c59da5eab80 -to=dest-project
|
1906
1949
|
"""
|
1907
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
1950
|
+
owner, _, project_name, run_uuid = get_project_run_or_local(
|
1908
1951
|
project or ctx.obj.get("project"),
|
1909
1952
|
uid or ctx.obj.get("run_uuid"),
|
1910
1953
|
is_cli=True,
|
@@ -1972,13 +2015,16 @@ def dashboard(ctx, project, uid, yes, url, offline, path, server_config):
|
|
1972
2015
|
sys.exit(1)
|
1973
2016
|
run_data = RunConfigManager.read_from_path(offline_path)
|
1974
2017
|
owner, project_name, run_uuid = run_data.owner, run_data.project, run_data.uuid
|
2018
|
+
team = None
|
1975
2019
|
else:
|
1976
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
2020
|
+
owner, team, project_name, run_uuid = get_project_run_or_local(
|
1977
2021
|
project or ctx.obj.get("project"),
|
1978
2022
|
uid or ctx.obj.get("run_uuid"),
|
1979
2023
|
is_cli=True,
|
1980
2024
|
)
|
1981
|
-
subpath = "{}/
|
2025
|
+
subpath = "{}/runs/{}".format(
|
2026
|
+
get_project_subpath_url(owner, team, project_name), run_uuid
|
2027
|
+
)
|
1982
2028
|
dashboard_url = get_dashboard_url(subpath=subpath)
|
1983
2029
|
get_dashboard(dashboard_url=dashboard_url, url_only=url, yes=yes)
|
1984
2030
|
if offline:
|
@@ -2022,7 +2068,7 @@ def service(ctx, project, uid, yes, external, url):
|
|
2022
2068
|
You can open the service embedded in Polyaxon UI or using the real service URL,
|
2023
2069
|
please use the `--external` flag.
|
2024
2070
|
"""
|
2025
|
-
owner, project_name, run_uuid = get_project_run_or_local(
|
2071
|
+
owner, team, project_name, run_uuid = get_project_run_or_local(
|
2026
2072
|
project or ctx.obj.get("project"),
|
2027
2073
|
uid or ctx.obj.get("run_uuid"),
|
2028
2074
|
is_cli=True,
|
@@ -2055,8 +2101,12 @@ def service(ctx, project, uid, yes, external, url):
|
|
2055
2101
|
|
2056
2102
|
wait_for_running_condition(client)
|
2057
2103
|
|
2104
|
+
host_kwargs = get_op_agent_host(client.settings)
|
2058
2105
|
run_url = get_dashboard_url(
|
2059
|
-
subpath="{}/
|
2106
|
+
subpath="{}/runs/{}/service".format(
|
2107
|
+
get_project_subpath_url(owner, team, project_name), run_uuid
|
2108
|
+
),
|
2109
|
+
**host_kwargs,
|
2060
2110
|
)
|
2061
2111
|
|
2062
2112
|
namespace = client.run_data.settings.namespace
|
@@ -2066,8 +2116,8 @@ def service(ctx, project, uid, yes, external, url):
|
|
2066
2116
|
if rewrite_path:
|
2067
2117
|
service_endpoint = REWRITE_EXTERNAL_V1 if is_external else REWRITE_SERVICES_V1
|
2068
2118
|
|
2069
|
-
service_subpath = "{}/{}/
|
2070
|
-
namespace, owner, project_name, run_uuid
|
2119
|
+
service_subpath = "{}/{}/runs/{}/".format(
|
2120
|
+
get_project_subpath_url(namespace, team, owner), project_name, run_uuid
|
2071
2121
|
)
|
2072
2122
|
port = 80
|
2073
2123
|
if client.settings and client.settings.agent:
|
@@ -2080,9 +2130,9 @@ def service(ctx, project, uid, yes, external, url):
|
|
2080
2130
|
if port:
|
2081
2131
|
service_subpath = "{}{}/".format(service_subpath, port)
|
2082
2132
|
|
2133
|
+
host_kwargs = get_op_agent_host(client.settings)
|
2083
2134
|
external_run_url = get_dashboard_url(
|
2084
|
-
base=service_endpoint,
|
2085
|
-
subpath=service_subpath,
|
2135
|
+
base=service_endpoint, subpath=service_subpath, **host_kwargs
|
2086
2136
|
)
|
2087
2137
|
|
2088
2138
|
if url:
|
@@ -2163,7 +2213,7 @@ def pull(
|
|
2163
2213
|
\b
|
2164
2214
|
$ polyaxon ops pull -a
|
2165
2215
|
"""
|
2166
|
-
owner, project_name = get_project_or_local(
|
2216
|
+
owner, _, project_name = get_project_or_local(
|
2167
2217
|
project or ctx.obj.get("project"), is_cli=True
|
2168
2218
|
)
|
2169
2219
|
|
@@ -2256,10 +2306,32 @@ def pull(
|
|
2256
2306
|
help="Optional, to ignore the owner/project of the local "
|
2257
2307
|
"run and use the owner/project provided or resolved from the current project.",
|
2258
2308
|
)
|
2309
|
+
@click.option(
|
2310
|
+
"--reset-uuid",
|
2311
|
+
is_flag=True,
|
2312
|
+
default=False,
|
2313
|
+
help="Optional, to ignore the uuid of the local " "run and generate a new uuid.",
|
2314
|
+
)
|
2315
|
+
@click.option(
|
2316
|
+
"--agent", "-ag", type=str, help="Optional, uuid reference of an agent to use."
|
2317
|
+
)
|
2318
|
+
@click.option("--name", "-n", type=str, help="Optional, a new name to set for the run.")
|
2259
2319
|
@click.pass_context
|
2260
2320
|
@clean_outputs
|
2261
|
-
def push(
|
2262
|
-
|
2321
|
+
def push(
|
2322
|
+
ctx,
|
2323
|
+
project,
|
2324
|
+
uid,
|
2325
|
+
all_runs,
|
2326
|
+
no_artifacts,
|
2327
|
+
clean,
|
2328
|
+
path,
|
2329
|
+
reset_project,
|
2330
|
+
reset_uuid,
|
2331
|
+
agent,
|
2332
|
+
name,
|
2333
|
+
):
|
2334
|
+
"""Push a local run (or all runs) to a remove server.
|
2263
2335
|
|
2264
2336
|
Uses /docs/core/cli/#caching
|
2265
2337
|
|
@@ -2283,7 +2355,7 @@ def push(ctx, project, uid, all_runs, no_artifacts, clean, path, reset_project):
|
|
2283
2355
|
\b
|
2284
2356
|
$ polyaxon ops push -uid 8aac02e3a62a4f0aaa257c59da5eab80 --reset-project -p send-to-project
|
2285
2357
|
"""
|
2286
|
-
owner, project_name = get_project_or_local(
|
2358
|
+
owner, _, project_name = get_project_or_local(
|
2287
2359
|
project or ctx.obj.get("project"), is_cli=True
|
2288
2360
|
)
|
2289
2361
|
|
@@ -2306,6 +2378,8 @@ def push(ctx, project, uid, all_runs, no_artifacts, clean, path, reset_project):
|
|
2306
2378
|
path=artifacts_path,
|
2307
2379
|
run_client=client,
|
2308
2380
|
reset_project=reset_project,
|
2381
|
+
name=name,
|
2382
|
+
reset_uuid=reset_uuid,
|
2309
2383
|
raise_if_not_found=True,
|
2310
2384
|
)
|
2311
2385
|
except Exception as e:
|
@@ -2322,6 +2396,7 @@ def push(ctx, project, uid, all_runs, no_artifacts, clean, path, reset_project):
|
|
2322
2396
|
path=artifacts_path,
|
2323
2397
|
upload_artifacts=not no_artifacts,
|
2324
2398
|
clean=clean,
|
2399
|
+
agent=agent,
|
2325
2400
|
)
|
2326
2401
|
Printer.success(
|
2327
2402
|
f"Finished pushing offline run {uid} to {client.owner}/{client.project}"
|