Skip to content

Instantly share code, notes, and snippets.

@lomnom
Last active November 5, 2025 17:59
Show Gist options
  • Select an option

  • Save lomnom/3ee4bdfa11e429bd90abf1ff08845726 to your computer and use it in GitHub Desktop.

Select an option

Save lomnom/3ee4bdfa11e429bd90abf1ff08845726 to your computer and use it in GitHub Desktop.
Setting up Contest Management System on a raspberry pi 3A

Steps taken to get cms up and running

Cms was installed onto a raspberry pi running 64x raspbian through docker. This document details the process. It assumes you are working from the terminal.

Before everything

sudo apt-get update && sudo apt-get upgrade to have up-to-date apt info

Get CMS source

Note that we install through the docker route to avoid the suffering that comes with manually resolving dependencies.

  1. Install git thru apt with sudo apt-get install git.
  2. Clone cms source from https://github.com/cms-dev/cms with git clone https://github.com/cms-dev/cms

Installing docker

We need to install the docker compose plugin for cms. Installing docker-compse from apt does not acheive this. Thus, follow the instructions from the official docker docs first here then do here.

Building & testing cms

A small patch before this...

Specifically for the raspberry pi that runs on arm64, you need to change this line in cms/Dockerfile.

OLD:
    echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/isolate.asc]" \
        "http://www.ucw.cz/isolate/debian/ ${CODENAME}-isolate main" \

NEW:
    echo "deb [signed-by=/etc/apt/keyrings/isolate.asc]" \
        "http://www.ucw.cz/isolate/debian/ bookworm-isolate main" \

TODO: Make a git issue? [If this works.] Force bookworm to allow amd64 install.

Another small patch...

To ensure non-messed up permissions, in cms/Dockerfile add this line at the end before the CMD line.

RUN  chmod 777 /home/cmsuser/src /home/cmsuser/cms

Note: Check why the dockerfile messes it up

Note: Ugly bandaid solution.

The actual process

Source here

  1. Go into cms.
  2. Run sudo docker/cms-test.sh
  3. Ensure it finishes without errors. (Or see errors and hope its okay 💀)
  4. Run docker rm -f cms-main-testdb-1 to delete the db created in this process. It is okay if it fails, its not important.

Note that the tests (#2) will take forever to run. It is responsible for building the whole cms then running sanity checks on it.

First run

instructions from here)

In the first run, you need to set up the database.

  1. Run with sudo docker/cms-dev.sh. It will put you in a bash shell.
  2. Run createdb -h devdb -U postgres cmsdb in that shell
  3. Run cmsInitDB in that shell

Import demo contest

Note: Can you easily ignore/not use/deactivate the demo contest?

>>> git clone https://github.com/cms-dev/con_test.git
>>> cd con_test
>>> cmsImportUser --all
>>> cmsImportContest -i .

Test

Now, test it.

cmsContestWebServer

You should be able to access the page at [IP]:8888 if all goes well.

Running it

Accessing admin page

  1. Enter the shell in the docker container with sudo docker/cms-dev.sh
  2. Run cmsAddAdmin [any_name_you_want] to make an admin account
  3. Run cmsAdminWebServer to start the admin page
  4. Access admin page at [IP]:8889

Actually running it

  1. Enter the shell in the docker container with sudo docker/cms-dev.sh
  2. Run the services you need one by one.

You would normally run with cmsLogService & then cmsResourceService -a && fg to run everything. But this spawns waaay too many workers and it blows up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment