π§ Defining the Runtime Image with ccpimage
ο
The ccpimage
input defines the Docker image used to run the method.
This is required for all methods and determines the environment where your scripts or code will be executed.
You can choose:
A minimal image like
bash
A language runtime (
python:3.9
,r-base
)A custom image with preinstalled dependencies
π§ Using a Simple Bash Imageο
To define methods that only require basic Unix commands (e.g., wget
, curl
, file manipulations),
you can use bash
as the default value in the ccpimage
field.
"inputs": {
"ccpimage": {
"id": "ccpimage",
"title": "Runtime",
"description": "`bash`, a basic Unix Docker image.",
"minOccurs": 1,
"maxOccurs": 1,
"schema": {
"type": "string",
"format": "url",
"contentMediaType": "text/plain",
"default": "bash",
"readOnly": true
}
}
}
βοΈ Example: Parametric Shell Scriptο
Letβs define a method that posts an input file to a REST API using wget
.
"inputs": {
"url": {
"title": "API URL",
"schema": {
"type": "string",
"format": "url",
"default": "https://api.example.org/annotate"
}
},
"file": {
"title": "Input file",
"schema": {
"type": "string",
"format": "file"
}
}
}
π Execution Scriptsο
Your method logic is defined entirely via deploy and execute scripts:
"additionalParameters": {
"parameters": [
{
"name": "deploy-script",
"value": [
"echo {{file}} | base64 -d > /ccp_data/input"
]
},
{
"name": "execute-script",
"value": [
"wget {{url}} --post-file /ccp_data/input -O /ccp_data/annotated.json"
]
}
]
}
π Example Methodο
See the complete Bash Example