Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
SepehrGanji committed Sep 30, 2024
1 parent 3fb80a2 commit 0b2cff3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Coder Judge

## About project
Coder Judge is an open-source platfrom written in Java and Python to compile and run code submissions against test-cases. It uses RabbitMQ to fetch pending jobs, compiles them and then runs agains test cases.
After judging, one of these verdics are possible for the code.
- `COMPILE-ERROR`
- `ACCEPT`
- `WRONG-ANSWER`
- `RUNTIME-ERROR`
- `TIME-LIMIT`
- `MEMORY-LIMIT`

Currently, we support `C++` and `Python` as the submission languages. You can add other languages by simply adding compiler in `app/other/compile.py` and modifying the runner script in `app/other/run.py`.

## Project Setup

You need `java` and `gradle` on your system to run this project.
### Environment file pattern
The `.env` file must be placed in the root directory following the pattern described below.
```
DB_URL= # database host address (including port)
DB_USER= # database username
DB_PASSWD= # database password
QUEUE_HOST= # queue host address (including port)
QUEUE_USER= # queue username
QUEUE_PASSWD= # queue password
SUBMISSION_QUEUE_NAME= # queue name for submissions
RESULT_QUEUE_NAME= # queue name for results
FILE_PATH= # root filesystem path
```

### Setup envirounment variables
You need to set-up every variable on your `.env` file to your current envirounment. This can simply done with Docker, or on `bash` with:
```
$ export $(grep -v '^#' .env | xargs)
```
### Run the project
```
./gradlew run
```
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void run() {
List<String> args = List.of(lang, fullPath);
int stat = FileRunner.getInstance().runFile("compile.py", args);
log.info("Compilation status: " + stat);
String status = stat == 0 ? "COMPILED" : "COMPILE_ERROR";
String status = stat == 0 ? "COMPILED" : "COMPILE-ERROR";
SubmissionEntity.getInstance().updateStatus(submissionId, status);
}
}

0 comments on commit 0b2cff3

Please sign in to comment.