polyaxon 2.5.0rc3__py3-none-any.whl → 2.5.2__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.
@@ -22,11 +22,8 @@ def get_dashboard_url(
22
22
  base: str = "ui", subpath: str = "", use_cloud: bool = False, host: str = None
23
23
  ) -> str:
24
24
  if not host:
25
- host = (
26
- POLYAXON_CLOUD_HOST
27
- if use_cloud
28
- else clean_host(settings.CLIENT_CONFIG.host)
29
- )
25
+ host = POLYAXON_CLOUD_HOST if use_cloud else settings.CLIENT_CONFIG.host
26
+ host = clean_host(host)
30
27
  dashboard_url = "{}/{}/".format(host, base)
31
28
  if subpath:
32
29
  return "{}{}/".format(dashboard_url, subpath.rstrip("/"))
@@ -314,7 +314,7 @@ async def list_files(
314
314
 
315
315
 
316
316
  async def delete_file_or_dir(
317
- fs: FSSystem, store_path: str, subpath: Union[str], is_file: bool
317
+ fs: FSSystem, store_path: str, subpath: Optional[str], is_file: bool
318
318
  ) -> bool:
319
319
  try:
320
320
  await ensure_async_execution(
@@ -24,10 +24,10 @@ class BaseAsyncAgent(BaseAgent):
24
24
  IS_ASYNC = True
25
25
 
26
26
  async def _enter(self):
27
- if not self.client._is_managed:
28
- return self
29
27
  logger.warning("Agent is starting.")
30
28
  await self.executor.refresh()
29
+ if not self.client._is_managed:
30
+ return self
31
31
  try:
32
32
  agent = await self.client.get_info()
33
33
  self._check_status(agent)
@@ -81,13 +81,16 @@ class BaseAsyncAgent(BaseAgent):
81
81
 
82
82
  async def reconcile(self):
83
83
  if (
84
- now() - self._last_reconciled_at
84
+ now() - self._last_data_collected_at
85
85
  ).total_seconds() > self.SLEEP_AGENT_DATA_COLLECT_TIME:
86
+ await self.collect_agent_data()
87
+ if (
88
+ now() - self._last_reconciled_at
89
+ ).total_seconds() < self.SLEEP_AGENT_DATA_RECONCILE_TIME:
86
90
  return
87
91
 
88
- # Collect data
89
- await self.collect_agent_data()
90
-
92
+ logger.info("Checking cluster state.")
93
+ self._last_reconciled_at = now()
91
94
  # Update reconcile
92
95
  namespaces = [settings.AGENT_CONFIG.namespace]
93
96
  namespaces += settings.AGENT_CONFIG.additional_namespaces or []
@@ -4,7 +4,7 @@ import traceback
4
4
  from concurrent.futures import ThreadPoolExecutor
5
5
  from typing import Any, Dict, Optional, Tuple, Type
6
6
 
7
- from clipped.utils.tz import now
7
+ from clipped.utils.tz import get_datetime_from_now, now
8
8
 
9
9
  from polyaxon import settings
10
10
  from polyaxon._auxiliaries import V1PolyaxonInitContainer, V1PolyaxonSidecarContainer
@@ -24,7 +24,8 @@ class BaseAgent:
24
24
  HEALTH_FILE = "/tmp/.healthz"
25
25
  SLEEP_STOP_TIME = 60 * 5
26
26
  SLEEP_ARCHIVED_TIME = 60 * 60
27
- SLEEP_AGENT_DATA_COLLECT_TIME = 60 * 30
27
+ SLEEP_AGENT_DATA_COLLECT_TIME = 60 * 15
28
+ SLEEP_AGENT_DATA_RECONCILE_TIME = 60 * 5
28
29
  IS_ASYNC = False
29
30
 
30
31
  def __init__(
@@ -38,11 +39,13 @@ class BaseAgent:
38
39
  self.max_interval = max(max_interval, 3)
39
40
  if not agent_uuid and not owner:
40
41
  owner = DEFAULT
42
+ last_hour = get_datetime_from_now(days=0, hours=1)
41
43
  self.executor = None
42
44
  self._default_auth = bool(agent_uuid)
43
- self._executor_refreshed_at = now()
45
+ self._executor_refreshed_at = last_hour
44
46
  self._graceful_shutdown = False
45
- self._last_reconciled_at = now()
47
+ self._last_data_collected_at = last_hour
48
+ self._last_reconciled_at = last_hour
46
49
  self.client = AgentClient(
47
50
  owner=owner, agent_uuid=agent_uuid, is_async=self.IS_ASYNC
48
51
  )
@@ -60,7 +63,7 @@ class BaseAgent:
60
63
 
61
64
  def collect_agent_data(self):
62
65
  logger.info("Collecting agent data.")
63
- self._last_reconciled_at = now()
66
+ self._last_data_collected_at = now()
64
67
  try:
65
68
  return self.client.collect_agent_data(
66
69
  namespace=settings.CLIENT_CONFIG.namespace
@@ -79,14 +79,17 @@ class BaseSyncAgent(BaseAgent):
79
79
 
80
80
  def reconcile(self):
81
81
  if (
82
- now() - self._last_reconciled_at
82
+ now() - self._last_data_collected_at
83
83
  ).total_seconds() > self.SLEEP_AGENT_DATA_COLLECT_TIME:
84
+ self.collect_agent_data()
85
+ if (
86
+ now() - self._last_reconciled_at
87
+ ).total_seconds() < self.SLEEP_AGENT_DATA_RECONCILE_TIME:
84
88
  return
85
89
 
86
- # Collect data
87
- self.collect_agent_data()
88
-
89
90
  # Update reconcile
91
+ logger.info("Checking cluster state.")
92
+ self._last_reconciled_at = now()
90
93
  namespaces = [settings.AGENT_CONFIG.namespace]
91
94
  namespaces += settings.AGENT_CONFIG.additional_namespaces or []
92
95
  ops = []
@@ -930,15 +930,23 @@ class BaseConverter:
930
930
 
931
931
  # Add outputs
932
932
  if plugins and plugins.collect_artifacts:
933
+ _artifacts_init_env = []
934
+ if log_level:
935
+ _artifacts_init_env.append(
936
+ self._get_env_var(name=ENV_KEYS_LOG_LEVEL, value=log_level)
937
+ )
938
+ proxy_env = self._get_proxy_env_vars(
939
+ settings.AGENT_CONFIG.use_proxy_env_vars_use_in_ops
940
+ )
941
+ if proxy_env:
942
+ _artifacts_init_env += proxy_env
933
943
  containers += to_list(
934
944
  self._get_artifacts_path_init_container(
935
945
  polyaxon_init=polyaxon_init,
936
946
  artifacts_store=artifacts_store,
937
947
  run_path=self.run_path,
938
948
  auto_resume=plugins.auto_resume,
939
- env=self._get_proxy_env_vars(
940
- settings.AGENT_CONFIG.use_proxy_env_vars_use_in_ops
941
- ),
949
+ env=_artifacts_init_env,
942
950
  ),
943
951
  check_none=True,
944
952
  )
@@ -185,7 +185,7 @@ class LifeCycle:
185
185
 
186
186
  @classmethod
187
187
  def is_pending(cls, status: str) -> bool:
188
- """Checks if a run with this status is in a pending status."""
188
+ """Checks if a run with this status is in one of the pending(not compiled or queued yet) statuses."""
189
189
  return status in cls.PENDING_VALUES
190
190
 
191
191
  @classmethod
@@ -220,7 +220,7 @@ class LifeCycle:
220
220
 
221
221
  @classmethod
222
222
  def is_safe_stoppable(cls, status: str) -> bool:
223
- """Checks if a run with this status is an be stopped without operator."""
223
+ """Checks if a run with this status is can be stopped without calling the operator."""
224
224
  return status in cls.SAFE_STOP_VALUES
225
225
 
226
226
  @classmethod
polyaxon/pkg.py CHANGED
@@ -1,5 +1,5 @@
1
1
  NAME = "polyaxon"
2
- VERSION = "2.5.0-rc3"
2
+ VERSION = "2.5.2"
3
3
  SCHEMA_VERSION = 1.1
4
4
  DESC = "Command Line Interface (CLI) and client to interact with Polyaxon API."
5
5
  URL = "https://github.com/polyaxon/polyaxon"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyaxon
3
- Version: 2.5.0rc3
3
+ Version: 2.5.2
4
4
  Summary: Command Line Interface (CLI) and client to interact with Polyaxon API.
5
5
  Home-page: https://github.com/polyaxon/polyaxon
6
6
  Author: Polyaxon, Inc.
@@ -60,9 +60,9 @@ Provides-Extra: docker
60
60
  Requires-Dist: docker; extra == "docker"
61
61
  Provides-Extra: fs
62
62
  Requires-Dist: adlfs==2024.7.0; extra == "fs"
63
- Requires-Dist: fsspec==2024.9.0; extra == "fs"
64
- Requires-Dist: gcsfs==2024.9.0.post1; extra == "fs"
65
- Requires-Dist: s3fs==2024.9.0; extra == "fs"
63
+ Requires-Dist: fsspec==2024.10.0; extra == "fs"
64
+ Requires-Dist: gcsfs==2024.10.0; extra == "fs"
65
+ Requires-Dist: s3fs==2024.10.0; extra == "fs"
66
66
  Provides-Extra: fsspec
67
67
  Requires-Dist: fsspec; extra == "fsspec"
68
68
  Provides-Extra: gcs
@@ -72,7 +72,7 @@ Requires-Dist: gitpython; extra == "git"
72
72
  Provides-Extra: init
73
73
  Requires-Dist: docker; extra == "init"
74
74
  Requires-Dist: GitPython<3.2.0; extra == "init"
75
- Requires-Dist: aiofiles==23.2.1; extra == "init"
75
+ Requires-Dist: aiofiles==24.1.0; extra == "init"
76
76
  Provides-Extra: k8s_async
77
77
  Requires-Dist: kubernetes-asyncio>=28.2.1; extra == "k8s-async"
78
78
  Requires-Dist: aiohttp>=3.0.0; extra == "k8s-async"
@@ -84,7 +84,7 @@ Requires-Dist: s3fs; extra == "s3"
84
84
  Provides-Extra: sandbox
85
85
  Requires-Dist: haupt[sandbox]; extra == "sandbox"
86
86
  Provides-Extra: sidecar
87
- Requires-Dist: aiofiles==23.2.1; extra == "sidecar"
87
+ Requires-Dist: aiofiles==24.1.0; extra == "sidecar"
88
88
  Requires-Dist: pandas; extra == "sidecar"
89
89
  Requires-Dist: anyio; extra == "sidecar"
90
90
 
@@ -93,7 +93,7 @@ Requires-Dist: anyio; extra == "sidecar"
93
93
  [![Slack](https://img.shields.io/badge/Slack-1.5k%20members-blue.svg?style=flat&logo=slack&longCache=true)](https://polyaxon.com/slack/)
94
94
 
95
95
  [![Docs](https://img.shields.io/badge/docs-stable-brightgreen.svg?style=flat&longCache=true)](https://polyaxon.com/docs/)
96
- [![Release](https://img.shields.io/badge/release-v2.5.0-brightgreen.svg?longCache=true)](https://polyaxon.com/docs/releases/2-1/)
96
+ [![Release](https://img.shields.io/badge/release-v2.5.2-brightgreen.svg?longCache=true)](https://polyaxon.com/docs/releases/2-5/)
97
97
  [![GitHub](https://img.shields.io/badge/issue_tracker-github-blue?style=flat&logo=github&longCache=true)](https://github.com/polyaxon/polyaxon/issues)
98
98
  [![GitHub](https://img.shields.io/badge/roadmap-github-blue?style=flat&logo=github&longCache=true)](https://github.com/orgs/polyaxon/projects/5)
99
99
 
@@ -9,7 +9,7 @@ polyaxon/exceptions.py,sha256=ujvG9p1Pn2KHYbHqB3-faadW46dEuULUQXNtfkd2zk8,10236
9
9
  polyaxon/fs.py,sha256=RS8XmVrrfXfIJXN6cTCCRRYwesCLHVVfC01Vi56lecs,246
10
10
  polyaxon/k8s.py,sha256=nI5oPCSlqU4aaeVShM6SlYS9eqYiYUL4GDXIZ4bnq-I,1051
11
11
  polyaxon/logger.py,sha256=gdZQms37Pe5G2j-Ear5jbSAJeGgX6fnvg7oE8_9MSlc,2309
12
- polyaxon/pkg.py,sha256=KOSmdNG6T__woM59eUugry5zTzcKESoKBKiTr0-w418,266
12
+ polyaxon/pkg.py,sha256=LvIi5SHiW4ZmXaS1Yuhmmz7nKTbh6JBf4kvXWYjZJUQ,262
13
13
  polyaxon/polyaxonfile.py,sha256=xHmHT_cHomfuAQm82Jhnp71YNN5mQ-Lod7EbonjY4b4,429
14
14
  polyaxon/schemas.py,sha256=-CykY3emoAUCs_zRNbjwkuMkqbaEDjfKsZC86rI8154,5870
15
15
  polyaxon/settings.py,sha256=Pxx1-T2oeJ5XmvGFN0YgnVzum_9FyTPaQtl68aQvYc4,4116
@@ -29,7 +29,7 @@ polyaxon/_cli/check.py,sha256=WSQpQp3enPmgIXrllwgUTd3VcjYCG8P-37ONt7F67wo,1337
29
29
  polyaxon/_cli/completion.py,sha256=soJlrKTAFdxskWNH3YjgCMTM__NqVCr9Rr6z8FSmXao,2017
30
30
  polyaxon/_cli/components.py,sha256=pvfZB9NIjwA8qtfdebKWMAbdx--7ARV0FZImPnW6u4A,19818
31
31
  polyaxon/_cli/config.py,sha256=-ruIopLsC0ArPvw8RHlY5uQDu2_eaQ5PnvEDNJsq9f8,9165
32
- polyaxon/_cli/dashboard.py,sha256=zRrOJMfowM7YQnYXhz_guKsTi-jkoCuVl_g0UTJ37qE,1681
32
+ polyaxon/_cli/dashboard.py,sha256=Dmx6lXqVmUQ60eOtEpxWCvGzKEjibxXVmSHDQUkRn8M,1649
33
33
  polyaxon/_cli/errors.py,sha256=BYs7-I0CLLNYma-I0eJXB1EHs8ZTs_nWGRKGJz6CzTI,1031
34
34
  polyaxon/_cli/init.py,sha256=lZhkIbaHGv4FdMypdmXhYXRrH5GpM-qcDEks4IsmKIM,7714
35
35
  polyaxon/_cli/models.py,sha256=71oxGrIe4nQORnnfAiNi6T7A0DBnEe3V6whBABBGL3c,18066
@@ -265,7 +265,7 @@ polyaxon/_flow/schedules/interval.py,sha256=f8htwcdlMY0QhrIPzBAXrgxASkdvAPkBSzhf
265
265
  polyaxon/_flow/templates/__init__.py,sha256=48uuXIvy3G10V2o5oWw9oztNIZt5yIAXcWjVxNhHwVI,2676
266
266
  polyaxon/_flow/termination/__init__.py,sha256=MLO-LxCNSEDJDYQihjh8_uTIxs6w2y-MNcLPau7nugY,3496
267
267
  polyaxon/_fs/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
268
- polyaxon/_fs/async_manager.py,sha256=XMG2uIwRReN9ppzCp2X2V9tzt_wBuKiQ8gbEyb5TaJA,10754
268
+ polyaxon/_fs/async_manager.py,sha256=xSGTHQw_pfNobGcsNjx_7Sry0Yv6AfXqDiVhqsxK2gQ,10757
269
269
  polyaxon/_fs/fs.py,sha256=LXVmpOGAYayl5RZVrrE8nf3w7ILEJ4SSUtx621DKGYE,3412
270
270
  polyaxon/_fs/manager.py,sha256=DjhGHRHEUd7Oj-pS4uhfYxCpJJAwP7tt5Xu0KWZqDik,991
271
271
  polyaxon/_fs/tar.py,sha256=1Gk9HwhdwPlG7r2ZuXuaPAMu4q_eYqPe9MSQibYuf_E,891
@@ -411,12 +411,12 @@ polyaxon/_runner/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,
411
411
  polyaxon/_runner/executor.py,sha256=Ln5fhc3MGk4cOg0VenbiFh80rWR-dj4t3ll7XXR-2v8,8297
412
412
  polyaxon/_runner/kinds.py,sha256=IhEL-HfztpDU4wUA7z8koQwN1Z32g2q57iDiiT9YZ40,132
413
413
  polyaxon/_runner/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
414
- polyaxon/_runner/agent/async_agent.py,sha256=EWHsblxzEBLryD_AMsf4jvVWahCWDdJSW4e9xqN_Crc,15493
415
- polyaxon/_runner/agent/base_agent.py,sha256=5PRo65T0S_LsVEWPQrvylEeE72dSy6IpB1dsFQNhkYM,7310
414
+ polyaxon/_runner/agent/async_agent.py,sha256=HMHrSQrz8h_8glFLyv3VwqiGksXan0uuHtu2Ak0mfKA,15689
415
+ polyaxon/_runner/agent/base_agent.py,sha256=d3lYR0p4VFbCBDVCl6CMXzKBFJbIE9EERvviQRaIZRg,7498
416
416
  polyaxon/_runner/agent/client.py,sha256=Nnu3zy9dh8w5W9QYjcITytMNtP5WAeqh0_97yYF1ByI,5485
417
- polyaxon/_runner/agent/sync_agent.py,sha256=1w3rjpMgCmhRbe_xjgd0MNGaE8gatQT7hjJWoqFBQoc,14591
417
+ polyaxon/_runner/agent/sync_agent.py,sha256=2vEjd4Bd-MNdNTuvMpCDGk7e1gXzKrK8xMaNfpDvvDM,14787
418
418
  polyaxon/_runner/converter/__init__.py,sha256=I6njdCBfyW_Pt1tvxIcpD1Eiy4Vs46QtQpbABgYjyoY,63
419
- polyaxon/_runner/converter/converter.py,sha256=bjSyRL8Z9Jb9gbgI2ymewo2ZFhW9887ySF48duq42cU,38005
419
+ polyaxon/_runner/converter/converter.py,sha256=bNHP_uunnWgpyWrtwetnAmIDRotOrH3kp6mtbtZ2MlQ,38313
420
420
  polyaxon/_runner/converter/types.py,sha256=Sg8BaqSEHHwUzeG_MP5gv-j9NPiL1IdUpcOlkJQLZzI,567
421
421
  polyaxon/_runner/converter/common/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
422
422
  polyaxon/_runner/converter/common/constants.py,sha256=D5batbx4p8UwQNX3oFbZHPQ6Ln3tUtBEIH02GezaUB0,201
@@ -440,7 +440,7 @@ polyaxon/_schemas/compatibility.py,sha256=qNNYxkOr5crVJFny_Bc3e0xDt9O8A51rWcX_8T
440
440
  polyaxon/_schemas/container_resources.py,sha256=aZ4XZn0uwCbVGnyhfpAB8Ejs8miNJpwmhVxgs7dC_38,1401
441
441
  polyaxon/_schemas/home.py,sha256=3RFrNvgXeCEVWMGbQ_WtnBqP6aAczeDktyUW4h7u6Pk,510
442
442
  polyaxon/_schemas/installation.py,sha256=thpf0W0jE6DWNHUyuOePHzx-M4_qVFC4N6PeBauzokg,425
443
- polyaxon/_schemas/lifecycle.py,sha256=0NNTJADiLKrg3pLO4rfEGLqDXmOFC-QqruHHcE5FvfY,11612
443
+ polyaxon/_schemas/lifecycle.py,sha256=M2Cc3ia3_zjMleqivlNIlpyEE_wzeQ_gLgOuAulnhlo,11664
444
444
  polyaxon/_schemas/log_handler.py,sha256=kws7k8pZrdeHqkn1dE54bdlGst-cjxe2qk9zL0LX3d8,430
445
445
  polyaxon/_schemas/services.py,sha256=J3mr-7xj52I5s5JHlaq2pYeCocqvH6GgV8WP6EfshKY,1481
446
446
  polyaxon/_schemas/user.py,sha256=kTtPQdvFoeDca5v5Esf9lnIuVThXPNj99QBziTRyn6w,341
@@ -611,9 +611,9 @@ polyaxon/tuners/hyperopt.py,sha256=zd6MblMGkooqLGDFJVo5kClqYnBoMwGj-opqqj8FDzQ,7
611
611
  polyaxon/tuners/mapping.py,sha256=pOdHCiwEufTk-QT7pNyjBjAEWNTM-lMC17WNTCk7C24,69
612
612
  polyaxon/tuners/random_search.py,sha256=6VEekM3N9h6E1lbpVTTUGKFPJlGMY2u-GkG615_nQcI,80
613
613
  polyaxon_sdk/__init__.py,sha256=HWvFdGWESyVG3f26K_szewiG-McMOHFkXKTfZcBlHsM,92
614
- polyaxon-2.5.0rc3.dist-info/LICENSE,sha256=86kroZbQUDsmSWOomB7dpceG65UXiVSPob4581tStBc,11349
615
- polyaxon-2.5.0rc3.dist-info/METADATA,sha256=N5qXubhi69Di4LFVClmmam28jvEwiaykYBF9gp7qp3M,11667
616
- polyaxon-2.5.0rc3.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
617
- polyaxon-2.5.0rc3.dist-info/entry_points.txt,sha256=aFbUMjkg9vzRBVAFhqvR1m92yG8Cov7UAF0zViGfoQw,70
618
- polyaxon-2.5.0rc3.dist-info/top_level.txt,sha256=I_2e_Vv8rdcqWcMMdZocbrHiKPNGqoSMBqIObrw00Rg,22
619
- polyaxon-2.5.0rc3.dist-info/RECORD,,
614
+ polyaxon-2.5.2.dist-info/LICENSE,sha256=86kroZbQUDsmSWOomB7dpceG65UXiVSPob4581tStBc,11349
615
+ polyaxon-2.5.2.dist-info/METADATA,sha256=9i6FODhQvHEGVMurHGLfp3_SyzIU3BxraF8bDSfVdJo,11661
616
+ polyaxon-2.5.2.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
617
+ polyaxon-2.5.2.dist-info/entry_points.txt,sha256=aFbUMjkg9vzRBVAFhqvR1m92yG8Cov7UAF0zViGfoQw,70
618
+ polyaxon-2.5.2.dist-info/top_level.txt,sha256=I_2e_Vv8rdcqWcMMdZocbrHiKPNGqoSMBqIObrw00Rg,22
619
+ polyaxon-2.5.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.44.0)
2
+ Generator: bdist_wheel (0.45.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5