Skip to content

Commit 27d38c6

Browse files
committed
chore: bump xet-core to c805591 (cas_object->xorb_object, Ulid tracking IDs)
- Update all xet-core crates from e85cf9d to c805591 - Rename cas_object crate to xorb_object (SerializedCasObject -> SerializedXorbObject) - Add Ulid tracking ID parameter to download_stream_from_offset, download_file, start_clean, and upload_files calls
1 parent 6b93d3d commit 27d38c6

5 files changed

Lines changed: 67 additions & 62 deletions

File tree

Cargo.lock

Lines changed: 48 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ edition = "2024"
55

66
[dependencies]
77
# xet-core crates
8-
data = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
9-
mdb_shard = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
10-
utils = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
11-
hub_client = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
12-
xet_runtime = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
13-
cas_client = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
14-
cas_types = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
15-
cas_object = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
16-
merklehash = { git = "https://github.com/huggingface/xet-core.git", rev = "e85cf9d" }
8+
data = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
9+
mdb_shard = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
10+
utils = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
11+
hub_client = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
12+
xet_runtime = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
13+
cas_client = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
14+
cas_types = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
15+
xorb_object = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
16+
merklehash = { git = "https://github.com/huggingface/xet-core.git", rev = "c805591" }
1717

1818
# External crates
1919
fuser = "0.17"
@@ -30,6 +30,7 @@ async-trait = "0.1"
3030
bytes = "1"
3131
chrono = "0.4"
3232
uuid = { version = "1", features = ["v4"] }
33+
ulid = "1"
3334
nfsserve = "0.10"
3435

3536
[[bin]]

src/cached_xet_client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::sync::{Arc, Mutex};
44
use bytes::Bytes;
55
use cas_client::adaptive_concurrency::ConnectionPermit;
66
use cas_client::{Client, ProgressCallback, URLProvider};
7-
use cas_object::SerializedCasObject;
7+
use xorb_object::SerializedXorbObject;
88
use cas_types::{BatchQueryReconstructionResponse, FileRange, QueryReconstructionResponse};
99
use mdb_shard::file_structs::MDBFileInfo;
1010
use merklehash::MerkleHash;
@@ -103,7 +103,7 @@ impl Client for CachedXetClient {
103103
async fn upload_xorb(
104104
&self,
105105
prefix: &str,
106-
serialized_cas_object: SerializedCasObject,
106+
serialized_cas_object: SerializedXorbObject,
107107
progress_callback: Option<ProgressCallback>,
108108
upload_permit: ConnectionPermit,
109109
) -> Result<u64> {
@@ -244,7 +244,7 @@ mod tests {
244244
async fn upload_xorb(
245245
&self,
246246
_prefix: &str,
247-
_serialized_cas_object: SerializedCasObject,
247+
_serialized_cas_object: SerializedXorbObject,
248248
_progress_callback: Option<ProgressCallback>,
249249
_upload_permit: ConnectionPermit,
250250
) -> Result<u64> {

src/xet.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::sync::Arc;
44
use bytes::Bytes;
55
use data::configurations::TranslatorConfig;
66
use data::{FileDownloadSession, FileUploadSession, SingleFileCleaner, XetFileInfo};
7+
use ulid::Ulid;
78

89
use crate::error::{Error, Result};
910

@@ -50,7 +51,7 @@ impl XetSessions {
5051
/// Start a streaming download from a byte offset (sync, returns an iterator-like stream).
5152
pub fn download_stream(&self, file_info: &XetFileInfo, offset: u64) -> Result<data::DownloadStream> {
5253
self.session
53-
.download_stream_from_offset(file_info, offset, None)
54+
.download_stream_from_offset(file_info, offset, Ulid::new())
5455
.map_err(|e| Error::Xet(e.to_string()))
5556
}
5657
}
@@ -66,7 +67,7 @@ impl XetOps for XetSessions {
6667
.await
6768
.map_err(|e| Error::Xet(e.to_string()))?;
6869
let cleaner = session
69-
.start_clean(None, None, Some(mdb_shard::Sha256::default()))
70+
.start_clean(None, 0, Some(mdb_shard::Sha256::default()), Ulid::new())
7071
.await;
7172
Ok(Box::new(StreamingWriter {
7273
cleaner,
@@ -78,7 +79,7 @@ impl XetOps for XetSessions {
7879
async fn download_to_file(&self, xet_hash: &str, file_size: u64, dest: &Path) -> Result<()> {
7980
let file_info = XetFileInfo::new(xet_hash.to_string(), file_size);
8081
self.session
81-
.download_file(&file_info, dest, None)
82+
.download_file(&file_info, dest, Ulid::new())
8283
.await
8384
.map_err(|e| Error::Xet(e.to_string()))?;
8485
Ok(())
@@ -96,7 +97,7 @@ impl XetOps for XetSessions {
9697

9798
let files: Vec<_> = paths
9899
.iter()
99-
.map(|p| (p.to_path_buf(), Some(mdb_shard::Sha256::default())))
100+
.map(|p| (p.to_path_buf(), Some(mdb_shard::Sha256::default()), Ulid::new()))
100101
.collect();
101102

102103
let results = upload_session

tests/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub async fn upload_file(
163163
.await
164164
.expect("FileUploadSession::new failed");
165165

166-
let files = vec![(staged_path.to_path_buf(), None::<mdb_shard::Sha256>)];
166+
let files = vec![(staged_path.to_path_buf(), None::<mdb_shard::Sha256>, ulid::Ulid::new())];
167167
let mut results = upload_session.upload_files(files).await.expect("upload_files failed");
168168

169169
let file_info = results.pop().expect("upload returned no file info");

0 commit comments

Comments
 (0)