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.
┌───────────────┐ ┌───────────────┐
│ Udev Script │ │ ZEDlet │
└───────────────┘ └───────────────┘
│ │
└────────┬────────┘
▼
┌─────────────────────┐
│ Unix Domain Socket │
└─────────────────────┘
│
▼
┌───────────────────────────┐
│ Device Scanner Daemon │
└───────────────────────────┘
│
▼
┌─────────────────────┐
│ Unix Domain Socket │
└─────────────────────┘
│
▼
┌──────────────────┐
│ Consumer Process │
└──────────────────┘
- dotnet SDK 2.0 or higher
- node.js 6.11 or higher
- Vagrant Optional
- Virtualbox Optional
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.
- (Optional) Install ZFS via OS package manager
- Install F# dependencies:
npm run restore
- Install JS dependencies:
npm i
dotnet fable npm-build
-
Running
vagrant up
will setup a complete environment. It will builddevice-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
- 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.
- In one terminal