diff --git a/libraries/core/src/descriptor/mod.rs b/libraries/core/src/descriptor/mod.rs index ad1b1ab0..24ab0184 100644 --- a/libraries/core/src/descriptor/mod.rs +++ b/libraries/core/src/descriptor/mod.rs @@ -25,8 +25,6 @@ pub struct Descriptor { pub nodes: Vec, #[serde(default)] pub daemon_config: DaemonCommunicationConfig, - #[serde(default)] - pub base_path: PathBuf, } pub const SINGLE_OPERATOR_DEFAULT_ID: &str = "op"; @@ -101,25 +99,21 @@ impl Descriptor { let buf = tokio::fs::read(path) .await .context("failed to open given file")?; - Descriptor::parse(buf, path) + Descriptor::parse(buf) } pub fn blocking_read(path: &Path) -> eyre::Result { let buf = std::fs::read(path).context("failed to open given file")?; - Descriptor::parse(buf, path) + Descriptor::parse(buf) } - pub fn parse(buf: Vec, path: &Path) -> eyre::Result { - let mut descriptor: Descriptor = - serde_yaml::from_slice(&buf).context("failed to parse given descriptor")?; - let base = path.canonicalize().unwrap().parent().unwrap().to_owned(); - descriptor.base_path = base; - - Ok(descriptor) + pub fn parse(buf: Vec) -> eyre::Result { + serde_yaml::from_slice(&buf).context("failed to parse given descriptor") } - pub fn is_valid(&self) -> eyre::Result<()> { - validate::check_dataflow(self).wrap_err("Dataflow could not be validated.") + pub fn check(&self, path: &Path, runtime_path: Option) -> eyre::Result<()> { + validate::check_dataflow(self, path, runtime_path) + .wrap_err("Dataflow could not be validated.") } }