2020 ComponentException ,
2121 TaskCancelled ,
2222)
23+ from grandchallenge .components .models import APIMethodChoices
2324from grandchallenge .components .schemas import GPUTypeChoices
2425from grandchallenge .evaluation .models import Evaluation , Method
2526
@@ -52,6 +53,7 @@ def test_instance_type(memory_limit, expected_type, requires_gpu_type):
5253 requires_gpu_type = requires_gpu_type ,
5354 use_warm_pool = False ,
5455 signing_key = b"" ,
56+ api_method = APIMethodChoices .EXEC ,
5557 )
5658
5759 assert executor ._instance_type .name == expected_type
@@ -77,6 +79,7 @@ def test_instance_type_incompatible(memory_limit, requires_gpu_type):
7779 requires_gpu_type = requires_gpu_type ,
7880 use_warm_pool = False ,
7981 signing_key = b"" ,
82+ api_method = APIMethodChoices .EXEC ,
8083 )
8184
8285 with pytest .raises (ValueError ):
@@ -115,6 +118,7 @@ def test_invocation_prefix():
115118 requires_gpu_type = GPUTypeChoices .NO_GPU ,
116119 use_warm_pool = False ,
117120 signing_key = b"" ,
121+ api_method = APIMethodChoices .EXEC ,
118122 )
119123
120124 # The id of the job must be in the prefixes
@@ -173,6 +177,7 @@ def test_invocation_json(settings):
173177 requires_gpu_type = GPUTypeChoices .NO_GPU ,
174178 use_warm_pool = False ,
175179 signing_key = b"totallysecret" ,
180+ api_method = APIMethodChoices .EXEC ,
176181 )
177182
178183 with Stubber (executor ._sagemaker_client ) as s :
@@ -207,6 +212,7 @@ def test_invocation_json(settings):
207212 "no_proxy" : "amazonaws.com" ,
208213 "GRAND_CHALLENGE_COMPONENT_MAX_MEMORY_MB" : "7168" ,
209214 "GRAND_CHALLENGE_COMPONENT_SIGNING_KEY_HEX" : "746f74616c6c79736563726574" ,
215+ "GRAND_CHALLENGE_COMPONENT_API_METHOD" : "exec" ,
210216 },
211217 "VpcConfig" : {
212218 "SecurityGroupIds" : [
@@ -256,6 +262,7 @@ def test_set_duration():
256262 requires_gpu_type = GPUTypeChoices .NO_GPU ,
257263 use_warm_pool = False ,
258264 signing_key = b"" ,
265+ api_method = APIMethodChoices .EXEC ,
259266 )
260267
261268 assert executor .utilization_duration is None
@@ -283,6 +290,7 @@ def test_get_log_stream_name(settings):
283290 requires_gpu_type = GPUTypeChoices .NO_GPU ,
284291 use_warm_pool = False ,
285292 signing_key = b"" ,
293+ api_method = APIMethodChoices .EXEC ,
286294 )
287295
288296 with Stubber (executor ._logs_client ) as s :
@@ -315,6 +323,7 @@ def test_set_task_logs(settings):
315323 requires_gpu_type = GPUTypeChoices .NO_GPU ,
316324 use_warm_pool = False ,
317325 signing_key = b"" ,
326+ api_method = APIMethodChoices .EXEC ,
318327 )
319328
320329 assert executor .stdout == ""
@@ -462,6 +471,7 @@ def test_set_runtime_metrics(settings):
462471 requires_gpu_type = GPUTypeChoices .NO_GPU ,
463472 use_warm_pool = False ,
464473 signing_key = b"" ,
474+ api_method = APIMethodChoices .EXEC ,
465475 )
466476
467477 assert executor .runtime_metrics == {}
@@ -558,6 +568,7 @@ def test_handle_completed_job():
558568 requires_gpu_type = GPUTypeChoices .NO_GPU ,
559569 use_warm_pool = False ,
560570 signing_key = b"itsasecret" ,
571+ api_method = APIMethodChoices .EXEC ,
561572 )
562573
563574 inference_result = InferenceResult (
@@ -604,6 +615,7 @@ def test_handle_time_limit_exceded(settings):
604615 requires_gpu_type = GPUTypeChoices .NO_GPU ,
605616 use_warm_pool = False ,
606617 signing_key = b"" ,
618+ api_method = APIMethodChoices .EXEC ,
607619 )
608620
609621 with pytest .raises (ComponentException ) as error :
@@ -629,6 +641,7 @@ def test_handle_stopped_event(settings):
629641 requires_gpu_type = GPUTypeChoices .NO_GPU ,
630642 use_warm_pool = False ,
631643 signing_key = b"" ,
644+ api_method = APIMethodChoices .EXEC ,
632645 )
633646
634647 with (
@@ -737,6 +750,7 @@ def test_deprovision(settings):
737750 requires_gpu_type = GPUTypeChoices .NO_GPU ,
738751 use_warm_pool = False ,
739752 signing_key = b"" ,
753+ api_method = APIMethodChoices .EXEC ,
740754 )
741755
742756 created_files = (
0 commit comments