Closed rpatidar closed 6 months ago
found i was hitting wrong endpoint
curl 'http://localhost:8080/api/compile/json' -X POST -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json; charset=UTF-8' -H 'Referer: http://localhost:8080/problem/1' -H 'Origin: http://localhost:8080' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Connection: keep-alive' -H 'Cookie: csrftoken=jpFoTKvcdkdlEqAXIFWy01Ni4FGYqSHIPU6EdOrMSQciYoWLq6Sq8anKGErSpnzZ; _ga_Z4KXEBY4VP=GS1.1.1693626148.2.1.1693626222.60.0.0; _ga=GA1.1.536432755.1693448373; fusra_session_id=4d440183-4faf-4e39-8cf4-28fa7c03cf49; intercom-device-id-y10e7138=080b5c46-95b6-4c59-8f5c-33360dc6c0b4; ajs_anonymous_id=74ae1ae5-6ed5-4821-b0a1-f679e5164f69; ajs_user_id=7c5ec2f70f412cb5d62a0ee073ab891d1d296543fc3afa46ba2865ec0a39d42c' --data-raw '{"sourcecode":"// Java code here\npublic class main {\n public static void main(String[] args) {\n System.out.println(\"NO\");\n }\n}","language":"JAVA", "testCases": {"test1" : {"input" : "", "expectedOutput" : "YES"}}}'
but this gives me
{"error":null,"execution":{"verdict":"Out Of Memory","statusCode":400,"error":"./entrypoint-test1.sh: line 4: 8 Segmentation fault timeout -s SIGTERM 0 java -Djava.security.manager -Djava.security.policy=./security.policy main\n","testCasesResult":{"test1":{"verdict":"Out Of Memory","verdictStatusCode":400,"output":"","error":"./entrypoint-test1.sh: line 4: 8 Segmentation fault timeout -s SIGTERM 0 java -Djava.security.manager -Djava.security.policy=./security.policy main\n","expectedOutput":"YES","executionDuration":6,"outputDiff":"<add>YES</add>"}},"compilationDuration":289,"averageExecutionDuration":6.0,"timeLimit":0,"memoryLimit":0,"language":"JAVA","dateTime":"2024-04-26T11:57:59.646843"}}%
all issue resolved. awesome product.
curl 'http://localhost:8080/api/compile/json' -X POST -H 'Content-Type: application/json; charset=UTF-8' --data-raw '{"sourcecode":"// Java code here\npublic class main {\n public static void main(String[] args) {\n System.out.println(\"NO\");\n }\n}","language":"JAVA", "testCases": {"test1" : {"input" : "", "expectedOutput" : "NO"}}, "memoryLimit" : 500 }'
{"error":null,"execution":{"verdict":"Accepted","statusCode":100,"error":"","testCasesResult":{"test1":{"verdict":"Accepted","verdictStatusCode":100,"output":"NO\n","error":"","expectedOutput":"NO","executionDuration":1780,"outputDiff":null}},"compilationDuration":284,"averageExecutionDuration":1780.0,"timeLimit":0,"memoryLimit":500,"language":"JAVA","dateTime":"2024-04-26T12:08:38.771927"}}%
Thanks for the feedback. Yes, about your first comment: you were hitting the wrong endpoint. For the second one: you were setting memory limit and time limit to 0.
Can i close the issue?
I am trying to execute the dynamic code via the API but it looks like when i make the call it still try to look into the predefined problem repository. am i missing something or this is by design ?
Error: