Skip to content

Judger Design

Eason0729 edited this page Dec 19, 2023 · 2 revisions

Introduction

This project is not very complex, most code self-explain and do not need that much comment, so I would keep it short.

purpose

Follow judger.proto, mainly to provide ability to compile and execute untrusted code remotely.

Dependency

Before understanding judger design, you need to understand a little more about sandbox.

You don't need to understand it fully, because we use a patched nsjail under hood.

Organization

Organization is useful to quickly allocate the problem, with organization and trace, you can at least figure out where the program stuck.

To show how its organization, look at following diagram image

Let's look at a case where you want to add support for cgroup v1.

The reason we cannot just use cgroup v1 with the help of cgroup-rs is because we need to write 1 into cgroup.kill file.

So we need alternative method to kill it, that method is killpg(), therefore we need to rearrange the chart to

container--(depend)-->RunningProc--(associate)-->Limiter...

Therefore you know what part you can get started with!

Clone this wiki locally