Giter VIP home page Giter VIP logo

device-scanner's Introduction

device-scanner

Build Status Greenkeeper badge

This repo provides a persistent daemon That holds block devices + ZFS devices in memory.

It also provides listeners that emit changes to the daemon.

Finally, it also provides a proxy that transforms the unix domain socket events to HTTP POSTs.

Architecture

    ┌───────────────┐ ┌───────────────┐
    │  Udev Script  │ │    ZEDlet     │
    └───────────────┘ └───────────────┘
            │                 │
            └────────┬────────┘
                     ▼
          ┌─────────────────────┐
          │ Unix Domain Socket  │
          └─────────────────────┘
                     │
                     ▼
       ┌───────────────────────────┐
       │   Device Scanner Daemon   │
       └───────────────────────────┘
                     │
                     ▼
          ┌─────────────────────┐
          │ Unix Domain Socket  │
          └─────────────────────┘
                     │
                     ▼
           ┌──────────────────┐
           │ Consumer Process │
           └──────────────────┘

Development Requirements

npm comes bundled with node.js, but we recommend to use at least npm 5. If you have npm installed, you can upgrade it by running npm install -g npm.

Although is not a Fable requirement, on macOS and Linux you'll need Mono for other F# tooling like Paket or editor support.

Development setup

  • (Optional) Install ZFS via OS package manager
  • Install F# dependencies: npm run restore
  • Install JS dependencies: npm i

Building the app

Local

  • dotnet fable npm-build

Vagrant

  • Running vagrant up will setup a complete environment. It will build device-scanner, package it as an RPM and install it on the node.

    To interact with the device-scanner in real time the following command can be used to keep the stream open such that updates can be seen as the data changes:

    cat - | ncat -U /var/run/device-scanner.sock | jq

    If interaction is not required, device info can be retrieved from the device-scanner by running the following command:

    echo '"Stream"' | socat - UNIX-CONNECT:/var/run/device-scanner.sock | jq

Testing the app

  • Run the tests dotnet fable npm-test
  • Run the tests and output code coverage dotnet fable npm-coverage
  • Run the tests in watch mode:
    • In one terminal dotnet fable start
    • In a second terminal npm run test-watch
      • This will allow you to run all, or just a subset of tests, and will re-test the changed files on save.

device-scanner's People

Contributors

johnsonw avatar tanabarr avatar greenkeeper[bot] avatar jgrund avatar

Watchers

Leo Lorenzo Luis avatar  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.