opengeospatial / ogcapi-processes

https://ogcapi.ogc.org/processes
Other
49 stars 45 forks source link

Part 4: Define which submission types for jobs are actually needed #451

Open m-mohr opened 1 month ago

m-mohr commented 1 month ago

There are so many options to get async/sync results from /jobs and /jobs/:id/results. It should probably be limited to a small subset so that there are not X options for "the same thing.

Discussion started in https://github.com/opengeospatial/ogcapi-processes/pull/437#discussion_r1796403346_

fmigneault commented 4 weeks ago

The current execution modes are:

  1. sync | jobControlOptions: execute-sync (technically OAP's default)

    • POST /jobs + Prefer: wait={seconds}: starts execution right away, responds with results 200
    • returns the results inline from the first request (no extra request required)
    • if desired, results could be retrieved again at GET /jobs/{jobId}/results
  2. async | jobControlOptions: execute-async (could be a default if supported: https://github.com/opengeospatial/ogcapi-processes/issues/449#issuecomment-2426580448)

    • POST /jobs + Prefer: respond-async: job queued immediately, responds a Job Status 201
    • starts whenever resources are available, results might be ready, but could be at a later time
    • once completed, results must be retrieved at GET /jobs/{jobId}/results
  3. create | jobControlOptions TBD (see https://github.com/opengeospatial/ogcapi-processes/issues/449#issuecomment-2426580448)
    (openEO's default)

    • POST /jobs + status: create: job is created but awaits trigger to be queued, responds Job Status 201
    • POST /jobs/{jobId}/results: places the job in queue, executes whenever resources are available (return 202?, see https://github.com/opengeospatial/ogcapi-processes/issues/461)
    • once completed, results must be retrieved at GET /jobs/{jobId}/results

https://github.com/opengeospatial/ogcapi-processes/pull/437#discussion_r1797212331 also proposed that (3) could consider whatever Prefer header at the same time as status: create, such that once triggered, sync or async could be applied.

fmigneault commented 2 weeks ago

Meeting on 2024-10-31

Suggestions:

Decisions

Still to decide/under discussion

m-mohr commented 2 weeks ago

Just wondering, we only discussed header and body parameters for the queue parameter. Could it also be a query parameter? It feels easier to use and define than a new header.

fmigneault commented 2 weeks ago

It technically could, but I'm personally not fond of POST requests using query parameters simultaneously with body contents. It adds complexity for clients and servers having to cross-check multiple places. Users are more often used to GET+query or POST+body for submitting searches/operations, so I would prefer to keep them distinct methods.

m-mohr commented 2 weeks ago

Fair enough. Header is fine, too.