You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Tianyun Zhang a559c44b9d
upgrade dotnet dependencies
1 month ago
.vscode add vscode C# config 2 months ago
Client hide score of 0 if failed on samples 1 month ago
Dockerize update README.md 2 months ago
Isolate add Isolate source code 8 months ago
Notification change namespace of Data to Shared 2 months ago
Server upgrade dotnet dependencies 1 month ago
Shared upgrade dotnet dependencies 1 month ago
Worker upgrade dotnet dependencies 1 month ago
.dockerignore add dockerfile to build worker container 8 months ago
.drone.yml set registry mirror for dockerd in drone.yml 2 months ago
.gitignore update Docker configuration files 8 months ago
.gitlab-ci.yml update pipeline config 7 months ago
CHANGELOG.md hide score of 0 if failed on samples 1 month ago
Dockerfile.env use tencent nuget mirror, bump version 1.5.9 2 months ago
Dockerfile.node update dockerfiles, add node container 2 months ago
Dockerfile.runtime fix apt source in sdk and runtime containers 2 months ago
Dockerfile.sdk fix apt source in sdk and runtime containers 2 months ago
Dockerfile.webapp fix building spa, bump version 1.5.1 2 months ago
Dockerfile.worker update dockerfiles, add node container 2 months ago
DotOJ.sln update client project config file 2 months ago
LICENSE add GPLv3 license 2 months ago
README.md update README.md 2 months ago
release.sh fix folder name in release.sh 2 months ago

README.md

DotOJ

Also known as: .OJ, NTOJ, OJ Core, etc.

Yet another online judge built on .NET Core tech stack, with ASP.NET and Angular.

Dependencies

DotOJ depends on multiple open-source projects:

Development

The judging service depends on control group of Linux kernels. It is not possible to run workers on Windows or macOS, but the web application is cross-platform.

Follow the steps to prepare a dev environment:

  1. Install .NET 5 SDK, Node, MariaDB (MySQL) and RabbitMQ.
  2. Edit Server/appsettings.json and Worker/appsettings.json with database and message queue configuration and edit application information.
  3. Restore .NET and Node packages.
    • Run dotnet restore to restore all nuget packages.
    • Run npm install in Client folder to download node dependencies.
  4. Run dotnet run in Server and Worker folder to start application.

Deployment

Docker Containers

Docker containers are published in registry and namespace ccr.ccs.tencentyun.com/dotoj. There are six containers to build and run services:

  • sdk: .NET Core SDK.
  • runtime: ASP.NET runtime.
  • env: build environment.
  • node: node environment.
  • webapp: web frontend and server.
  • worker: judge service.

For more information on how to deploy with docker, refer to Dockerize/README.md.

Scaling Application

The application can be easily scaled by adding or removing workers.

However, workers needs to share file system with web app in order to keep judge data updated. On the other hand, if judge data can be made read only, then workers can run on separate environments with connection to the same DB context.

Create X.509 Cerfificate

$ openssl req -x509 -newkey rsa:4096 -sha256 -nodes \
  -subj "/CN=DotOJ" -keyout identity.key -out identity.crt
$ openssl pkcs12 -export -out out/identity.pfx -password pass:identity \
  -inkey identity.key -in identity.crt