Skip to content

Srajan-Bansal/OpenExecutor

Repository files navigation

OpenExecutor

A sandboxed code execution engine for HackStack — built with Spring Boot.

What it does

  1. Consumes code execution requests from Kafka (code-executor topic)
  2. Loads test cases from Redis (populated from hackstack-problems at startup)
  3. Compiles and runs code in isolated sandboxes using isolate
  4. Measures runtime and memory per test case
  5. Publishes results to Kafka (code-results topic)

Tech Stack

  • Java 17
  • Spring Boot 3.5
  • Apache Kafka (consumer + producer)
  • Redis (test case caching)
  • isolate (sandbox execution)
  • Maven

Getting Started

Prerequisites

  • Java 17+
  • Redis running on localhost:6379
  • Kafka running on localhost:9092
  • isolate installed (for sandboxed execution)
  • hackstack-problems cloned as a sibling directory

Run

# Build
./mvnw clean package

# Run
./mvnw spring-boot:run

# Run tests
./mvnw test

The service starts on port 8081.

Configuration

All configuration is in src/main/resources/application.properties:

Property Default Description
server.port 8081 Server port
spring.data.redis.host localhost Redis host
spring.data.redis.port 6379 Redis port
spring.kafka.bootstrap-servers localhost:9092 Kafka broker
basePath ../hackstack-problems Path to problems directory

Supported Languages

  • Java
  • JavaScript

Related Repositories

About

Spring Boot code execution engine for HackStack competitive programming platform. Secure sandbox environment for running and evaluating submitted code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors