Skip to content

3. Deploy and Undeploy operations

Spacebel sa edited this page Oct 20, 2017 · 13 revisions

Operations

The WPS Transactional Extension adds 2 operations to the existing operations: DeployProcess (register and deploy an application to the backend), and UndeployProcess (unregister and undeploy the application). It also slightly modifies the Capabilities response to include the supported Deployment Profiles.

Deploy

The DeployProcess operation is specified by the DeployProces schema. A skeleton of the request is shown below:

<wps:DeployProcess  service="WPS" version="2.0.0" xmlns:wps="http://www.opengis.net/wps/2.0" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:owc="http://www.opengis.net/owc/1.0" xmlns:eoc="http://www.opengis.net/wps/2.0/profile/tb13/eoc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <wps:ProcessOffering>
  </wps:ProcessOffering>
	<wps:DeploymentProfile>
		<wps:DeploymentProfileName>XXX</wps:DeploymentProfileName>
		<wps:ExecutionUnit>
			<wps:Reference href="YYY"/>
		</wps:ExecutionUnit>
	</wps:DeploymentProfile>
</wps:DeployProcess>

The deploy process operations includes the following elements:

  • ProcessOffering: description of the process to deploy

  • DeploymentProfile: the package or a reference to the application package. Note it also sets the Deployment Profile name, which must be implemented by the specific implementation.

Undeploy

The UndeployProcess operation is specified by the UndeployProces schema.

Examples

Deploy Request Example

<?xml version="1.0" encoding="UTF-8"?>
<wps:DeployProcess service="WPS" version="2.0.0" xmlns:wps="http://www.opengis.net/wps/2.0" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:owc="http://www.opengis.net/owc/1.0" xmlns:eoc="http://www.opengis.net/wps/2.0/profile/tb13/eoc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<wps:ProcessOffering jobControlOptions="async-execute dismiss" outputTransmission="value reference">
		<wps:Process>
			<ows:Title>Land Cover Mapping</ows:Title>
			<ows:Abstract>Lang Cover Mapping is based on the Sentinel-2 processing workflow generated for the F-TEP platform.</ows:Abstract>
			<ows:Identifier>LandCover</ows:Identifier>
			<ows:Metadata xlink:role="http://www.opengis.net//tb13/eoc/applicationContext">
				[ApplicationContent subset - see below example ]
			</ows:Metadata>
			<wps:Input>
				<ows:Title>Sentinel-2 Image</ows:Title>
				<ows:Abstract>URL of Sentinel-2 Level 1C image product in the format offered by AWS or IPT, with a size of up to multiple gigabytes.</ows:Abstract>
				<ows:Identifier>Image</ows:Identifier>
				<wps:ComplexData>
					<wps:Format mimeType="text/directory" default="true"/>
				</wps:ComplexData>
			</wps:Input>
			<wps:Input minOccurs="0">
				<ows:Title>Reference Data</ows:Title>
				<ows:Abstract>Representative training data set with land cover class attributes, in OGR vector format supported by GDAL, such as ESRI shapefile, in a flat zip structure containing .shp and the supporting files.</ows:Abstract>
				<ows:Identifier>ReferenceData</ows:Identifier>
				<wps:ComplexData>
					<wps:Format mimeType="application/zip" encoding="base64" default="true"/>
				</wps:ComplexData>
			</wps:Input>
			<wps:Input>
				<ows:Title>Area Of Interest</ows:Title>
				<ows:Identifier>AreaOfInterest</ows:Identifier>
				<wps:LiteralData>
					<!-- Not sure if WKT has a MIME type -->
					<wps:Format mimeType="text/plain" default="true"/>
					<LiteralDataDomain default="true">
						<ows:AnyValue/>
						<ows:DataType ows:reference="http://www.w3.org/2001/XMLSchema#string">String</ows:DataType>
						<ows:DefaultValue>POLYGON((-92.906633 16.190411,-92.066559 16.188383,-92.070266 15.376645,-92.907004 15.378567,-92.906633 16.190411))</ows:DefaultValue>ows:DefaultValue>
					</LiteralDataDomain>
				</wps:LiteralData>
			</wps:Input>
			<wps:Input>
				<ows:Title>EPSG Code</ows:Title>
				<ows:Abstract>Coordinate reference system expressed as a code from the EPSG database using the format "EPSG:NNNN".</ows:Abstract>
				<ows:Identifier>EPSGCode</ows:Identifier>
				<wps:LiteralData>
					<wps:Format mimeType="text/plain" default="true"/>
					<LiteralDataDomain>
						<ows:ValuesReference ows:reference="http://...."/>
						<ows:DataType ows:reference="http://www.w3.org/2001/XMLSchema#string">String</ows:DataType>
						<ows:DefaultValue>EPSG:4326</ows:DefaultValue>
					</LiteralDataDomain>
				</wps:LiteralData>
			</wps:Input>
			<wps:Input minOccurs="0">
				<ows:Title>Target Resolution</ows:Title>
				<ows:Abstract>Some description of what the target resolution means.</ows:Abstract>
				<ows:Identifier>TargetResolution</ows:Identifier>
				<wps:LiteralData>
					<wps:Format mimeType="text/plain" default="true"/>
					<LiteralDataDomain>
						<ows:AnyValue/>
						<ows:DataType ows:reference="http://www.w3.org/2001/XMLSchema#long">Long Integer</ows:DataType>
						<ows:DefaultValue>20</ows:DefaultValue>
					</LiteralDataDomain>
				</wps:LiteralData>
			</wps:Input>
			<wps:Output>
				<ows:Title>GeoTIF Image</ows:Title>
				<ows:Abstract>Labeled GeoTIF file containing, for each pixel, one of the class codes specified in the training reference data.</ows:Abstract>
				<ows:Identifier>Image_Result</ows:Identifier>
				<wps:ComplexData>
					<wps:Format mimeType="image/tiff" default="true"/>
				</wps:ComplexData>
			</wps:Output>
		</wps:Process>
	</wps:ProcessOffering>
	<wps:DeploymentProfile>
		<wps:DeploymentProfileName>http://spacebel.be/profile/docker.xsd</wps:DeploymentProfileName>
		<wps:ExecutionUnit>
			<wps:Reference href="registry.hub.docker.com/cnlspacebel/landcover"/>
		</wps:ExecutionUnit>
	</wps:DeploymentProfile>
</wps:DeployProcess>

For readability the ApplicationContext shown above was extracted from the previous document:

<eoc:ApplicationContext>
	<feed xmlns="http://www.w3.org/2005/Atom" xmlns:owc="http://www.opengis.net/owc/1.0" xml:lang="en" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2005/Atom http://www.ogcnetwork.net/schemas/atom/2005/atom.xsd">
		<title>EOC Land Cover Application Package</title>
		<subtitle type="text">Landcover EOC APP PKG</subtitle>
		<id>http://www.opengis.net/tb13/eoc/examples/app_pkg/langcover</id>
		<updated>2017-08-15T01:28:00Z</updated>
		<link rel="profile" href="http://www.opengis.net/spec/owc-atom/1.0/req/core" title="This file is compliant with version 1.0 of OGC Context"/>
		<author>
			<name>Panagiotis (Peter) A. Vretanos</name>
		</author>
		<entry>
			<title>EOC Land Cover Application</title>
			<id>http://www.opengis.net/tb13/eoc/LandCover</id>
			<updated>2017-09-04T15:23:09Z</updated>
			<content type="html">EOC Land Cover Application &lt;br/&gt; Lang Cover Mapping is based on the Sentinel-2 processing workflow generated for the F-TEP platform.</content>
			<!-- DockerImage offering -->
			<owc:offering code="http://www.opengis.net/tb13/eoc/DockerImage">
				<owc:content type="text/xml"/>
				<ows:AdditionalParameters about="http://www.opengis.net/tb13/eoc/DockerImage">
					<ows:AdditionalParameter>
						<ows:Name>eoc.reference</ows:Name>
						<ows:Value>registry.hub.docker.com/cnlspacebel/landcover</ows:Value>
					</ows:AdditionalParameter>
					<ows:AdditionalParameter>
						<ows:Name>eoc.command</ows:Name>
						<ows:Value>/home/worker/processor/workflow.sh</ows:Value>
					</ows:AdditionalParameter>
				</ows:AdditionalParameters>
			</owc:offering>
		</entry>
		<entry>
			<title>OpenSearch Collections</title>
			<id>http://www.opengis.net/tb13/eoc/OS_Collections</id>
			<updated>2017-09-04T15:23:09Z</updated>
			<content type="html">EOC OpenSearch Collections &lt;br/&gt; Lang Cover Mapping is based on the Sentinel-2 data that can be discovered using several locations.</content>
			<!-- OpenSearch offering for IPT Poland -->
			<owc:offering code="http://www.opengis.net/spec/owc-atom/1.0/req/opensearch">
				<owc:content type="application/opensearchdescription+xml" href="http://geo.spacebel.be/opensearch/description.xml?parentIdentifier=EOP%3AIPT%3ASentinel2"/>
			</owc:offering>
			<!-- OpenSearch offering for AWS -->
			<owc:offering code="http://www.opengis.net/spec/owc-atom/1.0/req/opensearch">
				<owc:content type="application/opensearchdescription+xml" href="http://geo.spacebel.be/opensearch/description.xml?parentIdentifier=EOP%3ASENTINEL-HUB%3ASentinel2"/>
			</owc:offering>
		</entry>
	</feed>
</eoc:ApplicationContext>

DeployProcess Response Example

<ns:DeployResult xmlns:ns="http://www.opengis.net/wps/2.0">
   <ns:DeploymentDone>true</ns:DeploymentDone>
</ns:DeployResult>

Execute Request Example

After deployment, the process may be executed as usual.

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute xmlns:wps="http://www.opengis.net/wps/2.0" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" service="WPS" version="2.0.0" response="document" mode="async"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ows:Identifier>LandCover</ows:Identifier>
	<wps:Input id="Image">
		<wps:Reference xlink:href="file://eodata/sentinel2/L1C/S2A_MSIL1C_20170309T163321_N0204_R083_T15PWT_20170309T164737"/>
	</wps:Input>
	<wps:Input id="ReferenceData">
		<wps:Data>VGhpcyBpcyBhIGV4YW1wbGUgb2YgYmluYXJ5IGVuY29kZWQgdGV4dA==</wps:Data>
	</wps:Input>
	<wps:Input id="AreaOfInterest">
		<wps:Data>POLYGON((-92.906633 16.190411,-92.066559 16.188383,-92.070266 15.376645,-92.907004 15.378567,-92.906633 16.190411))</wps:Data>
	</wps:Input>
	<wps:Input id="EPSGCode">
		<wps:Data>EPSG:32615</wps:Data>
	</wps:Input>
	<wps:Input id="TargetResolution">
		<wps:Data>20</wps:Data>
	</wps:Input>
	<wps:Output id="Image_Result"  transmission="value"/>
</wps:Execute>

Execute Response Example

<wps:StatusInfo xsi:schemaLocation="http://www.opengis.net/wps/2.0 http://schemas.opengis.net/wps/2.0/wps.xsd" xmlns:wps="http://www.opengis.net/wps/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <wps:JobID>a6493d14-0d1b-4c27-89ad-9ce02ebb5e6f</wps:JobID>
   <wps:Status>Accepted</wps:Status>
</wps:StatusInfo>`