Ещё фиксы от ИИ
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

@@ -61,8 +61,15 @@ public class CSharpExecutionServiceIsolate : IExecutionService
});
chmodProcess?.WaitForExit();
// 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
var isolateResult = await _isolateService.RunAsync(new IsolateRunOptions
@@ -75,7 +82,7 @@ public class CSharpExecutionServiceIsolate : IExecutionService
StackLimitKb = 256 * 1024,
ProcessLimit = 1, // Single process for C#
EnableNetwork = false,
StdinFile = inputFilePath,
StdinFile = sandboxInputPath,
StdoutFile = outputFilePath,
WorkingDirectory = "/box"
});