Skip to content

Commit 3e9bd30

Browse files
committed
Merge branch 'develop' into feature/sms-auth
2 parents 4cc9dae + 3c85b2e commit 3e9bd30

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/com/iexec/worker/docker/ComputationService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ public boolean runTeeComputation(TaskDescription taskDescription,
153153
long maxExecutionTime = taskDescription.getMaxExecutionTime();
154154
String teePostComputeImage = taskDescription.getTeePostComputeImage();
155155

156+
if (!customDockerClient.pullImage(chainTaskId, teePostComputeImage)) {
157+
String msg = "runTeeComputation failed (pullImage teePostComputeImage)";
158+
log.error(msg + " [chainTaskId:{},teePostComputeImage:{}]", chainTaskId, teePostComputeImage);
159+
return false;
160+
}
161+
156162
String secureSessionId = smsService.createTeeSession(contributionAuth);
157163
if (secureSessionId.isEmpty()) {
158164
log.error("Cannot compute TEE task without secure session [chainTaskId:{}]", chainTaskId);

src/test/java/com/iexec/worker/docker/ComputationServiceTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ TaskDescription getStubTaskDescription(boolean isTeeTask) {
5959
.maxExecutionTime(500000) // 5min
6060
.cmd("ls")
6161
.inputFiles(new ArrayList<>())
62+
.teePostComputeImage("registry/post-compute-app:tag")
6263
.build();
6364
}
6465

@@ -156,6 +157,7 @@ public void shouldComputeTeeTask() {
156157
when(smsService.createTeeSession(any()))
157158
.thenReturn(awesomeSessionId);
158159
when(sconeTeeService.buildSconeDockerEnv(any(), any(), any())).thenReturn(stubSconeEnv);
160+
when(customDockerClient.pullImage(anyString(), anyString())).thenReturn(true);
159161
when(customDockerClient.execute(any()))
160162
.thenReturn(DockerExecutionResult.success("Computed successfully !", "containerName"))
161163
.thenReturn(DockerExecutionResult.success("Encrypted successfully !", "containerName"));

0 commit comments

Comments
 (0)