Open dector opened 3 years ago
@ErikSchierboom I'm not sure, but this seems like different JVM/Docker behaviour. Do you use Mac? I don't have such issue on Linux.
My suggestion is that logfile isn't creating automatically before redirecting IO. Would be very grateful if you can you try this fix and tell me if it helps:
val ioRedirect = run {
logFile.delete()
+ logFile.createNewFile()
ProcessBuilder.Redirect.appendTo(logFile)
}
I'm running on WSL on Windows, which is a virtual machine with Ubuntu. Weirdly enough, re-running it now gets me a different error message:
Parsed arguments: LaunchArguments(exerciseSlug=hello-world, solutionsDir=/solution, resultFile=/output/results.json)
Running gradle
Gradle finished with exit code 1
=== Log START ===
Exception in thread "main" java.lang.RuntimeException: Could not create parent directory for lock file /root/.gradle/wrapper/dists/gradle-6.0.1-bin/1lxlpkiy24sb18odw96cp4ojv/gradle-6.0.1-bin.zip.lck
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:43)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
=== Log END ===
You don't get that error if you run ./bin/run-in-docker.sh hello-world /home/erik/exercism/kotlin-test-runner/examples/full /home/erik/exercism/kotlin-test-runner/examples/full
?
I reworked test runner's Dockerfile to use official Gradle images. And added Gradle cache into container. This will let us run build in offline mode (container size increased ofc).
However, there is major readonly
containers. Gradle performs some locks during builds.
I can do dirty hack and copy cache to tmpfs on every build. But is --readonly
really necessary?
But is --readonly really necessary?
Well, it helps improve security. We haven't yet enabled it in production, so for now you can ignore the readonly-ness.
There is incubating feature in new Gradle versions that allows sharing lock-free build cache via separate container. I'll take a look at it when I'll have enough time.
👍
@dector I'm running again with the latest fix, and the error is indeed fixed! Great. I do get another error though:
Any idea?
Originally posted by @ErikSchierboom in https://github.com/exercism/kotlin-test-runner/issues/14#issuecomment-837918541