Giter Site home page Giter Site logo

mraron / njudge Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 0.0 11.55 MB

An online judge system written in go

Home Page: https://njudge.hu

License: GNU Affero General Public License v3.0

Go 98.57% JavaScript 0.74% CSS 0.20% Dockerfile 0.30% Makefile 0.19%
judge hacktoberfest judger golang echo-framework sqlboiler online-judge

njudge's Introduction

njudge

Tests Go Reference Go Report Card

Online Judge system written in golang. A running version can be found here.

It consists of two main parts:

  • A group of reusable components, located in pkg/, which can be used in a variety ways related to the conversion, running and modification of algorithmic/olympiad tasks.
  • A web based online judge system, located in internal/.

How to run the online judge

Disclaimer: it's possible to run the system without docker, but it's much more of a hassle to set up the environment.

First, build the containers:

docker-compose build base
docker-compose build

Then, run the migrations:

docker-compose run web ./njudge web migrate --up

Modify the environment files web.env and judge.env. Typically only web.env needs to be changed. A quite minimal web.env file for example would be:

NJUDGE_MODE="production"
NJUDGE_HOSTNAME="yourhost.domain"
NJUDGE_URL="https://yourhost.domain"
NJUDGE_COOKIESECRET="somesecretstring"

Probably you would want some of NJUDGE_SENDGRID, NJUDGE_SMTP, NJUDGE_GOOGLEAUTH as well to provide OAuth login and email sending capabilities. For the full list of the configuration options supported by the web component check out config.go.

Then you can start all containers necessary via:

docker-compose up

To make problems available to the system you have two options:

  1. Use the automatically created njudge_problems volume, copy the problems there via docker cp.
  2. Modify the docker-compose.yml to use a bind mount pointing to a directory on your host system.

If both the judge and web component sees the problems, you have to use the admin panel (or some sql client) to create the necessary ProblemRels for it to be displayed on the frontend.

njudge's People

Contributors

dependabot[bot] avatar mraron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

njudge's Issues

Refactor utils

  • make it more testable #15
  • make sure polygon is 100% ok
  • make export func

template error on result page

template: ranklist.gohtml:11:14: executing \"ranklist.gohtml\" at <.Data.Problem.StatusSkeleton.MaxScore>: wrong number of args for StatusSkeleton: want 1 got 0

Refactor of utils/problems

  • Move the logic of running the testcases out of batch, it should only be about how we run a single testcase and there should be another abstraction for the feedback type itself
  • Feedback is really a testing policy currently, rename it and the web should decide how it displays everything
  • To help the previous point add a boolean value Example to testcase struct
  • Specifically validate polygon handling as some parts were written before polygon could handle subtasks properly
  • Make use of the new language.SandboxProvider to make communication tasks possible
  • Add logging to the whole process

glue crash

glue_1 | panic: runtime error: invalid memory address or nil pointer dereference
glue_1 | [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x8fabb3]
glue_1 |
glue_1 | goroutine 20 [running]:
glue_1 | github.com/mraron/njudge/pkg/glue.(*Server).runJudger(0xc000234600)
glue_1 | /app/pkg/glue/glue.go:146 +0x3b3
glue_1 | created by github.com/mraron/njudge/pkg/glue.(*Server).Run
glue_1 | /app/pkg/glue/glue.go:67 +0x12a
njudge_glue_1 exited with code 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.