zakariamaaraki / RemoteCodeCompiler

An online code compiler supporting 11 programming languages (Java, Kotlin, Scala, C, C++, C#, Golang, Python, Ruby, Rust and Haskell) for competitive programming and coding interviews.
GNU General Public License v3.0
151 stars 50 forks source link

Current version of the project does not work #47

Closed NazarovSh closed 8 months ago

NazarovSh commented 1 year ago

I followed the instructions step by step but this error occurred,

"error": "Unable to find image 'compiler.java:latest' locally\ndocker: Error response from daemon: pull access denied for compiler.java, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.\nSee 'docker run --help'.\n",

Screenshot 2023-09-04 at 11 38 03 Screenshot 2023-09-04 at 18 08 19 Screenshot 2023-09-04 at 18 09 25

also while using this (/api/compile/json) api endpoint why I should provide list of "convertedTestCases" in json ?

{
  "convertedTestCases": [ ⬅️ is it allowed to be here ❓
    {
      "expectedOutput": "string",
      "testCaseId": "string"
    }
  ],
  "language": "PYTHON",
  "memoryLimit": 0,
  "sourcecode": "string",
  "testCases": {
    "additionalProp1": {
      "expectedOutput": "string",
      "input": "string"
    },
    "additionalProp2": {
      "expectedOutput": "string",
      "input": "string"
    },
    "additionalProp3": {
      "expectedOutput": "string",
      "input": "string"
    }
  },
  "timeLimit": 0
}
zakariamaaraki commented 1 year ago

From the exception, i see that you don't have enough rights to pull the docker image. Make sure you have enough rights to use docker before launching the service.

For your second question, convertedTestCases is not part of the contract, it's something used internally by the service. Please follow the documentation in the readme.md file on how to make calls to the service.

droidback commented 11 months ago

THANKS! it worked, but still get some errors like this java.security.policy: error parsing file:/app/security.policy: line 2: expected codeBase or SignedBy or Principal while using multipart

Screenshot 2023-09-30 at 15 29 50

source code


public class For20 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        for (int i = 1; i <= n; i++) {
            System.out.print(i+" ");
        }

    }
}

inputs 3 5

expected outputs 1 2 3 1 2 3 4 5

zakariamaaraki commented 8 months ago

Hi, I fixed that issue, a quote was missing in the security.policy file