Skip to content

Deploy an application on Ades v2.0

bbrauzzi edited this page Oct 21, 2022 · 4 revisions

Deploy an application

For deploying an application as a processing service on the ADES, you need the following items:

Method Path Headers Status Code
POST /{WORKSPACE_NAME}/wps3/processes
  • Accept: application/json
  • Content-Type: application/json
  • (Optional) Authorization: Bearer ***
201

Request payload body:

{
    "executionUnit": {
        "href": "{URL to CWL or to OWS context file}",
        "type": "application/cwl"
    }
}

App deploy example:

Following is an example of how to to deploy a processing service application using curl.

curl -v -L --request POST 'http://HOSTNAME:PORT/WORKSPACE_NAME/wps3/processes' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6IlJTQTEifQ.eyJhY3RpdmUiOnRydWUsImV4cCI6MTU5MzUxNTU2NSwiaWF0IjoxNTkzNTExOTY1LCJuYmYiOm51bGwsInBlcm1pc3Npb25zIjpbeyJyZXNvdXJjZV9pZCI6ImI3Y2FkZTVjLTM3MmYtNGM4Ny1iZTgyLWE3OTU2NDk4ZTcyOSIsInJlc291cmNlX3Njb3BlcyI6WyJBdXRoZW50aWNhdGVkIiwib3BlbmlkIl0sImV4cCI6MTU5MzUxNTU2NCwicGFyYW1zIjpudWxsfV0sImNsaWVudF9pZCI6IjYxY2UyOGQ1LWFhMTYtNGRkYy04NDJmLWZjYzE1OGQzMTVmYSIsInN1YiI6bnVsbCwiYXVkIjoiNjFjZTI4ZDUtYWExNi00ZGRjLTg0MmYtZmNjMTU4ZDMxNWZhIiwiaXNzIjpudWxsLCJqdGkiOm51bGwsInBjdF9jbGFpbXMiOnsiYXVkIjpbIjYxY2UyOGQ1LWFhMTYtNGRkYy04NDJmLWZjYzE1OGQzMTVmYSJdLCJzdWIiOlsiZWIzMTQyMWUtMGEyZS00OTBmLWJiYWYtMDk3MWE0ZTliNzhhIl0sInVzZXJfbmFtZSI6WyJyZGlyaWVuem8iXSwiaXNzIjpbImh0dHBzOi8vZW9lcGNhLWRldi5kZWltb3Mtc3BhY2UuY29tIl0sImV4cCI6WyIxNTkzNTE1NTY0Il0sImlhdCI6WyIxNTkzNTExOTY0Il0sIm94T3BlbklEQ29ubmVjdFZlcnNpb24iOlsib3BlbmlkY29ubmVjdC0xLjAiXX19.A8a-SL0mqmQ-tP0lGQN6QIKAcT4l2LcHoIF5avaD4Yk' \
-d "@test/sample_apps/v2/snuggs/app-deploy-body.json"

The input files used in this example are available in the snuggs sample application folder which includes:

The WORKSPACE_NAME corresponds to the user's workspace where all its deployed applications will be stored. If the workspace does not exist, it will be created automatically when the call to the WPS endpoint will be made.

⚠️ The Authorization: Bearer header value is made up for this guide. This is a JWT token containing the identity of the user deploying the application. Once integrated with the user management, the ADES deploys the applications according to the user identified

command output should be similar to

*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 80 (#0)
> POST /terradue/wps3/processes HTTP/1.1
> Host: localhost
> User-Agent: curl/7.81.0
> Accept: application/json
> Content-Type: application/json
> Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6IlJTQTEifQ.eyJhY3RpdmUiOnRydWUsImV4cCI6MTU5MzUxNTU2NSwiaWF0IjoxNTkzNTExOTY1LCJuYmYiOm51bGwsInBlcm1pc3Npb25zIjpbeyJyZXNvdXJjZV9pZCI6ImI3Y2FkZTVjLTM3MmYtNGM4Ny1iZTgyLWE3OTU2NDk4ZTcyOSIsInJlc291cmNlX3Njb3BlcyI6WyJBdXRoZW50aWNhdGVkIiwib3BlbmlkIl0sImV4cCI6MTU5MzUxNTU2NCwicGFyYW1zIjpudWxsfV0sImNsaWVudF9pZCI6IjYxY2UyOGQ1LWFhMTYtNGRkYy04NDJmLWZjYzE1OGQzMTVmYSIsInN1YiI6bnVsbCwiYXVkIjoiNjFjZTI4ZDUtYWExNi00ZGRjLTg0MmYtZmNjMTU4ZDMxNWZhIiwiaXNzIjpudWxsLCJqdGkiOm51bGwsInBjdF9jbGFpbXMiOnsiYXVkIjpbIjYxY2UyOGQ1LWFhMTYtNGRkYy04NDJmLWZjYzE1OGQzMTVmYSJdLCJzdWIiOlsiZWIzMTQyMWUtMGEyZS00OTBmLWJiYWYtMDk3MWE0ZTliNzhhIl0sInVzZXJfbmFtZSI6WyJyZGlyaWVuem8iXSwiaXNzIjpbImh0dHBzOi8vZW9lcGNhLWRldi5kZWltb3Mtc3BhY2UuY29tIl0sImV4cCI6WyIxNTkzNTE1NTY0Il0sImlhdCI6WyIxNTkzNTExOTY0Il0sIm94T3BlbklEQ29ubmVjdFZlcnNpb24iOlsib3BlbmlkY29ubmVjdC0xLjAiXX19.A8a-SL0mqmQ-tP0lGQN6QIKAcT4l2LcHoIF5avaD4Yk
> Content-Length: 153
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 201 Created
< Date: Fri, 21 Oct 2022 07:18:23 GMT
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: ZOO@ZOO-Project
< Location: /terradue/wps3/processes/snuggs-0_3_0
< 
{"id":"snuggs-0_3_0","title":"s expressions","description":"Applies s expressions to EO acquisitions","mutable":true,"version":"0.3.0","outputTransmission":["value","reference"],"jobControlOptions":["async-execute"],"links":[{"rel":"http:\/\/www.opengis.net\/def\/rel\/ogc\/1.0\/execute","type":"application\/json","title":"Execute End Point","href":"\/terradue\/wps3\/processes\/snuggs-0_3_0\/execution"}]}
* Connection #0 to host localhost left intact

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

Method Path Headers Status Code
GET /{WORKSPACE_NAME}/wps3/processes Accept: application/json 200
curl -s -L "http://HOSTNAME:PORT/WORKSPACE_NAME/wps3/processes" -H "accept: application/json"

and the output should include

[...]
{
    "processes": [
        [...]
        {
            "id": "snuggs-0_3_0",
            "title": "s expressions",
            "description": "Applies s expressions to EO acquisitions",
            "mutable": true,
            "version": "0.3.0",
            "outputTransmission": [
                "value",
                "reference"
            ],
            "jobControlOptions": [
                "async-execute"
            ],
            "links": [
                {
                    "rel": "self",
                    "type": "application/json",
                    "title": "Process Description",
                    "href": "/terradue/wps3/processes/snuggs-0_3_0"
                }
            ]
        },
        [...]
    ]
}
[...]

Now, let's ask for a more detailed description of the newly deployed processing service

Method Path Headers Status Code
GET /{WORKSPACE_NAME}/wps3/processes/snuggs-0_3_0 Accept: application/json 200
curl -s -L "http://HOSTNAME:PORT/WORKSPACE_NAME/wps3/processes/snuggs-0_3_0" -H "accept: application/json"

The web service will return a comprehensive document describing all processing service inputs and outputs as defined by our application.

{
    "id": "snuggs-0_3_0",
    "title": "s expressions",
    "description": "Applies s expressions to EO acquisitions",
    "mutable": true,
    "version": "0.3.0",
    "outputTransmission": [
        "value",
        "reference"
    ],
    "jobControlOptions": [
        "async-execute"
    ],
    "links": [
        {
            "rel": "http://www.opengis.net/def/rel/ogc/1.0/execute",
            "type": "application/json",
            "title": "Execute End Point",
            "href": "/terradue/wps3/processes/snuggs-0_3_0/execution"
        }
    ],
    "inputs": {
        "input_reference": {
            "title": "Input product reference",
            "description": "Input product reference",
            "maxOccurs": 999,
            "schema": {
                "type": "string",
                "default": "Any value"
            }
        },
        "s_expression": {
            "title": "s expression",
            "description": "s expression",
            "maxOccurs": 999,
            "schema": {
                "type": "string",
                "default": "Any value"
            }
        }
    },
    "outputs": {
        "wf_outputs": {
            "title": "wf_outputs",
            "extended-schema": {
                "oneOf": [
                    {
                        "allOf": [
                            {
                                "$ref": "http://zoo-project.org/dl/link.json"
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "enum": [
                                            "application/json"
                                        ]
                                    }
                                }
                            }
                        ]
                    },
                    {
                        "type": "object",
                        "required": [
                            "value"
                        ],
                        "properties": {
                            "value": {
                                "oneOf": [
                                    {
                                        "type": "object"
                                    }
                                ]
                            }
                        }
                    }
                ]
            },
            "schema": {
                "oneOf": [
                    {
                        "type": "object"
                    }
                ]
            }
        }
    }
}

⏭️ Our application is now deployed as a processing service, it is time to Submit a processing job to the ADES.