The PrismRunner is a local portable runner authored in Go that executes Beam pipelines on your machine. It’s designed for fast startup, comprehensive testing, and excellent debugging support.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apache/beam/llms.txt
Use this file to discover all available pages before exploring further.
Overview
PrismRunner provides:- Fast Startup: Quick pipeline execution for rapid development
- Portable: Uses the Beam FnAPI to work with all SDKs
- Local Execution: Runs on your machine for easy debugging
- Testing Focused: Enforces correctness to catch bugs early
- Modern Architecture: Built with Go’s concurrency model
When to Use PrismRunner
Best For
- Local development
- Fast iteration cycles
- Testing pipelines
- Debugging workflows
- Cross-language pipelines
- CI/CD testing
Not Suitable For
- Production workloads
- Large datasets
- Distributed processing
- Long-running jobs
- High-throughput streaming
PrismRunner is designed to eventually replace the DirectRunner for Go SDK users and provide better local testing for all SDKs.
Setup and Configuration
Installation
PrismRunner is automatically downloaded when needed by the Beam SDK:- Java
- Python
- Go
Add the Prism runner dependency:For Gradle:
Manual Installation
You can also install Prism manually:Running a Pipeline
Basic Usage
- Java
- Python
- Go
Command Line
Run with PrismRunner from the command line:PrismPipelineOptions
Configure PrismRunner with these options:Core Options
Path or URL to the Prism binary. If not set, the SDK will auto-download it.Can be:
- Local file path:
/usr/local/bin/prism - URL to binary:
https://example.com/prism - GitHub release URL: Auto-constructs download URL
Override the SDK version for downloading Prism from GitHub releases.
Enable the Prism Web UI for monitoring.Access at
http://localhost:8080 when enabled.Duration Prism waits for a new job before shutting down. Negative durations disable auto-shutdown.Valid time units:
ns, us, ms, s, m, hLog level for Prism:
debug, info, warn, or error.Features and Capabilities
Supported Transforms
- ✅ ParDo: All DoFn features
- ✅ GroupByKey: Including session windows
- ✅ CoGroupByKey: Multi-input grouping
- ✅ Combine: Lifted and unlifted
- ✅ Flatten: Multiple PCollections
- ✅ Side Inputs: All side input patterns
- ✅ Windowing: Fixed, sliding, session, global
Windowing Support
- Global windows
- Fixed windows
- Sliding windows
- Session windows
State and Timers
Splittable DoFn
PrismRunner expands Splittable DoFns:Web UI
PrismRunner includes a built-in web UI for monitoring:Accessing the UI
WhenenableWebUI is true:
- Start your pipeline with PrismRunner
- Open
http://localhost:8080in your browser - View job progress, metrics, and logs
Features
- Job status and progress
- Transform graph visualization
- Metrics and counters
- Error messages and logs
- Watermark tracking
The Web UI is particularly useful for debugging complex pipelines and understanding execution flow.
Testing with PrismRunner
PrismRunner is excellent for testing:Unit Tests
- Java
- Python
- Go
Integration Tests
PrismRunner is ideal for CI/CD integration tests:Debugging
PrismRunner provides excellent debugging support:Local Debugging
Since Prism runs locally, you can:- Set breakpoints in your DoFns
- Use your IDE’s debugger
- Inspect variables in real-time
- Step through pipeline execution
Logging
- Java
- Python
- Go
Prism Logs
Control Prism’s own logging:Portable Architecture
PrismRunner uses Beam’s portable architecture:How It Works
- Pipeline Translation: SDK translates pipeline to portable proto
- Job Submission: Prism receives the job via FnAPI
- SDK Harness: Prism launches SDK-specific workers
- Execution: Prism coordinates execution across workers
- Results: Results are returned to the client
Cross-Language Support
PrismRunner supports cross-language pipelines:Performance Considerations
PrismRunner is optimized for development, not production:- Memory: All data processed in memory
- Single Machine: No distributed execution
- Fast Startup: Quick iteration for development
- Testing Focus: Prioritizes correctness over speed
Comparison with DirectRunner
| Feature | PrismRunner | DirectRunner |
|---|---|---|
| Architecture | Portable/FnAPI | SDK-specific |
| Languages | All SDKs | Per-SDK |
| Startup Time | Fast | Fast |
| Cross-language | Yes | No |
| Web UI | Yes | No |
| State | Limited | Full |
| Maturity | Newer | Mature |
Current Limitations
- Testing Use Only: Not for production workloads
- In-Memory Only: Not suitable for large jobs
- Limited State: State and timers support is incomplete
- Single Machine: No distributed execution
- Feature Coverage: Some Beam features not yet implemented
Future Roadmap
Upcoming features:- Complete state and timers support
- Triggers and complex windowing
- Test Stream support
- Container execution for cross-language
- Better streaming support
- Performance optimizations
Best Practices
Development Workflow
-
Start with PrismRunner for development
-
Test with DirectRunner for comprehensive validation
-
Deploy with production runner
Testing Strategy
- Use PrismRunner for fast unit tests
- Use DirectRunner for thorough validation tests
- Use production runner for integration tests
CI/CD Integration
Troubleshooting
Prism binary not found
Prism binary not found
The SDK will auto-download Prism. If this fails:
- Check internet connectivity
- Manually download from GitHub releases
- Set
--prismLocationto local binary
Web UI not accessible
Web UI not accessible
- Ensure
--enableWebUI=true - Check port 8080 is not in use
- Verify firewall settings
Pipeline fails with 'feature not implemented'
Pipeline fails with 'feature not implemented'
- Check Prism’s current feature support
- Consider using DirectRunner instead
- Report the issue on GitHub
Slow execution
Slow execution
- Reduce data size for local testing
- Check for inefficient transforms
- Consider using a distributed runner for large data
Next Steps
Prism GitHub
View source and contribute
DirectRunner
Alternative local runner
Testing Guide
Learn more about testing
Cross-Language
Build multi-language pipelines