You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Execution and Partition-Level Environment Variables (#4801)
This PR introduces two key features:
## 1. Enhanced Execution Environment Variables
Added support for passing rich job metadata to execution engines via
environment variables including:
- `BACALHAU_PARTITION_INDEX`: Current partition index (0 to N-1)
- `BACALHAU_PARTITION_COUNT`: Total number of partitions
- `BACALHAU_JOB_ID`: Unique job identifier
- `BACALHAU_JOB_NAME`: User-provided job name
- `BACALHAU_JOB_NAMESPACE`: Job namespace
- `BACALHAU_JOB_TYPE`: Job type (Batch/Service)
- `BACALHAU_EXECUTION_ID`: Unique execution identifier
- `BACALHAU_NODE_ID`: ID of executing compute node
This allows jobs to:
- Be partition-aware and handle their specific partition's work
- Access their execution context
- Track node assignment
## 2. Test Suite for Partition Scheduling
Added comprehensive test suite that validates:
- Environment variable propagation to executors
- Partition scheduling behavior:
- Unique partition indices
- Node distribution
- Retry behavior
- Service job continuous execution
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
Here are the release notes for this pull request:
**New Features**
- Added environment variable management for job executions
- Enhanced support for system and task-level environment variables
- Improved job partitioning and execution context handling
**Bug Fixes**
- Fixed potential nil slice access in job task retrieval
- Added validation for environment variable naming conventions
**Improvements**
- Streamlined executor and job handling interfaces
- Added utility functions for environment variable manipulation
- Enhanced test coverage for job execution scenarios
**Technical Enhancements**
- Refactored execution context management
- Improved error handling in task and job validation
- Added robust environment variable sanitization and merging
capabilities
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 commit comments