From 9b81f255a68cd8f2ed5cacfa6efc6fb66b1730a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herman=20Zvonimir=20Do=C5=A1ilovi=C4=87?= Date: Wed, 26 Jun 2019 13:52:42 +0200 Subject: [PATCH 1/2] Use only Nim programming language. --- Dockerfile | 15 +- db/seeds.rb | 289 +----------------- docs/api/docs.md | 2 +- .../list_all_languages.md | 174 +---------- public/docs.html | 184 +---------- 5 files changed, 17 insertions(+), 647 deletions(-) diff --git a/Dockerfile b/Dockerfile index 952ff9e2..a4f4c412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,21 @@ -FROM judge0/api-base:0.3.0 +FROM judge0/api-base:nim0.20.0 -RUN echo "deb http://deb.debian.org/debian jessie main" > /etc/apt/sources.list && \ - echo "deb http://security.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list && \ - rm -rf /etc/apt/sources.list.d/* && \ +RUN curl -fSsL "https://deb.nodesource.com/setup_12.x" | bash - && \ apt-get update && \ apt-get install -y --no-install-recommends \ libpq-dev \ - nodejs-legacy \ - npm \ + nodejs \ sudo && \ rm -rf /var/lib/apt/lists/* -ENV PATH "/usr/local/ruby-2.3.3/bin:/opt/.gem/bin:$PATH" +ENV PATH "/usr/local/ruby-2.6.3/bin:/opt/.gem/bin:$PATH" ENV GEM_HOME "/opt/.gem/" RUN echo "gem: --no-document" > /root/.gemrc && \ gem install \ rails:5.0.0 \ bundler:1.15.4 \ pg:0.18 && \ - npm install -g aglio@2.3.0 + npm install -g --unsafe-perm aglio@2.3.0 EXPOSE 3000 @@ -33,4 +30,4 @@ RUN RAILS_ENV=production bundle && \ CMD ["./scripts/run-server"] LABEL maintainer="Herman Zvonimir Došilović, hermanz.dosilovic@gmail.com" -LABEL version="1.2.0" +LABEL version="1.2.0-nim0.20.0" diff --git a/db/seeds.rb b/db/seeds.rb index 0cba6436..446bc18d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,293 +1,10 @@ languages = [ { - name: "Bash (4.4)", - source_file: "script.sh", - run_cmd: "/usr/local/bash-4.4/bin/bash script.sh" - }, - { - name: "Bash (4.0)", - source_file: "script.sh", - run_cmd: "/usr/local/bash-4.0/bin/bash script.sh" - }, - - - { - name: "Basic (fbc 1.05.0)", - source_file: "main.bas", - compile_cmd: "/usr/local/fbc-1.05.0/bin/fbc main.bas", - run_cmd: "./main" - }, - - - { - name: "C (gcc 7.2.0)", - source_file: "main.c", - compile_cmd: "/usr/local/gcc-7.2.0/bin/gcc main.c -lm", - run_cmd: "./a.out" - }, - { - name: "C (gcc 6.4.0)", - source_file: "main.c", - compile_cmd: "/usr/local/gcc-6.4.0/bin/gcc main.c -lm", - run_cmd: "./a.out" - }, - { - name: "C (gcc 6.3.0)", - source_file: "main.c", - compile_cmd: "/usr/local/gcc-6.3.0/bin/gcc main.c -lm", - run_cmd: "./a.out" - }, - { - name: "C (gcc 5.4.0)", - source_file: "main.c", - compile_cmd: "/usr/local/gcc-5.4.0/bin/gcc main.c -lm", - run_cmd: "./a.out" - }, - { - name: "C (gcc 4.9.4)", - source_file: "main.c", - compile_cmd: "/usr/local/gcc-4.9.4/bin/gcc main.c -lm", - run_cmd: "./a.out" - }, - { - name: "C (gcc 4.8.5)", - source_file: "main.c", - compile_cmd: "/usr/local/gcc-4.8.5/bin/gcc main.c -lm", - run_cmd: "./a.out" - }, - - - { - name: "C++ (g++ 7.2.0)", - source_file: "main.cpp", - compile_cmd: "/usr/local/gcc-7.2.0/bin/g++ -Wl,-rpath,/usr/local/gcc-7.2.0/lib64 main.cpp", - run_cmd: "./a.out" - }, - { - name: "C++ (g++ 6.4.0)", - source_file: "main.cpp", - compile_cmd: "/usr/local/gcc-6.4.0/bin/g++ -Wl,-rpath,/usr/local/gcc-6.4.0/lib64 main.cpp", - run_cmd: "./a.out" - }, - { - name: "C++ (g++ 6.3.0)", - source_file: "main.cpp", - compile_cmd: "/usr/local/gcc-6.3.0/bin/g++ -Wl,-rpath,/usr/local/gcc-6.3.0/lib64 main.cpp", - run_cmd: "./a.out" - }, - { - name: "C++ (g++ 5.4.0)", - source_file: "main.cpp", - compile_cmd: "/usr/local/gcc-5.4.0/bin/g++ -Wl,-rpath,/usr/local/gcc-5.4.0/lib64 main.cpp", - run_cmd: "./a.out" - }, - { - name: "C++ (g++ 4.9.4)", - source_file: "main.cpp", - compile_cmd: "/usr/local/gcc-4.9.4/bin/g++ -Wl,-rpath,/usr/local/gcc-4.9.4/lib64 main.cpp", - run_cmd: "./a.out" - }, - { - name: "C++ (g++ 4.8.5)", - source_file: "main.cpp", - compile_cmd: "/usr/local/gcc-4.8.5/bin/g++ -Wl,-rpath,/usr/local/gcc-4.8.5/lib64 main.cpp", - run_cmd: "./a.out" - }, - - - { - name: "C# (mono 5.4.0.167)", - source_file: "Main.cs", - compile_cmd: "/usr/local/mono-5.4.0.167/bin/mcs Main.cs", - run_cmd: "/usr/local/mono-5.4.0.167/bin/mono Main.exe" - }, - { - name: "C# (mono 5.2.0.224)", - source_file: "Main.cs", - compile_cmd: "/usr/local/mono-5.2.0.224/bin/mcs Main.cs", - run_cmd: "/usr/local/mono-5.2.0.224/bin/mono Main.exe" - }, - - - { - name: "Clojure (1.8.0)", - source_file: "main.clj", - run_cmd: "/usr/bin/java -cp /usr/local/clojure-1.8.0/clojure-1.8.0.jar clojure.main main.clj" - }, - - - { - name: "Crystal (0.23.1)", - source_file: "main.cr", - compile_cmd: "/usr/local/crystal-0.23.1-3/bin/crystal build main.cr", + name: "Nim (0.20.0)", + source_file: "main.nim", + compile_cmd: "/usr/local/nim-0.20.0/bin/nim compile main.nim", run_cmd: "./main" }, - - - { - name: "Elixir (1.5.1)", - source_file: "main.exs", - run_cmd: "/usr/local/elixir-1.5.1/bin/elixir main.exs" - }, - - - { - name: "Erlang (OTP 20.0)", - source_file: "main.erl", - compile_cmd: "/bin/sed -i \"s/^/\\n/\" main.erl", - run_cmd: "/usr/local/erlang-20.0/bin/escript main.erl" - }, - - - { - name: "Go (1.9)", - source_file: "main.go", - compile_cmd: "/usr/local/go-1.9/bin/go build main.go", - run_cmd: "./main" - }, - - - { - name: "Haskell (ghc 8.2.1)", - source_file: "main.hs", - compile_cmd: "/usr/local/ghc-8.2.1/bin/ghc main.hs -o a.out", - run_cmd: "./a.out" - }, - { - name: "Haskell (ghc 8.0.2)", - source_file: "main.hs", - compile_cmd: "/usr/local/ghc-8.0.2/bin/ghc main.hs -o a.out", - run_cmd: "./a.out" - }, - - - { - name: "Insect (5.0.0)", - source_file: "main.ins", - run_cmd: "/usr/local/insect-5.0.0/insect main.ins" - }, - - - { - name: "Java (OpenJDK 9 with Eclipse OpenJ9)", - source_file: "Main.java", - compile_cmd: "/usr/local/openjdk9-openj9/bin/javac Main.java", - run_cmd: "/usr/local/openjdk9-openj9/bin/java Main" - }, - { - name: "Java (OpenJDK 8)", - source_file: "Main.java", - compile_cmd: "/usr/lib/jvm/java-8-openjdk-amd64/bin/javac Main.java", - run_cmd: "/usr/lib/jvm/java-8-openjdk-amd64/bin/java Main", - }, - { - name: "Java (OpenJDK 7)", - source_file: "Main.java", - compile_cmd: "/usr/lib/jvm/java-7-openjdk-amd64/bin/javac Main.java", - run_cmd: "/usr/lib/jvm/java-7-openjdk-amd64/bin/java Main", - }, - - - { - name: "JavaScript (nodejs 8.5.0)", - source_file: "main.js", - run_cmd: "/usr/local/node-8.5.0/bin/node main.js" - }, - { - name: "JavaScript (nodejs 7.10.1)", - source_file: "main.js", - run_cmd: "/usr/local/node-7.10.1/bin/node main.js" - }, - - - { - name: "OCaml (4.05.0)", - source_file: "main.ml", - compile_cmd: "/usr/local/ocaml-4.05.0/bin/ocamlc main.ml", - run_cmd: "./a.out" - }, - - - { - name: "Octave (4.2.0)", - source_file: "file.m", - run_cmd: "/usr/local/octave-4.2.0/bin/octave-cli -q --no-gui file.m" - }, - - - { - name: "Pascal (fpc 3.0.0)", - source_file: "main.pas", - compile_cmd: "/usr/local/fpc-3.0.0/bin/fpc -v0 main.pas", - run_cmd: "./main" - }, - - - { - name: "Python (3.6.0)", - source_file: "main.py", - run_cmd: "/usr/local/python-3.6.0/bin/python3 main.py" - }, - { - name: "Python (3.5.3)", - source_file: "main.py", - run_cmd: "/usr/local/python-3.5.3/bin/python3 main.py" - }, - { - name: "Python (2.7.9)", - source_file: "main.py", - run_cmd: "/usr/local/python-2.7.9/bin/python main.py" - }, - { - name: "Python (2.6.9)", - source_file: "main.py", - run_cmd: "/usr/local/python-2.6.9/bin/python main.py" - }, - - - { - name: "Ruby (2.4.0)", - source_file: "main.rb", - run_cmd: "/usr/local/ruby-2.4.0/bin/ruby main.rb" - }, - { - name: "Ruby (2.3.3)", - source_file: "main.rb", - run_cmd: "/usr/local/ruby-2.3.3/bin/ruby main.rb" - }, - { - name: "Ruby (2.2.6)", - source_file: "main.rb", - run_cmd: "/usr/local/ruby-2.2.6/bin/ruby main.rb" - }, - { - name: "Ruby (2.1.9)", - source_file: "main.rb", - run_cmd: "/usr/local/ruby-2.1.9/bin/ruby main.rb" - }, - - - { - name: "Rust (1.20.0)", - source_file: "main.rs", - compile_cmd: "/usr/local/rust-1.20.0/bin/rustc main.rs", - run_cmd: "./main" - }, - - - { - name: "Text (plain text)", - source_file: "source.txt", - run_cmd: "/bin/cat source.txt" - }, - - - { - name: "Executable", - source_file: "a.out", - compile_cmd: "/bin/chmod +x a.out", - run_cmd: "./a.out" - } ] diff --git a/docs/api/docs.md b/docs/api/docs.md index ffe529b3..e0b52db3 100644 --- a/docs/api/docs.md +++ b/docs/api/docs.md @@ -12,7 +12,7 @@ Source code is available on [GitHub](https://github.com/judge0/api). Dummy client is available [here](/dummy-client.html) and can be used to try and test features of Judge0 API. # Version -This document describes Judge0 API version [`v1.2.0`](https://github.com/judge0/api/tree/v1.2.0). +This document describes Judge0 API version [`v1.2.0-nim0.20.0`](https://github.com/judge0/api/tree/v1.2.0-nim0.20.0). # Date and time formats [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard is used. diff --git a/docs/api/statuses_and_languages/list_all_languages.md b/docs/api/statuses_and_languages/list_all_languages.md index 37f14a91..5ce383bf 100644 --- a/docs/api/statuses_and_languages/list_all_languages.md +++ b/docs/api/statuses_and_languages/list_all_languages.md @@ -4,178 +4,6 @@ [ { "id": 1, - "name": "Bash (4.4)" + "name": "Nim (0.20.0)" }, - { - "id": 2, - "name": "Bash (4.0)" - }, - { - "id": 3, - "name": "Basic (fbc 1.05.0)" - }, - { - "id": 4, - "name": "C (gcc 7.2.0)" - }, - { - "id": 5, - "name": "C (gcc 6.4.0)" - }, - { - "id": 6, - "name": "C (gcc 6.3.0)" - }, - { - "id": 7, - "name": "C (gcc 5.4.0)" - }, - { - "id": 8, - "name": "C (gcc 4.9.4)" - }, - { - "id": 9, - "name": "C (gcc 4.8.5)" - }, - { - "id": 10, - "name": "C++ (g++ 7.2.0)" - }, - { - "id": 11, - "name": "C++ (g++ 6.4.0)" - }, - { - "id": 12, - "name": "C++ (g++ 6.3.0)" - }, - { - "id": 13, - "name": "C++ (g++ 5.4.0)" - }, - { - "id": 14, - "name": "C++ (g++ 4.9.4)" - }, - { - "id": 15, - "name": "C++ (g++ 4.8.5)" - }, - { - "id": 16, - "name": "C# (mono 5.4.0.167)" - }, - { - "id": 17, - "name": "C# (mono 5.2.0.224)" - }, - { - "id": 18, - "name": "Clojure (1.8.0)" - }, - { - "id": 19, - "name": "Crystal (0.23.1)" - }, - { - "id": 20, - "name": "Elixir (1.5.1)" - }, - { - "id": 21, - "name": "Erlang (OTP 20.0)" - }, - { - "id": 22, - "name": "Go (1.9)" - }, - { - "id": 23, - "name": "Haskell (ghc 8.2.1)" - }, - { - "id": 24, - "name": "Haskell (ghc 8.0.2)" - }, - { - "id": 25, - "name": "Insect (5.0.0)" - }, - { - "id": 26, - "name": "Java (OpenJDK 9 with Eclipse OpenJ9)" - }, - { - "id": 27, - "name": "Java (OpenJDK 8)" - }, - { - "id": 28, - "name": "Java (OpenJDK 7)" - }, - { - "id": 29, - "name": "JavaScript (nodejs 8.5.0)" - }, - { - "id": 30, - "name": "JavaScript (nodejs 7.10.1)" - }, - { - "id": 31, - "name": "OCaml (4.05.0)" - }, - { - "id": 32, - "name": "Octave (4.2.0)" - }, - { - "id": 33, - "name": "Pascal (fpc 3.0.0)" - }, - { - "id": 34, - "name": "Python (3.6.0)" - }, - { - "id": 35, - "name": "Python (3.5.3)" - }, - { - "id": 36, - "name": "Python (2.7.9)" - }, - { - "id": 37, - "name": "Python (2.6.9)" - }, - { - "id": 38, - "name": "Ruby (2.4.0)" - }, - { - "id": 39, - "name": "Ruby (2.3.3)" - }, - { - "id": 40, - "name": "Ruby (2.2.6)" - }, - { - "id": 41, - "name": "Ruby (2.1.9)" - }, - { - "id": 42, - "name": "Rust (1.20.0)" - }, - { - "id": 43, - "name": "Text (plain text)" - }, - { - "id": 44, - "name": "Executable" - } ] diff --git a/public/docs.html b/public/docs.html index 608774dc..61a47f2e 100644 --- a/public/docs.html +++ b/public/docs.html @@ -26,7 +26,7 @@

About .

Dummy client is available here and can be used to try and test features of Judge0 API.

Version

-

This document describes Judge0 API version v1.2.0.

+

This document describes Judge0 API version v1.2.0-nim0.20.0.

Date and time formats

ISO 8601 standard is used.

Example: 2016-09-11T10:19:35Z

@@ -507,182 +507,10 @@

Example URI

GET& }
Response  401
HideShow

Authentication failed. Please read about authentication process.

Response  403
HideShow

Authorization failed. Please read about authorization process.

Statuses and Languages

Languages

List All Languages
GET/languages

Example URI

GET https://api.judge0.com/languages
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
-  {
-    "id": 1,
-    "name": "Bash (4.4)"
-  },
-  {
-    "id": 2,
-    "name": "Bash (4.0)"
-  },
-  {
-    "id": 3,
-    "name": "Basic (fbc 1.05.0)"
-  },
-  {
-    "id": 4,
-    "name": "C (gcc 7.2.0)"
-  },
-  {
-    "id": 5,
-    "name": "C (gcc 6.4.0)"
-  },
-  {
-    "id": 6,
-    "name": "C (gcc 6.3.0)"
-  },
-  {
-    "id": 7,
-    "name": "C (gcc 5.4.0)"
-  },
-  {
-    "id": 8,
-    "name": "C (gcc 4.9.4)"
-  },
-  {
-    "id": 9,
-    "name": "C (gcc 4.8.5)"
-  },
-  {
-    "id": 10,
-    "name": "C++ (g++ 7.2.0)"
-  },
-  {
-    "id": 11,
-    "name": "C++ (g++ 6.4.0)"
-  },
-  {
-    "id": 12,
-    "name": "C++ (g++ 6.3.0)"
-  },
-  {
-    "id": 13,
-    "name": "C++ (g++ 5.4.0)"
-  },
-  {
-    "id": 14,
-    "name": "C++ (g++ 4.9.4)"
-  },
-  {
-    "id": 15,
-    "name": "C++ (g++ 4.8.5)"
-  },
-  {
-    "id": 16,
-    "name": "C# (mono 5.4.0.167)"
-  },
-  {
-    "id": 17,
-    "name": "C# (mono 5.2.0.224)"
-  },
-  {
-    "id": 18,
-    "name": "Clojure (1.8.0)"
-  },
-  {
-    "id": 19,
-    "name": "Crystal (0.23.1)"
-  },
-  {
-    "id": 20,
-    "name": "Elixir (1.5.1)"
-  },
-  {
-    "id": 21,
-    "name": "Erlang (OTP 20.0)"
-  },
-  {
-    "id": 22,
-    "name": "Go (1.9)"
-  },
-  {
-    "id": 23,
-    "name": "Haskell (ghc 8.2.1)"
-  },
-  {
-    "id": 24,
-    "name": "Haskell (ghc 8.0.2)"
-  },
-  {
-    "id": 25,
-    "name": "Insect (5.0.0)"
-  },
-  {
-    "id": 26,
-    "name": "Java (OpenJDK 9 with Eclipse OpenJ9)"
-  },
-  {
-    "id": 27,
-    "name": "Java (OpenJDK 8)"
-  },
-  {
-    "id": 28,
-    "name": "Java (OpenJDK 7)"
-  },
-  {
-    "id": 29,
-    "name": "JavaScript (nodejs 8.5.0)"
-  },
-  {
-    "id": 30,
-    "name": "JavaScript (nodejs 7.10.1)"
-  },
-  {
-    "id": 31,
-    "name": "OCaml (4.05.0)"
-  },
-  {
-    "id": 32,
-    "name": "Octave (4.2.0)"
-  },
-  {
-    "id": 33,
-    "name": "Pascal (fpc 3.0.0)"
-  },
-  {
-    "id": 34,
-    "name": "Python (3.6.0)"
-  },
-  {
-    "id": 35,
-    "name": "Python (3.5.3)"
-  },
-  {
-    "id": 36,
-    "name": "Python (2.7.9)"
-  },
-  {
-    "id": 37,
-    "name": "Python (2.6.9)"
-  },
-  {
-    "id": 38,
-    "name": "Ruby (2.4.0)"
-  },
-  {
-    "id": 39,
-    "name": "Ruby (2.3.3)"
-  },
-  {
-    "id": 40,
-    "name": "Ruby (2.2.6)"
-  },
-  {
-    "id": 41,
-    "name": "Ruby (2.1.9)"
-  },
-  {
-    "id": 42,
-    "name": "Rust (1.20.0)"
-  },
-  {
-    "id": 43,
-    "name": "Text (plain text)"
-  },
-  {
-    "id": 44,
-    "name": "Executable"
-  }
+    {
+        "id": 1,
+        "name": "Nim (0.20.0)"
+    },
 ]

Statuses

List All Statuses
GET/statuses

Example URI

GET https://api.judge0.com/statuses
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
   {
     "id": 1,
@@ -1058,7 +886,7 @@ 

Example URI

GET& "paused": 0, "failed": 0 } -]

Generated by aglio on 17 Jun 2019