|
80 | 80 | o2dpg_workflow_utils = importlib.util.module_from_spec(spec) |
81 | 81 | sys.modules[module_name] = o2dpg_workflow_utils |
82 | 82 | spec.loader.exec_module(o2dpg_workflow_utils) |
83 | | -from o2dpg_workflow_utils import createTask, dump_workflow |
| 83 | +from o2dpg_workflow_utils import createTask, dump_workflow, createGlobalInitTask |
84 | 84 |
|
85 | 85 | module_name = "o2dpg_analysis_test_utils" |
86 | 86 | spec = importlib.util.spec_from_file_location(module_name, join(O2DPG_ROOT, "MC", "analysis_testing", "o2dpg_analysis_test_utils.py")) |
@@ -322,7 +322,9 @@ def run(args): |
322 | 322 | print("ERROR: QC upload was requested, however in that case a --pass-name and --period-name are required") |
323 | 323 | return 1 |
324 | 324 |
|
325 | | - workflow = [] |
| 325 | + ### setup global environment variables which are valid for all tasks, set as first task |
| 326 | + global_env = {"ALICEO2_CCDB_CONDITION_NOT_AFTER": args.condition_not_after} if args.condition_not_after else None |
| 327 | + workflow = [createGlobalInitTask(global_env)] |
326 | 328 | add_analysis_tasks(workflow, args.input_file, expanduser(args.analysis_dir), is_mc=args.is_mc, analyses_only=args.only_analyses, autoset_converters=args.autoset_converters, include_disabled_analyses=args.include_disabled, timeout=args.timeout, collision_system=args.collision_system, add_common_args=args.add_common_args) |
327 | 329 | if args.with_qc_upload: |
328 | 330 | add_analysis_qc_upload_tasks(workflow, args.period_name, args.run_number, args.pass_name) |
@@ -350,6 +352,8 @@ def main(): |
350 | 352 | parser.add_argument("--timeout", type=int, default=None, help="Timeout for analysis tasks in seconds.") |
351 | 353 | parser.add_argument("--collision-system", dest="collision_system", help="Set the collision system. If not set, tried to be derived from ALIEN_JDL_LPMInterationType. Fallback to pp") |
352 | 354 | parser.add_argument("--add-common-args", dest="add_common_args", nargs="*", help="Pass additional common arguments per analysis, for instance --add-common-args EMCAL-shm-segment-size 2500000000 will add --shm-segment-size 2500000000 to the EMCAL analysis") |
| 355 | + parser.add_argument('--condition-not-after', dest="condition_not_after", type=int, help="only consider CCDB objects not created after this timestamp (for TimeMachine)", default=3385078236000) |
| 356 | + |
353 | 357 | parser.set_defaults(func=run) |
354 | 358 | args = parser.parse_args() |
355 | 359 | return(args.func(args)) |
|
0 commit comments