Nex

Nex is the NATS Execution Engine—a lightweight way to run distributed workloads over NATS without standing up heavy orchestration. Nodes auction work to nexlets (runtime agents) so you can run native binaries today and extend the platform with custom runtimes when you need them.

Overview

Installation

Quickstart

  1. Start NATS (or point to an existing server):

    nats-server -a 127.0.0.1 -p 4222
    
  2. Start a Nex node (started with the native nexlet by default):

    nex -s nats://127.0.0.1:4222 node up
    nex -s nats://127.0.0.1:4222 node list  # verify the node is registered
    
  3. Deploy a workload. Create a Nexfile:

    Note: Nexfiles are written in YAML.

    name: "system-reporter"
    description: "Reports system stats every 30 seconds"
    type: native
    lifecycle: service
    start_request:
      uri: "file:///bin/sh"
      argv:
        - "-c"
        - "while true; do echo \"[$(date '+%Y-%m-%d %H:%M:%S')] Uptime: $(uptime)\"; sleep 30; done"
    

    Deploy and observe:

    nex -s nats://127.0.0.1:4222 workload start -f Nexfile
    nex -s nats://127.0.0.1:4222 workload ls
    

For deeper guides, concepts, and nexlet development, read our docs.