From 877a1022ce24f315761e0913131d46da4d36c2ab Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 2 Nov 2020 15:23:00 +0100 Subject: Add module for Orchestrator --- src/orchestrator/mod.rs | 3 +++ src/orchestrator/orchestrator.rs | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/orchestrator/mod.rs create mode 100644 src/orchestrator/orchestrator.rs (limited to 'src/orchestrator') diff --git a/src/orchestrator/mod.rs b/src/orchestrator/mod.rs new file mode 100644 index 0000000..3cff622 --- /dev/null +++ b/src/orchestrator/mod.rs @@ -0,0 +1,3 @@ +mod orchestrator; +pub use orchestrator::*; + diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs new file mode 100644 index 0000000..a14cda4 --- /dev/null +++ b/src/orchestrator/orchestrator.rs @@ -0,0 +1,50 @@ +use std::path::PathBuf; +use std::sync::RwLock; +use std::sync::Arc; + +use anyhow::Result; +use typed_builder::TypedBuilder; + +use crate::endpoint::EndpointManagerConfiguration; +use crate::endpoint::EndpointScheduler; +use crate::job::JobSet; +use crate::job::RunnableJob; +use crate::log::LogItem; +use crate::filestore::StagingStore; +use crate::filestore::ReleaseStore; + +pub struct Orchestrator { + scheduler: EndpointScheduler, + staging_store: Arc>, + release_store: Arc>, + jobsets: Vec, +} + +#[derive(TypedBuilder)] +pub struct OrchestratorSetup { + ep_cfg: Vec, + staging_store: Arc>, + release_store: Arc>, + jobsets: Vec, +} + +impl OrchestratorSetup { + pub async fn setup(self) -> Result { + let scheduler = EndpointScheduler::setup(self.ep_cfg, self.staging_store.clone()).await?; + + Ok(Orchestrator { + scheduler: scheduler, + staging_store: self.staging_store, + release_store: self.release_store, + jobsets: self.jobsets, + }) + } +} + +impl Orchestrator { + + pub async fn run(self) -> Result<()> { + unimplemented!() + } + +} -- cgit v1.2.3