|
25 | 25 |
|
26 | 26 | from aignostics import platform |
27 | 27 | from aignostics.platform import Run, RunSdkMetadata |
| 28 | +from aignostics.platform._sdk_metadata import GPUConfig |
28 | 29 | from tests.constants_test import ( |
29 | 30 | HETA_APPLICATION_ID, |
30 | 31 | HETA_APPLICATION_VERSION, |
@@ -280,31 +281,33 @@ def _submit_and_validate( # noqa: PLR0913, PLR0917 |
280 | 281 |
|
281 | 282 | logger.trace(f"Submitting application run for {application_id} version {application_version}") |
282 | 283 | client = platform.Client() |
| 284 | + gpu_config = GPUConfig( |
| 285 | + gpu_type=PIPELINE_GPU_TYPE, |
| 286 | + provisioning_mode=PIPELINE_GPU_PROVISIONING_MODE, |
| 287 | + max_gpus_per_slide=PIPELINE_MAX_GPUS_PER_SLIDE, |
| 288 | + flex_start_max_run_duration_minutes=PIPELINE_GPU_FLEX_START_MAX_RUN_DURATION_MINUTES, |
| 289 | + ) |
| 290 | + custom_metadata = { |
| 291 | + "sdk": { |
| 292 | + "tags": tags or set(), |
| 293 | + "scheduling": { |
| 294 | + "due_date": (datetime.now(tz=UTC) + timedelta(seconds=due_date_seconds)).isoformat(), |
| 295 | + "deadline": deadline.isoformat(), |
| 296 | + }, |
| 297 | + "pipeline": { |
| 298 | + "gpu": gpu_config.model_dump(), |
| 299 | + "cpu": { |
| 300 | + "provisioning_mode": PIPELINE_CPU_PROVISIONING_MODE, |
| 301 | + }, |
| 302 | + "node_acquisition_timeout_minutes": PIPELINE_NODE_ACQUISITION_TIMEOUT_MINUTES, |
| 303 | + }, |
| 304 | + } |
| 305 | + } |
283 | 306 | run = client.runs.submit( |
284 | 307 | application_id=application_id, |
285 | 308 | application_version=application_version, |
286 | 309 | items=payload, |
287 | | - custom_metadata={ |
288 | | - "sdk": { |
289 | | - "tags": tags or set(), |
290 | | - "scheduling": { |
291 | | - "due_date": (datetime.now(tz=UTC) + timedelta(seconds=due_date_seconds)).isoformat(), |
292 | | - "deadline": deadline.isoformat(), |
293 | | - }, |
294 | | - "pipeline": { |
295 | | - "gpu": { |
296 | | - "gpu_type": PIPELINE_GPU_TYPE, |
297 | | - "provisioning_mode": PIPELINE_GPU_PROVISIONING_MODE, |
298 | | - "flex_start_max_run_duration_minutes": PIPELINE_GPU_FLEX_START_MAX_RUN_DURATION_MINUTES, |
299 | | - "max_gpus_per_slide": PIPELINE_MAX_GPUS_PER_SLIDE, |
300 | | - }, |
301 | | - "cpu": { |
302 | | - "provisioning_mode": PIPELINE_CPU_PROVISIONING_MODE, |
303 | | - }, |
304 | | - "node_acquisition_timeout_minutes": PIPELINE_NODE_ACQUISITION_TIMEOUT_MINUTES, |
305 | | - }, |
306 | | - } |
307 | | - }, |
| 310 | + custom_metadata=custom_metadata, |
308 | 311 | ) |
309 | 312 |
|
310 | 313 | # Let's validate we can fiond the run by id |
|
0 commit comments