Skip to content

Commit afcce7a

Browse files
committed
fix test errors
1 parent 5877656 commit afcce7a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/src/main/kotlin/com/javaaidev/llmcodeexecutor/core/LLMCodeExecutor.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class LLMCodeExecutor(
7979
.connectionTimeout(Duration.ofSeconds(30))
8080
.responseTimeout(Duration.ofSeconds(45))
8181
.build()
82-
private val dockerClient = DockerClientImpl.getInstance(customDockerClientConfig, httpClient)
82+
private val dockerClient = DockerClientImpl.getInstance(dockerClientConfig, httpClient)
8383

8484
fun execute(request: CodeExecutionRequest): CodeExecutionResponse {
8585
pullImage()
@@ -101,8 +101,9 @@ class LLMCodeExecutor(
101101
cmd.withWorkingDir(it)
102102
}
103103
val containerId = cmd.exec().id
104+
logger.info("Created container {}", containerId)
104105
dockerClient.startContainerCmd(containerId).exec()
105-
106+
logger.info("Started container {}", containerId)
106107
val outputBuilder = StringBuffer()
107108
val errorBuilder = StringBuffer()
108109
val countDownLatch = CountDownLatch(1)
@@ -147,6 +148,7 @@ class LLMCodeExecutor(
147148
(config.executionTimeout ?: Duration.ofMinutes(1)).toSeconds(),
148149
TimeUnit.SECONDS
149150
)
151+
logger.info("Container finished execution {}", containerId)
150152
try {
151153
dockerClient.stopContainerCmd(containerId).exec()
152154
} catch (e: NotModifiedException) {
@@ -198,6 +200,7 @@ class LLMCodeExecutor(
198200
}
199201

200202
dockerClient.removeContainerCmd(containerId).exec()
203+
logger.info("Container removed {}", containerId)
201204
return CodeExecutionResponse(
202205
outputBuilder.toString(),
203206
errorBuilder.toString(),
@@ -207,6 +210,7 @@ class LLMCodeExecutor(
207210
}
208211

209212
private fun pullImage() {
213+
logger.info("Start pulling image {}", config.containerImage)
210214
val pullImageCountDownLatch = CountDownLatch(1)
211215
dockerClient.pullImageCmd(config.containerImage)
212216
.exec(object : ResultCallback<PullResponseItem> {

0 commit comments

Comments
 (0)