https://github.com/joshjms/pocket-watch
API for running unreliable code in a sandboxed environment.
https://github.com/joshjms/pocket-watch
isolate isolation judge sandbox
Last synced: 12 months ago
JSON representation
API for running unreliable code in a sandboxed environment.
- Host: GitHub
- URL: https://github.com/joshjms/pocket-watch
- Owner: joshjms
- Created: 2024-01-16T02:49:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-30T04:05:26.000Z (about 2 years ago)
- Last Synced: 2025-05-05T06:12:33.399Z (12 months ago)
- Topics: isolate, isolation, judge, sandbox
- Language: Go
- Homepage:
- Size: 8.48 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pocket Watch
REST + gRPC API for running unreliable code in a sandboxed environment. Everyone can make their very own Leetcode without compromising server security and health.
> The service is still under development. Please ⭐ this project to motivate the coding monkeys ❤️!
## Usage
### Initialization
#### Docker
```bash
docker run -p 8080:8080 \
--privileged --cap-add SYS_ADMIN --security-opt seccomp=unconfined --cgroup-parent=docker.slice --cgroupns private --tmpfs /tmp --tmpfs /run --tmpfs /run/lock \
pocketwatch:latest
```
### Running Source Code (C++ Example)
> Currently, only C/C++ source codes are supported. Add support for other languages in the future.
POST `/run`
#### Request
```go
{
Code string `json:"code"`
Language string `json:"language"` // just use "cpp"; other languages not yet supported
Stdin []string `json:"stdin"`
}
```
#### Response
```go
{
Verdict []string `json:"verdict"` // OK, RE, TLE, CE
Stdout []string `json:"stdout"`
Stderr []string `json:"stderr"`
Time []string `json:"time"`
Memory []string `json:"memory"`
}
```
## Contributing
TBD - For more information, contact me in Discord `joshjms`.
## References
- [pocket-api](https://github.com/sanstzu/pocket-api)
## People
* [Josh](https://github.com/joshjms)
* [Clay](https://github.com/sanstzu)