Skip to content

Deploy an application on Ades v1.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:

{
  "inputs": [
    {
      "id": "applicationPackage",
      "input": {
        "format": {
          "mimeType": "application/cwl"
        },
        "value": {
          "href": {URL to CWL or to OWS context file}
        }
      }
    }
  ],
  "outputs": [
    {
      "format": {
        "mimeType": "string",
        "schema": "string",
        "encoding": "string"
      },
      "id": "deployResult",
      "transmissionMode": "value"
    }
  ],
  "mode": "auto",
  "response": "raw"
}

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/v1/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...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /bob/wps3/processes HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.68.0
> Accept: application/json
> Content-Type: application/json
> Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6IlJTQTEifQ.eyJhY3RpdmUiOnRydWUsImV4cCI6MTU5MzUxNTU2NSwiaWF0IjoxNTkzNTExOTY1LCJuYmYiOm51bGwsInBlcm1pc3Npb25zIjpbeyJyZXNvdXJjZV9pZCI6ImI3Y2FkZTVjLTM3MmYtNGM4Ny1iZTgyLWE3OTU2NDk4ZTcyOSIsInJlc291cmNlX3Njb3BlcyI6WyJBdXRoZW50aWNhdGVkIiwib3BlbmlkIl0sImV4cCI6MTU5MzUxNTU2NCwicGFyYW1zIjpudWxsfV0sImNsaWVudF9pZCI6IjYxY2UyOGQ1LWFhMTYtNGRkYy04NDJmLWZjYzE1OGQzMTVmYSIsInN1YiI6bnVsbCwiYXVkIjoiNjFjZTI4ZDUtYWExNi00ZGRjLTg0MmYtZmNjMTU4ZDMxNWZhIiwiaXNzIjpudWxsLCJqdGkiOm51bGwsInBjdF9jbGFpbXMiOnsiYXVkIjpbIjYxY2UyOGQ1LWFhMTYtNGRkYy04NDJmLWZjYzE1OGQzMTVmYSJdLCJzdWIiOlsiZWIzMTQyMWUtMGEyZS00OTBmLWJiYWYtMDk3MWE0ZTliNzhhIl0sInVzZXJfbmFtZSI6WyJyZGlyaWVuem8iXSwiaXNzIjpbImh0dHBzOi8vZW9lcGNhLWRldi5kZWltb3Mtc3BhY2UuY29tIl0sImV4cCI6WyIxNTkzNTE1NTY0Il0sImlhdCI6WyIxNTkzNTExOTY0Il0sIm94T3BlbklEQ29ubmVjdFZlcnNpb24iOlsib3BlbmlkY29ubmVjdC0xLjAiXX19.A8a-SL0mqmQ-tP0lGQN6QIKAcT4l2LcHoIF5avaD4Yk
> Content-Length: 532
> Expect: 100-continue
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 201 Created 
< Date: Fri, 01 Oct 2021 16:05:54 GMT
< Server: Apache/2.4.6 (CentOS)
< X-Powered-By: ZOO@ZOO-Project
< Location: /bob/watchjob/processes/DeployProcess/jobs/74e31a4c-22d1-11ec-98f7-0242ac110004
< Transfer-Encoding: chunked
< Content-Type: application/json;charset=UTF-8
< 
* 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",
            "abstract": "Applies s expressions to EO acquisitions",
            "version": "0.3.0",
            "jobControlOptions": [
            "sync-execute",
            "async-execute",
            "dismiss"
            ],
            "outputTransmission": [
            "value",
            "reference"
            ],
            "links": [
            {
                "rel": "canonical",
                "type": "application/json",
                "title": "Process Description",
                "href": "/watchjob/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.

{
  "process": {
    "id": "snuggs-0_3_0",
    "title": "s expressions",
    "abstract": "Applies s expressions to EO acquisitions",
    "version": "0.3.0",
    "jobControlOptions": [
      "sync-execute",
      "async-execute",
      "dismiss"
    ],
    "outputTransmission": [
      "value",
      "reference"
    ],
    "links": [
      {
        "rel": "canonical",
        "type": "application/json",
        "title": "Execute End Point",
        "href": "/watchjob/processes/snuggs-0_3_0/jobs/"
      }
    ],
    "inputs": [
      {
        "id": "input_reference",
        "title": "Input product reference",
        "abstract": "Input product reference",
        "minOccurs": "1",
        "maxOccurs": "999",
        "input": {
          "literalDataDomains": [
            {
              "dataType": {
                "name": "string"
              },
              "valueDefinition": {
                "anyValue": true
              }
            }
          ]
        }
      },
      {
        "id": "s_expression",
        "title": "s expression",
        "abstract": "s expression",
        "minOccurs": "1",
        "maxOccurs": "999",
        "input": {
          "literalDataDomains": [
            {
              "dataType": {
                "name": "string"
              },
              "valueDefinition": {
                "anyValue": true
              }
            }
          ]
        }
      }
    ],
    "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.