Skip to content

Commit

Permalink
CasObject + LocalClient (#5)
Browse files Browse the repository at this point in the history
* CasObject with tests as cas_object crate

* LocalClient using CasObject

- all unit-tests are running successfully.

* Added back unit-tests from prev local_client.rs

* Removed unused variants for CasObjectError enum

* Removed unused use

* Add github actions (#4)

* Fixed clippy unhappiness

---------

Co-authored-by: Di Xiao <di@huggingface.co>
  • Loading branch information
rajatarya and seanses authored Sep 12, 2024
1 parent 1f006e2 commit 4844be4
Show file tree
Hide file tree
Showing 9 changed files with 778 additions and 248 deletions.
20 changes: 18 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ members = [
"retry_strategy",
"shard_client",
"utils",
"xet_error",
"xet_error", "cas_object",
]

[profile.release]
Expand Down
2 changes: 2 additions & 0 deletions cas_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ strict = []
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cas_object = {path = "../cas_object"}
error_printer = {path = "../error_printer"}
utils = {path = "../utils"}
merkledb = {path = "../merkledb"}
Expand Down Expand Up @@ -56,3 +57,4 @@ trait-set = "0.3.0"
lazy_static = "1.4.0"
tokio-stream = { version = "0.1", features = ["net"] }
rcgen = "0.12.0"
rand = "0.8.5"
6 changes: 6 additions & 0 deletions cas_client/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ pub enum CasClientError {
#[error("Hash Mismatch")]
HashMismatch,

#[error("Internal IO Error: {0}")]
InternalIOError(#[from] std::io::Error),

#[error("Other Internal Error: {0}")]
InternalError(anyhow::Error),

Expand All @@ -59,6 +62,9 @@ pub enum CasClientError {

#[error("Runtime Error (Temp files): {0}")]
RuntimeErrorTempFileError(#[from] tempfile::PersistError),

#[error("Cas Object Error: {0}")]
CasObjectError(#[from] cas_object::error::CasObjectError),
}

// Define our own result type here (this seems to be the standard).
Expand Down
Loading

0 comments on commit 4844be4

Please sign in to comment.