summaryrefslogtreecommitdiffstats
path: root/src/orchestrator/orchestrator.rs
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-02-17 09:48:07 +0100
committerMatthias Beyer <matthias.beyer@atos.net>2021-02-17 09:59:34 +0100
commit6b2e73a9cf24c80b3b86df68ff62392fdfc1e09c (patch)
tree4a448aadc8ba97f94fec1b877c050f987a89c32d /src/orchestrator/orchestrator.rs
parent04e7602e34987b832e1d2e95405f61443b30a641 (diff)
Pass MergedStores to endpoint/jobs rather than only staging store
This patch changes the code so that the MergedStores object is known in the endpoints and job execution code. This is necessary, because the jobs must be able to load artifacts from the release store as well, for example if a library was released in another submit and we can reuse it because the script for that library didn't change. For that, the interface of StoreRoot::join() was changed - -> Result<FullArtifactPath<'a>> + -> Result<Option<FullArtifactPath<'a>>> whereas it returns an Ok(None) if the artifact requested does not exist. This was necessary to try-joining a path on the store root of the staging store, and if there is no such file continue with try-joining the path on the release store. The calling code got a bit more complex with that change, though. Next, the MergedStores got a `derive(Clone)` because clone()ing it is cheap (two `Arc`s) and necessary to pass it easily to the jobs. Each instance of the code where the staging store was consulted was changed to consult the the release store as well. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/orchestrator/orchestrator.rs')
-rw-r--r--src/orchestrator/orchestrator.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs
index dff5651..e6e24c5 100644
--- a/src/orchestrator/orchestrator.rs
+++ b/src/orchestrator/orchestrator.rs
@@ -176,9 +176,10 @@ pub struct OrchestratorSetup<'a> {
impl<'a> OrchestratorSetup<'a> {
pub async fn setup(self) -> Result<Orchestrator<'a>> {
+ let merged_stores = MergedStores::new(self.release_store, self.staging_store);
let scheduler = EndpointScheduler::setup(
self.endpoint_config,
- self.staging_store.clone(),
+ merged_stores.clone(),
self.database.clone(),
self.submit.clone(),
self.log_dir,
@@ -187,8 +188,8 @@ impl<'a> OrchestratorSetup<'a> {
Ok(Orchestrator {
scheduler,
+ merged_stores,
progress_generator: self.progress_generator,
- merged_stores: MergedStores::new(self.release_store, self.staging_store),
source_cache: self.source_cache,
jobdag: self.jobdag,
config: self.config,