Sapporo is a web app for hosting online coding competition
It's based on Meteor.js. So just run it like other Meteor projects
meteor npm install
meteor
runtime/{cert,privkey}.pem
example-nginx.conf
and copy to runtime/nginx.conf
docker-compose up
admin:awesomecodewar
/etc/sysconfig/docker
and add -H tcp://0.0.0.0:2376
to OPTIONS
172.17.0.1:2376
as docker connectiondocker pull python:3
for each container (replace container name)tcp://0.0.0.0:2376
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
python:2
timeout 10 python2
test.py
<
input
sss
print("This is Python2")
python:3
timeout 10 python3
test.py
<
input
sss
print("This is Python3")
azul/zulu-openjdk:8
javac
codewars.java
> /dev/null 2>&1 && cd /; timeout 10 java codewars <
input
sss
class codewars { public static void main(String[] args) { System.out.println("This is Java"); } }
gcc:10.2.0
g++
test.cpp
-o output -std=c++11 -O2
&& timeout 10 ./output <
input
sss
#include <iostream> int main() { std::cout << "This is C++\n"; return 0; }
gcc:10.2.0
gcc
-o output -O2
test.c
&& timeout 10 ./output <
input
sss
#include<stdio.h> int main() { printf("This is C\n"); return 0; }
rust:1.46
rustc
test.rs
&& timeout 10 ./test <
input
sss
use std::io::{self, BufRead}; fn main() { let mut line = String::new(); io::stdin().lock().read_line(&mut line).expect("Could not read line"); println!("Hello from Rust! {}", line) }
golang:1.15
timeout 10 go run
test.go
<
input
sss
package main; import ("bufio"; "fmt"; "os"); func main() { reader := bufio.NewReader(os.Stdin); text, _ := reader.ReadString('\n'); fmt.Println("Hello from Go. ", text); }
swift:5.3
swiftc
test.swift
&& timeout 10 ./test <
input
sss
print("Hello World")
Provide the URL, e.g. https://hpcodewars.com.tw/registrations/sapporo
and the
sapporo_secret
specified in the registration's configuration file.