Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions tests/aignostics/platform/e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

from aignostics import platform
from aignostics.platform import Run, RunSdkMetadata
from aignostics.platform._sdk_metadata import GPUConfig
from tests.constants_test import (
HETA_APPLICATION_ID,
HETA_APPLICATION_VERSION,
Expand Down Expand Up @@ -281,12 +280,6 @@ def _submit_and_validate( # noqa: PLR0913, PLR0917

logger.trace(f"Submitting application run for {application_id} version {application_version}")
client = platform.Client()
gpu_config = GPUConfig(
gpu_type=PIPELINE_GPU_TYPE,
provisioning_mode=PIPELINE_GPU_PROVISIONING_MODE,
max_gpus_per_slide=PIPELINE_MAX_GPUS_PER_SLIDE,
flex_start_max_run_duration_minutes=PIPELINE_GPU_FLEX_START_MAX_RUN_DURATION_MINUTES,
)
custom_metadata = {
"sdk": {
"tags": tags or set(),
Expand All @@ -295,14 +288,23 @@ def _submit_and_validate( # noqa: PLR0913, PLR0917
"deadline": deadline.isoformat(),
},
"pipeline": {
"gpu": gpu_config.model_dump(),
"gpu": {
"gpu_type": PIPELINE_GPU_TYPE,
"provisioning_mode": PIPELINE_GPU_PROVISIONING_MODE,
"max_gpus_per_slide": PIPELINE_MAX_GPUS_PER_SLIDE,
},
"cpu": {
"provisioning_mode": PIPELINE_CPU_PROVISIONING_MODE,
},
"node_acquisition_timeout_minutes": PIPELINE_NODE_ACQUISITION_TIMEOUT_MINUTES,
},
}
}
# TODO(oliverm): remove this conditional when applications handle null flex_start_max_run_duration_minutes
if PIPELINE_GPU_FLEX_START_MAX_RUN_DURATION_MINUTES:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would using gpu_config.model_dump(exclude_none=True) with the Pydantic model class be an option to avoid this if block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, however that would also exclude other fields which happen to be null, and if any of those are nullable but not optional on the application side, I could end up breaking something. Since this is a temporary fix, I prefer this slightly messier but also slightly less risky approach.

custom_metadata["sdk"]["pipeline"]["gpu"]["flex_start_max_run_duration_minutes"] = (
PIPELINE_GPU_FLEX_START_MAX_RUN_DURATION_MINUTES
)
run = client.runs.submit(
application_id=application_id,
application_version=application_version,
Expand Down
Loading