https://github.com/akshitgrover/box-exec
Box execute is a npm package to compile/run codes (c,cpp,python) in a virtualized environment, Here virtualized environment used is a docker container. This packages is built to ease the task of running a code against test cases as done by websites used to practice algorithmic coding.
https://github.com/akshitgrover/box-exec
docker docker-container executor sandbox stage
Last synced: 11 months ago
JSON representation
Box execute is a npm package to compile/run codes (c,cpp,python) in a virtualized environment, Here virtualized environment used is a docker container. This packages is built to ease the task of running a code against test cases as done by websites used to practice algorithmic coding.
- Host: GitHub
- URL: https://github.com/akshitgrover/box-exec
- Owner: akshitgrover
- License: apache-2.0
- Created: 2018-04-29T18:07:51.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-30T23:14:38.000Z (over 4 years ago)
- Last Synced: 2025-02-28T21:32:31.941Z (11 months ago)
- Topics: docker, docker-container, executor, sandbox, stage
- Language: JavaScript
- Homepage:
- Size: 101 KB
- Stars: 18
- Watchers: 4
- Forks: 6
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Box Execute
[](https://travis-ci.org/akshitgrover/box-exec) [](https://npmjs.org/package/box-exec)  [](https://npmjs.org/package/box-exec) [](https://github.com/akshitgrover/box-exec/tree/master/examples)
## What Is Box-Execute?
Box execute is an npm package to compile/run codes (c,cpp,python) in a virtualized environment, Here virtualized environment used is a docker container. This packages is built to ease the task of running a code against test cases as done by websites used to practice algorithmic coding.
## Using Box-Execute
* `npm i box-exec`
* [`Look For Examples`](https://github.com/akshitgrover/box-exec/tree/master/examples)
## Box-Execute Structure
Language supported by Box-Execute are:
* c
* cpp
* python 2
* python 3
**NOTE:** Language support is to be extended.
For each language supported a docker container is present in which all the codes are executed to get the output.
## Under the hood
Box-Execute utilises staging architecture in order to run a code an get the output.
* **Stage One:**
>Container for a particular language is checked for it's status and in case of container "absence" or "not
running status" container is started or restarted based on the container status.
**NOTE:** This stage is executed in all conditions.
* **Stage Two**
>Source code file is copied in the running container.
**NOTE:** This stage is executed in all conditions.
* **Stage Three**
>This stage is only executed in case when source code file is "C" or "CPP" file. Used for compiling C/CPP code.
**NOTE:** This stage is executed only when source code file is in C/CPP
* **Stage Four**
>This is the final stage where code is executed to get the output. Streams are used to write data to STDIN.
**NOTE:** This stage is executed in all conditions.
## Future Work
* Update Error Return On Command Failure
* Extend Language Support
* Add CLI tool
* Explore For Erroneous Conditions