dlr-eoc / prosEO

prosEO – A Processing System for Earth Observation Data
GNU General Public License v3.0
14 stars 1 forks source link

Planner: Add a method to retrieve the job step dependency graph of a job #87

Closed tangobravo62 closed 3 years ago

tangobravo62 commented 4 years ago

While it is possible to deduce the dependencies between the job steps of a job from the database, it would be desirable to have a convenience method, which returns the immediate predecessors for each job step of a job, e. g. GET jobs/graph/{id} returns something like:


{
  "id": 100, // the job id
  "jobState": "STARTED",
  "jobsteps": [
    { "id": 101, "jobStepState": "RUNNING", "targetProductClass": "L1B", "predecessors": [] },
    { "id": 102, "jobStepState": "WAITING_INPUT", "targetProductClass": "CLOUD", "predecessors": [
       { "id": 101 }
      ]
    },
  [...]
  ]
}
emelchinger commented 4 years ago

This is implemented. Example of output:


  "id": 1667,
  "jobState": "STARTED",
  "jobSteps": [
    {
      "id": 1681,
      "jobStepState": "WAITING_INPUT",
      "outputProductClass": "PTM_L2B",
      "predecessors": []
    },
    {
      "id": 1668,
      "jobStepState": "WAITING_INPUT",
      "outputProductClass": "PTM_L3",
      "predecessors": [
        {
          "id": 1672
        },
        {
          "id": 1681
        }
      ]
    },
    {
      "id": 1672,
      "jobStepState": "WAITING_INPUT",
      "outputProductClass": "PTM_L2A",
      "predecessors": [
        {
          "id": 1675
        }
      ]
    },
    {
      "id": 1675,
      "jobStepState": "COMPLETED",
      "outputProductClass": "L1B_______",
      "predecessors": []
    }
  ]
}