Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Code Execution on Worker Server #13

Open
MadhavKrishanGoswami opened this issue Oct 5, 2024 · 4 comments
Open

Implement Code Execution on Worker Server #13

MadhavKrishanGoswami opened this issue Oct 5, 2024 · 4 comments

Comments

@MadhavKrishanGoswami
Copy link
Owner

Currently, the main server sends code to the worker server for execution. However, the worker server is returning a dummy output:

{ "output": "Dummy Output from worker" }

We need to modify the worker server so that it can actually execute Python code and return the real output.

Problem or Use Case:
The current setup is a placeholder that doesn't execute any code. This feature is required to handle real Python code execution. It will enable the worker server to process actual code submitted by users and return the correct results or error messages from the Python interpreter.

Proposed Solution:

  • Modify the worker server to execute Python code securely.
  • Ensure the worker can handle standard input, output, and errors for Python code.
  • Capture and return both successful output and error messages as part of the response to the main server.
  • Handle execution limits, like timeouts and memory usage, to avoid long-running or resource-heavy tasks.

Alternatives Considered:

  • Initially focus on Python execution, with future plans to support other languages.
  • Another option could be integrating a third-party service for Python execution, but building it natively gives more control over the execution environment.

Additional Context:
This feature will greatly enhance the worker server’s functionality by allowing real-time Python code execution, moving us toward a functional coding platform.

@ifeelsam
Copy link
Contributor

ifeelsam commented Oct 5, 2024

i think i get it, can i try?
will ask if further info needed

@MadhavKrishanGoswami
Copy link
Owner Author

Absolutely, go ahead! Feel free to try it out, and don't hesitate to reach out if you need more details or run into any issues. Good luck! 😊

@ifeelsam
Copy link
Contributor

ifeelsam commented Oct 6, 2024

added a pr #19
lmk if something's wrong

@MadhavKrishanGoswami
Copy link
Owner Author

Hey @ifeelsam! Thank you for raising the PR. I'll review it and get back to you as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants