methods develpment

This commit is contained in:
Alfredo Oliviero 2024-10-10 17:59:18 +02:00
parent 1216a776ae
commit f777511fbf
7 changed files with 20 additions and 40 deletions

View File

@ -6,7 +6,7 @@ Examples of this algorithms are parametric `curl` or `wget` operations on extern
## Default ccpimage for simple algorithms
To implement methods that doesn't need any particular library or configuration, we can leave empty the `ccpimage` value, to use a basic Linux Docker image.
To implement methods that doesn't need any particular library or configuration, we can insert `bash` as `ccpimage`. This instruction will select a basic Linux image.
![ccpimage bash](../_static/imgs/methods_development/input_ccpimage_bash.png)
@ -69,10 +69,8 @@ all the parameters and configurations needed for the execution of the algorithms
}
```
the "readOnly": true/false parameter defines what is binded in the definiton of the ccp method (readonly=true, only the `baseurl` input in the given example)
and what is parametric (readonly=false, or not defined in the input schema)
the example use a input file , we will see in detail how to process it in [input file](./03_1_input_file.md)
* [file upload](./03_1_input_file.md
![input file](../_static/imgs/methods_development/input_file.png)
## Execution

View File

@ -126,7 +126,7 @@ and what is parametric (readonly=false, or not defined in the input schema)
the given example uses special input parameters that will be explained in next sections
* [credentials](./03_5_credentials.md)
* [credentials](./03_4_credentials.md)
* [file upload](./03_1_input_file.md)
## Execution

View File

@ -1,14 +1,10 @@
# download public file from workspace
# Download Public File from Workspace
Authenticate the service on Keycloak, retrieve a token
then download the file using the authentication token
To retrieve a file from the workspace using its public link, you can handle it just like any [generic URL input](./03_2_input_urls.md).
![](../_static/imgs/methods_development/input_file.png)
Make sure to use the `-L` option with the `curl` command to ensure that any HTTP redirects are followed.
The input form allows to select from the user workspace files
![](../_static/imgs/methods_development/workspace_select_file.png)
method json
## Method JSON
```json
{
@ -32,7 +28,7 @@ method json
{
"name": "deploy-script",
"value": [
"./download.sh {{inputFile}}"
"curl -L {{inputFile}} -o /ccp_data/inputFile.csv"
]
},
{
@ -47,17 +43,4 @@ method json
}
```
download implementation:
the docker image contains the download script [download.sh](../support_files/download.sh]`
```sh
echo "Getting token"
TOKEN=$(curl -X POST $ccpiamurl -d grant_type=refresh_token -d client_id=$ccpclientid -d refresh_token=$ccprefreshtoken -H "X-D4Science-Context: $ccpcontext" | jq -r '."access_token"')
echo Downloading /ccp_data/inputFile.csv
curl $1 -o /ccp_data/inputFile.csv -H "Authorization: Bearer $TOKEN"
echo "Downloaded"
```
example: [Ariadne Dutch Archaeology Named Entity Recognizer](../methods_ccp/Ariadne%20Dutch%20Archaeology%20Named%20Entity%20Recognizer-1.0.0.json)
Example: [WorldCloud Urls](../methods_examples/WordCloud%20Urls-1.0.0.json)

View File

@ -1,7 +1,6 @@
# Credentials and Remote authentication
* Input of credentials in a secret input form
* Definition of an execute-script that uses the provided credentials to authenticate on an external service
The `credentials` input allows for the provision of Basic authentication credentials required to access external services. This input is configured as a `secret` field to ensure that sensitive data is handled securely during interactions with the remote service.
![credentials](../_static/imgs/methods_development/input_credentials.png)
@ -35,4 +34,3 @@
}
```
example: [Bash Example](../methods_examples/Bash%20Example-1.0.0.json)

View File

@ -1,12 +1,11 @@
# download private file from workspace
# Input: Workspace File Selection
Authenticate the service on Keycloak, retrieve a token
then download the file using the authentication token
The `workspace` input type allows users to work with their private files stored in their personal workspace. When selecting an input of type `workspace`
![Input workspace](../_static/imgs/methods_development/input_workspace.png)
![](../_static/imgs/methods_development/input_file.png)
When selecting an input of type `workspace`, the interface allows users to browse their workspace and select the desired file during method configuration.
The input form allows to select from the user workspace files
![](../_static/imgs/methods_development/workspace_select_file.png)
![workspace select file](../_static/imgs/methods_development/workspace_select_file.png)
method json
@ -48,7 +47,8 @@ method json
```
download implementation:
the docker image contains the download script [download.sh](../support_files/download.sh]`
the docker image contains the download script
The following script handles token retrieval and file download:
```sh
echo "Getting token"
@ -60,4 +60,6 @@ curl $1 -o /ccp_data/inputFile.csv -H "Authorization: Bearer $TOKEN"
echo "Downloaded"
```
It can be downloaded from the following URL: [download.sh](../_static/support_files/download.sh)
example: [Ariadne Dutch Archaeology Named Entity Recognizer](../methods_ccp/Ariadne%20Dutch%20Archaeology%20Named%20Entity%20Recognizer-1.0.0.json)

View File

@ -1,7 +1,6 @@
# Checklist
* definition of a checklist with given string set
* use of the checked params in the execute-script
The inputs of type checklist allows to define a checklist for single or multiple choise
![checklist](../_static/imgs/methods_development/input_checklist.png )