polyaxon 2.3.0rc0__py3-none-any.whl → 2.3.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.
- polyaxon/_deploy/operators/compose.py +0 -26
- polyaxon/_deploy/schemas/deployment.py +1 -0
- polyaxon/_deploy/schemas/intervals.py +0 -7
- polyaxon/_k8s/logging/async_monitor.py +52 -2
- polyaxon/_k8s/manager/async_manager.py +15 -0
- polyaxon/_k8s/manager/manager.py +16 -1
- polyaxon/_sdk/schemas/v1_preset.py +8 -0
- polyaxon/pkg.py +1 -1
- {polyaxon-2.3.0rc0.dist-info → polyaxon-2.3.0rc1.dist-info}/METADATA +1 -1
- {polyaxon-2.3.0rc0.dist-info → polyaxon-2.3.0rc1.dist-info}/RECORD +14 -14
- {polyaxon-2.3.0rc0.dist-info → polyaxon-2.3.0rc1.dist-info}/LICENSE +0 -0
- {polyaxon-2.3.0rc0.dist-info → polyaxon-2.3.0rc1.dist-info}/WHEEL +0 -0
- {polyaxon-2.3.0rc0.dist-info → polyaxon-2.3.0rc1.dist-info}/entry_points.txt +0 -0
- {polyaxon-2.3.0rc0.dist-info → polyaxon-2.3.0rc1.dist-info}/top_level.txt +0 -0
@@ -112,30 +112,6 @@ class ComposeOperator(CmdOperator):
|
|
112
112
|
)
|
113
113
|
return env
|
114
114
|
|
115
|
-
@staticmethod
|
116
|
-
def _generate_intervals(config):
|
117
|
-
template = "{}={}"
|
118
|
-
env = []
|
119
|
-
if config.intervals:
|
120
|
-
env.append(
|
121
|
-
template.format(
|
122
|
-
"POLYAXON_INTERVALS_RUNS_SCHEDULER", config.intervals.runs_scheduler
|
123
|
-
)
|
124
|
-
)
|
125
|
-
env.append(
|
126
|
-
template.format(
|
127
|
-
"POLYAXON_INTERVALS_OPERATIONS_DEFAULT_RETRY_DELAY",
|
128
|
-
config.intervals.operations_default_retry_delay,
|
129
|
-
)
|
130
|
-
)
|
131
|
-
env.append(
|
132
|
-
template.format(
|
133
|
-
"POLYAXON_INTERVALS_OPERATIONS_MAX_RETRY_DELAY",
|
134
|
-
config.intervals.operations_max_retry_delay,
|
135
|
-
)
|
136
|
-
)
|
137
|
-
return env
|
138
|
-
|
139
115
|
@staticmethod
|
140
116
|
def _generate_email(config):
|
141
117
|
template = "{}={}"
|
@@ -195,8 +171,6 @@ class ComposeOperator(CmdOperator):
|
|
195
171
|
if config.allowed_hosts:
|
196
172
|
env.append(template.format("POLYAXON_ALLOWED_HOSTS", config.allowed_hosts))
|
197
173
|
|
198
|
-
env += cls._generate_intervals(config)
|
199
|
-
|
200
174
|
if config.log_level:
|
201
175
|
env.append(template.format(ENV_KEYS_LOG_LEVEL, config.log_level))
|
202
176
|
env += cls._generate_postgres(config)
|
@@ -255,6 +255,7 @@ class DeploymentConfig(BaseSchemaModel):
|
|
255
255
|
allowed_hosts: Optional[List[StrictStr]] = Field(alias="allowedHosts")
|
256
256
|
include_host_ips: Optional[bool] = Field(alias="includeHostIps")
|
257
257
|
intervals: Optional[IntervalsConfig]
|
258
|
+
cleaning_intervals: Optional[Dict] = Field(alias="cleaningIntervals")
|
258
259
|
artifacts_store: Optional[V1Connection] = Field(alias="artifactsStore")
|
259
260
|
connections: Optional[List[V1Connection]]
|
260
261
|
mount_connections: Optional[List[str]] = Field(alias="mountConnections")
|
@@ -6,11 +6,4 @@ from polyaxon._schemas.base import BaseSchemaModel
|
|
6
6
|
|
7
7
|
|
8
8
|
class IntervalsConfig(BaseSchemaModel):
|
9
|
-
runs_scheduler: Optional[StrictInt] = Field(alias="runsScheduler")
|
10
|
-
operations_default_retry_delay: Optional[StrictInt] = Field(
|
11
|
-
alias="operationsDefaultRetryDelay"
|
12
|
-
)
|
13
|
-
operations_max_retry_delay: Optional[StrictInt] = Field(
|
14
|
-
alias="operationsMaxRetryDelay"
|
15
|
-
)
|
16
9
|
compatibility_check: Optional[StrictInt] = Field(alias="compatibilityCheck")
|
@@ -121,7 +121,7 @@ async def query_k8s_pod_logs(
|
|
121
121
|
return logs, last_time
|
122
122
|
|
123
123
|
|
124
|
-
async def
|
124
|
+
async def get_op_pods_and_services(
|
125
125
|
k8s_manager: AsyncK8sManager,
|
126
126
|
run_uuid: str,
|
127
127
|
run_kind: str,
|
@@ -138,12 +138,42 @@ async def get_op_pos_and_services(
|
|
138
138
|
return pods, services
|
139
139
|
|
140
140
|
|
141
|
+
async def get_resource_events(
|
142
|
+
k8s_manager: AsyncK8sManager, resource_type: str, resource_name: str
|
143
|
+
):
|
144
|
+
field_selector = (
|
145
|
+
f"involvedObject.kind={resource_type},involvedObject.name={resource_name}"
|
146
|
+
)
|
147
|
+
try:
|
148
|
+
events = await k8s_manager.list_namespaced_events(
|
149
|
+
namespace=namespace, field_selector=field_selector
|
150
|
+
)
|
151
|
+
|
152
|
+
all_events = []
|
153
|
+
for event in events.items:
|
154
|
+
event_data = {
|
155
|
+
"reason": event.reason,
|
156
|
+
"message": event.message,
|
157
|
+
"first_timestamp": event.first_timestamp,
|
158
|
+
"last_timestamp": event.last_timestamp,
|
159
|
+
"count": event.count,
|
160
|
+
"type": event.type,
|
161
|
+
}
|
162
|
+
all_events.append(event_data)
|
163
|
+
|
164
|
+
return all_events
|
165
|
+
|
166
|
+
except client.ApiException as e:
|
167
|
+
print(f"Exception when calling CoreV1Api->list_namespaced_event: {e}")
|
168
|
+
return []
|
169
|
+
|
170
|
+
|
141
171
|
async def get_op_spec(
|
142
172
|
k8s_manager: AsyncK8sManager,
|
143
173
|
run_uuid: str,
|
144
174
|
run_kind: str,
|
145
175
|
):
|
146
|
-
pods, services = await
|
176
|
+
pods, services = await get_op_pods_and_services(
|
147
177
|
k8s_manager=k8s_manager,
|
148
178
|
run_uuid=run_uuid,
|
149
179
|
run_kind=run_kind,
|
@@ -153,11 +183,21 @@ async def get_op_spec(
|
|
153
183
|
pods_list[
|
154
184
|
pod.metadata.name
|
155
185
|
] = k8s_manager.api_client.sanitize_for_serialization(pod)
|
186
|
+
pods_list[pod.metadata.name]["events"] = await get_resource_events(
|
187
|
+
k8s_manager=k8s_manager,
|
188
|
+
resource_type="Pod",
|
189
|
+
resource_name=pod.metadata.name,
|
190
|
+
)
|
156
191
|
services_list = {}
|
157
192
|
for service in services or []:
|
158
193
|
services_list[
|
159
194
|
service.metadata.name
|
160
195
|
] = k8s_manager.api_client.sanitize_for_serialization(service)
|
196
|
+
services_list[service.metadata.name]["events"] = await get_resource_events(
|
197
|
+
k8s_manager=k8s_manager,
|
198
|
+
resource_type="Service",
|
199
|
+
resource_name=service.metadata.name,
|
200
|
+
)
|
161
201
|
data = {"pods": pods_list, "services": services_list}
|
162
202
|
return data, pods, services
|
163
203
|
|
@@ -185,11 +225,21 @@ async def get_agent_spec(
|
|
185
225
|
pods_list[
|
186
226
|
pod.metadata.name
|
187
227
|
] = k8s_manager.api_client.sanitize_for_serialization(pod)
|
228
|
+
pods_list[pod.metadata.name]["events"] = await get_resource_events(
|
229
|
+
k8s_manager=k8s_manager,
|
230
|
+
resource_type="Pod",
|
231
|
+
resource_name=pod.metadata.name,
|
232
|
+
)
|
188
233
|
data = {"pods": pods_list}
|
189
234
|
services_list = {}
|
190
235
|
for service in services or []:
|
191
236
|
services_list[
|
192
237
|
service.metadata.name
|
193
238
|
] = k8s_manager.api_client.sanitize_for_serialization(service)
|
239
|
+
services_list[service.metadata.name]["events"] = await get_resource_events(
|
240
|
+
k8s_manager=k8s_manager,
|
241
|
+
resource_type="Service",
|
242
|
+
resource_name=service.metadata.name,
|
243
|
+
)
|
194
244
|
data["services"] = services_list
|
195
245
|
return data, pods, services
|
@@ -267,3 +267,18 @@ class AsyncK8sManager(BaseK8sManager):
|
|
267
267
|
raise PolyaxonK8sError("Connection error: %s" % e) from e
|
268
268
|
else:
|
269
269
|
logger.debug("Custom object `{}` was not found".format(name))
|
270
|
+
|
271
|
+
async def list_namespaced_events(
|
272
|
+
self,
|
273
|
+
field_selector: str = None,
|
274
|
+
namespace: str = None,
|
275
|
+
reraise: bool = False,
|
276
|
+
**kwargs
|
277
|
+
) -> List[client.CoreV1EventList]:
|
278
|
+
return await self._list_namespace_resource(
|
279
|
+
resource_api=self.k8s_api.list_namespaced_event, # type: ignore[attr-defined]
|
280
|
+
reraise=reraise,
|
281
|
+
namespace=namespace,
|
282
|
+
field_selector=field_selector,
|
283
|
+
**kwargs,
|
284
|
+
)
|
polyaxon/_k8s/manager/manager.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Optional
|
1
|
+
from typing import List, Optional
|
2
2
|
|
3
3
|
from kubernetes import client, config
|
4
4
|
from kubernetes.client import Configuration
|
@@ -806,3 +806,18 @@ class K8sManager(BaseK8sManager):
|
|
806
806
|
pod_id, namespace=namespace or self.namespace
|
807
807
|
)
|
808
808
|
return is_pod_running(event, container_id)
|
809
|
+
|
810
|
+
def list_namespaced_events(
|
811
|
+
self,
|
812
|
+
field_selector: str = None,
|
813
|
+
namespace: str = None,
|
814
|
+
reraise: bool = False,
|
815
|
+
**kwargs
|
816
|
+
) -> List[client.CoreV1EventList]:
|
817
|
+
return self._list_namespace_resource(
|
818
|
+
resource_api=self.k8s_api.list_namespaced_event, # type: ignore[attr-defined]
|
819
|
+
reraise=reraise,
|
820
|
+
namespace=namespace,
|
821
|
+
field_selector=field_selector,
|
822
|
+
**kwargs,
|
823
|
+
)
|
@@ -6,6 +6,13 @@ from clipped.compact.pydantic import StrictStr
|
|
6
6
|
from clipped.config.schema import BaseAllowSchemaModel
|
7
7
|
from clipped.types.uuids import UUIDStr
|
8
8
|
|
9
|
+
from polyaxon._sdk.schemas.v1_settings_catalog import V1SettingsCatalog
|
10
|
+
|
11
|
+
|
12
|
+
class V1PresetSettings(BaseAllowSchemaModel):
|
13
|
+
projects: Optional[List[V1SettingsCatalog]]
|
14
|
+
runs: Optional[List[V1SettingsCatalog]]
|
15
|
+
|
9
16
|
|
10
17
|
class V1Preset(BaseAllowSchemaModel):
|
11
18
|
uuid: Optional[UUIDStr]
|
@@ -17,3 +24,4 @@ class V1Preset(BaseAllowSchemaModel):
|
|
17
24
|
frozen: Optional[bool]
|
18
25
|
live_state: Optional[int]
|
19
26
|
content: Optional[StrictStr]
|
27
|
+
settings: Optional[V1PresetSettings]
|
polyaxon/pkg.py
CHANGED
@@ -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=
|
12
|
+
polyaxon/pkg.py,sha256=EpPiYvbxI85_k9who2bs3azkLZ4Q_H5ASoU-3WPOGGY,266
|
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
|
@@ -122,7 +122,7 @@ polyaxon/_deploy/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,
|
|
122
122
|
polyaxon/_deploy/reader.py,sha256=fYv1aXvaWulqy-mr0jbgnhAIa9oAXzDA3KQVOy3_kCo,220
|
123
123
|
polyaxon/_deploy/operators/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
124
124
|
polyaxon/_deploy/operators/cmd_operator.py,sha256=lXDwLKuayiajzd0PVxxxoLb5qbf9OhYWb4iGm_D9IxU,1746
|
125
|
-
polyaxon/_deploy/operators/compose.py,sha256=
|
125
|
+
polyaxon/_deploy/operators/compose.py,sha256=CmXAk27rqdCAzkEwsz9Tfrg_Va9BhXAUQTfwltO9sNc,6426
|
126
126
|
polyaxon/_deploy/operators/conda.py,sha256=x5PzfziR1rr68lBffqzQuObdqzlKEwpCI7aFWE42LTE,575
|
127
127
|
polyaxon/_deploy/operators/docker.py,sha256=aaaEU3eMqYbcq4YTMf9khgcDyfbNvv3fiaEkbauFglw,1115
|
128
128
|
polyaxon/_deploy/operators/helm.py,sha256=e3aa7Ogdbv0O5wi7dwvwnLXaW776WJzFrVTlqhLZ3gI,779
|
@@ -131,11 +131,11 @@ polyaxon/_deploy/operators/pip.py,sha256=zLJeApCYRo4KkP7PFGrqJZMJpjT2gwTQN2DofIf
|
|
131
131
|
polyaxon/_deploy/schemas/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
132
132
|
polyaxon/_deploy/schemas/auth.py,sha256=xGUexJVGRvLGmWXjyW0pxfft95SPSvZWSIXtS82mdEQ,296
|
133
133
|
polyaxon/_deploy/schemas/celery.py,sha256=ITDLTotzZ_IAZyLoAlUstQzQmq8gHEP3tF39vVYQQag,812
|
134
|
-
polyaxon/_deploy/schemas/deployment.py,sha256=
|
134
|
+
polyaxon/_deploy/schemas/deployment.py,sha256=KQNzHF28Fc4aahzwdicGvEMKIPrw3XmFeNWbs8jV-Ws,12872
|
135
135
|
polyaxon/_deploy/schemas/deployment_types.py,sha256=yLmUxXNlF2glMgzAyNg21KbTD5tnobM7hAl8pyal8Gk,348
|
136
136
|
polyaxon/_deploy/schemas/email.py,sha256=r_NwHFF4MoFHR4RvzFma38zr5tLc_W6oxpZKIEw3LlM,545
|
137
137
|
polyaxon/_deploy/schemas/ingress.py,sha256=MRhjOhTO9FqdQOA_g5SfHiod7eMEF4FjWMyJ4xkdvq0,423
|
138
|
-
polyaxon/_deploy/schemas/intervals.py,sha256
|
138
|
+
polyaxon/_deploy/schemas/intervals.py,sha256=c0fHEvm1JphgGMoqsR-SIGb3ik3b1rCmE1h4Gij5yKU,258
|
139
139
|
polyaxon/_deploy/schemas/operators.py,sha256=KSf3TLWpWFb__0ncKW88WVwL0JRE6lBfATawsmSq6x0,344
|
140
140
|
polyaxon/_deploy/schemas/proxy.py,sha256=hG5F8kzl59bAIZn5djIdsYNpptNsxHxmrH6urkoQ8kM,580
|
141
141
|
polyaxon/_deploy/schemas/rbac.py,sha256=bIHzx5zweJdHAtc9eXkweV4n3J8tuj_lsTrA8ZNIVqQ,145
|
@@ -343,12 +343,12 @@ polyaxon/_k8s/executor/async_executor.py,sha256=5JShP9O0Jv2Czgyab8BkAVxjuPLD5FWV
|
|
343
343
|
polyaxon/_k8s/executor/base.py,sha256=5qD21gfBlAq9KabgMYkExHejs61LtFAUAcnAqsmj3k0,4004
|
344
344
|
polyaxon/_k8s/executor/executor.py,sha256=Qub57Q86SdmBv73CuyFJxydFOIyL0CZKp4B_7aSyLsU,321
|
345
345
|
polyaxon/_k8s/logging/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
346
|
-
polyaxon/_k8s/logging/async_monitor.py,sha256=
|
346
|
+
polyaxon/_k8s/logging/async_monitor.py,sha256=N8hJs-26sBdenkZznYYMgZC9jW79us59jTPoBV0rhIc,7250
|
347
347
|
polyaxon/_k8s/logging/monitor.py,sha256=4-NLN4_y0QVsReNJr8Ekv8kh0XNRRTKiiHopWs4wtMc,3426
|
348
348
|
polyaxon/_k8s/manager/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
349
|
-
polyaxon/_k8s/manager/async_manager.py,sha256=
|
349
|
+
polyaxon/_k8s/manager/async_manager.py,sha256=REeGSH-rP0WvpCQvwE-6ZfELfpVCJBsDkTe1QzPLy3o,9474
|
350
350
|
polyaxon/_k8s/manager/base.py,sha256=d4ZnURFAwo1S63GVvi_57zgiuUVu-EnMuSfRzNLCEpk,2839
|
351
|
-
polyaxon/_k8s/manager/manager.py,sha256=
|
351
|
+
polyaxon/_k8s/manager/manager.py,sha256=o0rCjmDysD8lLP8mjQWPa76SRMKcezhj1IzPP5NkLXc,30624
|
352
352
|
polyaxon/_local_process/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
353
353
|
polyaxon/_local_process/agent.py,sha256=Ph2oZtu3dOONIiuu9wlloSpfPBkXXhV61lbc0cPHC7E,168
|
354
354
|
polyaxon/_local_process/executor.py,sha256=-Ewk1nL5HmC41JZEJh_h--ikDrvzWiZ1CKpCuwe0_eQ,5028
|
@@ -525,7 +525,7 @@ polyaxon/_sdk/schemas/v1_organization.py,sha256=n535i5c6X-TYEO1gbi3LXxwUeJLTxrHn
|
|
525
525
|
polyaxon/_sdk/schemas/v1_organization_member.py,sha256=ww8icQ-Z4E09fhoMLT7oxtAWkufQ6R7eDxCjr3n6vZw,454
|
526
526
|
polyaxon/_sdk/schemas/v1_password_change.py,sha256=gKqrwN-f4beEJGFOnrpsWuw2tRUYWRcQeSD3hrzZ5eQ,295
|
527
527
|
polyaxon/_sdk/schemas/v1_pipeline.py,sha256=hPhg5Bwz6oacOjDvYgBhjP_Vk3lR0N9BH1eevrqnrB8,349
|
528
|
-
polyaxon/_sdk/schemas/v1_preset.py,sha256=
|
528
|
+
polyaxon/_sdk/schemas/v1_preset.py,sha256=bwnD6Mk0W2PB5Ksh_Z0UyVOThnPI60Bjbvl2WZllElU,797
|
529
529
|
polyaxon/_sdk/schemas/v1_project.py,sha256=SopG7_j_zACdW9lLa0zOAPP5brkyoLPEGunhx-mEv_E,951
|
530
530
|
polyaxon/_sdk/schemas/v1_project_settings.py,sha256=5ITp9NZRbewyrXf2Mcy9zOue7_51-mbAp9ObZEH7Pl0,669
|
531
531
|
polyaxon/_sdk/schemas/v1_project_version.py,sha256=Ql7sgYaFuGSH1RpO5dA10aLz2aifwFN88-tl6JVA9_Y,1067
|
@@ -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.3.
|
615
|
-
polyaxon-2.3.
|
616
|
-
polyaxon-2.3.
|
617
|
-
polyaxon-2.3.
|
618
|
-
polyaxon-2.3.
|
619
|
-
polyaxon-2.3.
|
614
|
+
polyaxon-2.3.0rc1.dist-info/LICENSE,sha256=86kroZbQUDsmSWOomB7dpceG65UXiVSPob4581tStBc,11349
|
615
|
+
polyaxon-2.3.0rc1.dist-info/METADATA,sha256=bKKtzoP-Nk78Iiq0Dmmzj_e-a1sTdf2skooaeBsy7js,11711
|
616
|
+
polyaxon-2.3.0rc1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
617
|
+
polyaxon-2.3.0rc1.dist-info/entry_points.txt,sha256=aFbUMjkg9vzRBVAFhqvR1m92yG8Cov7UAF0zViGfoQw,70
|
618
|
+
polyaxon-2.3.0rc1.dist-info/top_level.txt,sha256=I_2e_Vv8rdcqWcMMdZocbrHiKPNGqoSMBqIObrw00Rg,22
|
619
|
+
polyaxon-2.3.0rc1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|