version: v0.2.0

steps:
  # Run the loop of stress-ng sub-workflows
  stressng_loop:
    kind: foreach
    items: !expr 'bindConstants($.input.stressng_tests, $.input.pcp_params)'
    workflow: workflow-stressng.yaml
    parallelism: 1

  # Run the loop of fio sub-workflows
  fio_loop:
    kind: foreach
    items: !expr 'bindConstants($.input.fio_tests, $.input.pcp_params)'
    workflow: workflow-fio.yaml
    parallelism: 1
    # Don't start this step until after the stressng_loop step completes
    wait_for: !expr $.steps.stressng_loop.outputs

input:
  root: WorkflowInput
  objects:
    WorkflowInput:
      id: WorkflowInput
      properties:
        pcp_params:
          type:
            id: PcpInputParams
            type_id: ref
            namespace: $.steps.stressng_loop.execute.inputs.items.constant
        stressng_tests:
          type:
            type_id: list
            items:
              id: StressNGParams
              type_id: ref
              namespace: $.steps.stressng_loop.execute.inputs.items.item
        fio_tests:
          type:
            type_id: list
            items:
              id: FioInput
              type_id: ref
              namespace: $.steps.fio_loop.execute.inputs.items.item

outputs:
  success:
    stressng_workload: !expr $.steps.stressng_loop.outputs.success.data
    fio_workload: !expr $.steps.fio_loop.outputs.success.data
