ojudge

A competitive programming judging platform written in OCaml
git clone git://git.laack.co/ojudge.git
Log | Files | Refs | README

commit 336e613e107b2e828c565e57e49b8a7a03726ce0
parent fd022ad10e5bebfb39bae1cef0f0d6567023453e
Author: Andrew Laack <andrew@laack.co>
Date:   Thu, 12 Nov 2026 23:32:40 -0600

Baseline container build and execution script

Diffstat:
Dojudge/Containerfile | 2--
Mojudge/Makefile | 9++++++---
Mojudge/bin/main.ml | 7+++++++
Aojudge/containers/Containerfile | 9+++++++++
Aojudge/containers/entrypoint.sh | 5+++++
5 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/ojudge/Containerfile b/ojudge/Containerfile @@ -1,2 +0,0 @@ -# bookwork-slim -FROM debian@sha256:734a72b3d6142a71993b4bc580ca01d8ca687f77a2c422d96a961d3376b179bc diff --git a/ojudge/Makefile b/ojudge/Makefile @@ -1,5 +1,8 @@ -run: +run-ocaml: dune exec ojudge -build: - podman build . -t judge +build-container: + podman build containers -t judge + +run-container: + podman run --rm -it -v .:/code --network=none --memory=256MB --cpus 1 judge diff --git a/ojudge/bin/main.ml b/ojudge/bin/main.ml @@ -1,2 +1,9 @@ + +let run = + "cat ex1.in | ./a.out" + +let compile = + "ocamlopt nums.cmxa str.cmxa -pp camlp4o -unsafe main.ml" + let command = "podman run --rm -it --network=none --memory=256MB --cpus 1 judge test" diff --git a/ojudge/containers/Containerfile b/ojudge/containers/Containerfile @@ -0,0 +1,9 @@ +# bookwork-slim +FROM debian@sha256:734a72b3d6142a71993b4bc580ca01d8ca687f77a2c422d96a961d3376b179bc + +RUN apt-get update && apt-get upgrade -y +RUN apt-get install ocaml libnum-ocaml-dev -y + +COPY entrypoint.sh /data/entrypoint.sh + +ENTRYPOINT ["/data/entrypoint.sh"] diff --git a/ojudge/containers/entrypoint.sh b/ojudge/containers/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +cd /code +ocamlopt nums.cmxa str.cmxa -unsafe main.ml +cat ex1.in | ./a.out