Skip to content

Deploy an application

bbrauzzi edited this page Oct 8, 2021 · 17 revisions

This section guides you through the deployment of an Application Package in the ADES. Specific pages of this guide or the ADES design describes the application

We assume you have a Application Package to be deployed. Otherwise there is a sample application we will use in this example.

Locating Deploy/Undeploy services

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.

Submitting the application for deployment

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

The input files used for this guide are present in the sample application folder with

  • workflow.cwl : CWL file describing the application workflow
  • deployment.json : data payload for the deployment request
  • ows.xml (Optional) : OWS Context file wrapping the application

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 'http://HOSTNAME:PORT/WORKSPACE_NAME/wps3/processes' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6IlJTQTEifQ.eyJhY3RpdmUiOnRydWUsImV4cCI6MTU5MzUxNTU2NSwiaWF0IjoxNTkzNTExOTY1LCJuYmYiOm51bGwsInBlcm1pc3Npb25zIjpbeyJyZXNvdXJjZV9pZCI6ImI3Y2FkZTVjLTM3MmYtNGM4Ny1iZTgyLWE3OTU2NDk4ZTcyOSIsInJlc291cmNlX3Njb3BlcyI6WyJBdXRoZW50aWNhdGVkIiwib3BlbmlkIl0sImV4cCI6MTU5MzUxNTU2NCwicGFyYW1zIjpudWxsfV0sImNsaWVudF9pZCI6IjYxY2UyOGQ1LWFhMTYtNGRkYy04NDJmLWZjYzE1OGQzMTVmYSIsInN1YiI6bnVsbCwiYXVkIjoiNjFjZTI4ZDUtYWExNi00ZGRjLTg0MmYtZmNjMTU4ZDMxNWZhIiwiaXNzIjpudWxsLCJqdGkiOm51bGwsInBjdF9jbGFpbXMiOnsiYXVkIjpbIjYxY2UyOGQ1LWFhMTYtNGRkYy04NDJmLWZjYzE1OGQzMTVmYSJdLCJzdWIiOlsiZWIzMTQyMWUtMGEyZS00OTBmLWJiYWYtMDk3MWE0ZTliNzhhIl0sInVzZXJfbmFtZSI6WyJyZGlyaWVuem8iXSwiaXNzIjpbImh0dHBzOi8vZW9lcGNhLWRldi5kZWltb3Mtc3BhY2UuY29tIl0sImV4cCI6WyIxNTkzNTE1NTY0Il0sImlhdCI6WyIxNTkzNTExOTY0Il0sIm94T3BlbklEQ29ubmVjdFZlcnNpb24iOlsib3BlbmlkY29ubmVjdC0xLjAiXX19.A8a-SL0mqmQ-tP0lGQN6QIKAcT4l2LcHoIF5avaD4Yk' \
-T test/sample_apps/snuggs/deployment-job.json

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

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

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.