Skip to content

binuud/brain-nodes

Repository files navigation

brain-nodes

Brain Nodes are reusable components, that are part of workflow and processes.

Why Go

I want to have a small docker foot print. The most favoured deployment is going to be via docker or as a binary. Go allows to have non mutable containers. Single binary without dependacy is also possible on go, where docker can have a larger footprint be used, as in pi boards etc. It has a cleaner types implementation.

Nodes

Nodes would be docker containers.

Nodes Meta

Each node will be described by the following meta fields

  • Name - name of node
  • Description - a brief descriptions
  • Version - version
  • Image - docker image to be used with registry details
  • evictable - boolean - do we evict it on completion

Nodes Endpoints

All nodes should support the following interfaces

  • getMeta - get meta object of the node - name, description, input/outputs etc
  • status - returns status (true -- all fine,false - some problem)
  • output - gets the output of the task that the node is assigned to do, this can be result of a prompt chat, image generatio, tts, success/fail message When calling output, the input will be parameter to this api, eg: in case of tts, the text to be converted to speech will be set as input to this api
  • outputStream - same as above, but in cases where we need output as a stream, can be combined with above api in futur
  • getConfig - get the current configuration
  • setConfig - set the config at run time
  • setInitialConfig - set the intial config

Node Meta and Node forms

Node meta and node forms will be stored external to the image. This decision is made so as to show the forms and meta without having the nodes actually running.

Node Interactions

These are special forms, shown for running nodes. Basically these forms need the node to be live and running.

Nodes Config

List of name value pairs, that are used to configure the Node, eg: the model to be used in case of ollama or tts, or embedding model to be used

Mounting docker.sock On Mac its not possible to mount the docker.sock file present under the home directory. We need to restart docker dekstop, with advanced option, setting to put docker.sock under /var/rundocker.sock

go install github.com/jdockerty/yaml-to-json-go@latest brew install yq go install github.com/ogen-go/protoc-gen-oas/cmd/protoc-gen-oas@latest\

For Testing /var/run/docker socket

docker run -it -p9081:9080 -p9091:9090  -v /var/run/docker.sock:/var/run/docker.sock   --privileged --name testme   dronasys-com/brain-container-server:latest sh           
### Run below in shell of container
curl --unix-socket ~/.docker/run/docker.sock http://localhost/images/json

curl -X GET --header "headerport:11801" http://localhost:8080/brain.nodes/aiModule/getConfig

curl -X GET --header "headerport:11200" http://localhost:8080/brain.nodes/aiModuleGrpc/health

Example filer server acccess link http://localhost:9086/static/tts/aafacf32-0a5c-4f59-bedd-c22a74b8f584.wav

About

Brain Nodes are reusable components, that are part of workflow and processes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors