summaryrefslogtreecommitdiffstats
path: root/src/orchestrator
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-11-02 15:23:00 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-11-04 13:58:56 +0100
commit877a1022ce24f315761e0913131d46da4d36c2ab (patch)
treeffce42b186d5a6a5c220e1cdb70d39aedba8f16e /src/orchestrator
parent33eee91b3ed7858aab6129e396ac905c238e04a3 (diff)
Add module for Orchestrator
Diffstat (limited to 'src/orchestrator')
-rw-r--r--src/orchestrator/mod.rs3
-rw-r--r--src/orchestrator/orchestrator.rs50
2 files changed, 53 insertions, 0 deletions
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<RwLock<StagingStore>>,
+ release_store: Arc<RwLock<ReleaseStore>>,
+ jobsets: Vec<JobSet>,
+}
+
+#[derive(TypedBuilder)]
+pub struct OrchestratorSetup {
+ ep_cfg: Vec<EndpointManagerConfiguration>,
+ staging_store: Arc<RwLock<StagingStore>>,
+ release_store: Arc<RwLock<ReleaseStore>>,
+ jobsets: Vec<JobSet>,
+}
+
+impl OrchestratorSetup {
+ pub async fn setup(self) -> Result<Orchestrator> {
+ 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!()
+ }
+
+}