Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8e1b2f3
Cut out a features to deffer till later. MVP implementation needed fo…
Synicix Jul 7, 2025
e2705c7
Rename error to be more clear
Synicix Jul 7, 2025
770ac57
Added uniffi bindings
Synicix Jul 7, 2025
e3929b3
Fix OOM issue with stress test
Synicix Jul 24, 2025
0c557c2
Adjust tolerance for pi
Synicix Jul 24, 2025
075543c
Merge branch 'dev' of github.com:walkerlab/orcapod into Synicix/pipeline
guzman-raphael Jul 27, 2025
76b4a95
Apply review feedback.
guzman-raphael Jul 27, 2025
eacd2cf
Remove unneeded PartialEq trait implementation.
guzman-raphael Jul 27, 2025
dfdee37
Add pipeline job test that validates input checksums, extract pod_cus…
guzman-raphael Jul 28, 2025
8eb6c34
Cover container dead case in docker orchestrator.
guzman-raphael Jul 28, 2025
70631ef
Debug GHA.
guzman-raphael Jul 28, 2025
abe0a7e
Add dot error test.
guzman-raphael Jul 28, 2025
18873c6
Add packet validation.
guzman-raphael Jul 28, 2025
ea40e21
Fix bug in packet validation.
guzman-raphael Jul 28, 2025
a0102b4
Set project coverage check to 95%.
guzman-raphael Jul 28, 2025
d57484c
Add test for incomplete packet.
guzman-raphael Jul 28, 2025
c5e7285
Allow dashes in agent group, logically isolate agent communication in…
guzman-raphael Jul 28, 2025
c2c77c9
Merge remote-tracking branch 'upstream/dev' into pipeline
Synicix Jul 28, 2025
832ff47
Merge branch 'dev' into pipeline
Synicix Jul 28, 2025
8d9a633
Merge branch 'pipeline' of github.com:Synicix/orcapod into Synicix/pi…
guzman-raphael Jul 28, 2025
674dea1
Split model module in uniffi to make it easier to maintain.
guzman-raphael Jul 29, 2025
5ad6e67
Merge pull request #7 from guzman-raphael/Synicix/pipeline
Synicix Jul 29, 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
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ chrono = "0.4.39"
colored = "2.1.0"
# derive utilities for new types
derive_more = { version = "2.0.1", features = ["display"] }
dot-parser = "0.5.1"
# chaining async calls and processing stream data in local docker orchestrator
futures-util = "0.3.31"
# auto derive getter access methods on structs
Expand All @@ -47,8 +48,10 @@ glob = "0.3.1"
heck = "0.5.0"
# hashmaps that preserve insertion order
indexmap = { version = "2.9.0", features = ["serde"] }
layout-rs = "0.1.3"
# random name generator
names = "0.14.0"
petgraph = "0.8.2"
# complex pattern matching in strings
regex = "1.11.0"
# serialization/deserialization to/from filestore
Expand Down Expand Up @@ -109,6 +112,7 @@ impl_trait_in_params = { level = "allow", priority = 127 } # impl in
implicit_return = { level = "allow", priority = 127 } # missing return ok
inline_asm_x86_intel_syntax = { level = "allow", priority = 127 } # intel syntax ok
integer_division = { level = "allow", priority = 127 } # allow discarding remainder
iter_over_hash_type = { level = "allow", priority = 127 } # allow iterating over hash types
little_endian_bytes = { level = "allow", priority = 127 } # allow to_le_bytes / from_le_bytes
missing_asserts_for_indexing = { level = "allow", priority = 127 } # missing assert before indexing ok
missing_docs_in_private_items = { level = "allow", priority = 127 } # missing docs on private ok
Expand Down
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
"getset",
"strsim",
"getrandom",
"wasi"
"wasi",
"petgraph",
"rfind"
],
"useGitignore": false,
"ignorePaths": [
Expand Down
2 changes: 2 additions & 0 deletions src/core/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match &self.kind {
Kind::EmptyResponseWhenLoadingContainerAltImage { backtrace, .. }
| Kind::FailedToParseDot { backtrace, .. }

Check warning on line 93 in src/core/error.rs

View check run for this annotation

Codecov / codecov/patch

src/core/error.rs#L93

Added line #L93 was not covered by tests
| Kind::GeneratedNamesOverflow { backtrace, .. }
| Kind::InvalidFilepath { backtrace, .. }
| Kind::InvalidPodResultTerminatedDatetime { backtrace, .. }
Expand All @@ -99,6 +100,7 @@
| Kind::NoFileName { backtrace, .. }
| Kind::NoMatchingPodRun { backtrace, .. }
| Kind::NoTagFoundInContainerAltImage { backtrace, .. }
| Kind::MissingInputSpecKey { backtrace, .. }

Check warning on line 103 in src/core/error.rs

View check run for this annotation

Codecov / codecov/patch

src/core/error.rs#L103

Added line #L103 was not covered by tests
| Kind::BollardError { backtrace, .. }
| Kind::GlobPatternError { backtrace, .. }
| Kind::IoError { backtrace, .. }
Expand Down
39 changes: 33 additions & 6 deletions src/core/util.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
use crate::uniffi::error::{Result, selector};
use crate::uniffi::{
error::{Result, selector},
model::PathSet,
};
use snafu::OptionExt as _;
use std::{any::type_name, collections::HashMap, fmt};
use std::{
any::type_name,
collections::HashMap,
fmt::{self, Debug},
hash::Hash,
};

#[expect(
clippy::unwrap_used,
Expand All @@ -26,8 +34,27 @@ pub fn parse_debug_name<T: fmt::Debug>(instance: &T) -> String {
.unwrap()
}

pub fn get<'map, T>(map: &'map HashMap<String, T>, key: &str) -> Result<&'map T> {
Ok(map.get(key).context(selector::KeyMissing {
key: key.to_owned(),
})?)
pub fn get<'map, K, T>(map: &'map HashMap<K, T>, key: &K) -> Result<&'map T>
where
K: Hash + Eq + ToOwned<Owned = K> + Debug,
{
let temp = map.get(key).context(selector::KeyMissing {
key: format!("{key:?}"),
})?;
Ok(temp)
}

pub fn find_missing_keys<'a>(
input_map: &HashMap<String, PathSet>,
keys_to_check: impl Iterator<Item = &'a String>,
) -> Vec<String> {
keys_to_check
.filter_map(|key| {
if input_map.contains_key(key) {
None
} else {
Some(key.clone())
}
})
.collect()
}
13 changes: 13 additions & 0 deletions src/uniffi/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::{
result,
};
use uniffi;

/// Shorthand for a Result that returns an `OrcaError`.
pub type Result<T, E = OrcaError> = result::Result<T, E>;
/// Possible errors you may encounter.
Expand All @@ -29,6 +30,12 @@ pub(crate) enum Kind {
path: PathBuf,
backtrace: Option<Backtrace>,
},
#[snafu(display("Failed to parse DOT graph: {dot} with reason: {reason}."))]
FailedToParseDot {
dot: String,
reason: String,
backtrace: Option<Backtrace>,
},
#[snafu(display("Out of generated random names."))]
GeneratedNamesOverflow { backtrace: Option<Backtrace> },
#[snafu(display("{source} ({path:?})."))]
Expand Down Expand Up @@ -58,6 +65,7 @@ pub(crate) enum Kind {
},
#[snafu(display("No known container names."))]
NoContainerNames { backtrace: Option<Backtrace> },

#[snafu(display("Missing file or directory name ({path:?})."))]
NoFileName {
path: PathBuf,
Expand All @@ -73,6 +81,11 @@ pub(crate) enum Kind {
path: PathBuf,
backtrace: Option<Backtrace>,
},
#[snafu(display("Input map missing required packet keys: {missing_keys:?}"))]
MissingInputSpecKey {
missing_keys: Vec<String>,
backtrace: Option<Backtrace>,
},
#[snafu(transparent)]
BollardError {
source: BollardError,
Expand Down
3 changes: 3 additions & 0 deletions src/uniffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ pub mod model;
pub mod orchestrator;
/// Data persistence provided by a store backend.
pub mod store;

/// Pipeline management and execution.
pub mod pipeline;
2 changes: 1 addition & 1 deletion src/uniffi/orchestrator/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl Orchestrator for LocalDockerOrchestrator {
.await?
.map(|(assigned_name, run_info)| {
let pod_job: PodJob =
serde_json::from_str(get(&run_info.labels, "org.orcapod.pod_job")?)?;
serde_json::from_str(get(&run_info.labels, &"org.orcapod.pod_job".to_owned())?)?;
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Allocating a String inline for the label key is unnecessary. Consider defining a const POD_JOB_LABEL: &str = "org.orcapod.pod_job" and using &POD_JOB_LABEL.to_owned() or similar to avoid repeated to_owned() calls.

Suggested change
serde_json::from_str(get(&run_info.labels, &"org.orcapod.pod_job".to_owned())?)?;
serde_json::from_str(get(&run_info.labels, &POD_JOB_LABEL.to_owned())?)?;

Copilot uses AI. Check for mistakes.
Ok(PodRun::new::<Self>(&pod_job, assigned_name))
})
.collect()
Expand Down
Loading