Hello! I use cwltool as a python module and I use the factory method. But now I want also to use the provenance features and I haven’t seen any factory to do that. How I can do that? From the main function, I saw the setup provenance function. So is a factory like this one ok? For simple use case that I tried it looks ok
class FactoryWithProvenance(Factory):
"""Load CWL documents & enable Provenance for the execution"""
def __init__(self, executor: Optional[JobExecutor] = None, loading_context: Optional[LoadingContext] = None,
runtime_context: Optional[RuntimeContext] = None) -> None:
"""Easy way to load a CWL document for execution."""
super().__init__(executor, loading_context, runtime_context)
make_fs_access = self.runtime_context.make_fs_access \
if self.runtime_context.make_fs_access is not None else StdFsAccess
ro = ResearchObject(
make_fs_access("")
)
self.runtime_context.research_obj = ro
log_file_io = ro.open_log_file_for_activity(ro.engine_uuid)
prov_log_handler = logging.StreamHandler(cast(IO[str], log_file_io))
prov_log_handler.setFormatter(ProvLogFormatter())
_logger.addHandler(prov_log_handler)
_logger.debug("[provenance] Logging to %s", log_file_io)
Thank you