This version is following ioi/cms.
System | Support |
---|---|
Ubuntu 20.04 | ✅ |
Ubuntu 22.04 | ✅, Need to enable cgroup v1 |
Windows Subsystem Linux (Ubuntu 22.04) | ✅ |
macOS |
macOS doesn't support isolate (a.k.a. cmsWorker) running, because cgroups doesn't support macOS.
TBD
Contest Management System is used ioi/isolate for sandbox, which is not supported cgroup v2 yet.
In Ubuntu 22.04, cgroup v1 default is not enabled. You need to enable it and reboot.
#!/bin/bash
echo 'GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=false"' | sudo tee /etc/default/grub.d/70-cgroup-v1.cfg
sudo update-grub
sudo reboot
After that, you will need to check cgroup v1 is enabled.
mount | grep cgroup
This is success example output.
ubuntu@cms:~$ mount | grep cgroup
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755,inode64)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/misc type cgroup (rw,nosuid,nodev,noexec,relatime,misc)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
Follow this manual to install Docker.
- Clone this project (include submodules)
git clone --recursive https://github.com/tico88612/cms-docker.git
-
If you want to change worker number, edit
config/cms.conf
anddocker-compose.yml
-
Copy
.env.example
to.env
and editCMS_SECRET_KEY
,CMS_ADMIN_PASSWORD
,CMS_RANKING_PASSWORD
etc. (Contest has not been created yet, don't touchCMS_CONTEST_ID
before creating the contest.)
cp .env.example .env
vim .env # Edit .env
- Build
cms-base:latest
image.
# Docker build
docker build -f images/cms-base/Dockerfile . -t cms-base:latest
# If you have install Buildx, you can try this
docker buildx build -f images/cms-base/Dockerfile . -t cms-base:latest
- Up all service
docker compose up -d
- Login to Admin system & Create contest.
Contest: http://localhost:8888
Admin: http://localhost:8889
Ranking: http://localhost:8890
- Have fun!
Pull Request Welcome!
- GitHub Action Build & Push Image
- Helm Chart Version (Kubernetes)