Backend Changes and Readme update
This commit is contained in:
22
Readme.md
Normal file
22
Readme.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Monaco Code Execution Engine
|
||||
Monaco is a secure, containerized code execution engine that allows you to run code in multiple programming languages through a simple REST API.
|
||||
|
||||
## Features
|
||||
- Multi-language support: Run code in Python, Java, C, and C++
|
||||
- Secure execution: All code runs in isolated Docker containers
|
||||
- Resource limits: Memory, CPU, and file descriptor limits to prevent abuse
|
||||
- Concurrent processing: Efficient job queue for handling multiple requests
|
||||
- Simple REST API: Easy to integrate with any frontend
|
||||
|
||||
## Architecture
|
||||
Monaco consists of several components:
|
||||
|
||||
- HTTP Handlers (handler/handler.go): Processes API requests
|
||||
- Execution Service (service/execution.go): Manages code execution in containers
|
||||
- Job Queue (queue/queue.go): Handles concurrent execution of code submissions
|
||||
- Submission Model (model/submission.go): Defines the data structure for code submissions
|
||||
|
||||
## Requirements
|
||||
- Go 1.22.3 or higher
|
||||
- Docker
|
||||
- Network connectivity for container image pulling
|
||||
@@ -232,7 +232,7 @@ func (s *ExecutionService) executeC(submission *model.CodeSubmission) {
|
||||
"gcc:latest", "bash", "-c", "cd /code && gcc -o main main.c && ./main")
|
||||
|
||||
log.Printf("[C-%s] Executing C code with timeout: 10s", submission.ID)
|
||||
output, err := s.executeWithTimeout(cmd, 1000*time.Second, submission.ID)
|
||||
output, err := s.executeWithTimeout(cmd, 10*time.Second, submission.ID)
|
||||
|
||||
elapsed := time.Since(startTime)
|
||||
log.Printf("[C-%s] C execution completed in %v", submission.ID, elapsed)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user