@@ -79,7 +79,7 @@ class LLMCodeExecutor(
79
79
.connectionTimeout(Duration .ofSeconds(30 ))
80
80
.responseTimeout(Duration .ofSeconds(45 ))
81
81
.build()
82
- private val dockerClient = DockerClientImpl .getInstance(customDockerClientConfig , httpClient)
82
+ private val dockerClient = DockerClientImpl .getInstance(dockerClientConfig , httpClient)
83
83
84
84
fun execute (request : CodeExecutionRequest ): CodeExecutionResponse {
85
85
pullImage()
@@ -101,8 +101,9 @@ class LLMCodeExecutor(
101
101
cmd.withWorkingDir(it)
102
102
}
103
103
val containerId = cmd.exec().id
104
+ logger.info(" Created container {}" , containerId)
104
105
dockerClient.startContainerCmd(containerId).exec()
105
-
106
+ logger.info( " Started container {} " , containerId)
106
107
val outputBuilder = StringBuffer ()
107
108
val errorBuilder = StringBuffer ()
108
109
val countDownLatch = CountDownLatch (1 )
@@ -147,6 +148,7 @@ class LLMCodeExecutor(
147
148
(config.executionTimeout ? : Duration .ofMinutes(1 )).toSeconds(),
148
149
TimeUnit .SECONDS
149
150
)
151
+ logger.info(" Container finished execution {}" , containerId)
150
152
try {
151
153
dockerClient.stopContainerCmd(containerId).exec()
152
154
} catch (e: NotModifiedException ) {
@@ -198,6 +200,7 @@ class LLMCodeExecutor(
198
200
}
199
201
200
202
dockerClient.removeContainerCmd(containerId).exec()
203
+ logger.info(" Container removed {}" , containerId)
201
204
return CodeExecutionResponse (
202
205
outputBuilder.toString(),
203
206
errorBuilder.toString(),
@@ -207,6 +210,7 @@ class LLMCodeExecutor(
207
210
}
208
211
209
212
private fun pullImage () {
213
+ logger.info(" Start pulling image {}" , config.containerImage)
210
214
val pullImageCountDownLatch = CountDownLatch (1 )
211
215
dockerClient.pullImageCmd(config.containerImage)
212
216
.exec(object : ResultCallback <PullResponseItem > {
0 commit comments