Giter Club home page Giter Club logo

judge0's Introduction

Judge0 Wallpaper

Judge0 CE

License Release Stars

DigitalOcean Referral Badge

🔥 The most advanced open-source online code execution system in the world.

Table of Contents

About

Judge0 (pronounced like "judge zero") is a robust, scalable, and open-source online code execution system. You can use it to build a wide range of applications that need online code execution features. Some examples include competitive programming platforms, e-learning platforms, candidate assessment and recruitment platforms, online code editors, online IDEs, and many more.

In our research paper Robust and Scalable Online Code Execution System, we present Judge0's modern modular architecture that can be easily deployed and scaled. We study its design, comment on the various challenges in building such systems, and compare it with other available online code execution systems and online judge systems.

To see Judge0 in action, try Judge0 IDE - our free and open-source online code editor.

Features

  • Quick and easy installation
  • Rich and verbose API documentation
  • Scalable architecture
  • Sandboxed compilation and execution
  • Support for 60+ languages
  • Compilation and execution of multi-file programs
  • Support for additional files alongside the user's program
  • Support for custom user-defined compiler options, command-line arguments, and time and memory limits
  • Detailed execution results
  • Webhooks (HTTP callbacks)

For more information about these and other features, please read the documentation.

Get Started

Feel free to start with the FREE Basic Plan on RapidAPI or host it yourself.

You can find our detailed plans and pricing here. So far our clients have run with us more than programs.

Why should you use Judge0 on RapidAPI?

Our infrastructure allows you to focus on building your product and forget about the know-how of maintaining and scaling Judge0.

RapidAPI plans are not (good) enough for you?

Let's talk. Contact us.

Flavors

Judge0 comes in two flavors: Judge0 CE and Judge0 Extra CE. They differ mostly in the supported languages.

You can find the source code for Judge0 CE on the master branch, while you can find the source code for Judge0 Extra CE on the extra branch.

Judge0 Extra CE is also available on RapidAPI.

Supported Languages

Judge0 comes in two flavors: Judge0 CE and Judge0 Extra CE. They differ mostly in the supported languages.

Click here to expand the list
# Name
1 Assembly (NASM 2.14.02)
2 Bash (5.0.0)
3 Basic (FBC 1.07.1)
4 C (Clang 7.0.1)
5 C (GCC 7.4.0)
6 C (GCC 8.3.0)
7 C (GCC 9.2.0)
8 C# (Mono 6.6.0.161)
9 C++ (Clang 7.0.1)
10 C++ (GCC 7.4.0)
11 C++ (GCC 8.3.0)
12 C++ (GCC 9.2.0)
13 Clojure (1.10.1)
14 COBOL (GnuCOBOL 2.2)
15 Common Lisp (SBCL 2.0.0)
16 D (DMD 2.089.1)
17 Elixir (1.9.4)
18 Erlang (OTP 22.2)
19 Executable
20 F# (.NET Core SDK 3.1.202)
21 Fortran (GFortran 9.2.0)
22 Go (1.13.5)
23 Groovy (3.0.3)
24 Haskell (GHC 8.8.1)
25 Java (OpenJDK 13.0.1)
26 JavaScript (Node.js 12.14.0)
27 Kotlin (1.3.70)
28 Lua (5.3.5)
29 Objective-C (Clang 7.0.1)
30 OCaml (4.09.0)
31 Octave (5.1.0)
32 Pascal (FPC 3.0.4)
33 Perl (5.28.1)
34 PHP (7.4.1)
35 Plain Text
36 Prolog (GNU Prolog 1.4.5)
37 Python (2.7.17)
38 Python (3.8.1)
39 R (4.0.0)
40 Ruby (2.7.0)
41 Rust (1.40.0)
42 Scala (2.13.2)
43 SQL (SQLite 3.27.2)
44 Swift (5.2.3)
45 TypeScript (3.7.4)
46 Visual Basic.Net (vbnc 0.0.0.5943)
Click here to expand the list
# Name
1 Bosque (latest)
2 C (Clang 10.0.1)
3 C (Clang 9.0.1)
4 C# (.NET Core SDK 3.1.302)
5 C# (Mono 6.10.0.104)
6 C# Test (.NET Core SDK 3.1.302, NUnit 3.12.0)
7 C++ (Clang 10.0.1)
8 C++ (Clang 9.0.1)
9 C++ Test (Clang 10.0.1, Google Test 1.8.1)
10 C++ Test (GCC 8.4.0, Google Test 1.8.1)
11 C3 (latest)
12 F# (.NET Core SDK 3.1.302)
13 Java (OpenJDK 14.0.1)
14 Java Test (OpenJDK 14.0.1, JUnit Platform Console Standalone 1.6.2)
15 MPI (OpenRTE 3.1.3) with C (GCC 8.4.0)
16 MPI (OpenRTE 3.1.3) with C++ (GCC 8.4.0)
17 MPI (OpenRTE 3.1.3) with Python (3.7.7)
18 Nim (stable)
19 Python for ML (3.7.7)
20 Visual Basic.Net (vbnc 0.0.0.5943)

References

Companies, Organizations, and Projects

These companies, institutions and organizations use Judge0.

Scientific Articles

These scientific articles mention Judge0.

Other Online References

Citation

Please cite us if you found the resources in this repository useful.

@INPROCEEDINGS{9245310,
  author={Došilović, Herman Zvonimir and Mekterović, Igor},
  booktitle={2020 43rd International Convention on Information, Communication and Electronic Technology (MIPRO)},
  title={Robust and Scalable Online Code Execution System},
  year={2020},
  volume={},
  number={},
  pages={1627-1632},
  doi={10.23919/MIPRO48935.2020.9245310}}

Community

Do you have a question, feature request, or something else on your mind? Or you want to follow Judge0 news?

Author and Contributors

Judge0 was created and is maintained by Herman Zvonimir Došilović.

Thanks a lot to all contributors for their contributions to this project.

Changelog

You can find the detailed specification of changes between versions in CHANGELOG.md.

Special Thanks

Special thanks to open-source projects without whom Judge0 probably wouldn't exist: Isolate, Docker, Ruby on Rails and others.

License

Judge0 is licensed under the GNU General Public License v3.0.

judge0's People

Contributors

aashish-ak avatar alan-navarro96 avatar awasthishubh avatar balababa avatar bhupesh-v avatar dependabot[bot] avatar hermanzdosilovic avatar phamngocquy avatar tallninja avatar terror avatar vvalchev avatar yash-khaitan avatar

Stargazers

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

Watchers

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

judge0's Issues

Documentation errata

  1. Submission section:
    • memory_limit unit should be kilobyte
    • message description should be described better. It is actually message from isolate - status message of isolate sandbox.
    • wall_time description should said: "Will be greater than or equal to time".
  2. Create Submission
    • "or characters which cannot be send with JSON" - senT
    • "Judge0 API assumes you are sending raw data" - plain text data
    • "Instead of checking submission status with second request, you can wait for submission result by sending wait query parameter and setting it to true. With this feature you will get submission result immediately after submission has been created." - Instead of checking submission status by making another request send wait query parameter and set it to true which will enable you to get submission status immediately as part of response to the request you made.
    • "On a official Judge0 API this feature is enabled" - an
    • "this feature is enabled" can mean that all your requests will get submission status as response. But no, this means that you can ask for submission status as part of response. This should be said in docs.
  3. Get Submission
    • fields is not of type integer
  4. Config Info
    • enable_wait_result "user can request to synchronically" - synchronously

Strict whitespace

When comparing stdout and expected_stdout Judge0 API is ignoring additional whitespace at each line.

For example:
let stdout:

<space><space><new line>
  *<space><new line>
 ***<space><space><new line>
*****<space><new line>
 ***<space><new line>
  *<space><new line>
<space><new line>
<new line>
<new line>

and expected_stdout:

<new line>
  *<space><new line>
 ***<new line>
*****<new line>
 ***<new line>
  *<new line>

then these two are considered equal, because if you remove all newlines from below and all space from right you get (for both):

<new line>
  *<new line>
 ***<new line>
*****<new line>
 ***<new line>
  *<new line>

This feature is great because users don't need to worry about aditional \n at the end of the output. It happend to me many times that adding printf("\n"); at the end gave me AC.

But I would like to introduce new feature: STRICT_WHITESPACE which wouldn't do these transformations and examples from above would not be the same and accepted.

I need to add:

  1. New configuration variable in judge0-api.conf.default called STRICT_WHITESPACE which is false by default.
  2. New attribute for Submission model called strict_whitespace.

Maybe this attribute can be called more appropriately than strict_whitespace. Should think about that.

Can't run in windows10 docker

I have already see the logs, there are several errors blow. I think the main problem is network didn't connected. Beacuse they can't reslove host name db, please give me some advice.

db container log

2017-10-16 10:56:55.765 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:56:55.765 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:56:58.173 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:56:58.173 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:57:00.590 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:57:00.590 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:57:03.387 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:57:03.387 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:57:05.838 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:57:05.838 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:57:09.235 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:57:09.235 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:57:14.356 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:57:14.356 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:57:30.599 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:57:30.599 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:57:45.553 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:57:45.553 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:58:12.888 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:58:12.888 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 10:59:05.801 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 10:59:05.801 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 11:00:07.586 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 11:00:07.586 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 11:01:09.696 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 11:01:09.696 UTC [1] HINT:  The server must be started by the user that owns the data directory.
2017-10-16 11:02:11.600 UTC [1] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2017-10-16 11:02:11.600 UTC [1] HINT:  The server must be started by the user that owns the data directory.

worker log

Running Judge0 API with configuration settings:
ENABLE_WAIT_RESULT: true
CPU_TIME_LIMIT: 2.0
MAX_CPU_TIME_LIMIT: 15.0
CPU_EXTRA_TIME: 0.5
MAX_CPU_EXTRA_TIME: 2.0
WALL_TIME_LIMIT: 5.0
MAX_WALL_TIME_LIMIT: 20.0
MEMORY_LIMIT: 128000
MAX_MEMORY_LIMIT: 256000
STACK_LIMIT: 64000
MAX_STACK_LIMIT: 128000
MAX_PROCESSES_AND_OR_THREADS: 30
MAX_MAX_PROCESSES_AND_OR_THREADS: 60
ENABLE_PER_PROCESS_AND_THREAD_TIME_LIMIT: false
ALLOW_ENABLE_PER_PROCESS_AND_THREAD_TIME_LIMIT: true
ENABLE_PER_PROCESS_AND_THREAD_MEMORY_LIMIT: true
ALLOW_ENABLE_PER_PROCESS_AND_THREAD_MEMORY_LIMIT: true
MAX_FILE_SIZE: 1024
MAX_MAX_FILE_SIZE: 4096
NUMBER_OF_RUNS: 1
MAX_NUMBER_OF_RUNS: 20
rails aborted!
PG::ConnectionBad: could not translate host name "db" to address: Name or service not known
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `initialize'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `new'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `connect'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:729:in `new_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:773:in `checkout_new_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:752:in `try_to_checkout_new_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:713:in `acquire_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:490:in `checkout'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:883:in `retrieve_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_handling.rb:91:in `connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/model_schema.rb:442:in `load_schema!'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/attributes.rb:233:in `load_schema!'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/attribute_decorators.rb:28:in `load_schema!'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/model_schema.rb:437:in `load_schema'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/model_schema.rb:344:in `columns'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/model_schema.rb:385:in `column_names'
/usr/src/api/app/serializers/submission_serializer.rb:2:in `<class:SubmissionSerializer>'
/usr/src/api/app/serializers/submission_serializer.rb:1:in `<top (required)>'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `block in require'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:380:in `block in require_or_load'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies/interlock.rb:11:in `loading'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:37:in `load_interlock'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:358:in `require_or_load'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:336:in `depend_on'
/opt/.gem/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:252:in `require_dependency'
/opt/.gem/gems/railties-5.0.2/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!'
/opt/.gem/gems/railties-5.0.2/lib/rails/engine.rb:475:in `each'
/opt/.gem/gems/railties-5.0.2/lib/rails/engine.rb:475:in `block in eager_load!'
/opt/.gem/gems/railties-5.0.2/lib/rails/engine.rb:473:in `each'
/opt/.gem/gems/railties-5.0.2/lib/rails/engine.rb:473:in `eager_load!'
/opt/.gem/gems/resque-1.26.0/lib/resque/tasks.rb:43:in `block (2 levels) in <top (required)>'
/opt/.gem/gems/railties-5.0.2/lib/rails/commands/rake_proxy.rb:14:in `block in run_rake_task'
/opt/.gem/gems/railties-5.0.2/lib/rails/commands/rake_proxy.rb:11:in `run_rake_task'
/opt/.gem/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
/opt/.gem/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
Tasks: TOP => resque:work => resque:preload
(See full trace by running task with --trace)

api log

could not translate host name "db" to address: Name or service not known
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "host"=>"db", "database"=>"postgres", "username"=>"postgres", "password"=>"YourPasswordHere1234", "pool"=>nil}
rails aborted!
PG::ConnectionBad: could not translate host name "db" to address: Name or service not known
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `initialize'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `new'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `connect'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:729:in `new_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:773:in `checkout_new_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:752:in `try_to_checkout_new_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:713:in `acquire_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:490:in `checkout'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:883:in `retrieve_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/connection_handling.rb:91:in `connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/tasks/postgresql_database_tasks.rb:6:in `connection'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/tasks/postgresql_database_tasks.rb:15:in `create'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/tasks/database_tasks.rb:109:in `create'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/tasks/database_tasks.rb:129:in `block in create_current'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/tasks/database_tasks.rb:292:in `block in each_current_configuration'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/tasks/database_tasks.rb:291:in `each'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/tasks/database_tasks.rb:291:in `each_current_configuration'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/tasks/database_tasks.rb:128:in `create_current'
/opt/.gem/gems/activerecord-5.0.2/lib/active_record/railties/databases.rake:27:in `block (2 levels) in <top (required)>'
/opt/.gem/gems/railties-5.0.2/lib/rails/commands/rake_proxy.rb:14:in `block in run_rake_task'
/opt/.gem/gems/railties-5.0.2/lib/rails/commands/rake_proxy.rb:11:in `run_rake_task'
/opt/.gem/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
/opt/.gem/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
Tasks: TOP => db:create
(See full trace by running task with --trace)

URL callback

It would be cool to have url callback when submission is done.

I need to add following callback attributes:

  • callback_url
  • callback_verb
  • callback_fields
  • callback_format (json or xml)

Callbacks need to be processed in separate workers.

Think about what other attributes you could add for callbacks.

problem in production mode

hello.
I try to make judge0 in production mode in server , redis server and db server and worker is run but
root_api_1 is not run and try to restart in many times .
thanks to help me

Disable changing default config for submission

Maybe we can introduce new config variable called PERMIT_CONFIG_CHANGE that would allow/deny users to change for example cpu_time_limit and other configuration variables for some submission. I need to think more about this.

all math functions not working in c

I Tried a simple code as shown below :

#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[])
{
    double value1, value2;
    double result;

    value1 = 4;
    value2 = 2;

    result = pow(value1, value2);
    printf("%f raised to the power of %f is %f\n", value1, value2, result);
    return 0;
}

OUTPUT
/tmp/ccJ63NC3.o: In function main': main.c:(.text+0x40): undefined reference to pow'
collect2: error: ld returned 1 exit status

Even though using include <math.h> it gave error , But when I change it to pow(4,2) it works fine.

Please check ..

Custom online judge that connects to Judge0 API

Hi
I'm trying to create a programming judge using Django and I came across your website. I was wondering if it is possible to create a Django app which can connect to your API, judge the submission and grade the code?
Thank you

Problem with setup. Rails Error: Unable to access log file.

Hello, I tried to run your app, I followed all steps but in final step I got that error:

Rails Error: Unable to access log file. 
Please ensure that /usr/src/api/log/development.log exists and is writable (ie, make it writable for user and group: chmod 0664 /usr/src/api/log/development.log). 
The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

As I understand before executing these steps

$ rails s -b 0.0.0.0
$ rails resque:work QUEUE=* 

I have to open new terminal windows and do that

$ ./scripts/dev-shell

Not able to pull judge0 api code

I am trying to pull judge0 api source code but after few pulls it gives authentication required error and terminates.

I have tried it several times.

I have attached the screenshot for the same.
screen shot 2017-03-31 at 8 16 13 am

Support for other languages

Greetings,

Is there going to be upcoming support for other programming languages, specifically JavaScript (thru NodejS)?

Runtime Error when running template Ruby code

I think that this problem is connected with #7 is such a way that when we enable memory cgroups on server and enable ENABLE_PER_PROCESS_AND_OR_THREAD_MEMORY_LIMIT option, this will be resolved.

Add PHP

Still lots of language not on judge0 API please upgrade with PHP language.I already wrote ide script but json response is not getting plaese add php as soon as possible.

Auth token

We should add feature which allows admins to specify authorization token in judge0-api.conf file. Every client should send this auth token along with other request body to be able to make API call.

So admin should be able to specify something like this:

AUTH_TOKEN_KEY=X-My-Token-Key # default would be X-Auth-Key
AUTH_TOKEN_VALUE=pyxsbC9Y94ZQ3FuN4AvNqRhaGf1ZIoY5yESQcyXKBjJnYaMdyM

Now every request should have this in request header. And if it doesn't client gets Unauthorized status code.

Internal error when stdout is empty but expected_output is not empty

command:

$ curl -d '{"source_code": "aW50IG1haW4oKXt9", "language_id": 4, "expected_output": "cGsK"}' -H "Content-Type: application/json" -X POST "https://api.judge0.com/submissions/?base64_encoded=true&wait=true"

The judge0 api server returned:

{"stdout":null,"time":"0.0",
 "memory":128,"stderr":null,
 "token":"b0003b1c-c43c-4638-a2e5-018e4f3e1aa3",
"compile_output":null,
"message":"dW5kZWZpbmVkIG1ldGhvZCBgc3BsaXQnIGZvciBuaWw6TmlsQ2xhc3M=\n","status":{"id":13,"description":"Internal Error"}}

The message says:

undefined method `split' for nil:NilClassbase64: invalid input

I guess this is a bug in ruby code?

Problem with setup : Postgres - could not connect to server

I am getting the following error when I try to run the docker container. This is with fresh install on OS X. Got similar error with Ubuntu 16.04 (AWS EC2 instance).

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?

GLIBCXX_3.4.21 not found

There is an error

./a.out: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./a.out)

when I run this code on http://ide.judge0.com

#include <iostream>
#include <string>

int main() {
    std::string greeting = "hello, world";
    std::cout << greeting << std::endl;
    return 0;
}

Partial response

By default submission show action returns all attributes (except source_code, input, expected_output) to the client. For better performance client could specify which attributes he needs using attributes query parameter.

For example if client only needs status and time it woud send:

curl https://api.judge.com/submissions/SUBMISSION-TOKEN?attributes=status,time

and this would result with

{
  "status": {
    "id": 3,
    "description": "Accepted"
  },
  "time": "0.002"
}

Hosting issue

The hosted api is returning a 422 error, saying that the language id is not valid.
Checked on the official dummy page too, same error

Compile Info

Currently compile error messages are added to stderr. I think it would be usefull just to have attribute compile_info in which we will always add compile information (warnings and/or errors).

Add support for multiple inputs

Currently, when making a new submission, the parameter input is a string. This means if I have multiple test cases (which is common in programming challenges), I'd need to make multiple requests. Could we modify the input, expected_output, and stdout to support multiple test cases (up to a reasonable limit, maybe 5)?

Aside: Really love what you're doing with this @hermanzdosilovic. Wish I could contribute, but unfortunately, I don't know Ruby. Two thumbs up!

Time don't have same precision

First of all, your job is amazing doing this incredibly project!
I tried run the judge0/api at my Linux/Ubuntu VPS, and its run amazing, thanks to you and the awesome Docker. Unfortunately, my submission running_time is not as precise as at your API. As you can see:
MINE SELF-HOSTED:

{
"token": "d402a8a5-f742-4eca-bd26-5ca8c5f4221e",
"status": {
"id": 3,
"description": "Accepted"
},
"stdout": "hello, Judge0\n",
"stderr": "",
"created_at": "2017-05-17T13:35:19.142Z",
"finished_at": "2017-05-17T13:35:21.299Z",
"time": "0.0",
"memory": 196,
"number_of_runs": 1,
"cpu_time_limit": "1.0",
"cpu_extra_time": "0.5",
"wall_time_limit": "10.0",
"memory_limit": 128000,
"stack_limit": 128000,
"max_processes_and_or_threads": 15,
"enable_per_process_and_thread_time_limit": true,
"enable_per_process_and_thread_memory_limit": true,
"max_file_size": 1024
}

AT api.judge0.com:

{
"token": "ea55675b-4603-4100-b572-b1fcb112065c",
"status": {
"id": 3,
"description": "Accepted"
},
"stdout": "hello, Judge0\n",
"stderr": "",
"created_at": "2017-05-17T13:25:37.808Z",
"finished_at": "2017-05-17T13:25:38.116Z",
"time": "0.001",
"memory": 128,
"number_of_runs": 1,
"cpu_time_limit": "1.0",
"cpu_extra_time": "0.5",
"wall_time_limit": "10.0",
"memory_limit": 128000,
"stack_limit": 128000,
"max_processes_and_or_threads": 15,
"enable_per_process_and_thread_time_limit": true,
"enable_per_process_and_thread_memory_limit": true,
"max_file_size": 1024
}

I hope find someone that help me with this issue, so that I can come to contribute in the future with the judge0,

Wait for submission results

I think it would be useful to have an option to wait for submission result and not just asynchronously ask for it.

This could be achieved with adding optional wait query parameter to Submission Create action. By default this parameter is set to false. Server would then add this submission to work queue and wait for this submission to finish, and after it is done it would return result back to the client.

I would also like to see this as configurable option, meaning that admin can disable it and that clients cannot use this if admin disable this feature. I think that this would be useful for hosts who don't want too many long lasting TCP connections, but just want standard asynchronous approach. If client requested wait for submission result and host doesn't allow that, then client should get appropriate error message and status code.

Checkers

Some tasks can have multiple solutions. When that is the case you need to use special program called checker that checks if user's solution is acceptable. Example would be printing one route in a graph from point A to point B - there could be more acceptable solutions.

I would like to add this feature in Judge0 API in the following way. Submission has_one checker (Submission) and checker (Submission) belongs to some submission. Checker is also submission that runs after initial submission is run. But checker is special type of submission that gets three arguments: stdout, stdin and expected_output. It then needs to check if for stdout is acceptable for stdin when expected_output is solution.

Checker would probably inherit all submission's config (cpu_time_limit, etc.) and needs to output 1 if submission is acceptable or 0 if it's not (WA). Checker can be written in any language that Judge0 API supports. It is a special type of submission that validates some other submission. Checker queue should be run by different kind of workers.

I should also add new states for submission that has checkers. For example: In Check Queue when it's checker is In Queue and Checking when its checker is Processing. Checker would have also his statuses just like submission.

Judge0 API Dummy client

Deployed production judge0 API in docker with the prescribed steps provided in the document, when testing by using dummy client we are getting this error.
URL is provided is down here.

Thank you.

Request/Response Log

[Request 25/04/2018, 16:06:32] POST http://183.82.3.219:3000/submissions?wait=true
{
"source_code": "#include <stdio.h>\n\nint main(void) {\n char name[10];\n scanf("%s", name);\n printf("hello, %s\n", name);\n return 0;\n}",
"language_id": "4",
"number_of_runs": "1",
"stdin": "Judge0",
"expected_output": "hello, Judge0",
"cpu_time_limit": "2",
"cpu_extra_time": "0.5",
"wall_time_limit": "5",
"memory_limit": "128000",
"stack_limit": "64000",
"max_processes_and_or_threads": "30",
"enable_per_process_and_thread_time_limit": false,
"enable_per_process_and_thread_memory_limit": true,
"max_file_size": "1024"
}
[Response 25/04/2018, 16:06:32] 422 Unprocessable Entity
{
"readyState": 4,
"responseText": "{"language_id":["language with id 4 doesn't exist"]}",
"responseJSON": {
"language_id": [
"language with id 4 doesn't exist"
]
},
"status": 422,
"statusText": "Unprocessable Entity"
}

[DONE 25/04/2018, 16:06:32]

Return doesn't work

I don't know but why does stdout displays null when my response arrives. My source code is - function hello(hey){return hey + ',hello';} hello('JAY');.

And when I use console.log then it works function hello(hey){console.log( hey + ',hello');} hello('JAY');.

Thank You

Insufficient memory for the Java Runtime Environment

When running template Java (OpenJDK 8) code I get following error.

[thread 140550862997248 also had an error][thread 140550867207936 also had an error]

[thread 140550868260608 also had an error][thread 140550864049920 also had an error]
[thread 140550869313280 also had an error]

[thread 140550861944576 also had an error][thread 140550859839232 also had an error]
[thread 140550860891904 also had an error]

#
# There is insufficient memory for the Java Runtime Environment to continue.
# pthread_getattr_np
[thread 140550857733888 also had an error][thread 140550858786560 also had an error]
[thread 140550856681216 also had an error]# An error report file with more information is saved as:
# 
[thread 140550865102592 also had an error]
/box/hs_err_pid1.log

Error occurred during initialization of VM
Could not allocate metaspace: 1073741824 bytes

Although there is 1GB of memory limit for each submission (according to https://api.judge0.com/config_info) that is not enough to run Java code. Also it is worth noticing that ENABLE_PER_PROCESS_AND_OR_THREAD_MEMORY_LIMIT limit is disabled due to memory cgroups being disabled on server. When I run this locally with the same configuration but ENABLE_PER_PROCESS_AND_OR_THREAD_MEMORY_LIMIT enabled, I can run this template Java code without a problem.

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.