polyaxon 2.6.0rc1__py3-none-any.whl → 2.6.1__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 (87) hide show
  1. polyaxon/_cli/operations.py +1 -1
  2. polyaxon/_cli/projects.py +2 -2
  3. polyaxon/_compiler/contexts/contexts.py +5 -5
  4. polyaxon/_compiler/contexts/dask_job.py +1 -1
  5. polyaxon/_compiler/contexts/kubeflow/mpi_job.py +1 -1
  6. polyaxon/_compiler/contexts/kubeflow/mx_job.py +1 -1
  7. polyaxon/_compiler/contexts/kubeflow/paddle_job.py +1 -1
  8. polyaxon/_compiler/contexts/kubeflow/pytroch_job.py +1 -1
  9. polyaxon/_compiler/contexts/kubeflow/tf_job.py +1 -1
  10. polyaxon/_compiler/contexts/kubeflow/xgb_job.py +1 -1
  11. polyaxon/_compiler/contexts/ray_job.py +1 -1
  12. polyaxon/_compiler/resolver/agent.py +1 -1
  13. polyaxon/_compiler/resolver/runtime.py +1 -1
  14. polyaxon/_deploy/schemas/ui.py +3 -1
  15. polyaxon/_docker/converter/base/base.py +1 -1
  16. polyaxon/_docker/converter/base/env_vars.py +1 -1
  17. polyaxon/_docker/converter/converters/job.py +1 -1
  18. polyaxon/_docker/converter/converters/service.py +1 -1
  19. polyaxon/_flow/environment/__init__.py +5 -4
  20. polyaxon/_flow/io/io.py +2 -0
  21. polyaxon/_flow/matrix/params.py +1 -1
  22. polyaxon/_flow/operations/operation.py +0 -1
  23. polyaxon/_flow/params/params.py +2 -2
  24. polyaxon/_flow/run/dag.py +6 -6
  25. polyaxon/_flow/run/resources.py +1 -1
  26. polyaxon/_fs/fs.py +1 -1
  27. polyaxon/_k8s/converter/base/containers.py +1 -1
  28. polyaxon/_k8s/converter/converters/dask_job.py +1 -1
  29. polyaxon/_k8s/converter/converters/job.py +1 -1
  30. polyaxon/_k8s/converter/converters/kubeflow/mpi_job.py +1 -1
  31. polyaxon/_k8s/converter/converters/kubeflow/mx_job.py +1 -1
  32. polyaxon/_k8s/converter/converters/kubeflow/paddle_job.py +1 -1
  33. polyaxon/_k8s/converter/converters/kubeflow/pytroch_job.py +1 -1
  34. polyaxon/_k8s/converter/converters/kubeflow/tf_job.py +1 -1
  35. polyaxon/_k8s/converter/converters/kubeflow/xgboost_job.py +1 -1
  36. polyaxon/_k8s/converter/converters/ray_job.py +1 -2
  37. polyaxon/_k8s/converter/converters/service.py +1 -1
  38. polyaxon/_k8s/k8s_validation.py +16 -16
  39. polyaxon/_k8s/logging/async_monitor.py +4 -4
  40. polyaxon/_k8s/manager/async_manager.py +5 -3
  41. polyaxon/_k8s/manager/manager.py +6 -6
  42. polyaxon/_local_process/converter/base/env_vars.py +1 -1
  43. polyaxon/_local_process/converter/base/init.py +1 -1
  44. polyaxon/_local_process/converter/base/mounts.py +0 -2
  45. polyaxon/_local_process/converter/converters/job.py +1 -1
  46. polyaxon/_local_process/converter/converters/service.py +1 -1
  47. polyaxon/_managers/project.py +3 -2
  48. polyaxon/_polyaxonfile/check.py +4 -4
  49. polyaxon/_polyaxonfile/specs/compiled_operation.py +3 -5
  50. polyaxon/_polyaxonfile/specs/libs/parser.py +1 -3
  51. polyaxon/_polyaxonfile/specs/libs/validator.py +1 -1
  52. polyaxon/_polyaxonfile/specs/operation.py +2 -2
  53. polyaxon/_pql/manager.py +1 -1
  54. polyaxon/_pql/parser.py +29 -26
  55. polyaxon/_runner/agent/base_agent.py +1 -2
  56. polyaxon/_runner/converter/init/artifacts.py +3 -2
  57. polyaxon/_runner/converter/init/tensorboard.py +1 -1
  58. polyaxon/_schemas/client.py +1 -1
  59. polyaxon/_sdk/api/agents_v1_api.py +56 -80
  60. polyaxon/_sdk/api/artifacts_stores_v1_api.py +2 -2
  61. polyaxon/_sdk/api/auth_v1_api.py +2 -6
  62. polyaxon/_sdk/api/connections_v1_api.py +16 -20
  63. polyaxon/_sdk/api/dashboards_v1_api.py +14 -14
  64. polyaxon/_sdk/api/organizations_v1_api.py +97 -143
  65. polyaxon/_sdk/api/presets_v1_api.py +18 -26
  66. polyaxon/_sdk/api/project_dashboards_v1_api.py +17 -19
  67. polyaxon/_sdk/api/project_searches_v1_api.py +20 -28
  68. polyaxon/_sdk/api/projects_v1_api.py +74 -92
  69. polyaxon/_sdk/api/queues_v1_api.py +22 -30
  70. polyaxon/_sdk/api/runs_v1_api.py +157 -207
  71. polyaxon/_sdk/api/searches_v1_api.py +16 -20
  72. polyaxon/_sdk/api/service_accounts_v1_api.py +30 -38
  73. polyaxon/_sdk/api/tags_v1_api.py +19 -25
  74. polyaxon/_sdk/api/teams_v1_api.py +64 -90
  75. polyaxon/_sdk/api/users_v1_api.py +17 -19
  76. polyaxon/_sdk/api/versions_v1_api.py +4 -4
  77. polyaxon/_sdk/async_client/rest.py +1 -3
  78. polyaxon/_sdk/schemas/v1_section_spec.py +1 -1
  79. polyaxon/_sdk/sync_client/api_client.py +2 -6
  80. polyaxon/_sdk/sync_client/rest.py +4 -8
  81. polyaxon/pkg.py +1 -1
  82. {polyaxon-2.6.0rc1.dist-info → polyaxon-2.6.1.dist-info}/METADATA +6 -6
  83. {polyaxon-2.6.0rc1.dist-info → polyaxon-2.6.1.dist-info}/RECORD +87 -87
  84. {polyaxon-2.6.0rc1.dist-info → polyaxon-2.6.1.dist-info}/LICENSE +0 -0
  85. {polyaxon-2.6.0rc1.dist-info → polyaxon-2.6.1.dist-info}/WHEEL +0 -0
  86. {polyaxon-2.6.0rc1.dist-info → polyaxon-2.6.1.dist-info}/entry_points.txt +0 -0
  87. {polyaxon-2.6.0rc1.dist-info → polyaxon-2.6.1.dist-info}/top_level.txt +0 -0
@@ -75,7 +75,7 @@ class K8sManager(BaseK8sManager):
75
75
  include_uninitialized=True,
76
76
  reraise: bool = False,
77
77
  namespace: str = None,
78
- **kwargs
78
+ **kwargs,
79
79
  ):
80
80
  return self._list_namespace_resource(
81
81
  resource_api=self.k8s_api.list_namespaced_pod,
@@ -89,7 +89,7 @@ class K8sManager(BaseK8sManager):
89
89
  include_uninitialized=True,
90
90
  reraise: bool = False,
91
91
  namespace: str = None,
92
- **kwargs
92
+ **kwargs,
93
93
  ):
94
94
  return self._list_namespace_resource(
95
95
  resource_api=self.k8s_batch_api.list_namespaced_job,
@@ -105,7 +105,7 @@ class K8sManager(BaseK8sManager):
105
105
  plural,
106
106
  reraise: bool = False,
107
107
  namespace: str = None,
108
- **kwargs
108
+ **kwargs,
109
109
  ):
110
110
  return self._list_namespace_resource(
111
111
  resource_api=self.k8s_custom_object_api.list_namespaced_custom_object,
@@ -747,7 +747,7 @@ class K8sManager(BaseK8sManager):
747
747
  include_uninitialized=True,
748
748
  reraise: bool = False,
749
749
  namespace: str = None,
750
- **kwargs
750
+ **kwargs,
751
751
  ):
752
752
  objs = self.list_pods(
753
753
  include_uninitialized=include_uninitialized,
@@ -765,7 +765,7 @@ class K8sManager(BaseK8sManager):
765
765
  include_uninitialized=True,
766
766
  reraise: bool = False,
767
767
  namespace: str = None,
768
- **kwargs
768
+ **kwargs,
769
769
  ):
770
770
  objs = self.list_jobs(
771
771
  include_uninitialized=include_uninitialized,
@@ -812,7 +812,7 @@ class K8sManager(BaseK8sManager):
812
812
  field_selector: str = None,
813
813
  namespace: str = None,
814
814
  reraise: bool = False,
815
- **kwargs
815
+ **kwargs,
816
816
  ) -> List[client.CoreV1EventList]:
817
817
  return self._list_namespace_resource(
818
818
  resource_api=self.k8s_api.list_namespaced_event, # type: ignore[attr-defined]
@@ -98,7 +98,7 @@ class EnvMixin(BaseConverter):
98
98
 
99
99
  try:
100
100
  secret_value = orjson_loads(resource.name)
101
- except orjson.JSONDecodeError as e:
101
+ except orjson.JSONDecodeError:
102
102
  return items_from
103
103
 
104
104
  for item in resource.items:
@@ -50,7 +50,7 @@ class InitConverter(_BaseConverter):
50
50
  env_from: List[Any],
51
51
  args: List[str],
52
52
  command: Optional[List[str]] = None,
53
- **kwargs
53
+ **kwargs,
54
54
  ) -> Optional[process_types.V1Container]:
55
55
  env = env or []
56
56
 
@@ -1,8 +1,6 @@
1
1
  from typing import List, Optional
2
2
 
3
3
  from polyaxon._connections import V1Connection, V1ConnectionResource
4
- from polyaxon._contexts import paths as ctx_paths
5
- from polyaxon._local_process import process_types
6
4
  from polyaxon._runner.converter import BaseConverter
7
5
 
8
6
 
@@ -18,7 +18,7 @@ class JobConverter(JobMixin, BaseConverter):
18
18
  default_sa: Optional[str] = None,
19
19
  default_auth: bool = False,
20
20
  ) -> List[process_types.V1Container]:
21
- job = compiled_operation.run # type: V1Job
21
+ job: V1Job = compiled_operation.run
22
22
  plugins = V1Plugins.get_or_create(
23
23
  config=compiled_operation.plugins, auth=default_auth
24
24
  )
@@ -1,7 +1,7 @@
1
1
  from typing import Dict, Iterable, List, Optional
2
2
 
3
3
  from polyaxon._connections import V1Connection, V1ConnectionResource
4
- from polyaxon._flow import V1CompiledOperation, V1Plugins, V1Service
4
+ from polyaxon._flow import V1CompiledOperation, V1Plugins
5
5
  from polyaxon._local_process import process_types
6
6
  from polyaxon._local_process.converter.base import BaseConverter
7
7
  from polyaxon._local_process.converter.mixins import ServiceMixin
@@ -22,8 +22,9 @@ class ProjectConfigManager(ConfigManager):
22
22
  project = cls.get_config()
23
23
  if not project:
24
24
  Printer.error(
25
- "No project was found, please initialize a project."
26
- " {}".format(cli_constants.INIT_COMMAND)
25
+ "No project was found, please initialize a project." " {}".format(
26
+ cli_constants.INIT_COMMAND
27
+ )
27
28
  )
28
29
  sys.exit(1)
29
30
 
@@ -93,8 +93,7 @@ def check_polyaxonfile(
93
93
  ):
94
94
  if sum([1 for i in [python_module, url, hub] if i]) > 1:
95
95
  message = (
96
- "You can only use one and only one option: "
97
- "hub, url, or a python module.".format(hub)
96
+ "You can only use one and only one option: hub, url, or a python module."
98
97
  )
99
98
  if is_cli:
100
99
  Printer.error(message, sys_exit=True)
@@ -213,8 +212,9 @@ def check_polyaxonfile(
213
212
  def check_polyaxonfile_kind(specification, kind):
214
213
  if specification.kind != kind:
215
214
  Printer.error(
216
- "Your polyaxonfile must be of kind: `{}`, "
217
- "received: `{}`.".format(kind, specification.kind),
215
+ "Your polyaxonfile must be of kind: `{}`, " "received: `{}`.".format(
216
+ kind, specification.kind
217
+ ),
218
218
  sys_exit=True,
219
219
  )
220
220
 
@@ -87,7 +87,7 @@ class CompiledOperationSpecification(BaseSpecification):
87
87
 
88
88
  @staticmethod
89
89
  def _apply_dag_context(config: V1CompiledOperation) -> V1CompiledOperation:
90
- dag_run = config.run # type: V1Dag
90
+ dag_run: V1Dag = config.run
91
91
  dag_run.process_dag()
92
92
  dag_run.validate_dag()
93
93
  dag_run.process_components(config.inputs)
@@ -318,9 +318,7 @@ class CompiledOperationSpecification(BaseSpecification):
318
318
  ) -> V1CompiledOperation:
319
319
  if not preset:
320
320
  return config
321
- preset = OperationSpecification.read(
322
- preset, is_preset=True
323
- ) # type: V1Operation
321
+ preset = OperationSpecification.read(preset, is_preset=True) # type: V1Operation
324
322
  if preset.run_patch:
325
323
  config.run = config.run.patch(
326
324
  validate_run_patch(preset.run_patch, config.run.kind),
@@ -348,7 +346,7 @@ class CompiledOperationSpecification(BaseSpecification):
348
346
  "conditions",
349
347
  "skip_on_upstream_skip",
350
348
  }
351
- patch_keys = patch_keys.intersection(preset.__fields_set__)
349
+ patch_keys = patch_keys.intersection(preset.model_fields_set)
352
350
  patch_data = {k: getattr(preset, k) for k in patch_keys}
353
351
  patch_compiled = V1CompiledOperation.construct(**patch_data)
354
352
  return config.patch(patch_compiled, strategy=preset.patch_strategy)
@@ -61,9 +61,7 @@ class PolyaxonfileParser:
61
61
  return parsed_params
62
62
 
63
63
  @classmethod
64
- def parse_operation(
65
- cls, config, param_spec: Dict[str, ParamSpec]
66
- ): # pylint:disable=too-many-branches
64
+ def parse_operation(cls, config, param_spec: Dict[str, ParamSpec]): # pylint:disable=too-many-branches
67
65
  parsed_params = cls.get_parsed_params(param_spec)
68
66
 
69
67
  parsed_data = {Sections.VERSION: config.version, Sections.KIND: config.kind}
@@ -11,7 +11,7 @@ def validate(spec, data):
11
11
 
12
12
  def validate_keys(section, config, section_data):
13
13
  extra_args = [
14
- key for key in section_data.keys() if key not in config.__fields__.keys()
14
+ key for key in section_data.keys() if key not in config.model_fields.keys()
15
15
  ]
16
16
  if extra_args:
17
17
  raise PolyaxonfileError(
@@ -39,7 +39,7 @@ class OperationSpecification(BaseSpecification):
39
39
 
40
40
  config = config.patch(preset, preset.patch_strategy)
41
41
  # Patch run
42
- component = config.component # type: V1Component
42
+ component: V1Component = config.component
43
43
  if not component:
44
44
  raise PolyaxonSchemaError(
45
45
  "Compile operation received an invalid configuration: "
@@ -107,7 +107,7 @@ class OperationSpecification(BaseSpecification):
107
107
  "conditions",
108
108
  "skip_on_upstream_skip",
109
109
  }
110
- patch_keys = patch_keys.intersection(config.__fields_set__)
110
+ patch_keys = patch_keys.intersection(config.model_fields_set)
111
111
  patch_data = {k: getattr(config, k) for k in patch_keys}
112
112
  patch_compiled = V1CompiledOperation.construct(contexts=contexts, **patch_data)
113
113
 
polyaxon/_pql/manager.py CHANGED
@@ -59,7 +59,7 @@ class PQLManager:
59
59
  if cls.FIELDS_TRANS[field].get("type"):
60
60
  update_tokenized_query[
61
61
  "{}_type".format(field_trans)
62
- ] = cls.FIELDS_TRANS[field]["type"]
62
+ ] = cls.FIELDS_TRANS[field]["type"] # fmt: skip
63
63
  else:
64
64
  update_tokenized_query[key] = tokenized_query[key]
65
65
 
polyaxon/_pql/parser.py CHANGED
@@ -85,8 +85,9 @@ def parse_datetime_operation(operation: str) -> "QueryOpSpec":
85
85
  # Check not allowed ops
86
86
  if "|" in _operation:
87
87
  raise PQLException(
88
- "`|` is not allowed for datetime conditions. "
89
- "Operation: {}".format(operation)
88
+ "`|` is not allowed for datetime conditions. Operation: {}".format(
89
+ operation
90
+ )
90
91
  )
91
92
 
92
93
  # Check nil operation
@@ -140,13 +141,11 @@ def parse_scalar_operation(operation: str, loader: Callable = None) -> "QueryOpS
140
141
  # Check not allowed ops
141
142
  if "|" in _operation:
142
143
  raise PQLException(
143
- "`|` is not allowed for scalar conditions. "
144
- "Operation: {}".format(operation)
144
+ "`|` is not allowed for scalar conditions. Operation: {}".format(operation)
145
145
  )
146
146
  if ".." in _operation:
147
147
  raise PQLException(
148
- "`..` is not allowed for scalar conditions. "
149
- "Operation: {}".format(operation)
148
+ "`..` is not allowed for scalar conditions. Operation: {}".format(operation)
150
149
  )
151
150
 
152
151
  # Check nil operation
@@ -173,8 +172,9 @@ def parse_scalar_operation(operation: str, loader: Callable = None) -> "QueryOpS
173
172
  float(_operation)
174
173
  except (ValueError, TypeError):
175
174
  raise PQLException(
176
- "Scalar operation requires int or float params, "
177
- "received {}.".format(operation)
175
+ "Scalar operation requires int or float params, received {}.".format(
176
+ operation
177
+ )
178
178
  )
179
179
  return QueryOpSpec(op, negation, _operation)
180
180
 
@@ -205,8 +205,7 @@ def parse_value_operation(operation: str) -> "QueryOpSpec":
205
205
  # Check range not allowed
206
206
  if ".." in _operation:
207
207
  raise PQLException(
208
- "`..` is not allowed for value conditions. "
209
- "Operation: {}".format(operation)
208
+ "`..` is not allowed for value conditions. Operation: {}".format(operation)
210
209
  )
211
210
 
212
211
  # Check nil operation
@@ -230,8 +229,9 @@ def parse_value_operation(operation: str) -> "QueryOpSpec":
230
229
  ]
231
230
  if len(params) <= 1:
232
231
  raise PQLException(
233
- "`{}` is not allowed for value conditions, "
234
- "Operation: {}".format(op, operation)
232
+ "`{}` is not allowed for value conditions, Operation: {}".format(
233
+ op, operation
234
+ )
235
235
  )
236
236
  return QueryOpSpec(op, negation, params)
237
237
 
@@ -270,8 +270,7 @@ def parse_search_operation(operation: str) -> "QueryOpSpec":
270
270
  # Check range not allowed
271
271
  if ".." in _operation:
272
272
  raise PQLException(
273
- "`..` is not allowed for search conditions. "
274
- "Operation: {}".format(operation)
273
+ "`..` is not allowed for search conditions. Operation: {}".format(operation)
275
274
  )
276
275
 
277
276
  # Check nil operation
@@ -286,8 +285,9 @@ def parse_search_operation(operation: str) -> "QueryOpSpec":
286
285
  op, _operation = parse_comparison_operation(_operation)
287
286
  if op:
288
287
  raise PQLException(
289
- "`{}` is not allowed for search conditions, "
290
- "Operation: {}".format(op, operation)
288
+ "`{}` is not allowed for search conditions, Operation: {}".format(
289
+ op, operation
290
+ )
291
291
  )
292
292
 
293
293
  # Early return
@@ -303,8 +303,9 @@ def parse_search_operation(operation: str) -> "QueryOpSpec":
303
303
  ]
304
304
  if len(params) <= 1:
305
305
  raise PQLException(
306
- "`{}` is not allowed for search conditions, "
307
- "Operation: {}".format(op, operation)
306
+ "`{}` is not allowed for search conditions, Operation: {}".format(
307
+ op, operation
308
+ )
308
309
  )
309
310
  return QueryOpSpec(op, negation, params)
310
311
 
@@ -317,8 +318,9 @@ def parse_search_operation(operation: str) -> "QueryOpSpec":
317
318
  params = [param.strip() for param in params if param.strip()]
318
319
  if len(params) != 1:
319
320
  raise PQLException(
320
- "`{}` is not allowed for search conditions, "
321
- "Operation: {}".format(op, operation)
321
+ "`{}` is not allowed for search conditions, Operation: {}".format(
322
+ op, operation
323
+ )
322
324
  )
323
325
  return QueryOpSpec(op, negation, parse_operation_value(params[0]))
324
326
 
@@ -328,8 +330,9 @@ def parse_search_operation(operation: str) -> "QueryOpSpec":
328
330
  params = [param.strip() for param in params if param.strip()]
329
331
  if len(params) != 1:
330
332
  raise PQLException(
331
- "`{}` is not allowed for search conditions, "
332
- "Operation: {}".format(op, operation)
333
+ "`{}` is not allowed for search conditions, Operation: {}".format(
334
+ op, operation
335
+ )
333
336
  )
334
337
  return QueryOpSpec(op, negation, parse_operation_value(params[0]))
335
338
 
@@ -339,16 +342,16 @@ def parse_search_operation(operation: str) -> "QueryOpSpec":
339
342
  params = [param.strip() for param in params if param.strip()]
340
343
  if len(params) != 1:
341
344
  raise PQLException(
342
- "`{}` is not allowed for search conditions, "
343
- "Operation: {}".format(op, operation)
345
+ "`{}` is not allowed for search conditions, Operation: {}".format(
346
+ op, operation
347
+ )
344
348
  )
345
349
  return QueryOpSpec(op, negation, parse_operation_value(params[0]))
346
350
 
347
351
  if not _operation:
348
352
  raise PQLException(
349
353
  "Expression is not valid, it must be formatted as "
350
- "name:operation, "
351
- "Operation: {}".format(operation)
354
+ "name:operation, Operation: {}".format(operation)
352
355
  )
353
356
  # Now the operation must be an equality param param
354
357
  return QueryOpSpec("=", negation, _operation)
@@ -70,8 +70,7 @@ class BaseAgent:
70
70
  )
71
71
  except Exception as e:
72
72
  logger.warning(
73
- "Agent failed to collect agent data: {}\n"
74
- "Retrying ...".format(repr(e))
73
+ "Agent failed to collect agent data: {}\nRetrying ...".format(repr(e))
75
74
  )
76
75
 
77
76
  def sync_compatible_updates(self, compatible_updates: Dict):
@@ -8,8 +8,9 @@ def get_artifacts_store_args(artifacts_path: str, clean: bool) -> str:
8
8
  dir=artifacts_path
9
9
  )
10
10
  delete_dir = (
11
- 'if [ -d {path} ] && [ "$(ls -A {path})" ]; '
12
- "then rm -R {path}/*; fi;".format(path=artifacts_path)
11
+ 'if [ -d {path} ] && [ "$(ls -A {path})" ]; then rm -R {path}/*; fi;'.format(
12
+ path=artifacts_path
13
+ )
13
14
  )
14
15
  if clean:
15
16
  return "{} {}".format(get_or_create, delete_dir)
@@ -21,7 +21,7 @@ def get_tensorboard_args(
21
21
  if tb_args.use_names:
22
22
  args.append("--use-names")
23
23
  if tb_args.path_prefix:
24
- args.append("--path-prefix={}".format(tb_args.path_prefix)),
24
+ args.append("--path-prefix={}".format(tb_args.path_prefix))
25
25
  if tb_args.plugins:
26
26
  plugins = validate_tags(tb_args.plugins, validate_yaml=True)
27
27
  args.append("--plugins={}".format(",".join(plugins)))
@@ -113,7 +113,7 @@ class ClientConfig(BaseSchemaModel):
113
113
  token: Optional[str] = None,
114
114
  use_cloud_host: bool = False,
115
115
  retries: Optional[int] = None,
116
- **data
116
+ **data,
117
117
  ):
118
118
  host = (
119
119
  clean_host(host or LOCALHOST) if not use_cloud_host else POLYAXON_CLOUD_HOST