Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
861 commits
Select commit Hold shift + click to select a range
5972124
Merge pull request #69 from snel-repo/nwb_update
mirigotti Aug 29, 2022
d53ad32
Merge branch 'dev' into paper_dev
Sam-NT Sep 6, 2022
a3f19e4
Adding time import to supervisor
Sam-NT Sep 6, 2022
ff546c4
Merge pull request #68 from snel-repo/paper_dev
Sam-NT Sep 6, 2022
27a21d0
Adding graph error handling to supervisor
Sam-NT Sep 6, 2022
ee5b028
Removing unused supervisor functions
Sam-NT Sep 6, 2022
4c395ea
Added redis-server error handling (supervisor exits if error)
Sam-NT Sep 6, 2022
361adcb
Adding log-level argument to supervisor
Sam-NT Sep 6, 2022
4741473
Adding more error handling after testing
Sam-NT Sep 6, 2022
da5c785
Moving exceptions to brand lib directory
Sam-NT Sep 6, 2022
894e106
Adding supervisor_status update feature
Sam-NT Sep 7, 2022
9ced333
Adding NodeError exception and adding exception scenario that checks …
Sam-NT Sep 7, 2022
440d802
Adding error handling for booter
Sam-NT Sep 7, 2022
2f6da09
Update exportNWB to load source node from derivatives section
mirigotti Sep 7, 2022
fe1f049
updated NWB guidelines
mirigotti Sep 7, 2022
3a35664
Fixing booter error handling on supervisor
Sam-NT Sep 7, 2022
d49653f
Updating exportNWB doc with additional details about source_node
Sam-NT Sep 7, 2022
b91e6d3
Removing unused function from exportNWB
Sam-NT Sep 7, 2022
8d38b77
Merge pull request #71 from snel-repo/nwb_source_node_update
Sam-NT Sep 7, 2022
f057dc2
Merge branch 'dev' into error_handling_dev
Sam-NT Sep 7, 2022
601cf7f
Adding tracebacks to exception messages, booter untested
Sam-NT Sep 8, 2022
f0e6b40
Validated functional booter error logging
Sam-NT Sep 8, 2022
c717052
Updating documentation related to exception handling
Sam-NT Sep 8, 2022
163d2b7
Fixed booter host ip arg flag from 'hs' to 'i'
mirigotti Sep 8, 2022
bdb6893
Removing unused booter imports
Sam-NT Sep 8, 2022
cdc8165
Merge pull request #72 from snel-repo/booter_host_hotfix
mirigotti Sep 8, 2022
e956b59
Fixing checkBooter to not ignore 'graph failed' messages
Sam-NT Sep 8, 2022
0005fd7
Merge branch 'dev' into error_handling_dev
Sam-NT Sep 8, 2022
eae6208
Fixing redis connection error to directly exit instead of calling sup…
Sam-NT Sep 8, 2022
10eeb44
Fixing supervisor bug where nodes that launched too quickly would cau…
Sam-NT Sep 8, 2022
5cd46ee
Removing node initialization checking from supervisor
Sam-NT Sep 9, 2022
7d166d9
Adding updateParameters command to supervisor
Sam-NT Sep 15, 2022
ad51380
Improving efficiency of xrange and xrevrange calls in supervisor.py a…
Sam-NT Sep 15, 2022
99a9cf3
Adding short documentation for supervisor's updateParameters command
Sam-NT Sep 15, 2022
a66fe0a
Merge pull request #73 from snel-repo/error_handling_dev
Sam-NT Sep 16, 2022
c7a5341
Merge branch 'dev' into param_updates_dev
Sam-NT Sep 16, 2022
08079bd
Fixed writing strings to trial table as TrialInfo type
bbhaduri Sep 16, 2022
15a4698
Merge pull request #74 from snel-repo/exportNWB_str_fix
Sam-NT Sep 16, 2022
d47e384
Merge branch 'dev' into param_updates_dev
Sam-NT Sep 20, 2022
be941fd
Fixing checkBooter to update booter_status_id with most recent entry ID
Sam-NT Sep 20, 2022
9edfb0f
Add xread_count to brand API
yahiaali Sep 20, 2022
2673299
Merge branch 'paper_dev' of github.com:snel-repo/realtime_rig_dev int…
yahiaali Sep 20, 2022
a690246
Add Xianda's list-parsing functions
yahiaali Sep 21, 2022
19f77a6
Update node CLI arguments to match supervisor
yahiaali Sep 21, 2022
13c9409
Merge remote-tracking branch 'origin/dev' into paper_dev
yahiaali Sep 23, 2022
aa60368
Add functions for C timespec and timeval objects
yahiaali Sep 23, 2022
11cdb4c
Merge pull request #75 from snel-repo/param_updates_dev
mirigotti Sep 26, 2022
cf6c61e
Update NewUserSetup.md
mirigotti Sep 27, 2022
7d1b17d
Update NewUserSetup.md
mirigotti Sep 27, 2022
d4ba3ad
Adding link to Installing BRAND section where appropriate
Sam-NT Sep 28, 2022
bf526de
Merge pull request #78 from snel-repo/update-new-user-setup-doc
Sam-NT Sep 28, 2022
90537c9
Tweaked README point about redis id
tscizzlebg Oct 2, 2022
401828e
Merge pull request #79 from snel-repo/tyler-readme-edit
tscizzlebg Oct 2, 2022
af92cb1
In README, added specifics for the supergraph_stream
tscizzlebg Oct 3, 2022
4333c3c
Merge pull request #80 from snel-repo/supergraph_stream_example
tscizzlebg Oct 3, 2022
a99bbde
BRANDNode now gets parameters from all unread supergraphs
Sam-NT Oct 6, 2022
fb85f72
Adding documentation to README for nodes updating parameters from sup…
Sam-NT Oct 6, 2022
f933c17
Fixing bug where supervisor's model parameters were updated even if u…
Sam-NT Oct 7, 2022
7324f28
Merge branch 'dev' into paper_dev
mirigotti Oct 7, 2022
8d61d53
Merge pull request #76 from snel-repo/paper_dev
mirigotti Oct 7, 2022
448252e
Merge branch 'dev' into node_supergraph_read_fix
Sam-NT Oct 8, 2022
32ef29f
Fixed GraphError supervisor crash when no graph had yet been loaded
Sam-NT Oct 8, 2022
7de1770
Adding supergraph documentation to README
Sam-NT Oct 8, 2022
e12f786
Merge pull request #83 from snel-repo/node_supergraph_read_fix
mirigotti Oct 10, 2022
933eb69
Print error using repr instead of missing err_str
yahiaali Oct 12, 2022
11977fc
Merge pull request #89 from snel-repo/error_print
Sam-NT Oct 12, 2022
5dc0b1d
Add BRAND_spec.md to docs folder
mirigotti Oct 13, 2022
76d40b1
Update node CLI arg formatting in BRAND_spec.md
yahiaali Oct 20, 2022
fc84dd9
Merge pull request #93 from snel-repo/brand_spec_doc
mirigotti Oct 20, 2022
ea6b77f
Adding save_rdb, save_nwb, and flush_db supervisor functions
Sam-NT Oct 24, 2022
f554bef
Adding saveRdb, saveNwb, and flushDb commands to supervisor_ipstream
Sam-NT Oct 24, 2022
7a1699e
Adding DerivativeError exception with error handling for exportNWB
Sam-NT Oct 24, 2022
7acac08
Adding loadGraph function to supervisor
Sam-NT Oct 24, 2022
10184a8
Adding CLI argument and functions to set supervisor data directory
Sam-NT Oct 24, 2022
e28cf0f
Adding logging of node git hashes in supergraph
Sam-NT Oct 24, 2022
5668d3a
Adding git hash checking to booter, crashes if supergraph hashes don'…
Sam-NT Oct 24, 2022
fde59f6
Updating documentation with new supervisor configuration options, sup…
Sam-NT Oct 24, 2022
e214f91
Add function to sync data from multiple streams
yahiaali Oct 24, 2022
f3b02c6
Make now writes a git_hash file for each node, and supervisor and boo…
Sam-NT Oct 27, 2022
1eb7b49
Updating make to log Git hashes with all nodes and derivatives even w…
Sam-NT Oct 28, 2022
b0b4581
Updating description of Git hash logging in README
Sam-NT Oct 28, 2022
5af3bf2
Adding supervisor make command and CommandError exception
Sam-NT Oct 28, 2022
7491466
Supervisor make command now also sends make command to booters, fixin…
Sam-NT Oct 28, 2022
76085a0
Adding documentation for make command
Sam-NT Oct 28, 2022
0600b33
Adding supervisor Git hash validation during startGraph
Sam-NT Oct 31, 2022
d253e48
Removing supervisor command capitalization requirements
Sam-NT Oct 31, 2022
021594c
Adding requirement for a graph to not be running for the saveNwb comm…
Sam-NT Nov 1, 2022
6d16d6f
supervisor setDataDir now updates the data directory without loading …
Sam-NT Nov 1, 2022
6fe4e2e
Booter now only validates Git hashes for which it is responsible
Sam-NT Nov 1, 2022
4becec0
Consolidating code that checks whether a graph is running into a func…
Sam-NT Nov 2, 2022
43e8e78
Merge pull request #95 from snel-repo/supervisor_usability_updates
mirigotti Nov 3, 2022
f2f6ea7
Edit NWB derivatives devices to be specified in graph
mirigotti Nov 14, 2022
3fc2a30
Add arbitrary sync sampling frequency to export NWB
mirigotti Nov 14, 2022
28c1153
Add xread_sync function, edit stream comments in exportNWB with colum…
mirigotti Nov 15, 2022
4b7845d
Fix bug in exportNWB when streams have multiple label in sync dict
mirigotti Nov 17, 2022
9bd71fc
Adding unfinished supervisor code to write stream definitions to the …
Sam-NT Nov 17, 2022
f65d351
Making sync_timing_hz and devices_file optional graph parameters
Sam-NT Nov 17, 2022
7b199d2
Merge pull request #99 from snel-repo/nwb_devices_edit
Sam-NT Nov 17, 2022
bbe6839
Merge branch 'dev' into nwb_update
Sam-NT Nov 17, 2022
a0e79f3
Transitioning supervisor to a superclass
Sam-NT Nov 18, 2022
850d73b
Removing unused function from supervisor
Sam-NT Nov 21, 2022
fd9ee4e
Moving exportNWB documentation to the exportNWB derivatives directory
Sam-NT Nov 21, 2022
2c2631b
Updating exportNWB to comply with new stream logging in the supergrap…
Sam-NT Nov 21, 2022
1cc780c
Adding option for sync-specific rates in exportNWB and updating expor…
Sam-NT Nov 23, 2022
e95ec63
Reverting exportNWB changes, moving them to brand-emory repository
Sam-NT Nov 23, 2022
c3b208b
Fixing bug where supervisor and booter would search for binaries for …
Sam-NT Nov 23, 2022
27d5141
Fixing error where node name was called incorrectly during a NodeError
Sam-NT Nov 23, 2022
201d055
Fixing bug where git_hash key wasn't being written to the supergraph …
Sam-NT Nov 29, 2022
c4a0a71
Added check for empty git hash for node, to prevent error when node d…
mirigotti Nov 30, 2022
7feed80
Merge origin/supervisor_lib_move into paper_dev
yahiaali Dec 1, 2022
2d733b6
Merge pull request #100 from snel-repo/supervisor_lib_move
yahiaali Dec 2, 2022
f8b456f
Merge remote-tracking branch 'origin/dev' into paper_dev
yahiaali Dec 2, 2022
62ae842
Log git hash mismatch as warning
yahiaali Dec 13, 2022
36ba512
Merge pull request #98 from snel-repo/paper_dev
Sam-NT Dec 16, 2022
a383580
Fixing crash during DerivativeError handling if no associated process
Sam-NT Dec 19, 2022
3a3ab88
Merge pull request #103 from snel-repo/deriv_error_no_proc
Sam-NT Dec 19, 2022
5382550
Remove deprecated sklearn package
yahiaali Feb 6, 2023
b181bc6
Merge pull request #108 from snel-repo/sklearn_pip
mirigotti Feb 9, 2023
04acf40
Fixing xread_sync to properly check for equal timestamps between stre…
Sam-NT Feb 17, 2023
cdf4f8e
Merge pull request #112 from snel-repo/xread_sync_fix_2
Sam-NT Feb 17, 2023
7519fc4
Check if nodes have stopped. If not, send SIGKILL.
yahiaali Apr 27, 2023
5a98f9a
Print warning when node is not stopped by SIGINT
yahiaali Apr 27, 2023
23868d4
Merge pull request #113 from snel-repo/stop_nodes
Sam-NT Apr 27, 2023
a430ed7
Run nodes as the current user, not root
yahiaali Aug 18, 2023
13621c7
Restrict process tree search to a depth of 1.
yahiaali Aug 18, 2023
5c78114
Merged supervisors in progress
Sam-NT Dec 19, 2023
33f8a65
adding untested autorun derivative processes
Sam-NT Dec 19, 2023
1b381f6
Merge pull request #133 from snel-repo/sudoless
mirigotti Dec 19, 2023
caa69ae
functional supervisor with derivative runner
Sam-NT Dec 19, 2023
809c263
Make nodes run as root by default.
yahiaali Dec 19, 2023
2110657
BRANDNode: adding RedisLoggingHandler and garbage collection
Sam-NT Dec 20, 2023
ae496a4
RunDerivativeStep: now just expects a list of derivatives to run
Sam-NT Dec 20, 2023
4218a7c
RunDerivatives: waits for threads to finish via join, uses shared sto…
Sam-NT Dec 20, 2023
e31d01e
RunDerivativeStep: traverses process tree to kill derivatives if nece…
Sam-NT Dec 20, 2023
9b217bd
supervisor: reorganizing exception handling into class methods
Sam-NT Dec 20, 2023
26790eb
derivative: log messages now print once
Sam-NT Dec 20, 2023
38333a0
booter: removing git hash functionality
Sam-NT Dec 20, 2023
e801714
Merge pull request #141 from snel-repo/opt_root
mirigotti Dec 20, 2023
756e074
booter: adding RunDerivatives support
Sam-NT Dec 20, 2023
d18ebd1
derivative: can now start and stop single derivatives at any time
Sam-NT Dec 22, 2023
6787318
derivative: all booters properly exit when a step encounters an error
Sam-NT Dec 22, 2023
18015e6
derivative: does not kill -1 step if autorun steps fail
Sam-NT Dec 22, 2023
ca8843a
derivative: properly handles absent Redis connections
Sam-NT Dec 22, 2023
2d05d13
booter: adding RedisLoggingHandler
Sam-NT Dec 22, 2023
bcddda8
Merge branch 'dev' into core_update_from_sudoless_SN
Sam-NT Dec 22, 2023
183327c
Makefile: removing Git hash logging
Sam-NT Dec 22, 2023
e182332
bootstrap: installs yq via snap
Sam-NT Dec 22, 2023
048f9b1
brand_c: adding Davis C functions
Sam-NT Dec 22, 2023
ea80efd
Makefile: attempts to specify graph, node, and derivative to make, de…
Sam-NT Dec 22, 2023
890d23f
Make: now supports specifying derivatives, updated supervisor/booter …
Sam-NT Dec 23, 2023
544fc57
supervisor: derivative KeyErrors now pertain to derivatives
Sam-NT Dec 23, 2023
24c0db5
derivative: option to continue if a step errors
Sam-NT Dec 23, 2023
2e11835
updateParameters: now supports updating derivative parameters
Sam-NT Dec 23, 2023
cf2d2f4
supervisor/booter: adding stopChildProcess command
Sam-NT Dec 23, 2023
df072c1
Updating readme
Sam-NT Dec 23, 2023
9887e7d
BRANDnode: defaults log level INFO
Sam-NT Dec 23, 2023
b5438b6
Removing Git hash info from README
Sam-NT Dec 23, 2023
779532f
Removing remaining NWB references
Sam-NT Dec 23, 2023
c996a6a
Clarifying documentation and variable names
Sam-NT Dec 23, 2023
f77f6a0
derivative/get_steps: removing erroneous returns in docstring
Sam-NT Dec 23, 2023
e66151c
derivative: no longer adds new RedisLoggingHandlers with each execution
Sam-NT Dec 25, 2023
3968e06
derivative: timestamps are in world-clock time
Sam-NT Dec 27, 2023
467c47a
supervisor: autorun derivatives are now direct supervisor threads, re…
Sam-NT Dec 27, 2023
1401b82
AutorunDerivatives: only waits for derivatives that are presently run…
Sam-NT Dec 27, 2023
de6f329
derivative: adding logic for CTRL+C
Sam-NT Dec 27, 2023
6d9e93e
modified default conda env
ucd-npl-cart Dec 28, 2023
07fc45e
added Redis APIs
ucd-npl-cart Dec 28, 2023
b55b84e
Adding ping command, work in progress
Sam-NT Dec 29, 2023
09ed10e
ping: working sometimes
Sam-NT Dec 29, 2023
766321f
ping: now working
Sam-NT Dec 29, 2023
2663c6f
ping: now works across machines
Sam-NT Dec 29, 2023
2188c37
ping: now works with multiple booters
Sam-NT Dec 30, 2023
44a87eb
ping: removing debug ID printout
Sam-NT Dec 30, 2023
a631743
ping: simplifying stream interactions to just 2 streams
Sam-NT Dec 30, 2023
620f902
ping: simplifying exit logic
Sam-NT Dec 30, 2023
daa0af6
derivative: RunDerivative now adds RedisLoggingHandler
Sam-NT Jan 2, 2024
820d494
derivative: now checks whether derivatives are running and accommodates
Sam-NT Jan 2, 2024
a91f126
Merge remote-tracking branch 'origin/core_update_from_sudoless_SN' in…
ucd-npl-cart Jan 2, 2024
edd4ad5
supervisor: now xadds 'Listening for commands' status after each command
Sam-NT Jan 3, 2024
6f8f299
derivative: fixing incorrect logging tags
Sam-NT Jan 4, 2024
e682522
derivative: logger has at most one RedisLoggingHandler
Sam-NT Jan 4, 2024
2b8f27e
supervisor: correctly writes rdb_filename and save_path_rdb to superg…
Sam-NT Jan 8, 2024
75e3dfe
derivative: delay is now stored as a string to be compatible with sub…
Sam-NT Jan 8, 2024
0695f6d
Exception tracebacks are now written to Redis
Sam-NT Jan 19, 2024
341abc0
Fixing Redis ConnectionError handling
Sam-NT Jan 19, 2024
5fe692c
Merge pull request #143 from snel-repo/exc_to_redis
yahiaali Jan 30, 2024
ace5677
supervisor/booter: removing unused sh import, adding -j option to make
Sam-NT Feb 1, 2024
1f2b621
Merge branch 'core_update_from_sudoless_SN' into core_update_from_sud…
ucd-npl-cart Feb 21, 2024
86d1b63
changed session id format to davis format
ucd-npl-cart Feb 23, 2024
85f03be
changed save path format to davis format
ucd-npl-cart Feb 23, 2024
c92e438
restore unified-brand `get_save_path()`
ucd-npl-cart Feb 23, 2024
bace132
Removed temp files
ucd-npl-cart Feb 23, 2024
3d6b3d0
fix for sleep shell command
ucd-npl-cart Feb 23, 2024
b33aa2c
fix for `delay_sec` option
ucd-npl-cart Feb 23, 2024
4ef15f5
changed default conda env back to `rt`
ucd-npl-cart Feb 23, 2024
176b177
delay fix
ucd-npl-cart Feb 24, 2024
ea233d8
delay fix
ucd-npl-cart Feb 24, 2024
570ea63
Merge branch 'core_update_from_sudoless_SN_test' into core_update_fro…
ucd-npl-cart Feb 24, 2024
990e256
Merge pull request #144 from snel-repo/core_update_from_sudoless_SN_d…
Sam-NT Mar 5, 2024
92084dc
derivative: increasing derivative startup timer
Sam-NT Mar 14, 2024
9b010d3
derivative: checks if any more derivatives to check before waiting again
Sam-NT Mar 14, 2024
ca94ff3
derivative: removing unnecessary additional check for derivatives tha…
Sam-NT Mar 18, 2024
a26d612
Merge pull request #145 from snel-repo/derivative_start_timer
yahiaali Apr 4, 2024
74349ad
Merge pull request #142 from snel-repo/core_update_from_sudoless_SN
yahiaali Apr 4, 2024
fbc7232
Removed the publish status while running. Made load_graph always publ…
tscizzlebg Apr 5, 2024
fb20a96
Put publish_graph arg back in for load_graph
tscizzlebg Apr 5, 2024
c55f180
Merge pull request #146 from snel-repo/remove-publish-while-running
Sam-NT Apr 11, 2024
1ef0f98
Adding psutil to the setuptools install_requires list
Sam-NT Apr 15, 2024
ec0a566
Specifying psutil version in setup.py
Sam-NT Apr 15, 2024
08bff3d
Removing unused numpy import in Python API
Sam-NT Apr 15, 2024
86342bb
Revert "Specifying psutil version in setup.py"
Sam-NT Apr 15, 2024
2302d80
Re-adding psutil version
Sam-NT Apr 15, 2024
d6d8a01
Revert "Removing unused numpy import in Python API"
Sam-NT Apr 15, 2024
b57ef1e
Increased C node nickname buffer length from 20 to 50
theForerunner May 2, 2024
c76361f
Adding numpy dependency to BRAND Python API
Sam-NT May 2, 2024
a9b4d65
Merge pull request #148 from snel-repo/increase-c-node-nickname-length
tscizzlebg May 3, 2024
c9644c0
Took the apt update out of the loop, so it happens once
tscizzlebg May 3, 2024
1a90707
Merge branch 'dev' into add_psutil_require
Sam-NT May 3, 2024
cbc4793
Merge pull request #147 from snel-repo/add_psutil_require
Sam-NT May 3, 2024
6f5610b
Merge branch 'dev' into bootstrap-update-once
tscizzlebg May 3, 2024
3e22d7a
Remove unused redis-server line in bootstrap
tscizzlebg May 3, 2024
9c8f76f
Merge pull request #149 from snel-repo/bootstrap-update-once
Sam-NT May 9, 2024
eed7c60
Supervisor now wait for booters to stop based on `checkBooter()`
theForerunner May 29, 2024
4d981ba
Added logging before running derivatives
theForerunner May 31, 2024
387e184
Simplified stop graph code
theForerunner Jun 4, 2024
e8deb04
Moved `do_save` back in front of `do_derivative` and changed log msg
theForerunner Jun 6, 2024
8c81672
Elevate log level if not all booters are handling `stop_graph` message
theForerunner Jun 6, 2024
37004b8
In progress on verbose_command in supervisor and booter
tscizzlebg Jul 3, 2024
75058b7
Added verbose_command to booter
ucd-npl-cart Jul 4, 2024
ae1be19
When booter gets new supergraph, dont print every node name and deriv…
ucd-npl-cart Jul 4, 2024
11bd071
Make verbose not treated as a node nickname
ucd-npl-cart Jul 4, 2024
a579de9
Changed `verbose_command` logic
theForerunner Jul 9, 2024
2a4d08b
Changed indents
theForerunner Jul 9, 2024
7cb77d1
Changed indents
theForerunner Jul 9, 2024
93155ad
Fixed warning when only `verbose_global` is received
ucd-npl-cart Jul 10, 2024
915df0e
Added logging on default log level mod
ucd-npl-cart Jul 10, 2024
275e0f1
Modifications according to Tyler's suggestions
theForerunner Jul 16, 2024
f7fadce
Fixed command check error
ucd-npl-cart Jul 16, 2024
4202ba8
Rename `verbose` to `log_level`
theForerunner Jul 16, 2024
53ccb00
Make booter always log receive command w/ default log level
ucd-npl-cart Jul 17, 2024
6487cb6
log received command at command log level
ucd-npl-cart Jul 17, 2024
ce00641
Merge pull request #150 from snel-repo/stop-and-save-fix
yahiaali Aug 2, 2024
0ad55b1
Merge branch 'dev' with 'verbose-command-edit'
yahiaali Aug 2, 2024
af55935
Merge pull request #154 from snel-repo/verbose-command-edit
yahiaali Aug 2, 2024
a80ba87
Merge remote-tracking branch 'upstream/dev' into dev
yahiaali Oct 31, 2024
3432f2d
Complete merge of brand.c code
yahiaali Oct 31, 2024
b07de55
Add option to bind redis-server to multiple interfaces
yahiaali Nov 19, 2024
cf6f60e
Start booter nodes using the IP address and port of booter, not super…
yahiaali Nov 19, 2024
efc33e6
Merge pull request #155 from snel-repo/bind_multi
yahiaali Nov 22, 2024
ff1ae92
Merge remote-tracking branch 'private/dev' into dev
yahiaali Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 36 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
export ROOT ?= $(shell pwd)
include $(ROOT)/setenv.mk

# Get all directories in ../brand-modules/*/nodes/ and ../brand-modules/*/derivatives/
MODULES_BASE_PATH=../brand-modules
ifdef graph
#run yq to get the list of modules
ifdef machine
NODE_PATHS=$(shell yq 'explode(.) | .nodes[] | .module + "/nodes/" + select(has("machine")|not or .machine=="$(machine)").name' $(graph))
DERIVS_PATHS=$(shell yq 'explode(.) | .derivatives[] | .module + "/derivatives/" + select(has("machine")|not or .machine=="$(machine)").name' $(graph))
else
NODE_PATHS=$(shell yq '.nodes[] | .module + "/nodes/" + .name' $(graph))
DERIVS_PATHS=$(shell yq '.derivatives[] | .module + "/derivatives/" + .name' $(graph))
endif
#loop through the list of modules and get the path to the Makefile
MODULES_NODES=$(foreach path,$(NODE_PATHS),$(shell dirname $(wildcard $(path)/Makefile)))
MODULES_DERIVS_NO_EXT=$(foreach path,$(DERIVS_PATHS),$(shell echo ${path%.*}))
MODULES_DERIVS=$(foreach path,$(MODULES_DERIVS_NO_EXT),$(shell dirname $(wildcard $(path)/Makefile)))
else ifdef node
ifdef module
#loop through the list of modules and get the path to the Makefile
MODULES_NODES=$(shell dirname $(MODULES_BASE_PATH)/$(module)/nodes/$(node)/Makefile)
else
#loop through the list of modules and get the path to the Makefile
MODULES_NODES=$(shell dirname $(wildcard $(MODULES_BASE_PATH)/*/nodes/$(node)/Makefile))
endif
else ifdef derivative
ifdef module
#loop through the list of modules and get the path to the Makefile
MODULES_DERIVS=$(shell dirname $(MODULES_BASE_PATH)/$(module)/derivatives/$(derivative)/Makefile)
else
#loop through the list of modules and get the path to the Makefile
MODULES_DERIVS=$(shell dirname $(wildcard $(MODULES_BASE_PATH)/*/derivatives/$(derivative)/Makefile))
endif
else
MODULES_NODES=$(shell dirname $(wildcard $(MODULES_BASE_PATH)/*/nodes/*/Makefile))
MODULES_DERIVS=$(shell dirname $(wildcard $(MODULES_BASE_PATH)/*/derivatives/*/Makefile))
endif

# Get all directories in nodes/ and derivatives/
SUBDIRS_NODES=$(wildcard nodes/*)
SUBDIRS_DERIVS=$(wildcard derivatives/*)
Expand All @@ -9,11 +45,6 @@ SUBDIRS_DERIVS=$(wildcard derivatives/*)
CLEANDIRS_NODES = $(SUBDIRS_NODES:%=clean-%)
CLEANDIRS_DERIVS = $(SUBDIRS_DERIVS:%=clean-%)

# Get all directories in ../brand-modules/*/nodes/ and ../brand-modules/*/derivatives/
MODULES_BASE_PATH=../brand-modules
MODULES_NODES=$(wildcard $(MODULES_BASE_PATH)/*/nodes/*)
MODULES_DERIVS=$(wildcard $(MODULES_BASE_PATH)/*/derivatives/*)

# make some clean targets for all subdirs
MODULES_CLEANDIRS_NODES = $(MODULES_NODES:%=clean-%)
MODULES_CLEANDIRS_DERIVS = $(MODULES_DERIVS:%=clean-%)
Expand All @@ -29,17 +60,6 @@ all: $(SUBDIRS_NODES) $(SUBDIRS_DERIVS) $(MODULES_NODES) $(MODULES_DERIVS) hired
.PHONY: modules $(MODULES_CLEANDIRS_NODES)
.PHONY: modules $(MODULES_CLEANDIRS_DERIVS)

# function that tests if a path $(1) is in a Git repository, and writes the Git hash to git_hash.o if so
write_git_hash = @\
git -C $(1) rev-parse; \
if [ $$? = 0 ]; then \
test -s $(1)/git_hash.o; \
if [ $$? = 0 ]; then \
rm -f $(1)/git_hash.o; \
fi; \
echo -n $$(git -C $(1) rev-parse HEAD) > $(1)/git_hash.o; \
fi

# function that tests if a Makefile exists in a path $(1), and runs make if so
test_and_make = @\
test -s $(1)/Makefile; \
Expand All @@ -53,22 +73,18 @@ test_and_make = @\

# make targets for all paths under nodes/
$(SUBDIRS_NODES): hiredis redis
$(call write_git_hash,$@)
$(call test_and_make,$@)

# make targets for all paths under derivatives/
$(SUBDIRS_DERIVS): hiredis redis
$(call write_git_hash,$@)
$(call test_and_make,$@)

# make targets for all relevant paths under ../brand-modules/*/nodes/
$(MODULES_NODES): hiredis redis
$(call write_git_hash,$@)
$(call test_and_make,$@)

# make targets for all relevant paths under ../brand-modules/*/derivatives/
$(MODULES_DERIVS): hiredis redis
$(call write_git_hash,$@)
$(call test_and_make,$@)

# Linking to hiredis seems to have a bug, where make
Expand Down
95 changes: 73 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ make

Of note: if any of the source code is updated (for example, when developing a new node), `make` needs to be re-run for those changes to be reflected in the binaries that are run by BRAND.

Optional `make` usages:
```bash
make graph="<path-to-graph/graph-name.yaml>" [machine="<machine-name>"] # to make nodes and derivatives relevant to a given graph yaml and optionally a specific machine
make node="<name-of-node>" [module="<module-name>"] # to make a single node instead of all nodes and derivatives and optionally specify a module
make derivative="<name-of-derivative>" [module="<module-name>"] # to make a single derivative instead of all nodes and derivatives and optionally specify a module
```

## Directory structure

BRAND follows the following directory structure (where `brand` corresponds to the main folder for this repository):
Expand All @@ -48,7 +55,15 @@ where `<module-name>` is the name of an external code module that extends the co

### `derivatives/`

The `derivatives` folder contains any derivative scripts. Derivatives are code that are run offline using data stored in an `.rdb` file. Consider derivatives to be analysis code. Derivatives are a new feature to BRAND, so check back in the future for more documentation and functionality.
The `derivatives` folder contains any derivative scripts. Derivatives are scripts that, when run, complete a particular operation and then exit on their own. These are useful for analysis, model, training, data export, etc. This directory's organization is:

```
|---derivatives
|---<derivative_name>
|---<derivative_name.EXT>
```

Presently, supported extensions are `.py` or `.bin`. Optionally, [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix)) can be used to indicate how to run the derivative if neither a `.py` or `.bin`.

### `graphs/`

Expand Down Expand Up @@ -139,8 +154,40 @@ nodes:
<parameter2_name>: <parameter2_value>
...
...
derivatives:
- name: <derivative_1_name> # including file extension
nickname: <unique_nickname>
module: <path_to_module>
run_priority: <run_priority> # optional
machine: <machine_id> # optional
autorun_step: <autorun_step> # optional
parameters:
<parameter1_name>: <parameter1_value>
<parameter2_name>: <parameter2_value>
...
- full_path: <full_path_to_derivative_2>
nickname: <unique_nickname>
parameters:
<parameter1_name>: <parameter1_value>
<parameter2_name>: <parameter2_value>
...
...
```

Nodes and derivatives have the following required parameters:
* `name`: Indicates the name of the node or derivative.
* `nickname`: Indicates the unique nickname of the node or derivative, and must be unique across all nodes and derivatives in the graph.
* `module`: Indicates the module in which the node or derivative is located.

Nodes and derivatives have the following optional parameters:
* `run_priority`: The process priority to be given to the node or derivative. Defaults to standard priority.
* `cpu_affinity`: The specific CPU "core" or list of cores (i.e. 4-5) to be given to the process. Defaults to using the operating system scheduler to assign CPU affinity.
* `machine`: The machine on which to run the node or derivative. Defaults to being run on the machine running `supervisor`.

Derivatives have the following additional optional parameters:
* `autorun_step`: Indicates the step in which to run this derivative if the `do_derivatives` `stopGraph` option is set to `1`. Derivatives with the same step number will be run in parallel. Steps will be run in increasing order and wait until all derivatives in the step are completed until proceeding to the next step. Derivatives given step `-1` will be started at the beginning and allowed to run independently of all other steps.
* `full_path`: Indicates the full path to the derivative and can replace both the required `name` and `module` parameters.

## Session workflow

After having installed and compiled the node executables, the following commands must be run to start the BRAND system:
Expand Down Expand Up @@ -204,27 +251,27 @@ optional arguments:
```bash
XADD supervisor_ipstream * commands stopGraph
```
Alternatively to stop the graph and save NWB export files, use the following Redis command (using `redis-cli` or other Redis interface). Note that this will require having your graph and nodes set up to support the [NWB Export Guidelines](./doc/ExportNwbGuidelines.md).
```bash
XADD supervisor_ipstream * commands stopGraphAndSaveNWB
```

At this time, `supervisor` can only execute one graph at a time. Check back in a future version of BRAND that will support running multiple graphs simultaneously.

### Supported `supervisor` commands

Commands can be sent to the `supervisor` through Redis using the following syntax: `XADD supervisor_ipstream * commands <command_name> [<arg_key> <arg_value>]`. The following commands are currently implemented:

* `startGraph [file <path_to_file>] [graph <graph_json>]`: Start graph from YAML file path or from JSON string. If `file` nor `graph` are provided, it runs the previously loaded graph.
* `loadGraph [file <path_to_file>] [graph <graph_json>]`: Load graph from YAML file path or from JSON string.
* `startGraph [file <path_to_file>] [graph <graph_json>]`: Start graph from YAML file path or from JSON string. If `file` nor `graph` are provided, it runs the previously loaded graph.
* `updateParameters [<nickname> '{"<parameter_name>":"<parameter_value>", ...}' ...]`: Updates the supergraph with specified parameter values for specified nodes. This can be executed anytime after having loaded a graph.
* `stopGraph`: Stop graph, by stopping the processes for each running node.
* `stopGraphAndSaveNWB`: Stop graph, save `.rdb` file, generate NWB file, and flush the Redis database. Requires following the [NWB Export Guidelines](./doc/ExportNwbGuidelines.md). `stopGraphAndSaveNWB` is suggested for running independent session blocks.
* `stopGraph [do_save <bool> do_derivatives <bool>]`: Stop graph, by stopping the processes for each running node.
* `stopChildProcess [nickname <nickname> process_type <node_or_derivative>]`: Stop a single child process (node or derivative).
* `saveRdb`: Dumps the database to disk as a `.rdb` file.
* `saveNwb`: Converts the present database streams to an NWB file, if configured as described in `stopGraphAndSaveNWB`. There must not be a running graph to execute the `saveNwb` command.
* `flushDb`: **USE WITH CAUTION** Flushes the database.
* `setDataDir [path <path_to_data_directory>]`: Sets the root directory for storing data (i.e. from `saveRdb` and `saveNwb` commands).
* `make`: Makes all binaries on the `supervisor` and `booter` machines. There must not be a running graph to execute the `make` command.
* `flushRedis`: **USE WITH CAUTION** Flushes the database.
* `setDataDir [path <path_to_data_directory>]`: Sets the root directory for storing data (i.e. from `saveRdb` commands).
* `setRdbFilename [filename <filename>]`: Sets the database's filename.
* `killAutorunDerivatives`: Kills all derivatives configured to automatically run after the graph ends, if enabled.
* `runDerivatives derivatives <comma-separated-nickname-list>`: Runs the derivatives in the comma-separated list of derivative nicknames a single time. This same command can be called with `runDerivative` or the key `derivative`.
* `killDerivatives derivatives <comma-separated-nickname-list>`: Kills the derivatives in the comma-separated list of derivative nicknames. This same command can be called with `killDerivative` or the key `derivative`.
* `make`: Makes binaries on the `supervisor` and `booter` machines. All `make` [specifications](#environment-setup-and-make) work with this command. There must not be a running graph to execute the `make` command.
* `setDerivativeContinueOnError continue_on_error <0/1>`: Sets the autorun derivative option whether to continue running derivative steps after one failed (defaults to `1` on boot).

### Redis streams used with the `supervisor`

Expand All @@ -249,7 +296,6 @@ After loading a graph with a `startGraph` command to `supervisor`, `supervisor`
{
"redis_host": <redis host>,
"redis_port": <redis port>,
"brand_hash": <Git commit hash for the core BRAND repository>,
"graph_name": <graph name>,
"graph_loaded_ts": <timestamp upon startGraph in nanoseconds>,
"nodes": {
Expand All @@ -258,7 +304,6 @@ After loading a graph with a `startGraph` command to `supervisor`, `supervisor`
"nickname": <node 1 nickname>,
"module": <node 1's source module as a relative path to the BRAND root directory>,
"binary": <full path to node 1's binary>,
"git_hash": <Git commit hash for node 1>,
"run_priority": <optional, node 1's realtime priority>,
"cpu_affinity": <optional, node 1's CPU affinity>,
"parameters": {
Expand All @@ -272,7 +317,6 @@ After loading a graph with a `startGraph` command to `supervisor`, `supervisor`
"nickname": <node 2 nickname>,
"module": <node 2's source module as a relative path to the BRAND root directory>,
"binary": <full path to node 2's binary>,
"git_hash": <Git commit hash for node 2>,
"run_priority": <optional, node 2's realtime priority>,
"cpu_affinity": <optional, node 2's CPU affinity>,
"parameters": {
Expand All @@ -284,19 +328,26 @@ After loading a graph with a `startGraph` command to `supervisor`, `supervisor`
...
},
"derivatives": {
"<derivative 1 name>": {
<unstructured derivative information>
"<derivative 1 nickname>": {
"name": <derivative 1 name including extension>,
"nickname": <derivative 1 nickname>,
"module": <derivative 1's source module as a relative path to the BRAND root directory>,
"machine": <optional machine on which to run derivative 1>,
"autorun_step": <optional step in which to run derivative 1 during the autorun stage after stopping a graph>,
"filepath": <path to file as a relative path to supervisor's working directory>,
"parameters": <dictionary of derivative 2's parameters>
},
"<derivative 2 name>": {
<unstructured derivative information>
"<derivative 2 nickname>": {
"full_path": <full path to derivative 2>,
"nickname": <derivative 2 nickname>,
"filepath": <path to file as a relative path to supervisor's working directory,
"parameters": <dictionary of derivative 2's parameters>
}
...
}
}
```

`make` will write a `git_hash.o` file to each node and derivative, which `supervisor` will write into the supergraph to easily track the exact code version used. When the `startGraph` command is sent, `booter` machines (see [Multi-machine graphs](#multi-machine-graphs) below) will generate a `GraphError` exception if the BRAND repository hashes do not match. Both `supervisor` and `booter` machines will generate a `NodeError` exception if the value in the local `git_hash.o` does not match the supergraph's Git hash for a node when `startGraph` is called. A warning will be printed in `supervisor` or `booter`'s console if the supergraph's Git hash for a node or derivative does not match the repository's hash. If a node is not located in a Git repository and does not have a `git_hash.o` file, then its Git hash in the supergraph will be an empty string.

Note the presence of derivatives in the graph YAML file and the supergraph is optional. The structure of a derivative's information should be defined in the derivative's documentation. Derivatives are a new feature to BRAND, so check back in the future for more documentation and functionality.

### Checking a graph's status
Expand Down Expand Up @@ -406,7 +457,7 @@ If everything is working correctly, you should see that the `func_generator` nod

### `DerivativeError`

`DerivativeError`s are thrown by `supervisor` if a derivative fails to exit gracefully. The error messages are printed and logged to the `graph_status` stream, but no other action is taken. Currently, this is only implemented for the `exportNWB` derivative, so check back later for more derivative features!
`DerivativeError`s are thrown by `supervisor` if a derivative fails to exit gracefully. The error messages are printed and logged to the `graph_status` stream, but no other action is taken.

### `RedisError`

Expand Down
9 changes: 4 additions & 5 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ libsdl2-gfx-dev
libsdl2-ttf-dev
)

sudo apt-get update

# install pkgs in $dependencies
for dep in ${dependencies[@]}; do
info "Installing ${dep}"
[ "${dep}" == "redis-server" ] && sudo add-apt-repository -y ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get -y install ${dep}
checkStatus $? "failed to install ${dep}"
info "Successfully installed ${dep}"
done

sudo snap install yq

# check if elm command is available. If not prompt user for installation.
install_elm=false
ROOT=`dirname "$0"`
Expand Down Expand Up @@ -84,6 +86,3 @@ git submodule update --init --recursive
checkStatus $? "failed to update git submodules"
info "Your environment is ready!"
info "Run \`conda activate rt\` before running make"



Loading