Build a Laboratory Research Run Cost and Compute Resource Scheduler — implementation
Linked challenge: Build a Laboratory Research Run Cost and Compute Resource Scheduler
Prompt source
implementation107 lines11 sectionsNo variables1 code block
## Build
Schedule bioinformatics pipeline runs against compute clusters while estimating computational and cloud storage expenses. Optimize queue allocations to prevent budget overruns and resource contention across research projects.
## User
Bioinformatics Core Facility Manager
## Workflow
1. Parse queued computational run requests specifying tool chains, dataset sizes, and project funding codes.
2. Calculate estimated CPU-hour, memory, and ephemeral storage expenses using calibrated baseline cost models.
3. Solve cluster node scheduling windows using Optuna to minimize cost spikes and wall-clock turnaround times.
4. Export structured execution schedules and budget impact dossiers for research laboratory review.
## Interface
Web terminal dashboard displaying active cluster queue reservations, projected departmental spend, and job allocation timelines.
## Data
Create synthetic normalized job manifests simulating Nextflow and Biopython pipeline runs with memory and CPU usage footprints. Explicitly label these as simplified synthetic app records, not complete official schema files.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Biopython](https://raw.githubusercontent.com/biopython/biopython/master/README.rst)
Models computational job profiles for sequence processing scripts that invoke Biopython alignment and translation routines.
## Tools
optuna, pydantic, fastapi.
Optuna efficiently optimizes hyperparameter and multi-objective scheduling parameters across discrete compute slot constraints.
Local light LLM or API model for generating execution summaries and human-readable cluster run directives.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Calculate projected run expenditures within five percent of defined instance rate tiers.
- Enforce strict priority queue scheduling preventing lower-priority jobs from blocking high-priority deadlines.
- Identify and flag resource requests that exceed remaining project grant balances before schedule commitment.
- Log cluster scheduling efficiency metrics and constraint resolutions to an Optuna tracking summary.
## Starter Examples
```json
[
{
"input": {
"project_id": "PRJ-9041",
"remaining_budget_usd": 450,
"jobs": [
{
"job_id": "JOB-01",
"pipeline": "biopython-msa",
"estimated_runtime_hours": 3.5,
"cores_requested": 16,
"ram_gb_requested": 64,
"hourly_node_rate_usd": 2.4,
"priority": "HIGH"
},
{
"job_id": "JOB-02",
"pipeline": "variant-annotator",
"estimated_runtime_hours": 12,
"cores_requested": 8,
"ram_gb_requested": 32,
"hourly_node_rate_usd": 1.2,
"priority": "NORMAL"
}
]
},
"expected_output": {
"project_id": "PRJ-9041",
"total_estimated_cost_usd": 22.8,
"budget_approved": true,
"scheduled_sequence": [
{
"job_id": "JOB-01",
"start_offset_hours": 0,
"allocated_slot": "node-pool-c5-4xlarge",
"cost_usd": 8.4
},
{
"job_id": "JOB-02",
"start_offset_hours": 3.5,
"allocated_slot": "node-pool-c5-2xlarge",
"cost_usd": 14.4
}
],
"remaining_balance_usd": 427.2
}
},
{
"input": {
"project_id": "PRJ-1022",
"remaining_budget_usd": 15,
"jobs": [
{
"job_id": "JOB-99",
"pipeline": "pangenome-graph-build",
"estimated_runtime_hours": 20,
"cores_requested": 32,
"ram_gb_requested": 128,
"hourly_node_rate_usd": 4.8,
"priority": "NORMAL"
}
]
},
"expected_output": {
"project_id": "PRJ-1022",
"total_estimated_cost_usd": 96,
"budget_approved": false,
"scheduled_sequence": [],
"remaining_balance_usd": 15,
"rejection_reason": "Estimated job cost $96.00 exceeds project remaining balance $15.00."
}
}
]
```
## Safety
Operates purely on synthetic computing job descriptors without storing protected clinical data or executing unvetted remote binaries.
Use mock external writes. Require human review before any real deployment.