Skip to content

exzgit/aether-edge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aether Edge Computing Framework

Aether Edge

Edge Computing Framework with WASM Runtime

Crates.io License Rust Support

Deploy WASM functions to the edge without managing infrastructure

Getting StartedDocumentationExamplesContributing


Overview

Aether enables developers to deploy WebAssembly functions to edge nodes without managing infrastructure. Edge nodes run functions in sandboxed WASI contexts while the Control Plane manages function registration, node coordination, and notifications.

Key Features

Low-Latency Execution

  • Edge-native WASM runtime
  • Sub-millisecond cold starts
  • Geographic distribution

Sandboxed Security

  • WASI isolation per function
  • Memory limits enforcement
  • Timeout protection

Smart Orchestration

  • Automatic node registration
  • Function caching & optimization
  • Health monitoring

Developer Friendly

  • Simple REST API
  • Base64 WASM upload
  • JSON-based invocation

Architecture

graph TB
    Client[Client Request] -->|POST /execute| Edge[Edge Runtime]
    Edge -->|Load WASM| Cache[Module Cache]
    Edge -->|Execute| WASM[WASM Sandbox]
    WASM -->|stdout| Result[Function Output]
    
    Edge -.->|Notify| Control[Control Plane]
    Control -->|Manage| Registry[Function Registry]
    Control -->|Coordinate| Nodes[Edge Nodes]
    
    style Edge fill:#4CAF50
    style Control fill:#2196F3
    style WASM fill:#FF9800
Loading

Request Flow

┌─────────┐     ┌──────────────┐     ┌─────────────┐
│ Client  │────▶│ Edge Runtime │────▶│ WASM Engine │
└─────────┘     └──────────────┘     └─────────────┘
                       │                     │
                       │                     ▼
                       │              ┌─────────────┐
                       │              │   Output    │
                       │              └─────────────┘
                       ▼
                ┌──────────────┐
                │Control Plane │
                │  (Metadata)  │
                └──────────────┘

Flow Description:

  1. Client Request → Edge Runtime (/execute)
  2. Edge Runtime (AppState) → Loads & executes WASM function with runtime limits
  3. Function Execution → WASM module runs sandboxed; output captured via stdout memory pipes
  4. Control Plane (AppControl) → Receives notifications, manages function registry, node metadata

Note: Control Plane manages metadata only — execution stays at the edge for optimal performance.


Core Components

Edge Runtime (AppState)

The edge execution engine that runs WASM functions with strict resource controls.

#[derive(Clone)]
pub struct AppState {
    func_dir: PathBuf,
    module_cache: Arc<Mutex<HashMap<String, Arc<Module>>>>,
    engine: Engine,
    exec_timeout: Duration,        // Default: 3s
    memory_limit_bytes: usize,     // Default: 16MB
}

Capabilities:

  • WASI context creation & sandboxing
  • Compiled module caching
  • Configurable memory & timeout limits
  • Health monitoring endpoints

Endpoints: /execute, /health


Control Plane (AppControl)

Central orchestration system for function and node management.

#[derive(Clone)]
pub struct AppControl {
    pub db: Arc<Db>,                    // Sled persistence
    pub func_dir: PathBuf,              // Function storage
    pub http_client: reqwest::Client,   // Node communication
}

Responsibilities:

  • Function metadata storage
  • Edge node registry
  • Event notification system
  • Persistent state management

Endpoints: /register, /api/functions, /callback


Quick Start

Prerequisites

  • Rust 1.70+ and Cargo
  • WASM target: rustup target add wasm32-wasi

Installation

# Clone the repository
git clone https://github.com/ezvalorazetho/aether-edge.git
cd aether-edge

# Build the project
cargo build --release

Running Services

Control Plane (Port 9090)

cargo run --bin aether-control

Manages function registry and node coordination.

Edge Node (Port 9091)

cargo run --bin aether-engine

Executes WASM functions at the edge.


Usage Examples

1. Upload a Function

curl -X POST http://127.0.0.1:9090/api/functions \
  -H "Content-Type: application/json" \
  -d '{
    "name": "hello_world",
    "wasm_b64": "<BASE64_ENCODED_WASM>"
  }'

Response:

{
  "status": "success",
  "function_id": "hello_world",
  "deployed_at": "2025-10-27T10:30:00Z"
}

2. Execute at the Edge

curl -X POST http://127.0.0.1:9091/execute \
  -H "Content-Type: application/json" \
  -d '{
    "function": "hello_world",
    "input": {
      "msg": "Hello from Aether!"
    }
  }'

Response:

{
  "output": "Hello from Aether!",
  "execution_time_ms": 1.23,
  "memory_used_kb": 145
}

3. List All Functions

curl http://127.0.0.1:9090/api/functions/manifest

Response:

{
  "functions": [
    {
      "name": "hello_world",
      "size_kb": 45,
      "uploaded_at": "2025-10-27T10:30:00Z"
    }
  ]
}

API Reference

Control Plane API (:9090)

Endpoint Method Description Request Body
/register POST Register edge node {"node_id": "edge-01", "url": "..."}
/api/functions POST Upload WASM function {"name": "...", "wasm_b64": "..."}
/api/functions/manifest GET List all functions -
/callback POST Receive node notifications {"event": "...", "data": {...}}

Edge Runtime API (:9091)

Endpoint Method Description Request Body
/execute POST Execute WASM function {"function": "...", "input": {...}}
/health GET Runtime health check -

Configuration

Edge Node Configuration

[runtime]
exec_timeout = "3s"          # Maximum execution time
memory_limit = "16MB"        # Max memory per module
cache_size = 100             # Number of cached modules

[server]
host = "0.0.0.0"
port = 9091

Control Plane Configuration

[database]
path = "./data/control.db"   # Sled DB location

[server]
host = "0.0.0.0"
port = 9090

[registry]
node_timeout = "30s"         # Node heartbeat timeout

Deployment

Docker Deployment

# Build control plane
docker build -t aether-control -f Dockerfile.control .

# Build edge runtime
docker build -t aether-edge -f Dockerfile.edge .

# Run with docker-compose
docker-compose up -d

Production Checklist

  • Configure firewall rules (9090, 9091)
  • Set up HTTPS with reverse proxy (nginx/caddy)
  • Configure resource limits in production
  • Enable logging and monitoring
  • Set up automatic node registration
  • Implement authentication layer

Performance Benchmarks

Metric Value Conditions
Cold Start < 5ms Cached module
Execution ~1-2ms Simple function
Throughput 10k req/s Single node
Memory 16MB Per function

Benchmarked on: Intel i7, 16GB RAM, NVMe SSD


Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow Rust best practices and idioms
  • Add tests for new features
  • Update documentation as needed
  • Ensure cargo clippy passes
  • Run cargo fmt before committing

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


Support

If you find Aether useful, consider supporting the development:

Support


Contact & Community


Built with Rust 🦀

Aether - Lightweight, Fast, Serverless-Ready Edge Computing

About

Aether is a modern Edge Computing Framework designed to run WebAssembly (WASM) workloads at the edge while keeping a centralized Control Plane for function registry, node management, and orchestration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages