JohnAZoidberg / Sapporo

Web App for hosting coding competition
1 stars 1 forks source link

Sapporo

Codacy Badge

Sapporo is a web app for hosting online coding competition

How to run

It's based on Meteor.js. So just run it like other Meteor projects

meteor npm install
meteor

Features

Set up

  1. Acquire certificate and put them in runtime/{cert,privkey}.pem
  2. Adjust example-nginx.conf and copy to runtime/nginx.conf
  3. Start all containers docker-compose up
  4. Open webpage and create admin account with admin:awesomecodewar
  5. Set up docker connection and languages
    1. Make docker listen on TCP
      • Edit /etc/sysconfig/docker and add -H tcp://0.0.0.0:2376 to OPTIONS
    2. Enter 172.17.0.1:2376 as docker connection
    3. Click on the configuration to validate that we can connect to the daemon
    4. Add languages (see below for configuration)
    5. Run docker pull python:3 for each container (replace container name)
    6. Test language support
  6. Add other hosts
    1. Make sure the docker daemons listen on tcp://0.0.0.0:2376
    2. Allow inbound traffic on port 2376 for security group of docker host by security group of sapporo host
    3. Pull docker images for all languages
    4. Configure IP and port of docker host

How to install docker and docker-compose on AWS Linux

sudo yum install -y docker
sudo service docker start
# Add yourself to docker group, so sudo is not required
sudo usermod -a -G docker ec2-user
# Make it autostart
sudo chkconfig docker on

# Useful  tools
sudo yum install -y git tmux

# Download docker-compose
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

# Then log out and in again

Language configuration

Import from registration

Provide the URL, e.g. https://hpcodewars.com.tw/registrations/sapporo and the sapporo_secret specified in the registration's configuration file.