Evaluator Images
Kelvin uses a set of Docker images to evaluate student submissions safely and consistently. These images are built in a hierarchical manner to minimize duplication and ensure consistency.
Image Structure
All evaluator images are located in evaluator/images/. The structure is designed to allow dependency inheritance between images.
base: The base image (kelvin/base) that all other images typically inherit from. It contains common tools and configurations (likelocalesettings, common libraries).- Language-specific images: Images like
gcc,java,pythonrun, etc. These inherit fromkelvin/base(or other kelvin images) and install specific compilers or interpreters.
Dependency Management
The build system automatically detects dependencies between images by parsing their Dockerfile FROM instructions.
For example, if evaluator/images/gcc/Dockerfile contains FROM kelvin/base, the build system ensures kelvin/base is built before kelvin/gcc.
Building Images
To build the images, use the provided build.py script located in evaluator/images/.
cd evaluator/images
uv run build.py
Build Options
--dry-run: Print thedocker buildcommands that would be executed without running them.
uv run build.py --dry-run
Adding a New Runtime Environment
To add support for a new language or tool:
-
Create a new directory in
evaluator/images/(e.g.,evaluator/images/rust). -
Create a
Dockerfilein that directory. -
Inherit from
kelvin/base(or another appropriate parent).Example
Dockerfile:FROM kelvin/base
RUN apt-get update && apt-get install -y rustc -
Run the build script. It will automatically detect the new image and its dependency.
uv run build.py
The image will be named kelvin/<directory_name> (e.g., kelvin/rust).