Background
There are many reasons events on a node/machine could trigger a job. Some examples:
- A directory has reached a level of fullness and files need to compacted and rotated
- A file has been uploaded to a directory
- A security violation has occurred and a node should be quarantined and scanned
The Bacalhau agent, running locally, could handle many of these tasks but first require the Bacalhau network to be notified.
Options
The Bacalhau agent could be useful in the event flow in several ways:
- Watch a given descriptor for changes
- Have a local pipe that could be triggered by a process
- Have a websocket that only responds/listens on localhost
Once the agent is triggered, we have two paths to execute a job:
- The agent begins the work immediately, and publishes the results
- The agent contacts the server, which schedules the job to begin and selectively chooses the exact node that triggered the event to run it on
For our initial MVP, we will do #1 and #2 from the above.
Flow