Skip to content

Commit

Permalink
Reorganize content
Browse files Browse the repository at this point in the history
Update recommendations and add Requirements in the corresponding Requirements class

Make CWL depending on OGC Application Package for not having to add another conformance class such as

Define the Requirement for w param in DRU directly to  make it easier to extent, cf. opengeospatial#386

Move workflow-not-found exception Requirement to DRU Requirements class
  • Loading branch information
gfenoy committed Jan 5, 2024
1 parent 9378b07 commit fa4fa0c
Show file tree
Hide file tree
Showing 21 changed files with 154 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
[%metadata]
label:: /rec/deploy-replace-undeploy/deploy/body-cwl
part:: If a process can be represented for the intended use as a <<rc_cwl,CWL Application>>, implementations SHOULD consider supporting the <<rc_cwl,CWL>> encoding for describing the process to be deployed to the API.
part:: The media type `application/cwl` SHALL be used to indicate that request body contains a processes description encoded as a <<rc_cwl,CWL Application>>.
part:: If the CWL contains more than one workflow, an additional `w` query parameter MAY be used to reference the workflow id to be deployed.
part:: If the `w` parameter has a value, the server SHOULD validate the CWL at the request time. If the server cannot find the `w` identifier within the workflow from the CWL provided, it SHOULD return a 400 status code with an exception having type "workflow-not-found."
part:: If a process can be encoded for the intended use in <<rc_cwl,CWL>>, implementations SHOULD consider supporting the <<rc_cwl,CWL>> encoding for describing the process to be deployed to the API.
====
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
label:: /rec/deploy-replace-undeploy/deploy/body-ogcapppkg
part:: If a process can be represented for the intended use as an <<rc_ogcapppkg,OGC Application Package>>, implementations SHOULD consider supporting the <<rc_ogcapppkg,OGC Application Package>> encoding for describing the process to be added to the API.
part:: The media type `application/ogcapppkg+json` SHALL be used to indicate that request body contains a processes description encoded as an <<rc_ogcapppkg,OGC Application Package>>.
====
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ label:: /rec/deploy-replace-undeploy/replace/body-cwl
part:: If a process can be described for the intended use as a <<rc_cwl,CWL graph>>, implementations SHOULD consider supporting the <<rc_cwl,CWL>> encoding for describing the replacement process.
part:: The media type `application/cwl` SHALL be used to indicate that request body contains a processes description encoded as <<rc_ogcapppkg,CWL>>.
====
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,5 @@
====
[%metadata]
label:: /rec/ogcapppkg/execution-unit-docker
part:: If the execution unit is a Docker image then it is recommended that the contents of the execution unit have the properties `type` and `image`.
part:: If the execution unit is specified as a Docker image, the value of the `type` property SHALL be `docker'.
part:: If the execution unit is specified as a Docker image, the value of the `image` property SHALL be a reference to the Docker image.
part:: If the execution unit is a Docker image, implementations SHOULD consider supporting the <<rc_docker,Docker Requirements class>>.
====
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,5 @@
====
[%metadata]
label:: /rec/ogcapppkg/execution-unit-cwl
part:: If the execution unit is encoded in CWL then it is recommended that the contents of the execution unit be the properties:
* `type` and `href` if passed by reference
* `value` and `mediaType` if passed by value
part:: If the execution unit is encoded in CWL, the value of the `type` property SHALL be `application/cwl`, when for `mediaType` it should be `application/cwl+json`.
part:: If the execution unit is encoded in CWL, the value of the `href` property SHALL be a reference to the CWL encoded file. The value of the `value` property shall be the CWL encoded in json format.
part:: If the CWL contains more than a single workflow identifier, an addition `w` query parameter MAY be used to target a specific workflow id to be deployed.
part:: The server SHOULD validate the CWL at the request time. In case, the server cannot find the `w` identifier within the workflow from the CWL provided, a 400 status code is expected with the type "cwl-worflow-not-exist".
part:: If the execution unit is encoded in CWL, implementations SHOULD consider supporting the <<rc_cwl,CWL Requirement class>>.
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[req_cwl_body]]
[requirement]
====
[%metadata]
label:: /req/cwl/body
part:: The media type `application/cwl` SHALL be used to indicate that request body contains a processes description encoded as <<rc_cwl,CWL>>.
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[req_cwl_execution-unit]]
[requirement]
====
[%metadata]
label:: /req/cwl/execution-unit
part:: If the execution unit is encoded in CWL then the content of the execution unit SHALL be an object with the following properties:
* `type` and `href` if passed by reference
* `value` and a `format` object with a `mediaType` property if passed by value
part:: If the execution unit is encoded in CWL, the value of the `type` property SHALL be `application/cwl`, when for `mediaType` it should be `application/cwl+json`.
part:: If the execution unit is encoded in CWL, the value of the `href` property SHALL be a reference to the CWL encoded file, when the value of the `value` property shall be the CWL encoded in JSON format.
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[req_cwl_w-param]]
[requirement]
====
[%metadata]
label:: /req/cwl/deploy/w-param
part:: If the CWL contains more than a single workflow identifier, an additional `w` query parameter MAY be used to target a specific workflow id to be deployed.
part:: If the `w` parameter has a value, the server SHALL validate the CWL at the request time. In case, the server cannot find the `w` identifier within the workflow from the CWL file provided, a 400 status code is expected and a document based upon exception.yaml with the type "worflow-not-found".
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[req_cwl_replace_body]]
[requirement]
====
[%metadata]
label:: /req/cwl/replace/body
part:: The media type `application/cwl` SHALL be used to indicate that request body contains a processes description encoded as <<rc_ogcapppkg,CWL>>.
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[req_deploy-replace-undeploy_deploy_exception-workflow-not-found]]
[requirement]
====
[%metadata]
label:: /req/deploy-replace-undeploy/deploy/exception-workflow-not-found
part:: If the `w` parameter has a value and the server cannot find the `w` identifier in the processes from the body POST request, the status code SHALL be `400`.
part:: The content of that response SHALL be based upon the schema https://raw.githubusercontent.com/opengeospatial/ogcapi-processes/master/core/openapi/schemas/exception.yaml[exception.yaml].
part:: The `type` of the exception SHALL be “http://www.opengis.net/def/exceptions/ogcapi-processes-2/1.0/workflow-not-found”.
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[req_deploy-replace-undeploy_deploy_w-param]]
[requirement]
====
[%metadata]
label:: /req/deploy-replace-undeploy/deploy/w-param
part:: If the body of the POST request contains more than a single process definition, an additional `w` query parameter MAY be used to target a specific process to be deployed. If not used, the first process found SHALL be deployed.
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[req_docker_execution-unit]]
[requirement]
====
[%metadata]
label:: /req/docker/execution-unit
part:: If the execution unit is specified as a Docker image, the value of the `type` property SHALL be `docker'.
part:: If the execution unit is specified as a Docker image, the value of the `image` property SHALL be a reference to the Docker image.
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[req_docker_schema]]
[requirement]
====
[%metadata]
label:: /req/docker/schema
part:: The `executionUnit` property of an `OGC Application Package` document SHALL be based upon the schema https://github.com/opengeospatial/ogcapi-processes/blob/master/openapi/schemas/processes-dru/executionUnit.yaml[executionUnit.yaml].
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[req_ogcappkg_body]]
[requirement]
====
[%metadata]
label:: /req/ogcapppkg/body
part:: The media type `application/ogcapppkg+json` SHALL be used to indicate that request body contains a processes description encoded as an <<rc_ogcapppkg,OGC Application Package>>.
====
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
====
[%metadata]
label:: /req/ogcapppkg/process-description
part:: The value of the processDescription property SHALL be based upon the OpenAPI 3.0 schema https://github.com/opengeospatial/ogcapi-processes/blob/master/openapi/schemas/processes-core/process.yaml[process.yaml].
part:: The value of the processDescription property SHALL be based upon the OpenAPI schema https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/schemas/process.yaml[process.yaml].
====
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
====
[%metadata]
label:: /req/ogcapppkg/schema
part:: An `OGC Application Package` document SHALL be based upon the schema http://schemas.opengis.net/ogcapi/processes/part2/1.0/openapi/schemas/ogcapppkg.yaml[ogcapppkg.yaml].
part:: An `OGC Application Package` document SHALL be based upon the OpenAPI schema http://schemas.opengis.net/ogcapi/processes/part2/1.0/openapi/schemas/ogcapppkg.yaml[ogcapppkg.yaml].
====
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ obligation:: requirement
subject:: Web API
inherit:: <<OAProc-1,OGC API - Processes - Part 1: Core>>
inherit:: <<rc_deploy-replace-undeploy,http://www.opengis.net/spec/ogcapi-processes-2/1.0/req/deploy-replace-undeploy>>
inherit:: <<rc_ogcapppkg,http://www.opengis.net/spec/ogcapi-processes-2/1.0/req/ogcapppkg>>
inherit:: Common Workflow Language <<Common_Workflow_Language>>
====
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

include::../requirements/requirements_class_deploy-replace-undeploy.adoc[]

A server that implements the DRU requirements class provides the ability to
A server that implements the DRU Requirements Class provides the ability to
dynamically deploy, replace and undeploy processes.

The HTTP POST method is used to deploy a new process to the API.
Expand Down Expand Up @@ -127,6 +127,8 @@ include::../requirements/deploy-replace-undeploy/deploy/REQ_body.adoc[]

include::../recommendations/deploy-replace-undeploy/deploy/PER_body.adoc[]

include::../requirements/deploy-replace-undeploy/deploy/REQ_w-param.adoc[]

include::../requirements/deploy-replace-undeploy/deploy/REQ_content-type.adoc[]

See https://www.rfc-editor.org/rfc/rfc7231#section-3.1.1.5[section 3.1.1.5 of RFC 7231] for details.
Expand Down Expand Up @@ -157,6 +159,8 @@ include::../requirements/deploy-replace-undeploy/deploy/REQ_response-duplicate.a

include::../requirements/deploy-replace-undeploy/deploy/REQ_response-immutable.adoc[]

include::../requirements/deploy-replace-undeploy/deploy/REQ_exception-workflow-not-found.adoc[]

[[replace]]
=== Replacing an existing processes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ The information contained in an `OGC Application Package` can include:
* Either an inline or by reference execution unit which is the `code` that the server needs to execute whenever the process is invoked.
* Additional resource information required by the execution unit.

=== Deploy and Replace

When using OGC Application Package encoding to communicate with a Processes Part 2 server, the following Requirement applies.

include::../requirements/ogcapppkg/REQ_body.adoc[]

=== OGC Application Package schema

==== Overview
Expand All @@ -42,25 +48,11 @@ include::../requirements/ogcapppkg/REQ_process-description.adoc[]
==== executionUnit property

The execution unit is the `code` that an implementation of the Part 2 extension needs
to execute whenever the deployed process is executed. The execution unit can be
specified by reference, e.g. Docker image reference.
to execute whenever the deployed process is executed.

include::../recommendations/ogcapppkg/REC_execution-unit-docker.adoc[]
If the schema defined for the executionUnit property of an OGC Application Package remains open, it may be refined in other Requirements.

When CWL encoding is used,
the execution unit can be either passed by value (in-line) or by reference.
include::../recommendations/ogcapppkg/REC_execution-unit-docker.adoc[]

include::../recommendations/ogcapppkg/REC_ogcapppkg_execution-unit-cwl.adoc[]

Below is an example of a deploy body request using a CWL-encoded execution unit by reference.

[[example1]]
[source%unnumbered]
----
{
"executionUnit": {
"href": "https://raw.githubusercontent.com/EOEPCA/app-snuggs/main/app-package.cwl",
"type": "application/cwl"
}
}
----
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,21 @@ include::../requirements/requirements_class_docker.adoc[]

A server that implements the Docker Requirement Class supports the management of Docker image as execution units by implementing the Processes API Part2 deploy-replace-undeploy extension.

In consequence, the following recommandation becomes requirement:
=== Execution unit

* <<rec_ogcapppkg_execution-unit-docker,/rec/deploy-replace-undeploy/ogcapppkg/execution-unit-docker>>
==== Overview

include::../requirements/docker/REQ_schema.adoc[]

[[schema_executionUnit]]
.link:https://github.com/opengeospatial/ogcapi-processes/blob/master/openapi/schemas/processes-dru/executionUnit.yaml[Schema for the Docker execution unit parameter]
[source,yaml]
----
include::../../../../openapi/schemas/processes-dru/executionUnit.yaml[]
----

==== type and image properties

The execution unit can be specified by reference, using a Docker image reference.

include::../requirements/docker/REQ_execution-unit.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,43 @@ include::../requirements/requirements_class_cwl.adoc[]

A server that implements the CWL Requirement Class SHALL support the use of CWL encoding when interacting with the Processes API Part 2 deploy-replace-undeploy extension endpoint.

In consequence, the following recommandations defined in <<rec_deploy-replace-undeploy_deploy_body-cwl>>, <<rec_deploy-replace-undeploy_replace_body-cwl>> and <<rec_ogcapppkg_execution-unit-cwl>> become requirements:
=== Execution Unit

* <<rec_deploy-replace-undeploy_deploy_body-cwl,/rec/deploy-replace-undeploy/deploy/body-cwl>>
* <<rec_deploy-replace-undeploy_replace_body-cwl,/rec/deploy-replace-undeploy/replace/body-cwl>>
* <<rec_ogcapppkg_execution-unit-cwl,/rec/ogcapppkg/execution-unit-cwl>>
In case the OGC Application Package encoding is used, the following Requirement applies.

include::../requirements/cwl/REQ_execution-unit.adoc[]

Below is an example of a deploy body request using a CWL-encoded execution unit by reference.

[[cwl_ogcapppkg_example1]]
[source%unnumbered]
----
{
"executionUnit": {
"href": "https://raw.githubusercontent.com/EOEPCA/app-snuggs/main/app-package.cwl",
"type": "application/cwl"
}
}
----

Below is an example of a deploy body request using a CWL-encoded execution unit by value. The value is not included for readability and results from converting from the original CWL format (YAML) into JSON.

[[cwl_ogcapppkg_example2]]
[source%unnumbered]
----
{
"executionUnit": {
"value": { ... },
"format": {
"mediaType": "application/cwl+json"
}
}
}
----


=== Deploy and Replace

When using CWL encoding to communicate with a Processes Part 2 server, the following Requirement applies.

include::../requirements/cwl/REQ_body.adoc[]

0 comments on commit fa4fa0c

Please sign in to comment.