Jobs
Jobs
Jobs are procedures composed of daft operations that run on the Eventual platform.They automatically handle scaling, retries, and fault tolerance, so you can focus on your business logic.
What is a Job?
A Job is a Python function decorated with@job.main()
that defines what work should be performed. Jobs are:
- Automatically Distributed: Your code runs across multiple machines without configuration
- Fault Tolerant: Built-in retry logic and error handling
- Scalable: Automatically scales based on workload
- Monitored: Full logging and metrics collection
Basic Job Example
Job Lifecycle
1
Submit
Job is submitted to the Eventual platform
2
Schedule
Platform schedules execution on available compute resources
3
Execute
Job function runs with automatic scaling and fault tolerance
4
Monitor
Progress is tracked with full logging and metrics
5
Complete
Results are returned and resources are cleaned up
Environments
Environments
Environments define the runtime context for your jobs, including Python dependencies and configuration.They ensure your jobs have everything needed to run successfully.
What is an Environment?
An Environment specifies:- Python Dependencies: Packages required by your job
- Environment Variables: Configuration values loaded into your job at runtime and shown in the UI
- Secrets: Sensitive configuration values, stored in an encrypted vault, accessible only to your job at runtime
- Files: Additional files needed at runtime
Note: Currently, secrets are ephemeral (tied to a single environment), but support for persistent, shareable secrets is planned.
Creating Environments
Environment Best Practices
Pin Dependencies
Pin Dependencies
Always specify exact versions to ensure reproducibility:
Use Environment Variables and Secrets
Use Environment Variables and Secrets
Store configuration in environment variables and sensitive values in secrets:Secrets are not visible in the UI and are intended for sensitive information. Persistent, shareable secrets are coming soon.
Include Required Files
Include Required Files
Add model files, configs, and other assets:
Resources
Resources
Resources are reference-able entities that can be used across jobs and shared within your organization.They provide abstractions over infrastructure components like data volumes, ML models, and compute clusters.
What are Resources?
Resources represent:- Data Volumes: S3 buckets, databases, file systems
- ML Models: Trained models, embeddings, checkpoints
- Compute Resources: GPU clusters, specialized hardware
- External Services: APIs, databases, third-party systems
Using Resources
Resource Benefits
Reusability
Define once, use across multiple jobs
Versioning
Track versions and metadata
Sharing
Share resources across teams
Governance
Control access and permissions
Putting It All Together
Here’s how Jobs, Environments, and Resources work together:How They Work Together
1
Environment Setup
The environment installs PyTorch and sets up the model cache directory
2
Resource Loading
The job loads images from the data volume and the ML model from the model resource
3
Distributed Processing
daft automatically distributes the image classification across the cluster
4
Result Storage
Classified results are saved back to the data volume
Next Steps
Now that you understand the core concepts, dive deeper into each area:Jobs Deep Dive
Learn advanced job patterns and best practices
Environments Guide
Master environment configuration and dependency management
Resources Guide
Understand resource types and sharing patterns
daft Integration
Learn how to process data with daft
Ready to see these concepts in action? Check out our image processing example to see how Jobs, Environments, and Resources work together in a real-world scenario.