GithubHelp home page GithubHelp logo

osx-overseer's Introduction

OS X Overseer

Simple, lightweight userspace process manager for OS X.

Requirements

  • Run as a server overseerd
    • Persist its state somewhere
    • Bind a port to take triggers from
  • Be triggered by re-running overseer
    • Detect new jobs
    • Detect jobs with changed configurations
    • Re-run tests for all jobs
    • Kill and kickoff processes for jobs with different state
    • Re-persist state
  • Config in $XDG_CONFIG_HOME/overseer, default $HOME/.config/overseer/
  • Runtime data in $XDG_DATA_HOME/overseer, default $HOME/.local/share/overseer
  • Kick off process and restart them if they go down
  • Check if process should be running with arbitrary test

Architecture

Daemon State Machine

  • Start
    • -> InitHomes
  • InitHomes
    • Success -> OpenSocket(Homes)
  • OpenSocket(Homes)
    • Success -> ReceiveRequest(Socket)
    • Failure -> Exit(Err(SocketOpenError))
  • ReceiveRequest(Socket)
    • Success -> ProcessRequest(Socket, Request)
    • Failure -> Exit(Err(SocketReadError))
  • ProcessRequest(Socket, Request)
    • "DIE" -> Exit(Ok(()))
    • other -> SendResponse(Socket)
  • SendResponse(Socket)
    • Success -> ReceiveRequest(Socket)
    • Failure -> Exit(Err(SocketWriteError))
  • Exit(Result<(), Error>)
    • -> Done
  • Done

Client State Machine

  • Start
    • -> InitHomes
  • InitHomes
    • Success -> CheckSocketExists(Homes)
    • Failure -> Exit(Err(InitHomesError))
  • CheckSocketExists(Homes)
    • Success -> OpenSocket(Homes)
    • Failure -> LaunchDaemon
  • OpenSocket(Homes)
    • Success -> SendRequest(Socket)
    • Failure -> DeleteSocketFile(Homes)
  • SendRequest(Socket)
    • Success -> ReadResponse(Socket)
    • Failure -> CloseSocket(Socket, Exit(Err(SocketSendError)))
  • CloseSocket(Socket, State)
    • -> param state
  • DeleteSocketFile(Homes)
    • -> LaunchDaemon(Homes)
  • LaunchDaemon(Homes)
    • Success -> OpenSocket(Homes)
    • Failure -> Exit(Err(DaemonLaunchError))
  • ReadResponse(Socket)
    • Success -> CloseSocket(Socket, PrintResponse(Response))
    • Failure -> CloseSocket(Socket, Exit(Err(SocketReadError)))
  • PrintResponse(Response)
    • -> Exit(Ok(()))
  • Exit(Result<(), Error>)
    • -> Done
  • Done

Types

struct Command {
  exe: String,
  args: Vec<String>,
};

struct Job { 
  name: String,
  job_command: Command,
  test_command: Option<Command>,
};

struct Config {
  jobs: Vec<Job>,
}

osx-overseer's People

Contributors

rjayatilleka avatar

Stargazers

Chris Raethke avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.