judge0 / ide

✨ Simple, free and open-source online code editor.
https://ide.judge0.com
MIT License
818 stars 257 forks source link

Long Input not working #28

Closed GalaxyZpj closed 4 years ago

GalaxyZpj commented 5 years ago

I recently tried a code with a very long stdin It outputs error, Any solution? Here's the code

# Enter your code here. Read input from STDIN. Print output to STDOUT
a, b = (int(x) for x in input().split())
happy = 0
l = [int(x) for x in input().split()]
A = set(int(x) for x in input().split())
B = set(int(x) for x in input().split())
for x in l:
    if x in A: happy += 1
    elif x in B: happy -= 1
print(happy)

This link contains the input testcase: https://hr-testcases-us-east-1.s3.amazonaws.com/8382/input03.txt?AWSAccessKeyId=AKIAJ4WZFDFQTZRGO3QA&Expires=1562489870&Signature=9WAGMM9%2Ftargc%2FgXD7YemRS%2BQGc%3D&response-content-type=text%2Fplain

GalaxyZpj commented 5 years ago

Sometimes for long testcases, it gives broken pipe error And sometimes it returns None Screenshot 2019-07-07 at 2 16 35 PM

hermanzdosilovic commented 5 years ago

I cannot open link for test case you gave me.

GalaxyZpj commented 5 years ago

Code.docx Testcase.docx

GalaxyZpj commented 5 years ago

Code.docx Testcase.docx

This when run on the Judge0 IDE or API, returns None. But when tried it with my own deployed instance, works perfectly fine.

hermanzdosilovic commented 4 years ago

I have Nginx in front of Judge0 API instance. Nginx has 1MB by default for client_max_body_size. I can increase it to 10MB. Would that be enough for you?

GalaxyZpj commented 4 years ago

Not required now. I am working on deployment of my own instance of Judge0 API. Now I wanna know how to add more workers. Seeing the api working, I figured out that one worker can only work at one submission at a particular time. Correct me if i'm wrong. I'm submitting multiple testcases at once by using threads, but this makes no difference until i have more workers. Pretty new to docker as well. A bit help on adding workers would be appreciated.

hermanzdosilovic commented 4 years ago

Take a look at this discussion: https://github.com/judge0/api/issues/72

GalaxyZpj commented 4 years ago

What about if i wanna host the api n all the workers on a single system?

hermanzdosilovic commented 4 years ago

Take a look at COUNT variable in judge0-api.conf file. 🙂

On Sat, 13 Jul 2019, 21:34 Pranav Jain, notifications@github.com wrote:

What about if i wanna host the api n all the workers on a single system?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/judge0/ide/issues/28?email_source=notifications&email_token=AB4PL3W2GLTT7SFTY5SXDTDP7IU3DA5CNFSM4H6VBHB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ3YBAQ#issuecomment-511148162, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4PL3W5AJ34YMU7WZMWKH3P7IU3DANCNFSM4H6VBHBQ .

GalaxyZpj commented 4 years ago

Take a look at COUNT variable in judge0-api.conf file. 🙂 On Sat, 13 Jul 2019, 21:34 Pranav Jain, @.***> wrote: What about if i wanna host the api n all the workers on a single system? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#28?email_source=notifications&email_token=AB4PL3W2GLTT7SFTY5SXDTDP7IU3DA5CNFSM4H6VBHB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ3YBAQ#issuecomment-511148162>, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4PL3W5AJ34YMU7WZMWKH3P7IU3DANCNFSM4H6VBHBQ .

Thats alright, but for that we need to have a copy of the worker container, i tried to do that but it just makes a copy of the api container, not the worker container. Any suggestion regarding this?

GalaxyZpj commented 4 years ago

Take a look at this discussion: judge0/api#72

Ok, Now I am able to add 2 workers, one by default when using the config and compose in the 1.2.0 release, and another one using the worker zip provided in this post. I wanted to add more workers. So i used the same compose file in the zip to add another worker, but it just recreates the worker which was added by using same compose file earlier. Is there a way to rename the worker container? I have already tried to add container_name: "newName" in the compose file, it just recreates the worker just as earlier but with the "newName".

GalaxyZpj commented 4 years ago

Was successful in adding 5 workers. It wasn't a proper way, but it worked. ThankYou.

hermanzdosilovic commented 4 years ago

New release of Judge0 API v1.2.1 contains a bug fix for this issue. Please take a look at it.

On Sun, 14 Jul 2019, 16:36 Pranav Jain, notifications@github.com wrote:

Closed #28 https://github.com/judge0/ide/issues/28.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/judge0/ide/issues/28?email_source=notifications&email_token=AB4PL3Q63XFBSBI5ZTVKNF3P7M2YFA5CNFSM4H6VBHB2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSPS64CY#event-2481319435, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4PL3RGAINRPK5QGJCCTILP7M2YFANCNFSM4H6VBHBQ .