feat(runner): compile Go and check answers per test group

This commit is contained in:
shira committed 2026-10-11 08:59:29 +03:00
1 parent e95c681165
commit afee564bf4
61 files changed
+2592 -143

No files matched your search

+4
View File
@@ -22,6 +22,7 @@ const (
DefaultCgroupRoot = "/sys/fs/cgroup"
DefaultNsjailPath = "/usr/bin/nsjail"
DefaultPythonPath = "/usr/local/bin/python3"
DefaultGoToolDir = "/usr/local/lib/lincodex-runner/go"
DefaultSandboxUID = 99999
DefaultMaxProcesses = 16
DefaultMemoryOverheadBytes = 4 << 20
@@ -55,6 +56,7 @@ type Config struct {
CgroupRoot string
NsjailPath string
PythonPath string
GoToolDir string
SandboxUID int
MaxProcesses int
MemoryOverheadBytes int64
@@ -92,6 +94,7 @@ func parse(lookup lookupFunc, readFile readFileFunc) (Config, error) {
CgroupRoot: r.text("RUNNER_CGROUP_ROOT", DefaultCgroupRoot),
NsjailPath: r.text("RUNNER_NSJAIL_PATH", DefaultNsjailPath),
PythonPath: r.text("RUNNER_PYTHON_PATH", DefaultPythonPath),
GoToolDir: r.text("RUNNER_GO_TOOL_DIR", DefaultGoToolDir),
SandboxUID: r.integer("RUNNER_SANDBOX_UID", DefaultSandboxUID),
MaxProcesses: r.integer("RUNNER_SANDBOX_MAX_PROCESSES", DefaultMaxProcesses),
MemoryOverheadBytes: r.int64("RUNNER_SANDBOX_MEMORY_OVERHEAD_BYTES", DefaultMemoryOverheadBytes),
@@ -164,6 +167,7 @@ func (c Config) validatePaths() error {
"RUNNER_CGROUP_ROOT": c.CgroupRoot,
"RUNNER_NSJAIL_PATH": c.NsjailPath,
"RUNNER_PYTHON_PATH": c.PythonPath,
"RUNNER_GO_TOOL_DIR": c.GoToolDir,
} {
if !strings.HasPrefix(path, "/") {
errs = append(errs, fmt.Errorf("config.validate - %s must be an absolute path", name))