From bd6b7f88461125f273bcc9130b7e3ffee279be4a Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 26 Jan 2024 14:49:49 -0800 Subject: [PATCH] Support multiple evaluators on a single machine --- ofborg/src/bin/mass-rebuilder.rs | 3 ++- ofborg/src/config.rs | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ofborg/src/bin/mass-rebuilder.rs b/ofborg/src/bin/mass-rebuilder.rs index 5d118c3..d35775b 100644 --- a/ofborg/src/bin/mass-rebuilder.rs +++ b/ofborg/src/bin/mass-rebuilder.rs @@ -35,7 +35,8 @@ fn main() -> Result<(), Box> { let conn = easylapin::from_config(&cfg.rabbitmq)?; let mut chan = task::block_on(conn.create_channel())?; - let cloner = checkout::cached_cloner(Path::new(&cfg.checkout.root)); + let root = Path::new(&cfg.checkout.root); + let cloner = checkout::cached_cloner(&root.join(cfg.runner.instance.to_string())); let nix = cfg.nix(); let events = stats::RabbitMq::from_lapin(&cfg.whoami(), task::block_on(conn.create_channel())?); diff --git a/ofborg/src/config.rs b/ofborg/src/config.rs index c095cfe..dba6806 100644 --- a/ofborg/src/config.rs +++ b/ofborg/src/config.rs @@ -64,8 +64,14 @@ pub struct LogStorage { pub path: String, } +const fn default_instance() -> u8 { + 1 +} + #[derive(Serialize, Deserialize, Debug)] pub struct RunnerConfig { + #[serde(default = "default_instance")] + pub instance: u8, pub identity: String, pub repos: Option>, #[serde(default = "Default::default")]