Skip to content

Commit ac0a453

Browse files
committed
Fix test and set MaxRuntimeInSeconds correctly
1 parent 728563d commit ac0a453

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/grandchallenge/components/backends/amazon_sagemaker_training.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _create_job_boto(self):
105105
},
106106
StoppingCondition={
107107
# https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StoppingCondition.html
108-
"MaxRuntimeInSeconds": self._time_limit,
108+
"MaxRuntimeInSeconds": int(self._time_limit.total_seconds()),
109109
},
110110
Environment={
111111
**self.invocation_environment,

app/tests/components_tests/test_amazon_sagemaker_training_backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def test_invocation_json(settings):
169169
time_limit=60,
170170
requires_gpu_type=GPUTypeChoices.NO_GPU,
171171
use_warm_pool=False,
172-
signing_key=b"",
172+
signing_key=b"totallysecret",
173173
)
174174

175175
with Stubber(executor._sagemaker_client) as s:
@@ -205,6 +205,7 @@ def test_invocation_json(settings):
205205
"GRAND_CHALLENGE_COMPONENT_WRITABLE_DIRECTORIES": "/opt/ml/output/data:/opt/ml/model:/opt/ml/input/data/ground_truth:/opt/ml/checkpoints:/tmp",
206206
"GRAND_CHALLENGE_COMPONENT_POST_CLEAN_DIRECTORIES": "/opt/ml/output/data:/opt/ml/model:/opt/ml/input/data/ground_truth",
207207
"GRAND_CHALLENGE_COMPONENT_MAX_MEMORY_MB": "7168",
208+
"GRAND_CHALLENGE_COMPONENT_SIGNING_KEY_HEX": "746f74616c6c79736563726574",
208209
},
209210
"VpcConfig": {
210211
"SecurityGroupIds": [
@@ -216,6 +217,7 @@ def test_invocation_json(settings):
216217
},
217218
)
218219
executor.provision(input_civs=[], input_prefixes={})
220+
executor.execute() # Required to validate expected_params in the stubber
219221

220222
with io.BytesIO() as fileobj:
221223
executor._s3_client.download_fileobj(

0 commit comments

Comments
 (0)