Skip to content

Commit

Permalink
Fix lint and test.
Browse files Browse the repository at this point in the history
  • Loading branch information
yorik committed Oct 16, 2024
1 parent 768e257 commit 0422797
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts
Submodule contracts updated 333 files
2 changes: 1 addition & 1 deletion core/lib/protobuf_config/src/prover_autoscaler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl ProtoRepr for proto::ProverAutoscalerScalerConfig {
let (cluster_and_gpu, max) = e.read().expect("max_provers");
if let Some((cluster, gpu)) = cluster_and_gpu.split_once('/') {
acc.entry(cluster.to_string())
.or_insert_with(HashMap::new)
.or_default()
.insert(gpu.parse().expect("max_provers/gpu"), max);
}
acc
Expand Down
11 changes: 9 additions & 2 deletions prover/crates/bin/prover_autoscaler/src/global/scaler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,14 @@ mod tests {
let queuer = queuer::Queuer {
prover_job_monitor_url: "".to_string(),
};
let scaler = Scaler::new(watcher, queuer, ProverAutoscalerScalerConfig::default());
let scaler = Scaler::new(
watcher,
queuer,
ProverAutoscalerScalerConfig {
max_provers: HashMap::from([("foo".to_string(), HashMap::from([(Gpu::L4, 100)]))]),
..Default::default()
},
);
let got = scaler.run(
&"prover".to_string(),
1499,
Expand Down Expand Up @@ -383,6 +390,6 @@ mod tests {
},
3,
)]);
assert!(got == want);
assert_eq!(got, want);
}
}

0 comments on commit 0422797

Please sign in to comment.