Autograder

Autograder is a web-based system designed for software project auto-grading, utilizing Docker.

This repository contains the server-side code. For the web-based client-side code, please visit https://github.com/howardlau1999/autograder-web.

For documentation, please head for https://autograder-docs.howardlau.me

知乎文章介绍:Autograder - 一个适合项目作业的评测系统

Build

Go 1.26+ is needed for building the server (go.mod pins the exact patch release; newer Go toolchains download it automatically).

To build without client-side webpage code (which means you need a reverse-proxy like nginx to serve the static contents)

go build -tags containers_image_openpgp -o autograder-server ./cmd/autograder-server

To build the grader service

go build -tags containers_image_openpgp -o autograder-grader ./cmd/autograder-grader

To build with the client-side webpage code, Node.js 24 (or 22.22+) is needed.

git submodule update --init
cd web
npm install && npm run install:vcd-stream && npm run build:server   # writes pkg/web/dist
cd ..
go build -tags containers_image_openpgp -o autograder-server ./cmd/autograder-server

install:vcd-stream installs the (pinned) VCD waveform parser separately because its install script builds a native addon; build:server is ng build with the output laid out flat in pkg/web/dist, which is what pkg/web/embed.go embeds.

Development checks

gofmt -l cmd pkg            # must print nothing
go vet -tags containers_image_openpgp ./...
go test -race -tags containers_image_openpgp ./...

Dependency notes

Configuration

Both binaries read config.toml from /etc/autograder-server/, $HOME/.autograder-server/ or the working directory; autograder-server --config prints a template. Any key can be overridden by an environment variable named after it with . and - replaced by _ (e.g. HUB_TOKEN, TOKEN_SECRET_SESSION). The server refuses to start while any of token.secret.*, hub.token or fs.http.token is empty or still set to the placeholder from the template.

Keys that need attention when deploying: