🐧 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.

ccpimage bash

"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"
    }
  }
}

Input file example


πŸš€ 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