Skip to content

Commit

Permalink
Merge pull request #211 from grycap/dev-slangarita
Browse files Browse the repository at this point in the history
Improve documentation of exposed service
  • Loading branch information
gmolto authored Sep 19, 2023
2 parents 7991520 + f993a74 commit 528c0c0
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/invoking.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,27 @@ The service will be listening in a URL that follows the next pattern:
https://{oscar_endpoint}/system/services/{name of service}/exposed/
```

The following FDL example shows how to expose a simple NGINX server as an OSCAR service:
Now, let's show an example of executing the [Body pose detection](https://marketplace.deep-hybrid-datacloud.eu/modules/deep-oc-posenet-tf.html) ML model of [AI4EOSC/DEEP Open Catalog](https://marketplace.deep-hybrid-datacloud.eu/). We need to have in mind several factors:

1. OSCAR endpoint. `localhost` or `https://{OSCAR_endpoint}`
2. Path resource. In this case, it is `v2/models/posenetclas/predict/`. Please do not forget the final `/`
3. Use `-k` or `--insecure` if the SSL is false.
4. Input image with the name `people.jpeg`
5. Output. It will create a `.zip` file that has the output

The following code section represents a schema of the command:

``` bash
curl {-k} -X POST https://{oscar_endpoint}/system/services/body-pose-detection-async/exposed/{path resource} -H "accept: */*" -H "Content-Type: multipart/form-data" -F "data=@{input image};type=image/png" --output {output file}
```

Finally, the complete command that works in [Local Testing](https://docs.oscar.grycap.net/local-testing/) with an image called `people.jpeg` as input and `output_posenet.zip` as output.

``` bash
curl -X POST https://localhost/system/services/body-pose-detection-async/exposed/v2/models/posenetclas/predict/ -H "accept: */*" -H "Content-Type: multipart/form-data" -F "data=@people.jpeg;type=image/png" --output output_posenet.zip
```

Another FDL example shows how to expose a simple NGINX server as an OSCAR service:

``` yaml
functions:
Expand All @@ -226,4 +245,4 @@ Two active pods of the deployment will be shown with the command `kubectl get po
``` text
oscar-svc nginx-dlp-6b9ddddbd7-cm6c9 1/1 Running 0 2m1s
oscar-svc nginx-dlp-6b9ddddbd7-f4ml6 1/1 Running 0 2m1s
```
```

0 comments on commit 528c0c0

Please sign in to comment.