Skip to main content

Overview

Kapso’s deployment system is extensible. You can add custom strategies by creating a new directory under src/deployment/strategies/.

Strategy Structure

Each strategy is a directory with these files:

Step 1: Create Directory

Step 2: Implement Runner

Create runner.py with a Runner class:

Step 3: Create Configuration

Create config.yaml:

Step 4: Selector Instruction

Create selector_instruction.txt for auto-selection:

Step 5: Adapter Instruction

Create adapter_instruction.txt for code adaptation:

Environment Variables

  • MY_STRATEGY_CONFIG - Configuration path

Notes

  • Keep dependencies minimal
  • Handle errors gracefully
The strategy is auto-discovered by the registry.

Runner Base Class

Strategy Registry

Strategies are auto-registered when discovered:

Using Your Strategy

Testing Your Strategy

Example: HTTP Strategy

A strategy that deploys as an HTTP server: