Skip to content

Commit

Permalink
Add launch configs for development
Browse files Browse the repository at this point in the history
  • Loading branch information
GDYendell committed Apr 26, 2024
1 parent 96a6b52 commit 3e82e6f
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Odin IOC",
"type": "debugpy",
"request": "launch",
"module": "odin_fastcs",
"justMyCode": false,
"console": "integratedTerminal",
"args": ["ioc", "ODIN"]
},
{
"name": "Odin Asyncio",
"type": "debugpy",
"request": "launch",
"module": "odin_fastcs",
"justMyCode": false,
"console": "integratedTerminal",
"args": ["asyncio"]
},
{
"name": "FrameProcessor",
"type": "debugpy",
"request": "launch",
"module": "odin.main",
"justMyCode": false,
"console": "integratedTerminal",
"args": ["--config", "${workspaceFolder}/dev/odin_server.cfg"]
},
{
"name": "Odin Control FP",
"type": "debugpy",
"request": "launch",
"module": "odin.main",
"justMyCode": false,
"console": "integratedTerminal",
"args": ["--config", "${workspaceFolder}/dev/odin_server.cfg"]
},
{
"name": "Debug Unit Test",
"type": "debugpy",
Expand All @@ -18,6 +54,6 @@
// Enable break on exception when debugging tests (see: tests/conftest.py)
"PYTEST_RAISE": "1",
},
}
},
]
}
140 changes: 140 additions & 0 deletions dev/fp1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
[
{
"fr_setup": {
"fr_ready_cnxn": "tcp://127.0.0.1:10001",
"fr_release_cnxn": "tcp://127.0.0.1:10002"
},
"meta_endpoint": "tcp://*:10008"
},
{
"plugin": {
"load": {
"index": "eiger",
"name": "EigerProcessPlugin",
"library": "/scratch/development/odin/eiger-detector/vscode_build/lib/libEigerProcessPlugin.so"
}
}
},
{
"plugin": {
"load": {
"index": "offset",
"name": "OffsetAdjustmentPlugin",
"library": "/scratch/development/odin/odin-data/vscode_build/lib/libOffsetAdjustmentPlugin.so"
}
}
},
{
"plugin": {
"load": {
"index": "param",
"name": "ParameterAdjustmentPlugin",
"library": "/scratch/development/odin/odin-data/vscode_build/lib/libParameterAdjustmentPlugin.so"
}
}
},
{
"plugin": {
"load": {
"index": "hdf",
"name": "FileWriterPlugin",
"library": "/scratch/development/odin/odin-data/vscode_build/lib/libHdf5Plugin.so"
}
}
},
{
"plugin": {
"connect": {
"index": "eiger",
"connection": "frame_receiver"
}
}
},
{
"plugin": {
"connect": {
"index": "offset",
"connection": "eiger"
}
}
},
{
"plugin": {
"connect": {
"index": "param",
"connection": "offset"
}
}
},
{
"plugin": {
"connect": {
"index": "hdf",
"connection": "param"
}
}
},
{
"hdf": {
"dataset": {
"compressed_size": {
"datatype": "uint32",
"chunks": [1000]
}
}
}
},
{
"hdf": {
"dataset": {
"uid": {
"datatype": "uint64",
"chunks": [1000]
}
}
}
},
{
"param": {
"parameter": {
"uid": {
"adjustment": 1
}
}
}
},
{
"hdf": {
"process": {
"number": 4,
"rank": 0
}
}
},
{
"hdf": {
"file": {
"flush_error_duration": 10000,
"write_error_duration": 10000,
"close_error_duration": 10000,
"create_error_duration": 10000
}
}
},
{
"hdf": {
"file": {
"first_number": 1
}
}
},
{
"hdf": {
"dataset": {
"data": {
"indexes": true
}
}
}
}
]
75 changes: 75 additions & 0 deletions dev/log4cxx.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<!-- Output the log message to system console -->
<appender name="ApplicationConsoleAppender" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%F:%L:%n %d{HH:mm:ss,SSS} %-14c %-5p - %m%n"/>
</layout>
</appender>

<appender name="FileWriterAppender" class="org.apache.log4j.FileAppender">
<param name="file" value="OdinData.log" />
<param name="append" value="false" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%F:%L - %d{HH:mm:ss,SSS} %-14c %-5p - %m%n" />
</layout>
</appender>

<appender name="graylog" class="org.apache.log4j.net.SyslogAppender">
<param name="Facility" value="LOCAL1"/>
<param name="SyslogHost" value="graylog-log-target.diamond.ac.uk:12211"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- syslog standard RFC 5424 formatting. Unfortunately the log4cxx SyslogAppender does not do this automatically -->
<param name="ConversionPattern" value="1 %d{yyyy-MM-ddTHH:mm:ss.SSS} %X{host} %X{app} %X{pid} - [dlsdaq@32121 logger_name=&quot;%c&quot; log_level=&quot;%p&quot; thread=&quot;%X{thread}&quot; username=&quot;%X{user}&quot; file_line=&quot;%F:%L&quot; beamline=&quot;iXX&quot; detector=&quot;Eiger16M&quot;] %m%n" />
</layout>
</appender>

<!-- all of the loggers inherit settings from the root and print to stdout -->
<root>
<priority value="all" />
<appender-ref ref="ApplicationConsoleAppender" />
</root>

<!-- The FrameProcessor applications logger hierarchy -->
<logger name="FP">
<priority value="all" />
<appender-ref ref="graylog" />
</logger>
<logger name="FP.App"></logger>
<logger name="FP.FrameProcessorController"></logger>
<logger name="FP.DataBlock"></logger>
<logger name="FP.DataBlockPool"></logger>
<logger name="FP.FrameProcessorPlugin"></logger>
<logger name="FP.FileWriterPlugin"></logger>
<logger name="FP.Acquisition"></logger>
<logger name="FP.HDF5File"></logger>
<!-- Detector-specific plugins -->
<logger name="FP.EigerProcessPlugin"></logger>
<logger name="FP.ExcaliburProcessPlugin"></logger>
<logger name="FP.LATRDProcessPlugin"></logger>

<!-- The FrameReceiver applications logger hierarchy -->
<logger name="FR">
<priority value="all" />
<appender-ref ref="graylog" />
</logger>
<logger name="FR.App"></logger>
<!-- Detector-specific plugins -->
<logger name="FR.EigerFrameDecoder"></logger>
<logger name="FR.ExcaliburFrameDecoder"></logger>
<logger name="FR.LATRDDecoderPlugin"></logger>

<!-- The Eiger Detector applications logger hierarchy -->
<logger name="ED">
<priority value="all" />
<appender-ref ref="graylog" />
</logger>
<logger name="ED.UnitTest"></logger>
<logger name="ED.APP"></logger>
<logger name="ED.EigerFan"></logger>

</log4j:configuration>
17 changes: 17 additions & 0 deletions dev/odin_server.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[server]
debug_mode = 1
http_port = 8888
http_addr = 127.0.0.1
static_path = ./static
adapters = od_fps, fp

[tornado]
logging = debug

[adapter.od_fps]
module = odin_data.control.odin_data_adapter.OdinDataAdapter
endpoints = 127.0.0.1:10004
update_interval = 0.2

[adapter.fp]
module = odin_data.control.frame_processor_adapter.FrameProcessorAdapter

0 comments on commit 3e82e6f

Please sign in to comment.