Comments (22)
@PansulBhatt You were looking at the client Javascript calls to the Django server. The requests from the server to the hackerearth API compile/run endpoints is what the issue is referring to.
from hackide.
Never mind. It seems as tho my virtual env skip a couple of key packages from the requirements for some reason.
Now I just getting a Bad Request. But I'll figure it out. Ty!
from hackide.
Since sources are compiled file by file now, I don't think there is a need to use HackerEarth asynchronously. In my opinion, the current method (using sync ajax calls without callback url) is enough to handle the usage.
from hackide.
@jinankjain I agree that making requests async will help in achieving better concurrency for the hackIDE.
Though I am yet to find a way to generate submission ID every time a request is made so as to keep track of responses from HackerEarth API. Please feel free to contribute if you find a way.
from hackide.
@sahildua2305 Every time when you do async function call to hackerearth api you will receive an code_id use that as submission ID and store that in DB to keep track of submission id.
from hackide.
@sahildua2305 Couldn't we use some kind of asynchronous task processing library out there (celery, rq) and use their task ids as the unique submission id. Celery's result backend will store this task id along with information about its run state. We could then poll and query if a running task is successful or not still pending.
from hackide.
@arijeetmkh Yes, that can be done. I have never worked with Celery. I will have to look into it. Would you like to give it a shot?
from hackide.
@sahildua2305 what are the benefits of an async request to the hackerearth api? I'm assuming the only api calls are to the /compile and /run endpoints only. Is it the fact that multiple sync calls will cause noticeable blocking when the usage is high? I wouldn't mind taking this up btw.
from hackide.
Hey @the-realtom, having async requests to the API will make the application more reliable as that will also reduce the load on HackerEarth's API. I talked to HackerEarth engineers and they suggested me to have async requests.
Would love to see your PR 👍
from hackide.
@sahildua2305 Your calls already look like they are asynchronous. Is there something that I am missing here. I was trying to contribute but while reviewing found that the call to compile (custom.js line:235) I found that this was already async.
from hackide.
Exactly, @the-realtom 👍
from hackide.
It says i need the client token for the ide to show up, when running in local. How can i get that?
from hackide.
@MasteMind You can get it here.
from hackide.
Hello! I'm looking to contibute, I think I can tackle this. @the-realtom are already on it? If so do you need any help? I'm here from Up For Grabs.
Also I have to say this would technically be my first PR to a Open Source project so if you don't want a first timer with the whole PR thing I understand. I have worked with django for 3 years now if that's worth anything 😛.
from hackide.
@vinibiso absolutely welcome here! Thanks for showing interest in tackling this issue. Please feel free to open a PR once you have something.
from hackide.
Hey @sahildua2305 sorry to bother but, while trying to run collect static, or straight up runserver it gives me the following:
No module named whitenoise.django
That's after creating my virtualenv and installing all the requirements.
I also checked just to see and it seems to be installed. Have you run into this issue before?
collecting whitenoise==2.0.6
Using cached whitenoise-2.0.6-py2.py3-none-any.whl
Installing collected packages: whitenoise
Successfully installed whitenoise-2.0.6
from hackide.
@vinibiso hi!
No, I have not faced this issue. Did you check about it online?
from hackide.
Just to leave a little bit of a progress report here.
I manager to figure out how to make the request assync.
However, like mentioned before, we will need celery and a broker, in my case I'm using Redis.
I have it all setup and configured now I just have to implement the two request functions as tasks and I believe it will be done.
from hackide.
@sahildua2305 I think it's done. It's gonna be a little tricky to test however because of the new requirements and as well as the fact that it only get's client secret when debug is not on.
While doing it and taking a look at the API, do we really need django to do this? Couldn't we just use JS to request? Is it because of client_secret?
from hackide.
@vinibiso You're right. Plus I am not 100% convinced that I want this feature to be there as the API has been pretty much stable for some time now.
from hackide.
Hey @sahil865gupta I think it's done, if you wanna take a look.
Right. It makes sense. Honestly looking at how celery works, I don't know if it's actually worth the whole redis, celery setup on the server if not much will change.
I made the changes more as a personal challenge because I had never worked with Celery before.
A good idea would be to try and make some tests and compare before and after the changes maybe by putting a bunch of code so that the API hangs a little bit more and try and run a bunch of another instances. In my case, when I put it to run and opened another instance it was instance no hanging.
from hackide.
@vinibiso it's been 3 years and I am convinced that we should switch to async version of HackerEarth API. Are you still up for taking this on?
from hackide.
Related Issues (20)
- Link generated for viewing old code doesn't contain port number HOT 1
- Implement profiling system allowing users to make their profiles and saving codes in their profiles HOT 3
- Add unit tests HOT 14
- ImportError: No module named 'mongoengine' HOT 5
- PHP phpinfo log viewable HOT 1
- Java files don't match with public class HOT 4
- Create a download dialog box for naming file download. HOT 3
- Improve compilation error message
- Port to django 1.11 HOT 4
- Could not create compile log file for stdout HOT 2
- Not working at all HOT 2
- couldn't run the server HOT 1
- issue with python version HOT 3
- Issue with requirements HOT 3
- Bug PHP Code Injection HOT 1
- Should not it be upgraded to the django latest version HOT 7
- Python3 support
- Newer compilers and interpreters
- Addition of docker HOT 5
- Feature to save code written in a language while switching to another language HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hackide.