# 🐳 CCP Runtime Architecture This page explains how the CCP platform executes methods inside **containerized runtimes** using a deploy/execute approach. --- ## 🧱 Base Architecture Each method runs in an **isolated container** (e.g. Docker) provided by a runtime (`ccpimage`). CCP mounts a temporary execution volume at: ``` /ccp_data/ ``` This folder is used for: - Storing downloaded input files - Writing outputs and logs - Temporary data exchange --- ## πŸ“œ Deploy and Execute Scripts Each execution involves **two sequential scripts**: ### πŸ›  Deploy Script Runs first. Used to prepare the environment: - Clones code repositories - Installs dependencies - Downloads data - Sets permissions ### πŸš€ Execute Script Runs after deploy. Used to run the actual algorithm: - Executes your script or binary - Uses data in `/ccp_data/` - Writes outputs to `/ccp_data/` Both scripts are defined in the method’s `method.json`. --- ## πŸ§ͺ Runtime Example Given this configuration: ```json "ccpimage": "python:3.9", "deploy-script": [ "git clone https://github.com/user/tool.git /src", "pip install -r /src/requirements.txt", "wget {{input_url}} -O /ccp_data/input.csv" ], "execute-script": [ "python3 /src/main.py --input /ccp_data/input.csv --output /ccp_data/result.json" ] ``` CCP will: 1. Start a `python:3.9` container 2. Run the deploy commands 3. Run the execution commands 4. Collect all `/ccp_data/*` files as output --- ## πŸ” Credentials Handling Secret values (e.g., API keys) can be passed using secure inputs (`format: Secret`). You can use them via placeholders like `{{api_key}}` inside the scripts. --- ## 🌍 Supported Runtimes CCP currently supports: - Docker images (`bash`, `python`, `jupyter`, `gdal`, `r-base`, etc.) - Custom base images via `ccpimage` parameter - Experimental: pre-bundled consolidated runtimes --- ## πŸ”— Related Pages - 🧭 [Platform architecture](./01_platform_architecture.md) - 🧱 [Deploy and execute scripts](/05_advanced_topics/02_execution_engine/04_runtimes.md) - πŸ“¦ [Method structure](../03_methods/01_internal_representation.md) - 🧩 [Intro to method development](../../04_methods_development/00_index.md) --- ## 🧩 Inputs and Placeholders Inputs defined in the method form (e.g., text, file, URL) are passed to the scripts using **placeholders** like: ```bash --input {{input_file}} --option {{threshold}} ``` At runtime, these placeholders are replaced with the actual values provided by the user. Files from inputs (workspace, URLs, uploads) are automatically downloaded or decoded into `/ccp_data/`. --- ## πŸ“‘ Metadata and Provenance During execution, CCP generates a set of **metadata files**: - `metadata_request.json`: user inputs and configuration - `metadata_jobStatus.json`: status and timestamps - `metadata_provo.xml`: provenance metadata (agents, entities, activities) These help track: - Who ran what - When and with which parameters - How outputs were generated You can inspect these files from the **execution results view** or download them for auditing and reproducibility. --- ## πŸ”— Related Pages - 🧭 [Platform architecture](./01_platform_architecture.md) - 🧱 [Deploy and execute scripts](/05_advanced_topics/02_execution_engine/04_runtimes.md) - πŸ“¦ [Method structure](/05_advanced_topics/03_methods/01_internal_representation.md) - 🧩 [Intro to method development](/04_methods_development/00_index.md)