version: v0.2.0

steps:
  # Start the PCP data collection
  pcp:
    plugin:
      deployment_type: image
      src: quay.io/arcalot/arcaflow-plugin-pcp:0.10.0
    step: run-pcp
    input: !expr $.input.constant
    closure_wait_timeout: 60000
    # Stop the PCP data collection after the post_wait step completes
    stop_if: !expr $.steps.post_wait.outputs

  # Wait the specified milliseconds before starting the fio workload
  pre_wait:
    plugin:
      deployment_type: image
      src: quay.io/arcalot/arcaflow-plugin-utilities:0.6.0
    step: wait
    input:
      wait_time_ms: 10000
    # Don't start this step until after the pcp step has started
    wait_for: !expr $.steps.pcp.starting.started

  # Start the fio workload
  fio:
    plugin:
      deployment_type: image
      src: quay.io/arcalot/arcaflow-plugin-fio:0.4.0
    input: !expr $.input.item
    # Don't start this step until after the pre_wait has completed
    wait_for: !expr $.steps.pre_wait.outputs

  # Wait the specified milliseconds after the fio workload succeeds
  post_wait:
    plugin:
      deployment_type: image
      src: quay.io/arcalot/arcaflow-plugin-utilities:0.6.0
    step: wait
    input:
      wait_time_ms: 10000
    # Don't start this step until after the fio step completes
    wait_for: !expr $.steps.fio.outputs

input:
  root: FioInput__PcpInputParams
  objects:
    FioInput__PcpInputParams:
      id: FioInput__PcpInputParams
      properties:
        constant:
          display:
            description: The parameters for the PCP workload
            name: PCP parameters
          type:
            type_id: ref
            id: PcpInputParams
            namespace: $.steps.pcp.starting.inputs.input
        item:
          display:
            description: The parameters for the fio workload
            name: fio parameters
          type:
            type_id: ref
            id: FioInput
            namespace: $.steps.fio.starting.inputs.input
          required: true

outputs:
  success:
    test_results: !expr $.steps.fio.outputs.success
    pcp_time_series: !expr $.steps.pcp.outputs.success.pcp_output
