-
Notifications
You must be signed in to change notification settings - Fork 13
Processing Parameters Extension #276 #545 #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0de6500
Jobs and services: Added `create_parameters` property in responses to…
m-mohr f03f747
Merge remote-tracking branch 'origin/draft' into processing-parameters
m-mohr e3265f7
Add processing options to a separate endpoint #276
m-mohr da3ca56
Merge branch 'draft' into processing-parameters
m-mohr 514b35b
Options should be optional
m-mohr 830f9c2
Move to an extension
m-mohr da2eefe
Add UDP extension
m-mohr 917a3fd
Apply suggestions from code review
m-mohr e9ed2bb
Renamed according to PR review
m-mohr f7b765b
Clarify where UDPs can come from
m-mohr a07ea68
Apply suggestions from code review
m-mohr a407db5
Add example
m-mohr 839ebe1
Update extensions/processing-parameters/README.md
m-mohr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| extends: "spectral:oas" | ||
| rules: | ||
| contact-properties: true | ||
| tag-description: true | ||
| oas3-parameter-description: true | ||
| oas3-unused-component: true | ||
| operation-id-kebab-case: | ||
| given: "$..operationId" | ||
| then: | ||
| function: pattern | ||
| functionOptions: | ||
| match: ^[a-z][a-z0-9\-]*$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Processing Parameters Extension | ||
|
|
||
| The Processing Parameters Extension to the openEO API provides an interface to explore and handle additional processing parameters that a back-end can offer for the three processing modes (synchronous processing, batch jobs, secondary web services). | ||
|
|
||
| - Version: **0.1.0** | ||
| - Stability: **experimental** | ||
| - [OpenAPI document](openapi.yaml) | ||
| - Conformance class: `https://api.openeo.org/extensions/processing-parameters/0.1.0` | ||
|
|
||
| **Note:** This document only documents the additions to the specification. | ||
| Extensions can not change or break existing behavior of the openEO API. | ||
|
|
||
| This extension adds a new endpoint (`GET /processing_parameters`, see [OpenAPI document](openapi.yaml)) | ||
| to discover the additional processing parameters that a back-end offers. | ||
|
|
||
| Additionally, this extension allows to provide specific default values for user-defined processes (UDPs), | ||
| which includes: | ||
|
|
||
| - UDPs submitted directly for synchronous processing, as batch jobs, or as secondary web services | ||
| - UDPs stored through the `/process_graphs` endpoints | ||
| - UDPs stored external to the API and retrieved through the [Remote Process Definition Extension](../remote-process-definition/README.md) | ||
|
|
||
| The parameters and its values are provided separately for each processing mode. | ||
|
|
||
| ## Embedding default processing options in UDPs | ||
|
|
||
| UDPs can provide default values for specific processing parameters. | ||
|
|
||
| The values for each parameter (so called 'options') are provided separately for each processing mode. | ||
| The following properties are added to the top-level of a UDP (e.g. as sibling nodes to the "process_graph" property) for the respective processing modes: | ||
|
|
||
| - `default_synchronous_options` for synchronous processing | ||
| - `default_job_options` for batch jobs | ||
| - `default_service_options` for secondary web services | ||
|
|
||
| The schema for each of these properties is: | ||
|
|
||
| ```yaml | ||
| type: object | ||
| additionalProperties: | ||
| description: Any type | ||
| ``` | ||
|
|
||
| The keys of the object are the respective parameter names. | ||
| The values of the object are the default values for the parameters. | ||
| Schematic restrictions are not defined for the object, but the schemas for the parameters as defined in `GET /processing_parameters` apply to the given values. | ||
| These values provide the defaults unless a user overrides them in the actual data processing request (e.g. `POST /jobs`, see below). | ||
|
|
||
m-mohr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Example UDP including defaults for the processing parameters `memory` and `block-sizes` of a batch job: | ||
|
|
||
| ```json | ||
| { | ||
| "id": "my_evi", | ||
| "parameters": [...], | ||
| "process_graph": {...}, | ||
| "default_job_options": { | ||
| "memory": "2GB", | ||
| "block-sizes": [128, 32] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Resolving parameters | ||
|
|
||
| Due to the variety of places where processing parameters can be provided, the following | ||
| list defines how the parameters must be resolved. The prioritization is as follows: | ||
|
|
||
| 1. If present, use the parameter specified in the processing request directly (e.g. in `POST /jobs` as a top-level property) | ||
| 2. If present, use the default parameter specified in the UDP | ||
m-mohr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 3. Otherwise, use the default value for the parameter as specified in `GET /processing_parameters` | ||
|
|
||
| "Present" means that the property is present in the JSON representation regardless of the value given, i.e. | ||
| properties are present if an empty string, an empty array, an empty object, `false`, `0`, or `null` are provided. | ||
|
|
||
| Unrecognized/unknown parameters that are provided through UDPs must be ignored by backends. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| openapi: 3.0.2 | ||
| info: | ||
| title: openEO API - Processing Parameters Extension | ||
| version: 0.1.0 | ||
| description: >- | ||
| The Processing Parameters Extension to the openEO API provides an interface to explore and handle additional processing parameters that a back-end can offer for the three processing modes (synchronous processing, batch jobs, and secondary web services). | ||
| The openEO API specification allows back-ends to accept "additional back-end specific properties" for each of the processing modes. | ||
| As the openEO API specification does not define the name and schemas of these properties, this extension provides a standardized way to define and document these properties. | ||
| contact: | ||
| name: openEO Consortium | ||
| url: 'https://openeo.org' | ||
| email: openeo.psc@uni-muenster.de | ||
| license: | ||
| name: Apache 2.0 | ||
| url: 'http://www.apache.org/licenses/LICENSE-2.0.html' | ||
| externalDocs: | ||
| url: https://github.com/Open-EO/openeo-api/blob/draft/extensions/workspaces/README.md | ||
| tags: | ||
| - name: Capabilities | ||
| description: General information about the API implementation and other supported capabilities provided by the back-end. | ||
| - name: Data Processing | ||
| description: Organizes and manages data processing on the back-end, either as synchronous on-demand computation or batch jobs. | ||
| - name: Batch Jobs | ||
| description: Management of batch processing tasks (jobs) and their results. | ||
| - name: Secondary Services | ||
| description: On-demand access to data using other web service protocols. | ||
| servers: | ||
| - url: 'https://openeo.example/api/{version}' | ||
| description: >- | ||
| The URL of the API MAY freely be chosen by the back-end providers. The | ||
| path, including API versioning, is a *recommendation* only. Nevertheless, | ||
| all servers MUST support HTTPS as the authentication methods are not | ||
| secure with HTTP only! | ||
| variables: | ||
| version: | ||
| default: v1 | ||
| description: >- | ||
| API versioning is RECOMMENDED. As the openEO API is following | ||
| [SemVer](https://semver.org/) only the MAJOR part of the stable | ||
| version numbers (i.e. versions >= 1.0.0) SHOULD be used for API | ||
| versioning in the URL. The reason is that backward-incompatible | ||
| changes are usually introduced by major changes. Therefore, the | ||
| version number in the URL MUST not be used by the clients to detect | ||
| the version number of the API. Use the version number returned from | ||
| `GET /` instead. | ||
| paths: | ||
| /processing_parameters: | ||
| get: | ||
| summary: Additional processing parameters | ||
| operationId: list-processing-parameters | ||
| description: |- | ||
| Lists additional custom processing parameters | ||
| that a back-end offers for the different processing modes (synchronous processing, batch jobs, secondary web services). | ||
| The parameters specified here can be added to the corresponding `POST` requests at the top-level of the object that is sent as the payload. | ||
| All parameters SHOULD explicitly be made optional with reasonable defaults as otherwise the interoperability between the implementations decreases. | ||
| tags: | ||
| - Capabilities | ||
| - Data Processing | ||
| - Batch Jobs | ||
| - Secondary Services | ||
| security: | ||
| - {} | ||
| - Bearer: [] | ||
| responses: | ||
| '200': | ||
| description: >- | ||
| An object with a list of parameters per processing mode. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| description: Processing parameters per processing mode. | ||
| type: object | ||
| properties: | ||
| create_job_parameters: | ||
| $ref: '#/components/schemas/processing_create_parameters' | ||
| create_service_parameters: | ||
| $ref: '#/components/schemas/processing_create_parameters' | ||
| create_synchronous_parameters: | ||
| $ref: '#/components/schemas/processing_create_parameters' | ||
| components: | ||
| schemas: | ||
| processing_create_parameters: | ||
| title: Creation Parameters | ||
| description: |- | ||
| List of additional custom parameters that a back-end offers during the creation | ||
| of batch jobs (`POST /jobs`) and secondary web services (`POST /services`) respectively. | ||
| type: array | ||
| items: | ||
| $ref: '../../openapi.yaml#/components/schemas/parameter' | ||
| example: | ||
| - name: memory | ||
| description: Maximum amount of memory that will be allocated for processing, in gigabytes. | ||
| optional: true | ||
| default: 32 | ||
| schema: | ||
| type: integer | ||
| minimum: 1 | ||
| securitySchemes: | ||
| Bearer: | ||
| $ref: '../../openapi.yaml#/components/securitySchemes/Bearer' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "name": "@openeo/api-extension-processing-parameters", | ||
| "version": "0.1.0", | ||
| "author": "openEO Consortium", | ||
| "license": "Apache-2.0", | ||
| "description": "The openEO API specification.", | ||
| "homepage": "https://openeo.org", | ||
| "bugs": { | ||
| "url": "https://github.com/Open-EO/openeo-api/issues" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/Open-EO/openeo-api.git" | ||
| }, | ||
| "devDependencies": { | ||
| "@stoplight/spectral-cli": "^6.6.0", | ||
| "redoc-cli": "^0.13.21" | ||
| }, | ||
| "scripts": { | ||
| "start": "redoc-cli serve openapi.yaml --watch --options.expandResponses \"200,201,202,203,204\" --options.pathInMiddlePanel true", | ||
| "build": "redoc-cli bundle openapi.yaml -o redoc.html --title \"openEO API - Processing Parameters Extension\" --cdn --options.expandResponses \"200,201,202,203,204\" --options.pathInMiddlePanel true", | ||
| "test": "spectral lint openapi.yaml" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.