diff --git a/Cargo.lock b/Cargo.lock index 9ca9fbb..baa2632 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,9 +295,9 @@ checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "code0-flow" -version = "0.0.32" +version = "0.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d74d62174eb76c90d7c1642a05f20084bb563ec8a1249c0f05bbd7ed03023" +checksum = "6e8a97ac31e8340a97ab6468dbcab82d835346182ca309d8518245acb1f6ffd3" dependencies = [ "async-nats", "async-trait", @@ -2184,9 +2184,9 @@ dependencies = [ [[package]] name = "tucana" -version = "0.0.68" +version = "0.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abae78f798d1203bbcce361ba4cb4c500f8fe64e56d16ba3a5a0854e285377eb" +checksum = "1ececdc8eeccd39a9ba82a4ee78e9663d9871a9ca9da65013477536360322392" dependencies = [ "pbjson", "pbjson-build", diff --git a/Cargo.toml b/Cargo.toml index 09e8841..9f73441 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,8 +8,8 @@ edition = "2024" [workspace.dependencies] async-trait = "0.1.89" -code0-flow = { version = "0.0.32" } -tucana = { version = "0.0.68" } +code0-flow = { version = "0.0.33" } +tucana = { version = "0.0.70" } tokio = { version = "1.44.1", features = ["rt-multi-thread", "signal"] } log = "0.4.27" futures-lite = "2.6.0" diff --git a/crates/taurus-core/src/runtime/engine.rs b/crates/taurus-core/src/runtime/engine.rs index c7e4599..f2f1e53 100644 --- a/crates/taurus-core/src/runtime/engine.rs +++ b/crates/taurus-core/src/runtime/engine.rs @@ -181,6 +181,7 @@ mod tests { value: Some(NodeValue { value: Some(node_value::Value::LiteralValue(value)), }), + cast: None, } } @@ -189,8 +190,11 @@ mod tests { database_id, runtime_parameter_id: runtime_parameter_id.to_string(), value: Some(NodeValue { - value: Some(node_value::Value::NodeFunctionId(node_id)), + value: Some(node_value::Value::SubFlow(unimplemented!( + "Taurus needs to handle SubFlows (issue nr #184)" + ))), }), + cast: None, } } @@ -208,6 +212,7 @@ mod tests { paths: Vec::new(), })), }), + cast: None, } } @@ -276,6 +281,7 @@ mod tests { paths: Vec::new(), })), }), + cast: None, } } diff --git a/crates/taurus-core/src/runtime/engine/compiler.rs b/crates/taurus-core/src/runtime/engine/compiler.rs index 3f4ae57..33a5d8f 100644 --- a/crates/taurus-core/src/runtime/engine/compiler.rs +++ b/crates/taurus-core/src/runtime/engine/compiler.rs @@ -125,7 +125,7 @@ pub fn compile_flow( let arg = match value { node_value::Value::LiteralValue(v) => CompiledArg::Literal(v.clone()), node_value::Value::ReferenceValue(r) => CompiledArg::Reference(r.clone()), - node_value::Value::NodeFunctionId(id) => CompiledArg::DeferredNode(*id), + node_value::Value::SubFlow(_sub_flow) => unimplemented!("Taurus needs to handle SubFlows (issue nr #184)"), }; parameters.push(CompiledParameter { diff --git a/crates/taurus-core/src/runtime/engine/executor.rs b/crates/taurus-core/src/runtime/engine/executor.rs index c8aeb27..ea2acc1 100644 --- a/crates/taurus-core/src/runtime/engine/executor.rs +++ b/crates/taurus-core/src/runtime/engine/executor.rs @@ -4,7 +4,7 @@ use std::cell::RefCell; use std::collections::HashMap; use futures_lite::future::block_on; -use tucana::aquila::ExecutionRequest; +use tucana::aquila::ActionExecutionRequest; use tucana::shared::reference_value::Target; use tucana::shared::value::Kind; use tucana::shared::{Struct, Value}; @@ -485,7 +485,7 @@ impl<'a> EngineExecutor<'a> { &self, node: &CompiledNode, values: Vec, - ) -> Result { + ) -> Result { if node.parameters.len() != values.len() { return Err(RuntimeError::new( "T-CORE-000005", @@ -499,7 +499,7 @@ impl<'a> EngineExecutor<'a> { fields.insert(parameter.runtime_parameter_id.clone(), value); } - Ok(ExecutionRequest { + Ok(ActionExecutionRequest { execution_identifier: Uuid::new_v4().to_string(), function_identifier: node.handler_id.clone(), parameters: Some(Struct { fields }), diff --git a/crates/taurus-core/src/runtime/remote/mod.rs b/crates/taurus-core/src/runtime/remote/mod.rs index f5ab662..5b3cd9f 100644 --- a/crates/taurus-core/src/runtime/remote/mod.rs +++ b/crates/taurus-core/src/runtime/remote/mod.rs @@ -4,7 +4,7 @@ //! trait without coupling the core engine to a specific transport. use async_trait::async_trait; -use tucana::{aquila::ExecutionRequest, shared::Value}; +use tucana::{aquila::ActionExecutionRequest, shared::Value}; use crate::types::errors::runtime_error::RuntimeError; @@ -12,7 +12,8 @@ pub struct RemoteExecution { /// Remote service identifier to route the call. pub target_service: String, /// Execution request payload expected by the remote runtime. - pub request: ExecutionRequest, + pub request: ActionExecutionRequest, + } #[async_trait] diff --git a/crates/taurus-provider/src/providers/remote/nats_remote_runtime.rs b/crates/taurus-provider/src/providers/remote/nats_remote_runtime.rs index 9ef694b..e7b09e7 100644 --- a/crates/taurus-provider/src/providers/remote/nats_remote_runtime.rs +++ b/crates/taurus-provider/src/providers/remote/nats_remote_runtime.rs @@ -3,7 +3,7 @@ use prost::Message; use taurus_core::runtime::remote::{RemoteExecution, RemoteRuntime}; use taurus_core::types::errors::runtime_error::RuntimeError; use tonic::async_trait; -use tucana::aquila::ExecutionResult; +use tucana::aquila::ActionExecutionResponse; use tucana::shared::Value; pub struct NATSRemoteRuntime { @@ -42,8 +42,8 @@ impl RemoteRuntime for NATSRemoteRuntime { } }; - let decode_result = ExecutionResult::decode(message.payload); - let execution_result = match decode_result { + let decode_result = ActionExecutionResponse::decode(message.payload); + let _execution_result = match decode_result { Ok(r) => r, Err(err) => { log::error!( @@ -58,24 +58,6 @@ impl RemoteRuntime for NATSRemoteRuntime { } }; - match execution_result.result { - Some(result) => match result { - tucana::aquila::execution_result::Result::Success(value) => Ok(value), - tucana::aquila::execution_result::Result::Error(err) => { - let code = err.code.to_string(); - let description = match err.description { - Some(string) => string, - None => "Unknown Error".to_string(), - }; - let error = RuntimeError::new(code, "RemoteExecutionError", description); - Err(error) - } - }, - None => Err(RuntimeError::new( - "T-PROV-000003", - "RemoteRuntimeExeption", - "Result of Remote Response was empty.", - )), - } + unimplemented!("Taurus needs to handle text executions (issue nr #185)") } } diff --git a/crates/taurus/src/app/mod.rs b/crates/taurus/src/app/mod.rs index 3bf3587..f88c0b1 100644 --- a/crates/taurus/src/app/mod.rs +++ b/crates/taurus/src/app/mod.rs @@ -1,10 +1,9 @@ mod worker; -use std::time::Duration; - use code0_flow::flow_config::load_env_file; use code0_flow::flow_config::mode::Mode::DYNAMIC; use code0_flow::flow_service::FlowUpdateService; +use std::time::Duration; use taurus_core::runtime::engine::ExecutionEngine; use taurus_provider::providers::emitter::nats_emitter::NATSRespondEmitter; use taurus_provider::providers::remote::nats_remote_runtime::NATSRemoteRuntime; @@ -12,7 +11,6 @@ use tokio::signal; use tokio::task::JoinHandle; use tokio::time::sleep; use tonic_health::pb::health_server::HealthServer; -use tucana::shared::{RuntimeFeature, Translation}; use crate::client::runtime_status::TaurusRuntimeStatusService; use crate::client::runtime_usage::TaurusRuntimeUsageService; @@ -114,7 +112,6 @@ async fn setup_dynamic_services_if_needed( config.aquila_url.clone(), config.aquila_token.clone(), "taurus".into(), - runtime_features(), ) .await, ); @@ -152,19 +149,6 @@ async fn push_definitions_until_success(config: &Config) { } } -fn runtime_features() -> Vec { - vec![RuntimeFeature { - name: vec![Translation { - code: "en-US".to_string(), - content: "Runtime".to_string(), - }], - description: vec![Translation { - code: "en-US".to_string(), - content: "Will execute incoming flows.".to_string(), - }], - }] -} - async fn update_stopped_status(runtime_status_service: Option<&TaurusRuntimeStatusService>) { if let Some(status_service) = runtime_status_service { status_service diff --git a/crates/taurus/src/client/runtime_status.rs b/crates/taurus/src/client/runtime_status.rs index 12a64dc..f2f21bb 100644 --- a/crates/taurus/src/client/runtime_status.rs +++ b/crates/taurus/src/client/runtime_status.rs @@ -9,37 +9,25 @@ use tucana::{ RuntimeStatusUpdateRequest, runtime_status_service_client::RuntimeStatusServiceClient, runtime_status_update_request::Status, }, - shared::{ExecutionRuntimeStatus, RuntimeFeature}, + shared::ExecutionRuntimeStatus, }; pub struct TaurusRuntimeStatusService { channel: Channel, identifier: String, - features: Vec, aquila_token: String, } impl TaurusRuntimeStatusService { - pub async fn from_url( - aquila_url: String, - aquila_token: String, - identifier: String, - features: Vec, - ) -> Self { + pub async fn from_url(aquila_url: String, aquila_token: String, identifier: String) -> Self { let channel = create_channel_with_retry("Aquila", aquila_url).await; - Self::new(channel, aquila_token, identifier, features) + Self::new(channel, aquila_token, identifier) } - pub fn new( - channel: Channel, - aquila_token: String, - identifier: String, - features: Vec, - ) -> Self { + pub fn new(channel: Channel, aquila_token: String, identifier: String) -> Self { TaurusRuntimeStatusService { channel, identifier, - features, aquila_token, } } @@ -68,7 +56,6 @@ impl TaurusRuntimeStatusService { status: status.into(), timestamp: timestamp as i64, identifier: self.identifier.clone(), - features: self.features.clone(), })), }, );