-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Jun 9, 2024
1 parent
0033aa3
commit dfcdf8b
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[toolchain] | ||
channel = "nightly-2024-05-12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use crate::Dag; | ||
use anyhow::Result; | ||
|
||
pub trait NHandler { | ||
//pause graph running for now | ||
fn pause(&mut self) -> Result<()>; | ||
|
||
//restart paused graph | ||
fn restart(&mut self) -> Result<()>; | ||
|
||
//stop resource about this graph | ||
fn stop(&mut self) -> Result<()>; | ||
} | ||
|
||
pub trait PipelineController { | ||
fn get_node(&self, name: &str) -> Option<Box<dyn NHandler>>; | ||
} | ||
|
||
pub trait Driver { | ||
//deploy graph to cluster | ||
fn deploy(&mut self, graph: &Dag) -> Result<Box<dyn PipelineController>>; | ||
|
||
//clean all resource about this graph | ||
fn clean(&mut self) -> Result<()>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use super::Driver; | ||
use crate::Dag; | ||
use anyhow::Result; | ||
pub struct KubeDriver {} | ||
|
||
impl Driver for KubeDriver { | ||
fn deploy(&mut self, graph: &Dag) -> Result<Box<dyn super::PipelineController>> { | ||
todo!() | ||
} | ||
|
||
fn clean(&mut self) -> Result<()> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mod driver; | ||
pub mod kube; | ||
|
||
pub use driver::*; |