Skip to main content
Add custom execution environments for workflow commands.

Overview

Runners execute bash commands in different environments. Osmedeus includes Host, Docker, and SSH runners.

Runner Interface

All runners implement this interface in internal/runner/runner.go:

Steps to Add a New Runner

1. Define the Type Constant

Add to internal/core/types.go:

2. Add Configuration (if needed)

Update internal/core/workflow.go:

3. Create the Runner

Create internal/runner/mynew_runner.go:

4. Register in Factory

Update internal/runner/runner.go:

5. Add Validation

Update internal/parser/validator.go:

6. Write Tests

Create internal/runner/mynew_runner_test.go:

Example: Kubernetes Runner

Usage in workflow:

Best Practices

  1. Implement context cancellation - Check ctx.Done() for graceful shutdown
  2. Clean up resources - Always cleanup in Cleanup() method
  3. Handle reconnection - For remote runners, handle connection drops
  4. Log operations - Use structured logging for debugging
  5. Validate configuration - Check required fields early
  6. Support file transfer - Implement CopyFromRemote if applicable

Next Steps