Code execution coordination microservice for the CS124 platform.
npm install @cs124/maceCode execution coordination microservice for the CS124 platform.
This service provides:
- Secure code execution for Java and Kotlin
- Sandboxed execution environment
- Code compilation and testing
- Integration with submission systems
- Performance monitoring and limits
- Node.js 22.18.0
- Docker (for dependencies and sandboxing)
- Java and Kotlin runtimes
``bashInstall dependencies
rush update
The service will be available at http://localhost:8085
$3
`bash
Development
rushx start # Start development server
rushx build # Build for production
rushx check # Run all quality checks
rushx test # Run testsCode Quality
rushx prettier # Format code
rushx eslint # Lint TypeScript/JavaScript
rushx tsc # Type check
rushx depcheck # Check for unused dependencies
`Project Structure
-
/server - Main server implementation
- /client - Client-side types and utilities
- /container - Docker container configuration
- /bundled - Built server bundle (generated)Technology Stack
- Runtime: Node.js 22.18.0
- Framework: Koa.js
- Language: TypeScript
- Execution: Docker-based sandboxing
- Languages: Java, Kotlin
- Build: esbuild
- Container: Docker with Alpine Linux
Features
- Secure Execution: Sandboxed code execution environment
- Multi-Language: Support for Java and Kotlin
- Performance Limits: CPU and memory constraints
- Compilation: Automatic compilation and error reporting
- Testing: Automated test execution
- Security: Isolated execution prevents system access
Security
- Sandboxing: All code runs in isolated Docker containers
- Resource Limits: CPU and memory restrictions
- Network Isolation: No external network access
- File System: Read-only file system with limited write access
- Time Limits: Execution timeout protection
Execution Flow
1. Receive code submission
2. Validate and sanitize input
3. Create isolated execution environment
4. Compile code (if necessary)
5. Execute with resource limits
6. Return results or errors
7. Clean up execution environment
Docker Deployment
The service is containerized using Docker with Node.js 22.18.0 Alpine.
Contributing
1. Always run
rushx check` before committing