-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OGC API Deploy and Undeploy routes #28
OGC API Deploy and Undeploy routes #28
Conversation
Thanks a lot for such a contribution. I would like to say that I personally like a lot the way you implemented the new capabilities by invoking a specific service rather than integrating everything inside the ZOO-Kernel. When I tried accessing the Basic HTML UI provided with the ZOO-Project, I noticed that the server response header were wrong, meaning that the status was not properly returned. So I applied the following patch on the response_print.c file:
This solved the issue with the server response headers (maybe the Status support should also be added to the printHeaders function). When I was able to interact properly with the ZOO-Kernel, I decided to follow your instructions for deploying a service. This worked perfectly fine. Nevertheless, after having deployed the service, I was unable to get the description for this service. So, I am wondering what is the purpose of deploying a service if this service cannot be accessed through traditional operations after it has been deployed. Indeed, I was supposing that I shall be able to access the Process Description and Execute the service but it seems that there is still some missing part. Probably, a ZOO-Kernel CWL internal support which would be able to parse the CWL and produce a Process Description out of it then, a way to execute such a CWL definition from the ZOO-Kernel as a traditional ZOO-Service. I hope you can provide some clarification here. |
df26743
to
9debe03
Compare
Fix typo in zoo_loader.cgi
EPECA-697 #comment add suport for application/cwl and application/ogcapppkg+json
Support CWL as request payload using application/cwl content-type
Avoid searching for /processes and /jobs when they are not the first path requested
When an error occurs, the response is not properly returned on stdout but on stderr. Probably printed too early. Review ongoing
Add support for schema type string with CWL example Fix service total number when no service is available in the database Update securityIn python service to add user name in conf['auth_env']
Add the additional zcfg file, simply duplicated from jwt and basicAuth
Filter the services list by removing deploy/undeploy services
Add missing ades-dev_env.yaml
Make sure that the auth_env is passed into the message sent to the ZOO-Kernel-FPM Remove verbose debug messages Ensure to refresh fetched values after invoking the ensureSecured as the main conf maps opinter is dereferenced from there
Fix the Deploy/Undeploy processes when no metadb is defined
Fix typo in DeployProcess
Context:
The Core OGC API - Processes includes the following routes:
GET /processes
Lists the processes this API offers.
GET /processes/{process-id}
Returns a detailed description of a process.
POST /processes/{process-id}/execution
Executes a process (asynchronous execution will create a new job). Inputs and outputs can be specified in a JSON document that needs to be sent in the POST body.
In addition to the Core section, the OGC API - Processes series also include an extension called "OGC API - Processes - Part 2: Deploy, Replace, Undeploy (DRU)" which provides the ability to deploy, replace and undeploy processes, using an OGC Application Package definition containing the execution unit instructions for running deployed processes.
For further information please refer to https://github.com/opengeospatial/ogcapi-processes/tree/master/extensions/deploy_replace_undeploy
Proposed Changes:
In compliance with the OGC API - Processes standards, this pull-request proposes to add to the ZOO-Project the following two routes:
POST /processes
Deploys a process
-- The body of the request should be an OGC Application Package definition (CWL) containing the execution unit instructions for running deployed processes.
-- A successful execution of the operation shall be reported as a response with a HTTP status code
201
.-- The response with HTTP status code
201
SHALL include aLocation
header with the URI of the newly added processes.DELETE /processes/{process-id}
Undeploys a process
-- A successful execution of the operation shall be reported as a response with a HTTP status code
204
.The deploy and undeploy routes can be configured in the
main.cfg
file as follows:If the
deploy_service_provider
andundeploy_service_provider
are not set, the routes will returna response with HTTP status code
501 Not Implemented
and body with the following message:The pull request proposes the implementation of the routes and not of the deploy and undeploy services itself. Yet, for testing the routes two mock services have been added to the default ZOO-Project services. These mock services just perform a virtual execution but the responses are those of a successful deploy or undeploy execution.
How to use
Deploy
For deploying a process an application package is needed. This CWL format document describes the inputs and outputs of a process. For more information please refer to https://www.commonwl.org/
For this example we will use the application package of the s-expression app.
To deploy the process run the following curl command:
The default mock deploy service should return a response with a HTTP status code
201
with the following bodyand a Location header with the value
http://localhost/ogc-api/processes/myNewService
where myNewService is the process id defined in the Deploy service provider.Undeploy
204
.