Skip to content

Commit 3dd1bdf

Browse files
Merge pull request #302 from iExecBlockchainComputing/feature/tee-post-compute-pull
Pull post compute image
2 parents eb1287c + a3f0a37 commit 3dd1bdf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ 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+
}
156161

157162
String secureSessionId = sconeTeeService.createSconeSecureSession(contributionAuth);
158163

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(sconeTeeService.createSconeSecureSession(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)