Overview
Runners execute bash commands in different environments. Osmedeus includes Host, Docker, and SSH runners.Runner Interface
All runners implement this interface ininternal/runner/runner.go:
Steps to Add a New Runner
1. Define the Type Constant
Add tointernal/core/types.go:
2. Add Configuration (if needed)
Updateinternal/core/workflow.go:
3. Create the Runner
Createinternal/runner/mynew_runner.go:
4. Register in Factory
Updateinternal/runner/runner.go:
5. Add Validation
Updateinternal/parser/validator.go:
6. Write Tests
Createinternal/runner/mynew_runner_test.go:
Example: Kubernetes Runner
Best Practices
- Implement context cancellation - Check
ctx.Done()for graceful shutdown - Clean up resources - Always cleanup in
Cleanup()method - Handle reconnection - For remote runners, handle connection drops
- Log operations - Use structured logging for debugging
- Validate configuration - Check required fields early
- Support file transfer - Implement
CopyFromRemoteif applicable
Next Steps
- Adding Step Types - Custom step executors
- Adding Functions - Utility functions
- Runners Concept - Runner overview
