Skip to content
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
844fdff
Move to dev
Aug 4, 2025
764387d
Remove uneeded results and change to return iterator
Synicix Aug 5, 2025
a03db37
Remove accident comment
Synicix Aug 5, 2025
abbb5ce
Add ground work for pod operator
Synicix Aug 5, 2025
450a90f
Add async operation for JoinOperator
Synicix Aug 5, 2025
e4b3a54
Add pod operator + better error handling for pod_result:::new()
Synicix Aug 5, 2025
fee8d9c
Improve error handling for file io in localfilestore
Synicix Aug 5, 2025
c04335f
Update operator to be in operation again
Synicix Aug 5, 2025
ebe04d1
Fix pod result hashing bug
Synicix Aug 5, 2025
20f2345
Apply feedback from review
Synicix Aug 6, 2025
51dfea6
Merge branch 'worktree-docker-patch' into 106
Synicix Aug 8, 2025
cb72829
Remove stale error
Synicix Aug 8, 2025
d36ec71
Merge branch 'worktree-docker-patch' into 106
Synicix Aug 10, 2025
2986e0d
Save changes
Synicix Aug 10, 2025
0e3dc71
Merge branch '106' into pipeline_runner
Synicix Aug 10, 2025
595a12e
Split model in core to match uniffi
Synicix Aug 10, 2025
b671dba
Merge branch 'model_split' into 106
Synicix Aug 10, 2025
ac363f2
Merge branch '106' into runner
Synicix Aug 10, 2025
86d5f70
Save progress
Synicix Aug 11, 2025
aead411
Merge branch 'dev' into model_split
Synicix Aug 11, 2025
58ba198
Fix missing stuff
Synicix Aug 11, 2025
9c72bd8
Merge branch 'model_split' into runner
Synicix Aug 11, 2025
7ee5251
save change
Synicix Aug 11, 2025
fda43aa
Update pipeline_runner to use new operator + improvments
Synicix Aug 11, 2025
1e9a19f
Readded tests
Synicix Aug 11, 2025
32299f8
save progress
Synicix Aug 12, 2025
e93c32b
Merge remote-tracking branch 'upstream' into runner
Synicix Aug 13, 2025
ab900b6
Fix logic bug
Synicix Aug 13, 2025
4f511ce
Update tests and test fixture to merge sentence correctly
Synicix Aug 13, 2025
2a4f1f7
Fix agent event to make it more efficient
Synicix Aug 13, 2025
c89c700
Remove empty impl
Synicix Aug 13, 2025
a834ed9
Fix remaining test to deal with issue
Synicix Aug 14, 2025
7863cad
Fix memory bug
Synicix Aug 15, 2025
b8c2de2
Update rust version
Synicix Aug 15, 2025
acbd967
Remove into iter()
Synicix Aug 15, 2025
ae137ed
Fix old lint that doesn't apply anymore, was hidden by rust analyzer
Synicix Aug 15, 2025
f5fefb0
Add PipelineStatus and failure logs
Synicix Aug 15, 2025
75336de
Remove notebook
Synicix Aug 15, 2025
f9adf0a
Remove stale functions
Synicix Aug 15, 2025
9795458
Remove unused imports
Synicix Aug 15, 2025
4fae330
Merge remote-tracking branch 'upstream/dev' into logging
Synicix Aug 28, 2025
53e972f
Merge branch 'orch_tests' into logging_patch
Synicix Aug 28, 2025
9de08e1
reintergrate logging into podresult
Synicix Aug 28, 2025
3ace99d
Fix code according to copilot suggestions
Synicix Aug 29, 2025
cd0e675
Revert test feature to be more inline with rust testing standards
Synicix Aug 29, 2025
a7bf03c
fix copilot suggestions
Synicix Aug 29, 2025
781ffcc
Update cspell
Synicix Aug 29, 2025
d16da30
Fix copilot suggestions
Synicix Aug 29, 2025
9a38076
Fix copilot suggestions
Synicix Aug 29, 2025
31533db
Merge branch 'runner' into test_split
Synicix Aug 29, 2025
a1a6d83
Covert to_yaml into an actual trait and add ExecRequirements, and rem…
Synicix Sep 2, 2025
03099b5
Move gpu_requirements to be included in hash, and fix missing impleme…
Synicix Sep 2, 2025
7fa14bb
Update python scripts
Synicix Sep 2, 2025
6ec5fa0
Add microseconds in case the case of mutiple save in a second
Synicix Sep 2, 2025
2b0d33b
Change threshold
Synicix Sep 2, 2025
1f66f20
Update agent python test
Synicix Sep 2, 2025
dacb312
Update python test.yaml
Synicix Sep 2, 2025
f3115da
Update name
Synicix Sep 2, 2025
39b3996
Update excessive nesting exception for clippy
Synicix Sep 5, 2025
8e956b9
Add hash to kernels
Synicix Sep 5, 2025
dbab550
Move pod test into unit test and add some basic framework for pipelin…
Synicix Sep 7, 2025
0436c38
Fix incorrect validation
Synicix Sep 23, 2025
c2fe914
Add hashing to pipeline node
Synicix Sep 24, 2025
cc3e4f1
Add test and fix bugs for pipeline validation
Synicix Sep 25, 2025
c20a127
Remove unused code
Synicix Oct 2, 2025
491e422
Update rust version
Synicix Oct 4, 2025
6d88730
Solve hidden cargo clippy issues by newer rust-analyzer
Synicix Oct 4, 2025
9ab6935
Mute github action expect issue with cargo clippy
Synicix Oct 4, 2025
0a78274
Fix unffi issue with record constructor
Synicix Oct 4, 2025
a2f44cf
Merge branch 'dev' into runner
eywalker Oct 14, 2025
af14f92
Fix merging issues
Synicix Oct 17, 2025
78ceed6
Fix clippy issues and orchestrator bugs
Synicix Oct 17, 2025
dd5c44f
Remove clippy except since github action complained
Synicix Oct 17, 2025
f9b53ba
Apply fixes requests from clippy
Synicix Oct 17, 2025
44b4245
Merge branch 'runner' into logging_patch
Synicix Oct 17, 2025
e185b65
Merge branch 'logging_patch' into test_split
Synicix Oct 17, 2025
e9326ee
Merge branch 'test_split' into pod_model_hash
Synicix Oct 17, 2025
1216c35
Merge branch 'test_split' into pipeline_validiation
Synicix Oct 17, 2025
8365fda
Fix incorrect assert check hash
Synicix Oct 17, 2025
0c3e7db
Merge branch 'pod_model_hash' into pipeline_validiation
Synicix Oct 17, 2025
ed9edcb
Update compute_hash_for_node_and_parents recursive base cases to do c…
Synicix Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
excessive-nesting-threshold = 4
excessive-nesting-threshold = 6
too-many-arguments-threshold = 10
allowed-idents-below-min-chars = ["..", "k", "v", "f", "re", "id", "Ok", "'_"]
16 changes: 6 additions & 10 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Install Rust + components
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.87
toolchain: 1.90.0
components: rustfmt,clippy
- name: Install code coverage
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run syntax and style tests
run: cargo clippy --no-default-features --features=test --all-targets -- -D warnings
run: cargo clippy --all-targets -- -D warnings
- name: Run format test
run: cargo fmt --check
- name: Run integration tests w/ coverage report
Expand Down Expand Up @@ -57,15 +57,11 @@ jobs:
uv pip install eclipse-zenoh -p ~/.local/share/base
. ~/.local/share/base/bin/activate
maturin develop --uv
- name: Run smoke test
- name: Run Python tests
env:
RUST_BACKTRACE: full
run: |
. ~/.local/share/base/bin/activate
python tests/extra/python/smoke_test.py -- tests/.tmp
- name: Run agent test
env:
RUST_BACKTRACE: full
run: |
. ~/.local/share/base/bin/activate
python tests/extra/python/agent_test.py -- tests/.tmp
for py_file in tests/extra/python/*.py; do
python "$py_file" -- tests/.tmp
done
5 changes: 0 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
],
"files.autoSave": "off",
"files.insertFinalNewline": true,
"gitlens.showWelcomeOnInstall": false,
"gitlens.showWhatsNewAfterUpgrades": false,
"lldb.consoleMode": "evaluate",
"rust-analyzer.cargo.features": [
"test"
],
"rust-analyzer.cargo.noDefaultFeatures": true,
"rust-analyzer.check.command": "clippy",
"rust-analyzer.runnables.extraTestBinaryArgs": [
"--nocapture"
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ glob = "0.3.1"
heck = "0.5.0"
# convert bytes to hex strings
hex = "0.4.3"
hostname = "0.4.1"
# hashmaps that preserve insertion order
indexmap = { version = "2.9.0", features = ["serde"] }
# utilities for iterables e.g. cartesian products
Expand Down Expand Up @@ -82,7 +83,7 @@ tokio = { version = "1.41.0", features = ["full"] }
# utilities for async calls
tokio-util = "0.7.13"
# automated CFFI + bindings in other languages
uniffi = { version = "0.29.1", features = ["cli", "tokio"] }
uniffi = { version = "0.29.4", features = ["cli", "tokio"] }
# shared, distributed memory via communication
zenoh = "1.3.4"

Expand Down
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
"wasi",
"patchelf",
"itertools",
"colinianking"
"colinianking",
"itertools",
"pathset",
],
"useGitignore": false,
"ignorePaths": [
Expand Down
48 changes: 43 additions & 5 deletions src/core/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ pub fn hash_buffer(buffer: impl AsRef<[u8]>) -> String {
///
/// Will return error if unable to access file.
pub fn hash_file(filepath: impl AsRef<Path>) -> Result<String> {
hash_stream(
&mut File::open(&filepath).context(selector::InvalidFilepath {
path: filepath.as_ref(),
})?,
)
hash_stream(&mut File::open(&filepath).context(selector::InvalidPath {
path: filepath.as_ref(),
})?)
}
/// Evaluate checksum hash of a directory.
///
Expand Down Expand Up @@ -107,3 +105,43 @@ pub fn make_random_hash() -> String {
rand::rng().fill_bytes(&mut bytes);
hex::encode(bytes)
}

#[cfg(test)]
mod tests {
#![expect(clippy::panic_in_result_fn, reason = "OK in tests.")]
use crate::{
core::crypto::{hash_buffer, hash_dir, hash_file},
uniffi::error::Result,
};
use std::fs::read;

#[test]
fn consistent_hash() -> Result<()> {
let filepath = "./tests/extra/data/images/subject.jpeg";
assert_eq!(
hash_file(filepath)?,
hash_buffer(&read(filepath)?),
"Checksum not consistent."
);
Ok(())
}

#[test]
fn complex_hash() -> Result<()> {
let dirpath = "./tests/extra/data/images";
assert_eq!(
hash_dir(dirpath)?,
"6c96a478ea25e34fab045bc82858a2980b2cfb22db32e83c01349a8e7ed3b42c".to_owned(),
"Directory checksum didn't match."
);
Ok(())
}

#[test]
fn internal_invalid_filepath() {
assert!(
hash_file("nonexistent_file.txt").is_err(),
"Did not raise an invalid filepath error."
);
}
}
13 changes: 12 additions & 1 deletion src/core/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,20 @@ impl fmt::Debug for OrcaError {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match &self.kind {
Kind::AgentCommunicationFailure { backtrace, .. }
| Kind::EmptyDir { backtrace, .. }
| Kind::IncompletePacket { backtrace, .. }
| Kind::InvalidFilepath { backtrace, .. }
| Kind::InvalidPath { backtrace, .. }
| Kind::InvalidIndex { backtrace, .. }
| Kind::InvalidInputSpecNodeNotInGraph { backtrace, .. }
| Kind::InvalidOutputSpecKeyNotInNode { backtrace, .. }
| Kind::InvalidOutputSpecNodeNotInGraph { backtrace, .. }
| Kind::KeyMissing { backtrace, .. }
| Kind::MissingInfo { backtrace, .. }
| Kind::FailedToGetPodJobOutput { backtrace, .. }
| Kind::PipelineValidationErrorMissingKeys { backtrace, .. }
| Kind::PodJobProcessingError { backtrace, .. }
| Kind::PodJobSubmissionFailed { backtrace, .. }
| Kind::UnexpectedPathType { backtrace, .. }
| Kind::BollardError { backtrace, .. }
| Kind::ChronoParseError { backtrace, .. }
| Kind::DOTError { backtrace, .. }
Expand Down
13 changes: 7 additions & 6 deletions src/core/graph.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
core::{pipeline::PipelineNode, util::get},
core::{model::pipeline::PipelineNode, util::get},
uniffi::{error::Result, model::pipeline::Kernel},
};
use dot_parser::ast::Graph as DOTGraph;
Expand All @@ -10,7 +10,6 @@ use petgraph::{
use std::collections::HashMap;

#[expect(
clippy::needless_pass_by_value,
clippy::panic_in_result_fn,
clippy::panic,
reason = "
Expand All @@ -20,15 +19,17 @@ use std::collections::HashMap;
)]
pub fn make_graph(
input_dot: &str,
metadata: HashMap<String, Kernel>,
metadata: &HashMap<String, Kernel>,
) -> Result<DiGraph<PipelineNode, ()>> {
let graph =
DiGraph::<DotNodeWeight, DotAttrList>::from_dot_graph(DOTGraph::try_from(input_dot)?).map(
|_, node| PipelineNode {
name: node.id.clone(),
kernel: get(&metadata, &node.id)
|node_idx, node| PipelineNode {
hash: String::new(),
kernel: get(metadata, &node.id)
.unwrap_or_else(|error| panic!("{error}"))
.clone(),
label: node.id.clone(),
node_idx,
},
|_, _| (),
);
Expand Down
40 changes: 7 additions & 33 deletions src/core/mod.rs
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
macro_rules! inner_attr_to_each {
{ #!$attr:tt $($it:item)* } => {
$(
#$attr
$it
)*
}
}

pub(crate) mod error;
pub(crate) mod graph;
pub(crate) mod pipeline;
pub(crate) mod store;
pub(crate) mod util;
pub(crate) mod validation;

inner_attr_to_each! {
#![cfg(feature = "default")]
pub(crate) mod crypto;
pub(crate) mod model;
pub(crate) mod operator;
pub(crate) mod orchestrator;
}
pub(crate) mod crypto;
/// Model definition for orcapod
pub(crate) mod model;
pub(crate) mod operator;
pub(crate) mod orchestrator;

#[cfg(feature = "test")]
inner_attr_to_each! {
#![cfg_attr(
feature = "test",
allow(
missing_docs,
clippy::missing_errors_doc,
clippy::missing_panics_doc,
reason = "Documentation not necessary since private API.",
),
)]
pub mod crypto;
pub mod model;
pub mod operator;
pub mod orchestrator;
}
/// Pipeline runner module
pub mod pipeline_runner;
50 changes: 28 additions & 22 deletions src/core/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,33 @@ use std::{
hash::BuildHasher,
result,
};
/// Converts a model instance into a consistent yaml.
///
/// # Errors
///
/// Will return `Err` if there is an issue converting an `instance` into YAML (w/o annotation).
pub fn to_yaml<T: Serialize>(instance: &T) -> Result<String> {
let mapping: IndexMap<String, Value> = serde_yaml::from_str(&serde_yaml::to_string(instance)?)?; // cast to map
let mut yaml = serde_yaml::to_string(
&mapping
.iter()
.filter_map(|(k, v)| match &**k {
"annotation" | "hash" => None,
"pod" | "pod_job" => Some((k, v["hash"].clone())),
_ => Some((k, v.clone())),
})
.collect::<IndexMap<_, _>>(),
)?; // skip fields and convert refs to hash pointers
yaml.insert_str(
0,
&format!("class: {}\n", get_type_name::<T>().to_snake_case()),
); // replace class at top
Ok(yaml)

/// Trait to handle serialization to yaml for `OrcaPod` models
pub trait ToYaml: Serialize + Sized {
/// Serializes the instance to a YAML string.
/// # Errors
/// Will return `Err` if it fail to serialize instance to string
fn to_yaml(&self) -> Result<String> {
let mapping: IndexMap<String, Value> = serde_yaml::from_str(&serde_yaml::to_string(self)?)?; // cast to map
let mut yaml = serde_yaml::to_string(
&mapping
.iter()
.filter_map(|(k, v)| Self::process_field(k, v))
.collect::<IndexMap<_, _>>(),
)?; // skip fields and convert refs to hash pointers
yaml.insert_str(
0,
&format!("class: {}\n", get_type_name::<Self>().to_snake_case()),
); // replace class at top
Ok(yaml)
}

/// Filter out which field to serialize and which to omit
///
/// # Returns
/// (`field_name`, `field_value`): to be pass to `to_yaml` for serialization
/// None: to skip
fn process_field(field_name: &str, field_value: &Value) -> Option<(String, Value)>;
}

pub fn serialize_hashmap<S, K: Ord + Serialize, V: Serialize, BH: BuildHasher>(
Expand Down Expand Up @@ -57,4 +62,5 @@ where
sorted.serialize(serializer)
}

pub mod pipeline;
pub mod pod;
Loading