polyaxon 2.1.0rc1__py3-none-any.whl → 2.1.0rc3__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.
@@ -59,7 +59,9 @@ class AsyncK8sManager(BaseK8sManager):
59
59
  raise PolyaxonK8sError("Connection error: %s" % e) from e
60
60
  return None
61
61
 
62
- async def is_pod_running(self, pod_id: str, container_id: str, namespace: str = None) -> bool:
62
+ async def is_pod_running(
63
+ self, pod_id: str, container_id: str, namespace: str = None
64
+ ) -> bool:
63
65
  event = await self.k8s_api.read_namespaced_pod_status(pod_id, namespace=namespace or self.namespace) # type: ignore[attr-defined]
64
66
  return is_pod_running(event, container_id)
65
67
 
@@ -197,12 +197,13 @@ class BaseAsyncAgent(BaseAgent):
197
197
  if not resource:
198
198
  return
199
199
 
200
+ namespace = None if len(run_data) < 5 else run_data[4]
200
201
  try:
201
202
  await self.executor.create(
202
203
  run_uuid=run_uuid,
203
204
  run_kind=run_data[1],
204
205
  resource=resource,
205
- namespace=run_data[4],
206
+ namespace=namespace,
206
207
  )
207
208
  except ApiException as e:
208
209
  if e.status == 409:
@@ -239,12 +240,14 @@ class BaseAsyncAgent(BaseAgent):
239
240
  if not resource:
240
241
  return
241
242
 
243
+ namepsace = None if len(run_data) < 5 else run_data[4]
244
+
242
245
  try:
243
246
  await self.executor.create(
244
247
  run_uuid=run_uuid,
245
248
  run_kind=run_data[1],
246
249
  resource=resource,
247
- namespace=run_data[4],
250
+ namespace=namepsace,
248
251
  )
249
252
  except ApiException as e:
250
253
  if e.status == 409:
@@ -270,12 +273,14 @@ class BaseAsyncAgent(BaseAgent):
270
273
  if not resource:
271
274
  return
272
275
 
276
+ namespace = None if len(run_data) < 5 else run_data[4]
277
+
273
278
  try:
274
279
  await self.executor.apply(
275
280
  run_uuid=run_uuid,
276
281
  run_kind=run_data[1],
277
282
  resource=resource,
278
- namespace=run_data[4],
283
+ namespace=namespace,
279
284
  )
280
285
  await self.client.log_run_running(
281
286
  run_owner=run_owner, run_project=run_project, run_uuid=run_uuid
@@ -285,14 +290,15 @@ class BaseAsyncAgent(BaseAgent):
285
290
  run_owner=run_owner, run_project=run_project, run_uuid=run_uuid, exc=e
286
291
  )
287
292
  await self.clean_run(
288
- run_uuid=run_uuid, run_kind=run_data[1], namespace=run_data[4]
293
+ run_uuid=run_uuid, run_kind=run_data[1], namespace=namespace
289
294
  )
290
295
 
291
296
  async def check_run(self, run_data: Tuple[str, str, str]):
292
297
  run_owner, run_project, run_uuid = get_run_info(run_instance=run_data[0])
298
+ namespace = None if len(run_data) < 3 else run_data[2]
293
299
  try:
294
300
  await self.executor.get(
295
- run_uuid=run_uuid, run_kind=run_data[1], namespace=run_data[2]
301
+ run_uuid=run_uuid, run_kind=run_data[1], namespace=namespace
296
302
  )
297
303
  except ApiException as e:
298
304
  if e.status == 404:
@@ -305,9 +311,10 @@ class BaseAsyncAgent(BaseAgent):
305
311
 
306
312
  async def stop_run(self, run_data: Tuple[str, str, str]):
307
313
  run_owner, run_project, run_uuid = get_run_info(run_instance=run_data[0])
314
+ namespace = None if len(run_data) < 3 else run_data[2]
308
315
  try:
309
316
  await self.executor.stop(
310
- run_uuid=run_uuid, run_kind=run_data[1], namespace=run_data[2]
317
+ run_uuid=run_uuid, run_kind=run_data[1], namespace=namespace
311
318
  )
312
319
  except ApiException as e:
313
320
  if e.status == 404:
@@ -326,11 +333,12 @@ class BaseAsyncAgent(BaseAgent):
326
333
 
327
334
  async def delete_run(self, run_data: Tuple[str, str, str, str, str]):
328
335
  run_owner, run_project, run_uuid = get_run_info(run_instance=run_data[0])
336
+ namespace = None if len(run_data) < 5 else run_data[4]
329
337
  if run_data[3]:
330
338
  await self.make_and_create_run(run_data)
331
339
  else:
332
340
  await self.clean_run(
333
- run_uuid=run_uuid, run_kind=run_data[1], namespace=run_data[4]
341
+ run_uuid=run_uuid, run_kind=run_data[1], namespace=namespace
334
342
  )
335
343
 
336
344
  async def clean_run(self, run_uuid: str, run_kind: str, namespace: str = None):
@@ -1,4 +1,4 @@
1
- from typing import Optional
1
+ from typing import Dict, Optional
2
2
  from typing_extensions import Annotated
3
3
 
4
4
  from clipped.compact.pydantic import Field, StrictInt, StrictStr, validate_arguments
@@ -2399,6 +2399,7 @@ class AgentsV1Api(BaseApi):
2399
2399
  def cron_agent(
2400
2400
  self,
2401
2401
  owner: Annotated[StrictStr, Field(..., description="Owner of the namespace")],
2402
+ body: Annotated[Optional[Dict], Field(..., description="Cron body")] = None,
2402
2403
  **kwargs
2403
2404
  ) -> V1AgentStateResponse: # noqa: E501
2404
2405
  """Global Cron agent # noqa: E501
@@ -2406,11 +2407,13 @@ class AgentsV1Api(BaseApi):
2406
2407
  This method makes a synchronous HTTP request by default. To make an
2407
2408
  asynchronous HTTP request, please pass async_req=True
2408
2409
 
2409
- >>> thread = api.cron_agent(owner, async_req=True)
2410
+ >>> thread = api.cron_agent(owner, body, async_req=True)
2410
2411
  >>> result = thread.get()
2411
2412
 
2412
2413
  :param owner: Owner of the namespace (required)
2413
2414
  :type owner: str
2415
+ :param body: Cron body (required)
2416
+ :type body: object
2414
2417
  :param async_req: Whether to execute the request asynchronously.
2415
2418
  :type async_req: bool, optional
2416
2419
  :param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -2427,12 +2430,13 @@ class AgentsV1Api(BaseApi):
2427
2430
  :rtype: V1AgentStateResponse
2428
2431
  """
2429
2432
  kwargs["_return_http_data_only"] = True
2430
- return self.cron_agent_with_http_info(owner, **kwargs) # noqa: E501
2433
+ return self.cron_agent_with_http_info(owner, body, **kwargs) # noqa: E501
2431
2434
 
2432
2435
  @validate_arguments
2433
2436
  def cron_agent_with_http_info(
2434
2437
  self,
2435
2438
  owner: Annotated[StrictStr, Field(..., description="Owner of the namespace")],
2439
+ body: Annotated[Optional[Dict], Field(..., description="Cron body")] = None,
2436
2440
  **kwargs
2437
2441
  ): # noqa: E501
2438
2442
  """Cron agent # noqa: E501
@@ -2440,11 +2444,13 @@ class AgentsV1Api(BaseApi):
2440
2444
  This method makes a synchronous HTTP request by default. To make an
2441
2445
  asynchronous HTTP request, please pass async_req=True
2442
2446
 
2443
- >>> thread = api.cron_agent_with_http_info(owner, async_req=True)
2447
+ >>> thread = api.cron_agent_with_http_info(owner, body, async_req=True)
2444
2448
  >>> result = thread.get()
2445
2449
 
2446
2450
  :param owner: Owner of the namespace (required)
2447
2451
  :type owner: str
2452
+ :param body: Cron body (required)
2453
+ :type body: object
2448
2454
  :param async_req: Whether to execute the request asynchronously.
2449
2455
  :type async_req: bool, optional
2450
2456
  :param _return_http_data_only: response data without head status code
@@ -2471,7 +2477,7 @@ class AgentsV1Api(BaseApi):
2471
2477
 
2472
2478
  _params = locals()
2473
2479
 
2474
- _all_params = ["owner"]
2480
+ _all_params = ["owner", "body"]
2475
2481
  _all_params.extend(
2476
2482
  [
2477
2483
  "async_req",
@@ -2510,11 +2516,21 @@ class AgentsV1Api(BaseApi):
2510
2516
  _files = {}
2511
2517
  # process the body parameter
2512
2518
  _body_params = None
2519
+ if _params["body"]:
2520
+ _body_params = _params["body"]
2513
2521
  # set the HTTP header `Accept`
2514
2522
  _header_params["Accept"] = self.api_client.select_header_accept(
2515
2523
  ["application/json"]
2516
2524
  ) # noqa: E501
2517
2525
 
2526
+ # set the HTTP header `Content-Type`
2527
+ _content_types_list = _params.get(
2528
+ "_content_type",
2529
+ self.api_client.select_header_content_type(["application/json"]),
2530
+ )
2531
+ if _content_types_list:
2532
+ _header_params["Content-Type"] = _content_types_list
2533
+
2518
2534
  # authentication setting
2519
2535
  _auth_settings = ["ApiKey"] # noqa: E501
2520
2536
 
polyaxon/pkg.py CHANGED
@@ -1,5 +1,5 @@
1
1
  NAME = "polyaxon"
2
- VERSION = "2.1.0-rc1"
2
+ VERSION = "2.1.0-rc3"
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.1.0rc1
3
+ Version: 2.1.0rc3
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.
@@ -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=_AjVHLBB1kJdzQbcjijfbbYvdHWpCCAX40TA44wZtWw,266
12
+ polyaxon/pkg.py,sha256=pp7j7yEBC1bpoS3D0J4SHsSAGUZ9E6GGygvSHN_FPvk,266
13
13
  polyaxon/polyaxonfile.py,sha256=xHmHT_cHomfuAQm82Jhnp71YNN5mQ-Lod7EbonjY4b4,429
14
14
  polyaxon/schemas.py,sha256=l5Lg1IGP6FM_pO8eToY0RUCzVD1kn3Dk5CNM_nsAf60,5877
15
15
  polyaxon/settings.py,sha256=Pxx1-T2oeJ5XmvGFN0YgnVzum_9FyTPaQtl68aQvYc4,4116
@@ -345,7 +345,7 @@ polyaxon/_k8s/logging/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdr
345
345
  polyaxon/_k8s/logging/async_monitor.py,sha256=fXOjl7mkRpGw4MsMJgICYBGV_27DjJf2fjlEY-AOQxw,3886
346
346
  polyaxon/_k8s/logging/monitor.py,sha256=4-NLN4_y0QVsReNJr8Ekv8kh0XNRRTKiiHopWs4wtMc,3426
347
347
  polyaxon/_k8s/manager/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
348
- polyaxon/_k8s/manager/async_manager.py,sha256=MeYa019OkOl9L4ykdHUu4223t9W291nYJ3AI1fhoO30,8850
348
+ polyaxon/_k8s/manager/async_manager.py,sha256=3mnc5iVmoD4xmdw3CgJkVS3wdnN6TTvMbWz3Wu3BOAg,8864
349
349
  polyaxon/_k8s/manager/base.py,sha256=hCe6RwRlO5ZYjz7P5fEoIHrrhf1yIof7DCzaEqM4kxw,2727
350
350
  polyaxon/_k8s/manager/manager.py,sha256=eJESZ6upQjeUrAYeU13cwXb_jmDYp56_SoysCZbY7VU,30143
351
351
  polyaxon/_managers/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
@@ -394,7 +394,7 @@ polyaxon/_runner/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,
394
394
  polyaxon/_runner/executor.py,sha256=ZxH_NxSrzDj_tHTCVmZ3MiXXFzKQdL_mke2GVp6229I,8175
395
395
  polyaxon/_runner/kinds.py,sha256=IhEL-HfztpDU4wUA7z8koQwN1Z32g2q57iDiiT9YZ40,132
396
396
  polyaxon/_runner/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
397
- polyaxon/_runner/agent/async_agent.py,sha256=W_UCpX9N_s4wSXXk8m39EybrM5IYQNQrOG3ihBaS_rY,13346
397
+ polyaxon/_runner/agent/async_agent.py,sha256=8XQ-J89vsrirTmVHf2Q7wjcvPfaAPuF3a4xoI-bE_KY,13712
398
398
  polyaxon/_runner/agent/base_agent.py,sha256=mBMTEqjbbqxV2O23vwUSRNVKyRJN-dChqtMNNSXy_Ac,6709
399
399
  polyaxon/_runner/agent/client.py,sha256=iZDPH97qKGIcEZwHwqYPeWrcWp8Tpo617MwK9_tSnkM,5035
400
400
  polyaxon/_runner/agent/sync_agent.py,sha256=9dI0S8KI85mubAD9JRLHtw9QPecnGZouMcX95N2GHgA,12891
@@ -441,7 +441,7 @@ polyaxon/_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
441
441
  polyaxon/_sdk/base_api.py,sha256=7LXnjh3jGHWqIMFj81Df21Z0nAhDIQqm5TALvMj15eU,393
442
442
  polyaxon/_sdk/configuration.py,sha256=QDZ9grJjtHuL7TQhWZqbAcBFlh9674go6kxaQ10XCWo,15103
443
443
  polyaxon/_sdk/api/__init__.py,sha256=ABYkNzoTkFk83AGh5eHBuNtwUdbJt9kNURKr9wzYSzk,1118
444
- polyaxon/_sdk/api/agents_v1_api.py,sha256=5uFK2FXFm3L9vpFx4IcR_IRWG-bmQheG8OS_xSGn9vQ,122436
444
+ polyaxon/_sdk/api/agents_v1_api.py,sha256=CeDSPKK0T8VytyElAQUny39HXkR0F7PrLmuBg9xFzQ4,123150
445
445
  polyaxon/_sdk/api/artifacts_stores_v1_api.py,sha256=VuBdfwKi0URQQCuh9GeHceRPMc7fOlJYl7-K-okJtH4,8403
446
446
  polyaxon/_sdk/api/auth_v1_api.py,sha256=Bov8wCCYmv8r1cZyodmIyDC_SahUpMsTKQsOa-vbuyg,35802
447
447
  polyaxon/_sdk/api/connections_v1_api.py,sha256=PPTGX7FrmD1zls1lWBukCWgNuRn7Eui365Ji5t_Sz0A,54365
@@ -593,9 +593,9 @@ polyaxon/tuners/hyperopt.py,sha256=zd6MblMGkooqLGDFJVo5kClqYnBoMwGj-opqqj8FDzQ,7
593
593
  polyaxon/tuners/mapping.py,sha256=pOdHCiwEufTk-QT7pNyjBjAEWNTM-lMC17WNTCk7C24,69
594
594
  polyaxon/tuners/random_search.py,sha256=6VEekM3N9h6E1lbpVTTUGKFPJlGMY2u-GkG615_nQcI,80
595
595
  polyaxon_sdk/__init__.py,sha256=HWvFdGWESyVG3f26K_szewiG-McMOHFkXKTfZcBlHsM,92
596
- polyaxon-2.1.0rc1.dist-info/LICENSE,sha256=86kroZbQUDsmSWOomB7dpceG65UXiVSPob4581tStBc,11349
597
- polyaxon-2.1.0rc1.dist-info/METADATA,sha256=7ICMEzbhernXUGamPBl9KINrFO9Bo5YRDs-f5pWztu8,11716
598
- polyaxon-2.1.0rc1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
599
- polyaxon-2.1.0rc1.dist-info/entry_points.txt,sha256=aFbUMjkg9vzRBVAFhqvR1m92yG8Cov7UAF0zViGfoQw,70
600
- polyaxon-2.1.0rc1.dist-info/top_level.txt,sha256=I_2e_Vv8rdcqWcMMdZocbrHiKPNGqoSMBqIObrw00Rg,22
601
- polyaxon-2.1.0rc1.dist-info/RECORD,,
596
+ polyaxon-2.1.0rc3.dist-info/LICENSE,sha256=86kroZbQUDsmSWOomB7dpceG65UXiVSPob4581tStBc,11349
597
+ polyaxon-2.1.0rc3.dist-info/METADATA,sha256=jwaUieEKgXxyP1je6ESxeF-xqdTLq9LHgW_Xw1ghnqw,11716
598
+ polyaxon-2.1.0rc3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
599
+ polyaxon-2.1.0rc3.dist-info/entry_points.txt,sha256=aFbUMjkg9vzRBVAFhqvR1m92yG8Cov7UAF0zViGfoQw,70
600
+ polyaxon-2.1.0rc3.dist-info/top_level.txt,sha256=I_2e_Vv8rdcqWcMMdZocbrHiKPNGqoSMBqIObrw00Rg,22
601
+ polyaxon-2.1.0rc3.dist-info/RECORD,,