-
Notifications
You must be signed in to change notification settings - Fork 5
Deploy an application
This section guides you through the deployment of an integrated application in the ADES. Specific pages of this guide describes the integrated application
- What is an Integrated Application 📦
- How to Integrate an Application 🛠️
We assume you have a Integrated Applicattion to be deployed. Otherwise there is a sample application we will use in this example.
When you had the ADES running, it already exposes bootstrap services:
Service Identifier | Description |
---|---|
eoepcaadesdeployprocess | Eoepca Deploy Process is a service to deploy a new application in the ADES as a processing service available. |
eoepcaadesundeployprocess | Eoepca Undeploy Process is a service to remove a previously deployed processing service available. |
GetStatus | GetStatus is a system service used to monitor the status of a job being executed and to retrieve the results when complete |
The first service eoepcaadesdeployprocess
is the embedded service that we will use to deploy our first application.
For deploying an application as a processing service on the ADES, you need the following items:
- A Common Workflow Language (CWL) file describing the application workflow with commands, inputs, outputs...
- A OGC Web Services Context Document (OWS Context) describing the application resources and referencing the previously listed CWL file
- A JSON document that will be the payload of the deployment request job specifying as input the OWS Context document.
The input files used for this guide are present in the sample application folder with
-
workflow.cwl : CWL file describing the application workflow
-
ows.xml : OWS Context file wrapping the application
-
deployment.json : data payload for the deployment request :
{ "inputs": [ { "id": "applicationPackage", "input": { "format": { "mimeType": "application/xml" }, "value": { "href": "https://catalog.terradue.com/eoepca-services/search?uid=application_vegetation_index" } } } ], "outputs": [ { "format": { "mimeType": "string", "schema": "string", "encoding": "string" }, "id": "deployResult", "transmissionMode": "value" } ], "mode": "async", "response": "raw" }
Now, we will submit the deployment job as we would do with any other processing services. Here is a shell command using curl.
curl -v -L --request POST 'https://wps-eoepca-dev.terradue.com/wps3/processes' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <apikey>' \
[email protected]
Curl command should proceed this way
> "accept: application/json" -H "Prefer: respond-async" -H "Content-Type: application/json" [email protected]
* About to connect() to localhost port 7777 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 7777 (#0)
> POST /wps3/processes/eoepcaadesdeployprocess/jobs HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:7777
> accept: application/json
> Prefer: respond-async
> Content-Type: application/json
> Content-Length: 543
>
* upload completely sent off: 543 out of 543 bytes
< HTTP/1.1 201 Created
< Date: Mon, 25 May 2020 14:11:43 GMT
< Server: Apache/2.4.6 (CentOS)
< X-Powered-By: ZOO@ZOO-Project
< Location: /watchjob/processes/eoepcaadesdeployprocess/jobs/a93616e8-9e91-11ea-a71d-0242ac110002
< Transfer-Encoding: chunked
< Content-Type: application/json;charset=UTF-8
<
* Connection #0 to host localhost left intact
So we can see a HTTP 201 Created
response that acknowledge the creation of the deployment job of our application
💡 Beware that at this level the application is not yet a processing services. The
HTTP 201 created
refers to the job that is in charge of deploying you application as a service in the ADES. If you want more information about this deployment process and the underlying operations, please refer to the ADES design document, section Services
After few seconds, the new processing service will appear in the list of available services. Let's do the the OGC API - Processes listing REST query
curl -s -L "https://wps-eoepca-dev.terradue.com/wps3/processes" -H "accept: application/json"
and the output should include
...
{
"processes": [
{
"id": "eoepcaadesundeployprocess",
"title": "Eoepca Deploy Process",
"abstract": "This method will undeploy an application encapsulated within a Docker container as a process accessible through the WPS interface.",
"version": "1.0.0",
"jobControlOptions": [
"sync-execute",
"async-execute",
"dismiss"
],
"outputTransmission": [
"value",
"reference"
],
"links": [
{
"rel": "canonical",
"type": "application/json",
"title": "Process Description",
"href": "/watchjob/processes/eoepcaadesundeployprocess/"
}
]
},
{
"id": "eoepcaadesdeployprocess",
"title": "Eoepca Deploy Process",
"abstract": "This method will deploy an application encapsulated within a Docker container as a process accessible through the WPS interface.",
"version": "1.0.0",
"jobControlOptions": [
"sync-execute",
"async-execute",
"dismiss"
],
"outputTransmission": [
"value",
"reference"
],
"links": [
{
"rel": "canonical",
"type": "application/json",
"title": "Process Description",
"href": "/watchjob/processes/eoepcaadesdeployprocess/"
}
]
},
{
"id": "GetStatus",
"title": "Produce an updated ExecuteResponse document. ",
"abstract": "Create an ExecuteResponse document from a sid (Service ID), it will use the niternal ZOO Kernel mechanisms to access the current status from a running Service and update the percentCompleted from the original backup file used by the ZOO Kernel when running a Service in background. ",
"version": "1.0.0",
"jobControlOptions": [
"sync-execute",
"async-execute",
"dismiss"
],
"outputTransmission": [
"value",
"reference"
],
"links": [
{
"rel": "canonical",
"type": "application/json",
"title": "Process Description",
"href": "/watchjob/processes/GetStatus/"
}
]
},
{
"id": "vegetation_index_",
"title": "Vegetation index",
"abstract": "Vegetation index processor",
"jobControlOptions": [
"sync-execute",
"async-execute",
"dismiss"
],
"outputTransmission": [
"value",
"reference"
],
"links": [
{
"rel": "canonical",
"type": "application/json",
"title": "Process Description",
"href": "/watchjob/processes/vegetation_index_/"
}
]
}
]
}
...
Now, let's ask for a more detailed description of the newly deployed processing service
curl -s -L "https://wps-eoepca-dev.terradue.com/wps3/processes/vegetation_index_" -H "accept: application/json"
The web service will return a comprehensive document describing all processing service inputs and outputs as defined by our application.
{
"process": {
"id": "vegetation_index_",
"title": "Vegetation index",
"abstract": "Vegetation index processor",
"jobControlOptions": [
"sync-execute",
"async-execute",
"dismiss"
],
"outputTransmission": [
"value",
"reference"
],
"links": [
{
"rel": "canonical",
"type": "application/json",
"title": "Execute End Point",
"href": "/watchjob/processes/vegetation_index_/jobs/"
}
],
"inputs": [
{
"id": "aoi",
"title": "Area of interest",
"abstract": "Area of interest in WKT",
"minOccurs": "1",
"maxOccurs": "1",
"input": {
"literalDataDomains": [
{
"dataType": {
"name": "string"
},
"valueDefinition": {
"anyValue": true
}
}
]
}
},
{
"id": "input_reference",
"title": "EO product for vegetation index",
"abstract": "EO product for vegetation index",
"minOccurs": "1",
"maxOccurs": "999",
"input": {
"formats": [
{
"default": true,
"mimeType": "application/opensearchdescription+xml"
},
{
"default": false,
"mimeType": "application/atom+xml"
},
{
"default": false,
"mimeType": "application/geo+json; profile=stac"
}
]
}
}
],
"outputs": [
{
"id": "wf_outputs",
"title": "wf_outputs",
"output": {
"formats": [
{
"default": true,
"mimeType": "application/json"
}
]
}
}
]
}
}
Our application is now deployed as a processing service, it is time to Submit a processing job to the ADES.