polyaxon 2.0.0rc49__py3-none-any.whl → 2.4.0rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. polyaxon/_auxiliaries/cleaner.py +8 -3
  2. polyaxon/_auxiliaries/init.py +7 -2
  3. polyaxon/_auxiliaries/notifier.py +8 -2
  4. polyaxon/_auxiliaries/sidecar.py +30 -2
  5. polyaxon/_cli/artifacts.py +96 -11
  6. polyaxon/_cli/components.py +96 -11
  7. polyaxon/_cli/config.py +118 -22
  8. polyaxon/_cli/dashboard.py +15 -2
  9. polyaxon/_cli/init.py +1 -1
  10. polyaxon/_cli/models.py +96 -11
  11. polyaxon/_cli/operations.py +267 -90
  12. polyaxon/_cli/project_versions.py +139 -6
  13. polyaxon/_cli/projects.py +23 -9
  14. polyaxon/_cli/run.py +37 -9
  15. polyaxon/_cli/services/agent.py +2 -2
  16. polyaxon/_cli/services/clean_artifacts.py +1 -1
  17. polyaxon/_cli/services/sidecar.py +8 -1
  18. polyaxon/_client/client.py +17 -0
  19. polyaxon/_client/mixin.py +39 -0
  20. polyaxon/_client/project.py +218 -23
  21. polyaxon/_client/run.py +131 -33
  22. polyaxon/_compiler/contexts/contexts.py +2 -2
  23. polyaxon/_compiler/contexts/ray_job.py +4 -2
  24. polyaxon/_compiler/resolver/agent.py +12 -2
  25. polyaxon/_compiler/resolver/runtime.py +2 -2
  26. polyaxon/_contexts/paths.py +4 -7
  27. polyaxon/_deploy/operators/compose.py +1 -27
  28. polyaxon/_deploy/schemas/deployment.py +4 -1
  29. polyaxon/_deploy/schemas/intervals.py +0 -7
  30. polyaxon/_deploy/schemas/proxy.py +1 -0
  31. polyaxon/_deploy/schemas/service.py +11 -1
  32. polyaxon/_docker/converter/base/base.py +8 -0
  33. polyaxon/_docker/executor.py +10 -4
  34. polyaxon/_env_vars/getters/owner_entity.py +4 -2
  35. polyaxon/_env_vars/getters/project.py +4 -2
  36. polyaxon/_env_vars/getters/run.py +5 -2
  37. polyaxon/_env_vars/keys.py +7 -1
  38. polyaxon/_flow/__init__.py +2 -0
  39. polyaxon/_flow/builds/__init__.py +19 -6
  40. polyaxon/_flow/component/base.py +1 -0
  41. polyaxon/_flow/component/component.py +14 -0
  42. polyaxon/_flow/environment/__init__.py +8 -8
  43. polyaxon/_flow/hooks/__init__.py +19 -6
  44. polyaxon/_flow/init/__init__.py +6 -6
  45. polyaxon/_flow/matrix/iterative.py +0 -1
  46. polyaxon/_flow/matrix/tuner.py +18 -6
  47. polyaxon/_flow/operations/operation.py +44 -17
  48. polyaxon/_flow/plugins/__init__.py +6 -0
  49. polyaxon/_flow/run/__init__.py +2 -2
  50. polyaxon/_flow/run/dag.py +2 -2
  51. polyaxon/_flow/run/dask/dask.py +0 -1
  52. polyaxon/_flow/run/dask/replica.py +3 -3
  53. polyaxon/_flow/run/enums.py +5 -0
  54. polyaxon/_flow/run/job.py +4 -4
  55. polyaxon/_flow/run/kubeflow/mpi_job.py +1 -2
  56. polyaxon/_flow/run/kubeflow/mx_job.py +1 -2
  57. polyaxon/_flow/run/kubeflow/paddle_job.py +35 -4
  58. polyaxon/_flow/run/kubeflow/pytorch_job.py +51 -5
  59. polyaxon/_flow/run/kubeflow/replica.py +4 -4
  60. polyaxon/_flow/run/kubeflow/scheduling_policy.py +12 -0
  61. polyaxon/_flow/run/kubeflow/tf_job.py +3 -3
  62. polyaxon/_flow/run/kubeflow/xgboost_job.py +1 -2
  63. polyaxon/_flow/run/ray/ray.py +2 -3
  64. polyaxon/_flow/run/ray/replica.py +3 -3
  65. polyaxon/_flow/run/service.py +4 -4
  66. polyaxon/_fs/fs.py +7 -2
  67. polyaxon/_fs/utils.py +3 -2
  68. polyaxon/_k8s/converter/base/base.py +2 -1
  69. polyaxon/_k8s/converter/base/main.py +1 -0
  70. polyaxon/_k8s/converter/base/sidecar.py +16 -1
  71. polyaxon/_k8s/converter/common/accelerators.py +7 -4
  72. polyaxon/_k8s/converter/converters/job.py +1 -1
  73. polyaxon/_k8s/converter/converters/kubeflow/paddle_job.py +1 -0
  74. polyaxon/_k8s/converter/converters/kubeflow/pytroch_job.py +2 -0
  75. polyaxon/_k8s/converter/converters/kubeflow/tf_job.py +1 -0
  76. polyaxon/_k8s/converter/converters/ray_job.py +4 -2
  77. polyaxon/_k8s/custom_resources/dask_job.py +3 -0
  78. polyaxon/_k8s/custom_resources/kubeflow/common.py +4 -1
  79. polyaxon/_k8s/custom_resources/kubeflow/paddle_job.py +10 -1
  80. polyaxon/_k8s/custom_resources/kubeflow/pytorch_job.py +14 -1
  81. polyaxon/_k8s/custom_resources/kubeflow/tf_job.py +4 -0
  82. polyaxon/_k8s/custom_resources/ray_job.py +3 -0
  83. polyaxon/_k8s/custom_resources/setter.py +1 -1
  84. polyaxon/_k8s/executor/async_executor.py +2 -0
  85. polyaxon/_k8s/executor/base.py +23 -6
  86. polyaxon/_k8s/logging/async_monitor.py +150 -5
  87. polyaxon/_k8s/manager/async_manager.py +96 -23
  88. polyaxon/_k8s/manager/base.py +4 -0
  89. polyaxon/_k8s/manager/manager.py +282 -134
  90. polyaxon/_local_process/__init__.py +0 -0
  91. polyaxon/_local_process/agent.py +6 -0
  92. polyaxon/_local_process/converter/__init__.py +1 -0
  93. polyaxon/_local_process/converter/base/__init__.py +1 -0
  94. polyaxon/_local_process/converter/base/base.py +140 -0
  95. polyaxon/_local_process/converter/base/containers.py +69 -0
  96. polyaxon/_local_process/converter/base/env_vars.py +253 -0
  97. polyaxon/_local_process/converter/base/init.py +414 -0
  98. polyaxon/_local_process/converter/base/main.py +74 -0
  99. polyaxon/_local_process/converter/base/mounts.py +82 -0
  100. polyaxon/_local_process/converter/converters/__init__.py +8 -0
  101. polyaxon/_local_process/converter/converters/job.py +40 -0
  102. polyaxon/_local_process/converter/converters/service.py +41 -0
  103. polyaxon/_local_process/converter/mixins.py +38 -0
  104. polyaxon/_local_process/executor.py +132 -0
  105. polyaxon/_local_process/process_types.py +39 -0
  106. polyaxon/_managers/agent.py +2 -0
  107. polyaxon/_managers/home.py +2 -1
  108. polyaxon/_operations/tuner.py +1 -0
  109. polyaxon/_polyaxonfile/check.py +2 -0
  110. polyaxon/_polyaxonfile/manager/operations.py +3 -0
  111. polyaxon/_polyaxonfile/manager/workflows.py +2 -0
  112. polyaxon/_polyaxonfile/specs/compiled_operation.py +1 -0
  113. polyaxon/_polyaxonfile/specs/operation.py +1 -0
  114. polyaxon/_polyaxonfile/specs/sections.py +3 -0
  115. polyaxon/_pql/manager.py +1 -1
  116. polyaxon/_runner/agent/async_agent.py +97 -21
  117. polyaxon/_runner/agent/base_agent.py +27 -9
  118. polyaxon/_runner/agent/client.py +15 -1
  119. polyaxon/_runner/agent/sync_agent.py +85 -20
  120. polyaxon/_runner/converter/converter.py +6 -2
  121. polyaxon/_runner/executor.py +13 -7
  122. polyaxon/_schemas/agent.py +27 -1
  123. polyaxon/_schemas/client.py +30 -3
  124. polyaxon/_schemas/installation.py +4 -3
  125. polyaxon/_schemas/lifecycle.py +10 -5
  126. polyaxon/_schemas/log_handler.py +2 -3
  127. polyaxon/_schemas/types/artifacts.py +3 -3
  128. polyaxon/_schemas/types/dockerfile.py +3 -3
  129. polyaxon/_schemas/types/file.py +3 -3
  130. polyaxon/_schemas/types/git.py +3 -3
  131. polyaxon/_schemas/types/tensorboard.py +3 -3
  132. polyaxon/_sdk/api/agents_v1_api.py +1076 -73
  133. polyaxon/_sdk/api/organizations_v1_api.py +371 -10
  134. polyaxon/_sdk/api/project_dashboards_v1_api.py +12 -12
  135. polyaxon/_sdk/api/project_searches_v1_api.py +12 -12
  136. polyaxon/_sdk/api/projects_v1_api.py +221 -44
  137. polyaxon/_sdk/api/runs_v1_api.py +917 -445
  138. polyaxon/_sdk/api/service_accounts_v1_api.py +16 -16
  139. polyaxon/_sdk/api/teams_v1_api.py +2827 -375
  140. polyaxon/_sdk/api/users_v1_api.py +231 -55
  141. polyaxon/_sdk/async_client/api_client.py +4 -0
  142. polyaxon/_sdk/schemas/__init__.py +10 -2
  143. polyaxon/_sdk/schemas/v1_agent.py +2 -1
  144. polyaxon/_sdk/schemas/v1_agent_reconcile_body_request.py +14 -0
  145. polyaxon/_sdk/schemas/v1_artifact_tree.py +1 -1
  146. polyaxon/_sdk/schemas/v1_dashboard_spec.py +4 -0
  147. polyaxon/_sdk/schemas/v1_events_response.py +4 -0
  148. polyaxon/_sdk/schemas/v1_organization.py +1 -0
  149. polyaxon/_sdk/schemas/v1_preset.py +8 -0
  150. polyaxon/_sdk/schemas/v1_project.py +1 -0
  151. polyaxon/_sdk/schemas/v1_project_settings.py +4 -2
  152. polyaxon/_sdk/schemas/v1_run.py +2 -2
  153. polyaxon/_sdk/schemas/v1_run_edge_lineage.py +14 -0
  154. polyaxon/_sdk/schemas/v1_run_edges_graph.py +9 -0
  155. polyaxon/_sdk/schemas/v1_section_spec.py +7 -2
  156. polyaxon/_sdk/schemas/v1_settings_catalog.py +1 -0
  157. polyaxon/_sdk/schemas/v1_team.py +3 -0
  158. polyaxon/_sdk/schemas/v1_user.py +1 -2
  159. polyaxon/_sdk/schemas/v1_user_access.py +17 -0
  160. polyaxon/_services/values.py +1 -0
  161. polyaxon/_sidecar/container/__init__.py +39 -18
  162. polyaxon/_sidecar/container/monitors/__init__.py +1 -0
  163. polyaxon/_sidecar/container/monitors/logs.py +10 -13
  164. polyaxon/_sidecar/container/monitors/spec.py +24 -0
  165. polyaxon/_sidecar/ignore.py +0 -1
  166. polyaxon/_utils/fqn_utils.py +25 -2
  167. polyaxon/client.py +1 -1
  168. polyaxon/pkg.py +1 -1
  169. polyaxon/schemas.py +8 -1
  170. polyaxon/settings.py +6 -0
  171. {polyaxon-2.0.0rc49.dist-info → polyaxon-2.4.0rc1.dist-info}/METADATA +43 -43
  172. {polyaxon-2.0.0rc49.dist-info → polyaxon-2.4.0rc1.dist-info}/RECORD +176 -155
  173. {polyaxon-2.0.0rc49.dist-info → polyaxon-2.4.0rc1.dist-info}/WHEEL +1 -1
  174. polyaxon/_sdk/schemas/v1_project_user_access.py +0 -10
  175. {polyaxon-2.0.0rc49.dist-info → polyaxon-2.4.0rc1.dist-info}/LICENSE +0 -0
  176. {polyaxon-2.0.0rc49.dist-info → polyaxon-2.4.0rc1.dist-info}/entry_points.txt +0 -0
  177. {polyaxon-2.0.0rc49.dist-info → polyaxon-2.4.0rc1.dist-info}/top_level.txt +0 -0
polyaxon/_cli/config.py CHANGED
@@ -4,6 +4,7 @@ import click
4
4
 
5
5
  from clipped.formatting import Printer
6
6
  from clipped.utils.dicts import dict_to_tabulate
7
+ from clipped.utils.paths import check_or_create_path
7
8
 
8
9
  from polyaxon import settings
9
10
  from polyaxon._cli.errors import handle_cli_error
@@ -15,6 +16,55 @@ from polyaxon._managers.user import UserConfigManager
15
16
  from polyaxon.logger import clean_outputs, logger
16
17
 
17
18
 
19
+ def set_home_path(home_path: str):
20
+ try:
21
+ _config = HomeConfigManager.get_config_or_default()
22
+ except Exception as e:
23
+ logger.debug(
24
+ "Home configuration could not be loaded.\n"
25
+ "Error: %s\n"
26
+ "Purging home configuration and resetting values.",
27
+ e,
28
+ )
29
+ logger.debug()
30
+ HomeConfigManager.purge()
31
+ _config = HomeConfigManager.get_config_or_default()
32
+ try:
33
+ check_or_create_path(home_path, is_dir=False)
34
+ except Exception as e:
35
+ handle_cli_error(
36
+ e, message=f"Couldn't create path configuration at {home_path}."
37
+ )
38
+ Printer.heading(
39
+ "Please make sure that that the path is accessible or manually create it."
40
+ )
41
+ sys.exit(1)
42
+ setattr(_config, "path", home_path)
43
+ HomeConfigManager.set_config(_config)
44
+ settings.set_home_config(_config)
45
+
46
+
47
+ def set_owner(owner: str):
48
+ try:
49
+ _config = UserConfigManager.get_config_or_default()
50
+ except Exception as e:
51
+ logger.debug(
52
+ "Home configuration could not be loaded.\n"
53
+ "Error: %s\n"
54
+ "Purging home configuration and resetting values.",
55
+ e,
56
+ )
57
+ UserConfigManager.purge()
58
+ _config = UserConfigManager.get_config_or_default()
59
+
60
+ data = owner.split("/")
61
+ if len(data) > 2:
62
+ Printer.error("Invalid owner format, please provide a valid owner.")
63
+ sys.exit(1)
64
+ _config.organization = owner
65
+ UserConfigManager.set_config(_config)
66
+
67
+
18
68
  def validate_options(ctx, param, value):
19
69
  possible_values = ["verbose", "host"]
20
70
  if value and value not in possible_values:
@@ -76,7 +126,7 @@ def show():
76
126
  if _config:
77
127
  Printer.heading("User config:")
78
128
  config_user = dict_to_tabulate(
79
- _config.to_dict(),
129
+ _config,
80
130
  humanize_values=True,
81
131
  exclude_attrs=["theme"],
82
132
  )
@@ -92,25 +142,67 @@ def get(keys):
92
142
  Examples:
93
143
 
94
144
  \b
95
- $ polyaxon config get host verify-ssl
145
+ $ polyaxon config get home host verify-ssl
96
146
  """
97
- _config = ClientConfigManager.get_config_or_default()
98
147
 
99
148
  if not keys:
100
149
  return
101
150
 
151
+ keys = set(keys)
152
+
153
+ # Check Home config
154
+ _config = HomeConfigManager.get_config_or_default()
155
+ print_values = {}
156
+ if "home" in keys:
157
+ if hasattr(_config, "path"):
158
+ print_values["home"] = getattr(_config, "path")
159
+ keys.discard("home")
160
+ if print_values:
161
+ Printer.heading("Home config:")
162
+ Printer.dict_tabulate(print_values)
163
+
164
+ not_found_keys = set([])
165
+
166
+ # Check client config
167
+ _config = ClientConfigManager.get_config_or_default()
102
168
  print_values = {}
103
169
  for key in keys:
104
170
  key = key.replace("-", "_")
105
171
  if hasattr(_config, key):
106
172
  print_values[key] = getattr(_config, key)
173
+ not_found_keys.discard(key)
107
174
  else:
108
- Printer.print("Key `{}` is not recognised.".format(key))
175
+ not_found_keys.add(key)
176
+ if print_values:
177
+ Printer.heading("Client config:")
178
+ Printer.dict_tabulate(print_values)
109
179
 
110
- Printer.dict_tabulate(print_values)
180
+ keys = not_found_keys
181
+ not_found_keys = set([])
111
182
 
183
+ # Check cli config
184
+ _config = CliConfigManager.get_config_or_default()
185
+ print_values = {}
186
+ for key in keys:
187
+ key = key.replace("-", "_")
188
+ if hasattr(_config, key):
189
+ print_values[key] = getattr(_config, key)
190
+ not_found_keys.discard(key)
191
+ else:
192
+ not_found_keys.add(key)
193
+ if print_values:
194
+ Printer.heading("CLI config:")
195
+ Printer.dict_tabulate(print_values)
112
196
 
113
- @config.command()
197
+ if not_found_keys:
198
+ Printer.print(
199
+ "The following keys `{}` were not found in any configuration.".format(
200
+ not_found_keys
201
+ )
202
+ )
203
+
204
+
205
+ @config.command(name="set")
114
206
  @click.option("--debug", type=bool, help="To set the verbosity of the client.")
115
207
  @click.option("--host", type=str, help="To set the server endpoint.")
116
208
  @click.option(
@@ -125,9 +217,14 @@ def get(keys):
125
217
  )
126
218
  @click.option(
127
219
  "--home",
128
- type=click.Path(exists=True),
220
+ type=click.Path(exists=False),
129
221
  help="To set POLYAXON_HOME to specify the context where the CLI/Client reads/writes global configuration.",
130
222
  )
223
+ @click.option(
224
+ "--owner",
225
+ type=click.Path(exists=False),
226
+ help="To set current organization or team space.",
227
+ )
131
228
  @click.option(
132
229
  "--disable-errors-reporting",
133
230
  type=bool,
@@ -140,30 +237,29 @@ def get(keys):
140
237
  help="To reconfigure the host without purging auth and other config options.",
141
238
  )
142
239
  @clean_outputs
143
- def set(**kwargs): # pylint:disable=redefined-builtin
240
+ def set_(**kwargs): # pylint:disable=redefined-builtin
144
241
  """Set the global config values.
145
242
 
146
243
  Examples:
147
244
 
245
+ \b
246
+ $ polyaxon config set --home=/tmp/.polyaxon
247
+
248
+ \b
249
+ $ polyaxon config set --home=
250
+
148
251
  \b
149
252
  $ polyaxon config set --host=localhost
150
253
  """
151
254
  no_purge = kwargs.pop("no_purge", None)
152
255
  if kwargs.get("home") is not None:
153
- try:
154
- _config = HomeConfigManager.get_config_or_default()
155
- except Exception as e:
156
- logger.debug(
157
- "Home configuration could not be loaded.\n"
158
- "Error: %s\n"
159
- "Purging home configuration and resetting values.",
160
- e,
161
- )
162
- logger.debug()
163
- HomeConfigManager.purge()
164
- _config = HomeConfigManager.get_config_or_default()
165
- setattr(_config, "path", kwargs.pop("home", None))
166
- HomeConfigManager.set_config(_config)
256
+ home_path = kwargs.pop("home", None)
257
+ set_home_path(home_path)
258
+
259
+ if kwargs.get("owner") is not None:
260
+ owner = kwargs.pop("owner", None)
261
+ if owner:
262
+ set_owner(owner)
167
263
 
168
264
  from polyaxon._managers.auth import AuthConfigManager
169
265
 
@@ -1,5 +1,7 @@
1
1
  import sys
2
2
 
3
+ from typing import Optional
4
+
3
5
  import click
4
6
 
5
7
  from clipped.formatting import Printer
@@ -10,10 +12,21 @@ from polyaxon.api import POLYAXON_CLOUD_HOST
10
12
  from polyaxon.logger import clean_outputs
11
13
 
12
14
 
15
+ def get_project_subpath_url(owner: str, team: Optional[str], project: str):
16
+ if team:
17
+ return "{}/ts/{}/{}".format(owner, team, project)
18
+ return "{}/{}".format(owner, project)
19
+
20
+
13
21
  def get_dashboard_url(
14
- base: str = "ui", subpath: str = "", use_cloud: bool = False
22
+ base: str = "ui", subpath: str = "", use_cloud: bool = False, host: str = None
15
23
  ) -> str:
16
- host = POLYAXON_CLOUD_HOST if use_cloud else clean_host(settings.CLIENT_CONFIG.host)
24
+ if not host:
25
+ host = (
26
+ POLYAXON_CLOUD_HOST
27
+ if use_cloud
28
+ else clean_host(settings.CLIENT_CONFIG.host)
29
+ )
17
30
  dashboard_url = "{}/{}/".format(host, base)
18
31
  if subpath:
19
32
  return "{}{}/".format(dashboard_url, subpath.rstrip("/"))
polyaxon/_cli/init.py CHANGED
@@ -112,7 +112,7 @@ def init(project, git_connection, git_url, polyaxonfile, polyaxonignore, yes):
112
112
  command_help="polyaxon init",
113
113
  )
114
114
  if project:
115
- owner, project_name = get_project_or_local(project, is_cli=True)
115
+ owner, _, project_name = get_project_or_local(project, is_cli=True)
116
116
  try:
117
117
  polyaxon_client = ProjectClient(
118
118
  owner=owner, project=project_name, manual_exceptions_handling=True
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,