25
25
import logging
26
26
import sys
27
27
from http import HTTPStatus
28
+ from pprint import pprint
28
29
from typing import Any , Dict , Optional
29
30
30
31
from decoder .decoder import TextEncoding , decode
40
41
)
41
42
42
43
from .decoder import (
44
+ get_step_replication_param ,
43
45
get_workflow_job_input_names_for_step ,
44
46
set_step_variables ,
45
47
workflow_step_has_outputs ,
@@ -466,11 +468,13 @@ def _validate_step_command(
466
468
running_wf , _ = self ._wapi_adapter .get_running_workflow (
467
469
running_workflow_id = running_wf_id
468
470
)
469
- print ("running wf" , running_wf )
471
+ print ("running wf" )
472
+ pprint (running_wf )
470
473
workflow_id = running_wf ["workflow" ]["id" ]
471
474
workflow , _ = self ._wapi_adapter .get_workflow (workflow_id = workflow_id )
472
475
473
- print ("workflow" , workflow )
476
+ print ("workflow" )
477
+ pprint (workflow )
474
478
475
479
# for step in workflow["steps"]:
476
480
# if step["name"] in previous_step_names:
@@ -556,10 +560,14 @@ def _launch(
556
560
wf_step_data , _ = self ._wapi_adapter .get_workflow_steps_driving_this_step (
557
561
running_workflow_step_id = rwfs_id ,
558
562
)
559
- print ("wf_step_data" , wf_step_data )
563
+ print ("wf_step_data" )
564
+ pprint (wf_step_data )
560
565
assert wf_step_data ["caller_step_index" ] >= 0
561
566
our_step_index : int = wf_step_data ["caller_step_index" ]
562
567
568
+ print ("step in _launch:" , step_name )
569
+ pprint (step )
570
+
563
571
# Now check the step command can be executed
564
572
# (by trying to decoding the Job command).
565
573
#
@@ -585,11 +593,7 @@ def _launch(
585
593
variables : dict [str , Any ] = error_or_variables
586
594
print ("variables" , variables )
587
595
# find out if and by which parameter this step should be replicated
588
- replicator = ""
589
- if replicate := step .get ("replicate" , {}):
590
- if using := replicate .get ("using" , {}):
591
- # using is a dict but there can be only single value for now
592
- replicator = list (using .values ())[0 ]
596
+ replicator = get_step_replication_param (step = step )
593
597
594
598
_LOGGER .info (
595
599
"Launching step: RunningWorkflow=%s RunningWorkflowStep=%s step=%s"
@@ -634,6 +638,10 @@ def _launch(
634
638
#
635
639
# 'running_workflow_step_inputs'
636
640
# A list of Job input variable names
641
+
642
+ print ("variables" )
643
+ pprint (variables )
644
+
637
645
inputs : list [str ] = []
638
646
inputs .extend (iter (get_workflow_job_input_names_for_step (wf , step_name )))
639
647
if replicator :
@@ -645,7 +653,8 @@ def _launch(
645
653
else :
646
654
single_step_variables = [variables ]
647
655
648
- print ("single step variables" , single_step_variables )
656
+ print ("single step variables" )
657
+ pprint (single_step_variables )
649
658
650
659
for params in single_step_variables :
651
660
lp : LaunchParameters = LaunchParameters (
0 commit comments