From 2fa0b2e0ad09d6e158c44b9cfd62163dd702f9c1 Mon Sep 17 00:00:00 2001 From: Eric Flumerfelt Date: Mon, 25 Aug 2025 15:29:56 -0500 Subject: [PATCH 1/3] Add in configuration for enabling the TRMonRequestor app. Still todo is data_file_checks updates --- python/integrationtest/data_classes.py | 2 ++ python/integrationtest/integrationtest_drunc.py | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/python/integrationtest/data_classes.py b/python/integrationtest/data_classes.py index 6c306e2..63a58bb 100755 --- a/python/integrationtest/data_classes.py +++ b/python/integrationtest/data_classes.py @@ -26,6 +26,7 @@ class drunc_config: dro_map_config: DROMap_config = field(default_factory=lambda: DROMap_config(1)) frame_file: str = "asset://?checksum=e96fd6efd3f98a9a3bfaba32975b476e" tpg_enabled: bool = False + trmon_app_enabled: bool = False fake_hsi_enabled: bool = False use_fakedataprod: bool = False config_db: str = "" @@ -47,3 +48,4 @@ class CreateConfigResult: log_file: str data_dirs: list[str] tpstream_data_dirs: list[str] + trmon_data_dirs: list[str] diff --git a/python/integrationtest/integrationtest_drunc.py b/python/integrationtest/integrationtest_drunc.py index 1df67e0..952c8ed 100755 --- a/python/integrationtest/integrationtest_drunc.py +++ b/python/integrationtest/integrationtest_drunc.py @@ -158,6 +158,7 @@ def create_config_files(request, tmp_path_factory): tpwriting_enabled=drunc_config.tpg_enabled, generate_segment=True, n_data_writers=drunc_config.n_data_writers, + trmon_app=drunc_config.trmon_app_enabled, ) generate_session( @@ -218,6 +219,7 @@ def apply_update(obj, substitution): # 30-Dec-2024, KAB: build up the list of directories used for writing raw and TPStream data rawdata_dirs = [] tpstream_dirs = [] + trmon_dirs = [] segment = sessionobj.segment app_list = get_segment_apps(segment) for app in app_list: @@ -238,6 +240,14 @@ def apply_update(obj, substitution): except: # not a TPStreamWriterApplication, so simply continue to the next app pass + try: + trmonapp = db.get_dal(class_name="TRMonReqApplication", uid=app) + outdir = trmonapp.data_store_params.directory_path + if outdir not in trmon_dirs: + trmon_dirs.append(outdir) + except: + # not a TPStreamWriterApplication, so simply continue to the next app + pass result = CreateConfigResult( config=drunc_config, @@ -246,6 +256,7 @@ def apply_update(obj, substitution): log_file=logfile, data_dirs=rawdata_dirs, tpstream_data_dirs=tpstream_dirs, + trmon_data_dirs=trmon_dirs ) yield result From 99ad220ab8374b0e2733d06cb1e48d3b87c5de9f Mon Sep 17 00:00:00 2001 From: Eric Flumerfelt Date: Tue, 26 Aug 2025 08:53:19 -0500 Subject: [PATCH 2/3] Track and add TRMon files to output object --- .../integrationtest/integrationtest_drunc.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/python/integrationtest/integrationtest_drunc.py b/python/integrationtest/integrationtest_drunc.py index 952c8ed..0f74da1 100755 --- a/python/integrationtest/integrationtest_drunc.py +++ b/python/integrationtest/integrationtest_drunc.py @@ -332,6 +332,8 @@ class RunResult: rawdata_paths = create_config_files.data_dirs tpset_dirs = [run_dir] tpset_paths = create_config_files.tpstream_data_dirs + trmon_dirs = [run_dir] + trmon_paths = create_config_files.trmon_data_dirs for path in rawdata_paths: rawdata_dir = pathlib.Path(path) @@ -373,6 +375,26 @@ class RunResult: if (now - modified_time) > 3600: print(f"Deleting TP data file from earlier test: {str(file_obj)}") file_obj.unlink(True) # missing is OK + for trmon_path in trmon_paths: + trmon_dir = pathlib.Path(trmon_path) + if trmon_dir not in trmon_dirs: + trmon_dirs.append(trmon_dir) + # deal with any pre-existing data files + temp_suffix = ".temp_saved" + now = time.time() + for file_obj in trmon_dir.glob( + f"{create_config_files.config.op_env}_trmon*.hdf5" + ): + print(f"Renaming TRMon data file from earlier test: {str(file_obj)}") + new_name = str(file_obj) + temp_suffix + file_obj.rename(new_name) + for file_obj in trmon_dir.glob( + f"{create_config_files.config.op_env}_trmon*.hdf5{temp_suffix}" + ): + modified_time = file_obj.stat().st_mtime + if (now - modified_time) > 3600: + print(f"Deleting TRMon data file from earlier test: {str(file_obj)}") + file_obj.unlink(True) # missing is OK print( "++++++++++ DRUNC Run BEGIN ++++++++++", flush=True @@ -420,6 +442,11 @@ class RunResult: result.tpset_files += list( tpset_dir.glob(f"{create_config_files.config.op_env}_tp_*.hdf5") ) + result.trmon_files = [] + for trmon_dir in trmon_dirs: + result.trmon_files += list( + trmon_dir.glob(f"{create_config_files.config.op_env}_trmon_*.hdf5") + ) result.log_files = list(run_dir.glob("log_*.txt")) + list(run_dir.glob("log_*.log")) result.opmon_files = list(run_dir.glob("info_*.json")) print("---------- DRUNC Run END ----------", flush=True) From fff0cc1155cc29054de3abc6f41e236e2174ba33 Mon Sep 17 00:00:00 2001 From: Marco Roda Date: Fri, 5 Sep 2025 15:36:53 +0200 Subject: [PATCH 3/3] Update version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 79efffc..39ea5ef 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = integrationtest -version = 3.4.0 +version = 3.5.0 url = https://github.com/DUNE-DAQ/integrationtest long_description = file: docs/README.md long_description_content_type = text/markdown