This directory contains examples that demonstrate platform-specific optimizations and cross-platform compatibility patterns. These examples help you deploy and optimize pipelines across different operating systems, environments, and deployment targets.
Cross-Platform Compatibility Testing
- Automatic platform detection and adaptation
- Platform-specific command and tool selection
- File system and path handling across platforms
- Performance and security analysis by platform
# Test compatibility across all platforms
python scripts/execution/run_pipeline.py examples/platform/cross_platform_compatibility.yaml \
-i target_platforms='["macos", "linux", "windows"]' \
-i test_mode="comprehensive"
# Quick basic compatibility test
python scripts/execution/run_pipeline.py examples/platform/cross_platform_compatibility.yaml \
-i test_mode="basic"
# Stress test for production readiness
python scripts/execution/run_pipeline.py examples/platform/cross_platform_compatibility.yaml \
-i test_mode="stress_test"Environment-Specific Deployment Optimization
- Development, CI/CD, container, cloud, edge, and production optimizations
- Resource allocation and performance tuning
- Environment-specific security and monitoring configuration
- Comprehensive deployment guides generation
# Development environment optimization
python scripts/execution/run_pipeline.py examples/platform/deployment_environments.yaml \
-i environment_type="development" \
-i optimization_focus="speed"
# Production deployment configuration
python scripts/execution/run_pipeline.py examples/platform/deployment_environments.yaml \
-i environment_type="production" \
-i resource_constraints='{"memory_limit":"16GB","cpu_limit":"8","timeout":"1800"}' \
-i optimization_focus="reliability"
# Edge computing optimization
python scripts/execution/run_pipeline.py examples/platform/deployment_environments.yaml \
-i environment_type="edge" \
-i resource_constraints='{"memory_limit":"2GB","cpu_limit":"2","timeout":"60"}' \
-i optimization_focus="memory"# Automatic platform detection
- id: detect_platform
action: generate_text
parameters:
prompt: "Detect current platform and provide system information"
model: <AUTO task="system_analysis">Platform detection model</AUTO># Platform-specific commands
command: |
{% if platform == 'windows' %}
dir /s /b *.log
{% else %}
find . -name "*.log" -type f
{% endif %}
shell: "{{ 'cmd' if platform == 'windows' else 'bash' }}"# Use forward slashes - work everywhere
path: "output/results/{{ filename }}"
create_directories: true # Handle directory creation across platforms# Adapt based on environment
max_tokens: >-
{%- if environment_type == 'edge' -%}200
{%- elif environment_type == 'development' -%}500
{%- else -%}1000
{%- endif %}# Environment-appropriate concurrency
parallel: true
max_concurrent: >-
{%- if environment_type == 'edge' -%}1
{%- elif environment_type == 'development' -%}2
{%- elif environment_type == 'production' -%}8
{%- else -%}4
{%- endif %}# Environment-optimized models
model: >-
{%- if environment_type == 'edge' -%}<AUTO quality="fast">Edge-optimized model</AUTO>
{%- elif environment_type == 'production' -%}<AUTO quality="premium">Production-quality model</AUTO>
{%- else -%}<AUTO>Balanced model selection</AUTO>
{%- endif %}# Container-specific settings
condition: "{{ environment_type == 'container' }}"
parameters:
health_check_enabled: true
graceful_shutdown_timeout: 30
resource_limits_enforced: true# Cloud-specific settings
condition: "{{ environment_type == 'cloud' }}"
parameters:
auto_scaling_enabled: true
multi_region_deployment: true
serverless_preferred: true# CI/CD-specific settings
condition: "{{ environment_type == 'ci_cd' }}"
parameters:
parallel_test_execution: true
artifact_caching: true
fast_fail_enabled: true| Feature | macOS | Linux | Windows | Notes |
|---|---|---|---|---|
| File Operations | ✅ | ✅ | ✅ | Universal support |
| Shell Commands | ✅ (bash/zsh) | ✅ (bash/sh) | ✅ (cmd/PowerShell) | Auto-detection |
| Path Handling | ✅ | ✅ | ✅ | Forward slash normalization |
| Environment Variables | ✅ | ✅ | ✅ | Cross-platform patterns |
| Package Management | Homebrew | apt/yum/pacman | Chocolatey/winget | Auto-detection |
| Python Integration | ✅ | ✅ | ✅ | Universal Python support |
| Environment | Optimization Focus | Resource Profile | Use Cases |
|---|---|---|---|
| Development | Speed, debugging | High resources | Local development, testing |
| CI/CD | Reliability, speed | Limited time | Automated testing, builds |
| Container | Efficiency, portability | Resource limits | Kubernetes, Docker |
| Cloud | Scalability, cost | Elastic resources | AWS, Azure, GCP |
| Edge | Low latency, efficiency | Constrained resources | IoT, embedded systems |
| Production | Reliability, performance | High availability | Mission-critical workloads |
| Architecture | Support Level | Notes |
|---|---|---|
| x86_64 | Full | Primary architecture |
| ARM64 | Full | Apple Silicon, ARM servers |
| ARM32 | Limited | Edge computing, IoT |
Development Environment:
- Local model preferences
- Aggressive caching
- Parallel processing where safe
- Skip non-essential validations
CI/CD Environment:
- Lightweight model selection
- Parallel test execution
- Cached dependencies
- Fast failure detection
Edge Computing:
- Minimal model footprints
- Streaming processing patterns
- Local storage optimization
- Memory-efficient algorithms
Container Deployment:
- Resource limit compliance
- Memory leak prevention
- Garbage collection tuning
- Shared resource utilization
Production Environment:
- Comprehensive error handling
- Circuit breaker patterns
- Health check implementation
- Graceful degradation
- Automated recovery
Cloud Deployment:
- Right-sizing resources
- Spot instance utilization
- Auto-scaling policies
- Serverless function optimization
- Data transfer minimization
# Platform-appropriate permissions
parameters:
file_permissions: >-
{%- if platform == 'windows' -%}
# Windows ACL handling
{%- else -%}
"644" # Unix permissions
{%- endif %}# Secure process execution
parameters:
run_as_user: "{{ 'orchestrator' if platform != 'windows' else null }}"
sandbox_enabled: true
resource_limits_enforced: true# Environment-specific network security
parameters:
tls_required: "{{ environment_type in ['production', 'cloud'] }}"
certificate_validation: strict
firewall_rules: environment_specificCross-Platform Metrics:
- Execution time by platform
- Resource utilization patterns
- Error rates by environment
- Platform-specific bottlenecks
Environment-Specific Metrics:
- Container resource usage
- Cloud cost optimization
- Edge device performance
- CI/CD pipeline efficiency
Development:
- Debug-focused alerts
- Performance degradation warnings
- Resource exhaustion notifications
Production:
- SLA breach alerts
- Security event notifications
- Auto-recovery status updates
- Capacity planning alerts
-
Platform Agnostic Design
- Use abstracted operations
- Avoid platform-specific hardcoding
- Implement feature detection
- Provide graceful fallbacks
-
Environment Awareness
- Detect deployment environment
- Adapt resource usage accordingly
- Optimize for environment constraints
- Implement environment-specific features
-
Resource Efficiency
- Monitor resource usage
- Implement appropriate limits
- Use efficient algorithms
- Optimize for target environment
-
Configuration Management
- Use environment variables
- Implement configuration layering
- Provide sensible defaults
- Support runtime configuration
-
Error Handling
- Implement platform-specific error handling
- Provide meaningful error messages
- Support graceful degradation
- Include recovery mechanisms
-
Testing Strategy
- Test on target platforms
- Validate environment configurations
- Benchmark performance characteristics
- Monitor production behavior
Path and File System Issues:
# Check path handling
python -c "import os; print('Platform:', os.name, 'Path sep:', os.sep)"
# Test file operations
python scripts/platform/test_file_operations.pyPermission Problems:
# Unix systems
chmod +x scripts/setup.sh
sudo chown -R orchestrator:orchestrator /opt/orchestrator
# Windows (run as administrator)
icacls "C:\orchestrator" /grant orchestrator:(OI)(CI)FEnvironment Detection:
# Check environment variables
python scripts/platform/check_environment.py
# Validate platform detection
python scripts/platform/detect_platform.pyMemory Constraints:
- Reduce model size for constrained environments
- Implement memory monitoring
- Use streaming processing for large data
- Configure garbage collection
CPU Limitations:
- Adjust concurrency limits
- Use efficient algorithms
- Profile CPU usage patterns
- Implement load balancing
Network Issues:
- Test connectivity to external services
- Implement retry mechanisms
- Use local caching where appropriate
- Monitor network performance
Horizontal Scaling:
- Container orchestration (Kubernetes)
- Cloud auto-scaling groups
- Load balancer configuration
- Distributed processing patterns
Vertical Scaling:
- Resource limit adjustments
- Performance tuning
- Memory optimization
- CPU efficiency improvements
Development to Production:
- Performance testing and validation
- Security configuration review
- Monitoring setup and validation
- Resource allocation optimization
- Rollback plan preparation
On-Premises to Cloud:
- Dependency mapping and validation
- Network configuration updates
- Storage migration planning
- Security policy adaptation
- Cost optimization analysis
After mastering platform examples:
- Basic Examples - Apply platform knowledge to simple patterns
- Advanced Examples - Implement sophisticated cross-platform workflows
- Integration Examples - Connect platform-optimized pipelines with external services
- Migration Examples - Plan platform-specific migration strategies