From 5987eb67a93aeead45d8396a6d8712447f0c929a Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 12:56:53 +0200 Subject: [PATCH 01/17] Fix output extra character --- std-udp-recv/src/FrameStats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std-udp-recv/src/FrameStats.cpp b/std-udp-recv/src/FrameStats.cpp index 22948d1..5e09867 100644 --- a/std-udp-recv/src/FrameStats.cpp +++ b/std-udp-recv/src/FrameStats.cpp @@ -66,7 +66,7 @@ void FrameStats::print_stats() system_clock::now()).time_since_epoch().count(); // Output in InfluxDB line protocol - cout << "std_udp_recv,"; + cout << "std_udp_recv"; cout << ",detector_name=" << detector_name_; cout << ",module_id=" << module_id_; cout << " "; From 8a88a1b1da9d7c1564dc37bed3ca7d93844b764b Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 13:11:43 +0200 Subject: [PATCH 02/17] Make better error message --- core-buffer/src/RamBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-buffer/src/RamBuffer.cpp b/core-buffer/src/RamBuffer.cpp index 8b3f298..fea7407 100644 --- a/core-buffer/src/RamBuffer.cpp +++ b/core-buffer/src/RamBuffer.cpp @@ -40,7 +40,7 @@ RamBuffer::RamBuffer(const string& buffer_name, shm_fd_ = shm_open(buffer_name_.c_str(), O_RDWR | O_CREAT, 0777); if (shm_fd_ < 0) { - throw runtime_error(strerror(errno)); + throw runtime_error(string("shm_open failed: ") + strerror(errno)); } if ((ftruncate(shm_fd_, buffer_bytes_)) == -1) { From 0d0e23b507eec8c5391fa8d910425746c1d97639 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 14:07:53 +0200 Subject: [PATCH 03/17] Use stats time instead of modulo --- std-udp-sync/include/SyncStats.hpp | 4 ++-- std-udp-sync/include/sync_config.hpp | 3 --- std-udp-sync/src/SyncStats.cpp | 9 ++++++--- std-udp-sync/src/main.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/std-udp-sync/include/SyncStats.hpp b/std-udp-sync/include/SyncStats.hpp index 18b9d1d..f315bea 100644 --- a/std-udp-sync/include/SyncStats.hpp +++ b/std-udp-sync/include/SyncStats.hpp @@ -7,7 +7,7 @@ class SyncStats { const std::string detector_name_; - const size_t stats_modulo_; + const size_t stats_time_; int image_counter_; int n_sync_lost_images_; @@ -18,7 +18,7 @@ class SyncStats { public: SyncStats(const std::string &detector_name, - const size_t stats_modulo); + const size_t stats_time); void record_stats(const uint32_t n_lost_pulses); }; diff --git a/std-udp-sync/include/sync_config.hpp b/std-udp-sync/include/sync_config.hpp index 253b4e2..a66e08e 100644 --- a/std-udp-sync/include/sync_config.hpp +++ b/std-udp-sync/include/sync_config.hpp @@ -2,7 +2,4 @@ namespace sync_config { // Number of times we try to re-sync in case of failure. const int SYNC_RETRY_LIMIT = 3; - - // Number of pulses between each statistics print out. - const size_t SYNC_STATS_MODULO = 1000; } diff --git a/std-udp-sync/src/SyncStats.cpp b/std-udp-sync/src/SyncStats.cpp index e9bb76d..8b86af3 100644 --- a/std-udp-sync/src/SyncStats.cpp +++ b/std-udp-sync/src/SyncStats.cpp @@ -7,9 +7,9 @@ using namespace chrono; SyncStats::SyncStats( const std::string &detector_name, - const size_t stats_modulo) : + const size_t stats_time) : detector_name_(detector_name), - stats_modulo_(stats_modulo) + stats_time_(stats_time) { reset_counters(); } @@ -26,7 +26,10 @@ void SyncStats::record_stats(const uint32_t n_lost_pulses) image_counter_++; n_sync_lost_images_ += n_lost_pulses; - if (image_counter_ == stats_modulo_) { + const auto time_passed = duration_cast( + steady_clock::now()-stats_interval_start_).count(); + + if (time_passed >= stats_time_*1000) { print_stats(); reset_counters(); } diff --git a/std-udp-sync/src/main.cpp b/std-udp-sync/src/main.cpp index b2d5150..b782884 100644 --- a/std-udp-sync/src/main.cpp +++ b/std-udp-sync/src/main.cpp @@ -49,7 +49,7 @@ int main (int argc, char *argv[]) FRAME_N_BYTES, config.n_modules, RAM_BUFFER_N_SLOTS); ZmqPulseSyncReceiver receiver(ctx, config.detector_name, config.n_modules); - SyncStats stats(config.detector_name, SYNC_STATS_MODULO); + SyncStats stats(config.detector_name, STATS_TIME); while (true) { auto meta = receiver.get_next_pulse_id(); From 1fcbaa3fb320ce9acc4b923cc982069b8c4a48c2 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 14:19:50 +0200 Subject: [PATCH 04/17] Add manual instructions on how to start pipeline --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 3d97181..9806664 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,33 @@ ln -s "$(pwd)""/""sf_stream" /usr/bin/sf_stream ln -s "$(pwd)""/""sf_writer" /usr/bin/sf_writer ``` +### Integration testing +Apart from unit-testing an integration pipeline can be started on your local +machine or dedicated server. + +#### Manual start +To manually start the integration pipeline you will have to start the following +containers: + +UDP generators: +```bash +docker run -d --rm --net=host --name=udp-sim paulscherrerinstitute/std-daq-buffer ./std_udp_sim example_detector.json 16 +``` + +4 UDP receivers: +```bash +for i in {0..3}; do docker run --rm -d --net=host --ipc=host --shm-size=8G -v /tmp:/tmp --name=udp-recv-${i} paulscherrerinstitute/std-daq-buffer ./std_udp_recv example_detector.json ${i} 16; done +``` + +1 UDP synchronizer: +```bash +docker run -d --rm --net=host -v /tmp:/tmp --name=udp-sync paulscherrerinstitute/std-daq-buffer ./std_udp_sync example_detector.json 16 +``` + +1 Image assembler: +```bash +docker run -d --rm --net=host --name=udp-sim paulscherrerinstitute/std-daq-buffer ./std_udp_sim example_detector.json 16 +``` ### Warnings #### UDP recv tests failing @@ -112,6 +139,7 @@ problems is the rmem limit. Please increase your rmem_max to something large: ```bash echo 2147483646 > /proc/sys/net/core/rmem_max ``` +You need to do this on your host when running the integration pipeline. #### Zeromq From eb147b8f54ee56a000fc56bc30ad1a7a87a426aa Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 14:20:21 +0200 Subject: [PATCH 05/17] Temp stub for compose test env --- docker/test_env-compose.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docker/test_env-compose.yml diff --git a/docker/test_env-compose.yml b/docker/test_env-compose.yml new file mode 100644 index 0000000..78c3137 --- /dev/null +++ b/docker/test_env-compose.yml @@ -0,0 +1,32 @@ +version: "3.9" +services: + udp-recv: + image: paulscherrerinstitute/std-daq-buffer:1.0.0 + network: host + shm_size: '2gb' + container_name: ${DAQ_PROFILE}.udp-recv.${SERVICE_NAME} + command: exec + + udp-sync: + image: paulscherrerinstitute/std-daq-buffer:1.0.0 + network: host + shm_size: '2gb' + container_name: ${DAQ_PROFILE}.udp-sync.${SERVICE_NAME} + + std-assembler: + image: paulscherrerinstitute/std-daq-buffer:1.0.0 + network: host + shm_size: '2gb' + container_name: ${DAQ_PROFILE}.assembler.${SERVICE_NAME} + + std-det-writer: + image: paulscherrerinstitute/std-daq-broker:1.0.0 + network: host + shm_size: '2gb' + container_name: ${DAQ_PROFILE}.writer.${SERVICE_NAME} + + std-det-writer_agent: + image: paulscherrerinstitute/std-daq-buffer:1.0.0 + network: host + shm_size: '2gb' + container_name: ${DAQ_PROFILE}.writer_agent.${SERVICE_NAME} \ No newline at end of file From 1e461d6647630219850bcaf6e02fdf5a3bf926a2 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 14:28:27 +0200 Subject: [PATCH 06/17] Use stats time instead of n_images for statistics --- jf-assembler/include/AssemblerStats.hpp | 4 ++-- jf-assembler/src/AssemblerStats.cpp | 9 ++++++--- jf-assembler/src/main.cpp | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/jf-assembler/include/AssemblerStats.hpp b/jf-assembler/include/AssemblerStats.hpp index 170521a..6dc13fd 100644 --- a/jf-assembler/include/AssemblerStats.hpp +++ b/jf-assembler/include/AssemblerStats.hpp @@ -7,7 +7,7 @@ class AssemblerStats { const std::string detector_name_; - const size_t stats_modulo_; + const size_t stats_time_; int image_counter_; int n_corrupted_images_; @@ -19,7 +19,7 @@ class AssemblerStats { public: AssemblerStats(const std::string &detector_name, - const size_t stats_modulo); + const size_t stats_time); void record_stats(const ImageMetadata *meta, const uint32_t n_lost_pulses); }; diff --git a/jf-assembler/src/AssemblerStats.cpp b/jf-assembler/src/AssemblerStats.cpp index 15e821a..673fe4f 100644 --- a/jf-assembler/src/AssemblerStats.cpp +++ b/jf-assembler/src/AssemblerStats.cpp @@ -7,9 +7,9 @@ using namespace chrono; AssemblerStats::AssemblerStats( const std::string &detector_name, - const size_t stats_modulo) : + const size_t stats_time) : detector_name_(detector_name), - stats_modulo_(stats_modulo) + stats_time_(stats_time) { reset_counters(); } @@ -32,7 +32,10 @@ void AssemblerStats::record_stats( n_corrupted_images_++; } - if (image_counter_ == stats_modulo_) { + const auto time_passed = duration_cast( + steady_clock::now()-stats_interval_start_).count(); + + if (time_passed >= stats_time_*1000) { print_stats(); reset_counters(); } diff --git a/jf-assembler/src/main.cpp b/jf-assembler/src/main.cpp index 2d646f5..6efe04b 100644 --- a/jf-assembler/src/main.cpp +++ b/jf-assembler/src/main.cpp @@ -86,7 +86,7 @@ int main (int argc, char *argv[]) sizeof(ImageMetadata), IMAGE_N_BYTES, 1, buffer_config::RAM_BUFFER_N_SLOTS); - AssemblerStats stats(config.detector_name, ASSEMBLER_STATS_MODULO); + AssemblerStats stats(config.detector_name, STATS_TIME); uint64_t image_id = 0; From 32eab833fd69da1558cba1b639cbab427636bed5 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 14:41:58 +0200 Subject: [PATCH 07/17] Put correct pixel size --- docker/example_detector.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/example_detector.json b/docker/example_detector.json index 02b0012..afa7304 100644 --- a/docker/example_detector.json +++ b/docker/example_detector.json @@ -2,6 +2,6 @@ "detector_name": "cSAXS.EG01V01", "detector_type": "eiger", "n_modules": 4, - "image_n_pixels": 123456, + "image_n_pixels": 524288, "start_udp_port": 50000 } \ No newline at end of file From 3dd6589444594a36469d002415bd7c20e1e32fbd Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 14:43:57 +0200 Subject: [PATCH 08/17] Simulate 2x2 detector --- std-udp-recv/test/simulator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/std-udp-recv/test/simulator.cpp b/std-udp-recv/test/simulator.cpp index 078047b..a2c720f 100644 --- a/std-udp-recv/test/simulator.cpp +++ b/std-udp-recv/test/simulator.cpp @@ -63,6 +63,9 @@ int main(int argc, char **argv) { #ifdef USE_EIGER send_udp_buffer.framenum = image_id; send_udp_buffer.bunchid = image_id + 100; + + send_udp_buffer.row = i_module / 2; + send_udp_buffer.column = i_module %2; #else send_udp_buffer.framenum = image_id+100; send_udp_buffer.bunchid = image_id; From ffcc802baf57b2f85f8e0c011c62a804f4acd939 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 15:00:40 +0200 Subject: [PATCH 09/17] Fix example detector file --- docker/example_detector.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/example_detector.json b/docker/example_detector.json index afa7304..6886cd5 100644 --- a/docker/example_detector.json +++ b/docker/example_detector.json @@ -2,6 +2,6 @@ "detector_name": "cSAXS.EG01V01", "detector_type": "eiger", "n_modules": 4, - "image_n_pixels": 524288, + "image_n_pixels": 264196, "start_udp_port": 50000 } \ No newline at end of file From 6b66426fbb135b3c18d521e3cd1e25f24e19d4d2 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 15:42:08 +0200 Subject: [PATCH 10/17] Fix run script for assembler --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9806664..8139ce7 100644 --- a/README.md +++ b/README.md @@ -122,12 +122,12 @@ for i in {0..3}; do docker run --rm -d --net=host --ipc=host --shm-size=8G -v /t 1 UDP synchronizer: ```bash -docker run -d --rm --net=host -v /tmp:/tmp --name=udp-sync paulscherrerinstitute/std-daq-buffer ./std_udp_sync example_detector.json 16 +docker run -d --rm -v /tmp:/tmp --name=udp-sync paulscherrerinstitute/std-daq-buffer ./std_udp_sync example_detector.json 16 ``` 1 Image assembler: ```bash -docker run -d --rm --net=host --name=udp-sim paulscherrerinstitute/std-daq-buffer ./std_udp_sim example_detector.json 16 +docker run -d --rm --ipc=host --shm-size=8G -v /tmp:/tmp --name=image-assembler paulscherrerinstitute/std-daq-buffer ./eiger_assembler example_detector.json 16 ``` ### Warnings From 634f858549d85e99993769294c232ff4f9cf643e Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 15:42:24 +0200 Subject: [PATCH 11/17] Remove bit_depth from sync --- std-udp-sync/src/main.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/std-udp-sync/src/main.cpp b/std-udp-sync/src/main.cpp index b782884..0a7396d 100644 --- a/std-udp-sync/src/main.cpp +++ b/std-udp-sync/src/main.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include @@ -17,37 +16,24 @@ using namespace std; using namespace sync_config; using namespace buffer_config; -#ifdef USE_EIGER - #include "eiger.hpp" -#else - #include "jungfrau.hpp" -#endif - int main (int argc, char *argv[]) { - if (argc != 3) { + if (argc != 2) { cout << endl; - cout << "Usage: std_udp_sync [detector_json_filename] [bit_depth]" << endl; + cout << "Usage: std_udp_sync [detector_json_filename]" << endl; cout << "\tdetector_json_filename: detector config file path." << endl; - cout << "\tbit_depth: bit depth of the incoming udp packets." << endl; cout << endl; exit(-1); } const auto config = UdpSyncConfig::from_json_file(string(argv[1])); - const int bit_depth = atoi(argv[2]); - - const size_t FRAME_N_BYTES = MODULE_N_PIXELS * bit_depth / 8; auto ctx = zmq_ctx_new(); zmq_ctx_set(ctx, ZMQ_IO_THREADS, 1); auto sender = BufferUtils::bind_socket(ctx, config.detector_name, "sync"); - RamBuffer frame_buffer(config.detector_name, sizeof(ModuleFrame), - FRAME_N_BYTES, config.n_modules, RAM_BUFFER_N_SLOTS); - ZmqPulseSyncReceiver receiver(ctx, config.detector_name, config.n_modules); SyncStats stats(config.detector_name, STATS_TIME); From 14f5c5c6b608f21b78a8641279e4ba84c2dee2bc Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 15:49:20 +0200 Subject: [PATCH 12/17] Remove unused bit_depth in sync --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8139ce7..1fe7246 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ for i in {0..3}; do docker run --rm -d --net=host --ipc=host --shm-size=8G -v /t 1 UDP synchronizer: ```bash -docker run -d --rm -v /tmp:/tmp --name=udp-sync paulscherrerinstitute/std-daq-buffer ./std_udp_sync example_detector.json 16 +docker run -d --rm -v /tmp:/tmp --name=udp-sync paulscherrerinstitute/std-daq-buffer ./std_udp_sync example_detector.json ``` 1 Image assembler: From d573e597380bd796e94fde07e981c91e8af6132d Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 15:59:44 +0200 Subject: [PATCH 13/17] Create Eiger virtual pipeline --- docker/test_env-compose.yml | 90 +++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 28 deletions(-) diff --git a/docker/test_env-compose.yml b/docker/test_env-compose.yml index 78c3137..24bfa80 100644 --- a/docker/test_env-compose.yml +++ b/docker/test_env-compose.yml @@ -1,32 +1,66 @@ -version: "3.9" +version: "3.6" services: - udp-recv: - image: paulscherrerinstitute/std-daq-buffer:1.0.0 - network: host - shm_size: '2gb' - container_name: ${DAQ_PROFILE}.udp-recv.${SERVICE_NAME} - command: exec + udp-sim: + image: "paulscherrerinstitute/std-daq-buffer:1.0.0" + network_mode: "host" + container_name: "udp-sim" + command: ./std_udp_sim example_detector.json 16 + + udp-recv-0: + image: "paulscherrerinstitute/std-daq-buffer:1.0.0" + network_mode: "host" + ipc: "host" + shm_size: 2G + volumes: + - /tmp:/tmp + container_name: "udp-recv-0" + command: ./std_udp_recv example_detector.json 0 16 + + udp-recv-1: + image: "paulscherrerinstitute/std-daq-buffer:1.0.0" + network_mode: "host" + ipc: "host" + shm_size: 2G + volumes: + - /tmp:/tmp + container_name: "udp-recv-1" + command: ./std_udp_recv example_detector.json 1 16 + + udp-recv-2: + image: "paulscherrerinstitute/std-daq-buffer:1.0.0" + network_mode: "host" + ipc: "host" + shm_size: 2G + volumes: + - /tmp:/tmp + container_name: "udp-recv-2" + command: ./std_udp_recv example_detector.json 2 16 + + udp-recv-3: + image: "paulscherrerinstitute/std-daq-buffer:1.0.0" + network_mode: "host" + ipc: "host" + shm_size: 2G + volumes: + - /tmp:/tmp + container_name: "udp-recv-3" + command: ./std_udp_recv example_detector.json 3 16 udp-sync: - image: paulscherrerinstitute/std-daq-buffer:1.0.0 - network: host - shm_size: '2gb' - container_name: ${DAQ_PROFILE}.udp-sync.${SERVICE_NAME} + image: "paulscherrerinstitute/std-daq-buffer:1.0.0" + restart: always + network_mode: "host" + volumes: + - /tmp:/tmp + container_name: "udp-sync" + command: ./std_udp_sync example_detector.json - std-assembler: - image: paulscherrerinstitute/std-daq-buffer:1.0.0 - network: host - shm_size: '2gb' - container_name: ${DAQ_PROFILE}.assembler.${SERVICE_NAME} - - std-det-writer: - image: paulscherrerinstitute/std-daq-broker:1.0.0 - network: host - shm_size: '2gb' - container_name: ${DAQ_PROFILE}.writer.${SERVICE_NAME} - - std-det-writer_agent: - image: paulscherrerinstitute/std-daq-buffer:1.0.0 - network: host - shm_size: '2gb' - container_name: ${DAQ_PROFILE}.writer_agent.${SERVICE_NAME} \ No newline at end of file + image-assembler: + image: "paulscherrerinstitute/std-daq-buffer:1.0.0" + network_mode: "host" + ipc: "host" + shm_size: 4G + volumes: + - /tmp:/tmp + container_name: "image-assembler" + command: ./eiger_assembler example_detector.json 16 From c94d152e237668ea434847e5ccdc6a0d44d1f29b Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 16:00:00 +0200 Subject: [PATCH 14/17] Improve readme on running integration tests --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 1fe7246..59640a4 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,22 @@ ln -s "$(pwd)""/""sf_writer" /usr/bin/sf_writer Apart from unit-testing an integration pipeline can be started on your local machine or dedicated server. +You need to have RabbitMQ running locally in order to use it: +```bash +docker run -d --name sf-msg-broker -p 15672:15672 -p 5672:5672 rabbitmq:3-management +``` + +Go into the **docker/** folder and run: +```bash +docker-compose -f test_env-compose.yml up +``` + +**Note**: you need to have docker-compose installed on your system. You can do this +by running: +```bash +yum install docker-compose +``` + #### Manual start To manually start the integration pipeline you will have to start the following containers: From 979f74986e41ab2b3a763fed3310e667832c52b9 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 16:02:26 +0200 Subject: [PATCH 15/17] Make simulator accept milliseconds of delay between images --- std-udp-recv/test/simulator.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/std-udp-recv/test/simulator.cpp b/std-udp-recv/test/simulator.cpp index a2c720f..5b3de3c 100644 --- a/std-udp-recv/test/simulator.cpp +++ b/std-udp-recv/test/simulator.cpp @@ -17,18 +17,21 @@ using namespace std; int main(int argc, char **argv) { - if (argc != 3) { + if (argc != 4) { cout << endl; - cout << "Usage: std_udp_sim [detector_json_filename] [bit_depth]"; + cout << "Usage: std_udp_sim [detector_json_filename] [bit_depth] " + "[ms_delay]"; cout << endl; cout << "\tdetector_json_filename: detector config file path." << endl; cout << "\tbit_depth: bit depth of the incoming udp packets." << endl; + cout << "\tms_delay: delay in milliseconds between images." << endl; cout << endl; exit(-1); } const auto config = UdpRecvConfig::from_json_file(string(argv[1])); const int bit_depth = atoi(argv[2]); + const int ms_delay = atoi(argv[3]); if (DETECTOR_TYPE != config.detector_type) { throw runtime_error("UDP recv version for " + DETECTOR_TYPE + @@ -83,7 +86,7 @@ int main(int argc, char **argv) { cout << "Sent image_id " << image_id << endl; // 10Hz == 100ms between images - usleep(100 * 1000); + usleep(ms_delay * 1000); image_id = ++image_id % MAX_IMAGE_ID; } From 9eecacbfc8330e69f229e30be2a89f6a94e6864f Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 16:09:37 +0200 Subject: [PATCH 16/17] Put delay to generator to simulate 10Hz --- docker/test_env-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test_env-compose.yml b/docker/test_env-compose.yml index 24bfa80..45d9b91 100644 --- a/docker/test_env-compose.yml +++ b/docker/test_env-compose.yml @@ -4,7 +4,7 @@ services: image: "paulscherrerinstitute/std-daq-buffer:1.0.0" network_mode: "host" container_name: "udp-sim" - command: ./std_udp_sim example_detector.json 16 + command: ./std_udp_sim example_detector.json 16 95 udp-recv-0: image: "paulscherrerinstitute/std-daq-buffer:1.0.0" From bca2e4245893f08ef7d7b879a40b6885ff6a8700 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 19 Jul 2021 16:18:24 +0200 Subject: [PATCH 17/17] Renamed compose to integration --- README.md | 2 +- docker/{test_env-compose.yml => integration-compose.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename docker/{test_env-compose.yml => integration-compose.yml} (100%) diff --git a/README.md b/README.md index 59640a4..6f650e1 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ docker run -d --name sf-msg-broker -p 15672:15672 -p 5672:5672 rabbitmq:3-manage Go into the **docker/** folder and run: ```bash -docker-compose -f test_env-compose.yml up +docker-compose -f integration-compose.yml up ``` **Note**: you need to have docker-compose installed on your system. You can do this diff --git a/docker/test_env-compose.yml b/docker/integration-compose.yml similarity index 100% rename from docker/test_env-compose.yml rename to docker/integration-compose.yml