Ещё фиксы от ИИ
All checks were successful
Build and Push Docker Images / build (src/LiquidCode.Tester.Gateway/Dockerfile, git.nullptr.top/liquidcode/liquidcode-tester-gateway-roman, gateway) (push) Successful in 57s
Build and Push Docker Images / build (src/LiquidCode.Tester.Worker/Dockerfile, git.nullptr.top/liquidcode/liquidcode-tester-worker-roman, worker) (push) Successful in 1m17s

This commit is contained in:
2025-11-05 22:15:50 +03:00
parent a8c0ec9ed3
commit 6ed26ae29b
6 changed files with 95 additions and 17 deletions

View File

@@ -52,8 +52,15 @@ public class KotlinExecutionServiceIsolate : IExecutionService
File.Copy(executablePath, boxJarPath, overwrite: true);
// Prepare output file in box
// Prepare input/output files inside the sandbox
var outputFilePath = Path.Combine(boxDir, "output.txt");
string? sandboxInputPath = null;
if (!string.IsNullOrEmpty(inputFilePath) && File.Exists(inputFilePath))
{
sandboxInputPath = Path.Combine(boxDir, "input.txt");
File.Copy(inputFilePath, sandboxInputPath, overwrite: true);
}
// Run in Isolate (Kotlin runs via Java)
var kotlinMemoryMb = Math.Max(memoryLimitMb, 128); // Minimum 128MB for JVM
@@ -69,7 +76,7 @@ public class KotlinExecutionServiceIsolate : IExecutionService
StackLimitKb = 256 * 1024,
ProcessLimit = 64, // JVM creates multiple threads
EnableNetwork = false,
StdinFile = inputFilePath,
StdinFile = sandboxInputPath,
StdoutFile = outputFilePath,
WorkingDirectory = "/box"
});