The repo is an API Implementation which conforms to the OGC Standards, specifically WPS-T.
[INSERT YOUR BADGES HERE (SEE: https://shields.io)]
This API is compliant with OGC's WPS-T specifications and implements a subset of the enpoints. We support the processes and jobs endpoints.
Link to OGC Specifications: http://docs.opengeospatial.org/per/18-050r1.html#_wps_t_restjson
The API supports the following OGC operations:
- Get Processes
- Deploy a Process
- Undeploy a Process
- Describe Process
- Execute Process
- Get Job Status
- Get Job Result
- Dismiss Job
- List Jobs by Process
This guide provides a quick way to install and get started with API.
- The
Flask
python module is required for installation. - If you want to run the API with a connection to HySDS, then make sure to have the kubernetes cluster running before hand. Refer to https://github.com/unity-sds/unity-sps-prototype/tree/main/hysds
Clone the repo and create a subdirectory for the SQLite database file.
git clone https://github.com/unity-sds/ades_wpst.git
cd ades_wpst
mkdir sqlite #to setup the local db
Be sure to satisfy the requirements list in "Requirements" section above first. Install natively as a python module with:
python setup.py install
Build the docker container:
docker build -t unity/ades-wpst-api:<tag> -f docker/Dockerfile .
For active development purposes (not releases), if you want to build container as frequent as multiple times a day, you can use the following to version containers by datetime
Run the following commands in order, every time:
export DOCKER_TAG=$(date +"%d-%m-%yT%H.%M.%S")
docker build -t unity/ades-wpst-api:$DOCKER_TAG -f docker/Dockerfile .
docker tag unity/ades-wpst-api:$DOCKER_TAG unity/ades-wpst-api:latest ;
Be sure to follow the steps in the "Get started" section above first. Run the Flask app server with:
python -m flask_ades_wpst.flask_wpst
To run the docker container without connecting to the the ADES platform:
docker run -it -p 5000:5000 -v ${PWD}/sqlite:/ades_wpst/sqlite unity/ades-wpst-api:latest
To run the docker container with the ADES platform, set the ADES_PLATFORM
environment variable to the
appropriate setting for your platform (examples: K8s, PBS, HySDS).
docker run -it -p 5000:5000 -v ${PWD}/sqlite:/ades_wpst/sqlite -e "ADES_PLATFORM=<platform>" unity/ades-wpst-api:<tag>
For the Unity prototype set it to HySDS:
docker run -it -p 5000:5000 -v ${PWD}/sqlite:/ades_wpst/sqlite -e "ADES_PLATFORM=HySDS" unity/ades-wpst-api:<tag>
To run as a Docker container, but sure to do the following in the docker run
command as shown in the examples above:
- Map the Flask application server port to the host port (
-p
option) - Mount your
sqlite
subdirectory on the host machine in to the container (-v
option) - Set the
ADES_PLATFORM
environment variable to a supported environment (e.g.,K8s
,PBS
,Generic
,HySDS
) (-e
option). If no environment variable is set, the default isGeneric
, which results in no additional actions being done on the host.
To test the API endpoints you can use the following test plan:
- Get Processes:
GET /processses
, after a new API deployment this should be empty i.e. in the response,processes
list should be empty. - Deploy a process :
POST /processses
, if response is 200 then proceed to following steps - Get Processes:
GET /processses
, expect to see the process deployed above. In the response validate that the name inprocesses[0].id
matches the proc ID from step 2. - Describe Process:
GET /processes/[procID]
- Execute Process:
POST /processes/[procID]/jobs
, submit a job with the expected input params for the process deployed in Step 2. Expect and empty response but check for the fieldlocation
for the URL to get job status in the response header. - Get Job Status:
GET /processes/[procID]/jobs/[jobID]
, use the URL found in the response header from step 5 (may need to update base URL to not point to localhost if API deployed on MCP) and perform a GET Request. Once the job status changes tosucceeded
then do Step 7. - Get Job Result:
GET /processes/[procID]/jobs/[jobID]/result
, If job had succeeded, look foroutputs
list in response. - Get Jobs by Process:
GET /processes/[procID]/jobs
, returns ajobs
list which contains the jobID, status and input parameters. - Dismiss a job:
DELETE /processes/[procID]/jobs/[jobID]
, stops a job if it's in running state, if job is still queued then it'll be deleted. Expect the same response format as Get Job Status (Step 6). The status should saydismissed
. If job state is anything other than running or accepted at the time dismiss is requested, then the API will return an error in the response sayingCan not dismiss a job in {job status} state
. - Undeploy Process:
DELETE /processes/[procID]
, perform this after you are done testing everything for the process. On successful undeployment, you'll seeundeploymentResult
in the response. To verify it's removed, you can do Get Processes (Step 3) and verify that the procID is not in the processes list.
See our CHANGELOG.md for a history of our changes.
See our [releases page]([INSERT LINK TO YOUR RELEASES PAGE]) for our key versioned releases.
No questions yet. Propose a question to be added here by reaching out to our contributors! See support section below.
Interested in contributing to our project? Please see our: CONTRIBUTING.md
See our: LICENSE
Key points of contact are: