Skip to content

Feat/docker sandbox 2280 - #2285

Merged
KaranUnique merged 4 commits into
Canopus-Labs:feature-2from
Vachhani-Tapan:feat/docker-sandbox-2280
Aug 31, 2026
Merged

Feat/docker sandbox 2280#2285
KaranUnique merged 4 commits into
Canopus-Labs:feature-2from
Vachhani-Tapan:feat/docker-sandbox-2280

Conversation

@Vachhani-Tapan

Copy link
Copy Markdown
Contributor

📝 Pull Request Description

Related Issue

Closes #2280

Summary

This PR introduces a robust backend infrastructure for securely executing user-submitted code in isolated sandbox environments. By leveraging ephemeral Docker containers with strict resource bounds (no internet, 128MB memory limit, 5-second timeout killswitch), users can safely compile and run Python and JavaScript code natively on the platform during technical interview prep without risking host system compromise.


Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature
  • ♻️ Refactoring
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • 🔥 Other(please describe) ______

How Has This Been Tested?

  • Simulated execution of valid code snippets via the new POST /api/execute endpoint, verifying accurate stdout/stderr captures.
  • Tested an infinite while (true) loop snippet to guarantee the child_process.exec timeout safely kills the runaway container and returns an execution timeout error.
  • Verified temporary host files in /tmp/ are immediately unlinked post-execution, preventing disk bloat.

Screenshots (if applicable)

N/A - Backend infrastructure addition.


Checklist

  • My code follows the project's guidelines
  • I have tested my changes
  • I have updated documentation where necessary
  • I have linked the related issue
  • My changes do not introduce new warnings or errors

@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request, @Vachhani-Tapan! 🙌
We'll review it as soon as possible.
If there are any specific instructions or feedback regarding your PR, we'll provide them here.
Thanks again for your contribution to our project! 😊

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5cf2c52f-8f65-41d9-9d7a-35f356b8e3dc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.


return new Promise((resolve, reject) => {
// Strict 5-second timeout on the child process to prevent infinite loops
exec(dockerCmd, { timeout: 5000 }, async (error, stdout, stderr) => {
@github-actions github-actions Bot added the merge ready PR is mergeable and has no conflicts label Aug 30, 2026
@KaranUnique
KaranUnique changed the base branch from main to feature August 31, 2026 05:42
@KaranUnique
KaranUnique changed the base branch from feature to feature-2 August 31, 2026 05:43
@KaranUnique
KaranUnique merged commit cdd26f2 into Canopus-Labs:feature-2 Aug 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Docker-based Code Execution Sandbox

3 participants