Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split layers according to size threshold-Push side #3

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

derrickqi2003
Copy link
Collaborator

Showing the fixes to the threshold

@derrickqi2003 derrickqi2003 self-assigned this Jan 4, 2024
@derrickqi2003 derrickqi2003 changed the title Planner changes Split layers according to size threshold Jan 30, 2024
@derrickqi2003 derrickqi2003 changed the title Split layers according to size threshold Split layers according to size threshold-Push side Jan 30, 2024
@derrickqi2003 derrickqi2003 marked this pull request as ready for review January 30, 2024 14:56
@@ -0,0 +1,45 @@
{
Copy link
Owner

Choose a reason for hiding this comment

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

add .vscode to gitignore so we don't need to commit this file

src/planner.rs Outdated
}

impl ConexPlanner {
pub fn default() -> Self {
Self {
layer_to_files: Vec::new(),
//30 mb threshold
split_threshold: 30 * 1024 * 1024,
Copy link
Owner

Choose a reason for hiding this comment

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

can this be passed in through CLI. this means it needs to be part of default() arguments, and then passed in through the Clap App in main.rs.

src/planner.rs Outdated
});
}
}
//println!("ingested total size {}",total_size.to_string());
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
//println!("ingested total size {}",total_size.to_string());

src/planner.rs Outdated
let mut segment_idx = 0;
let mut remainder_size = file.size;
while remainder_size != 0 {
//println!("remainder size {}",remainder_size.to_string());
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
//println!("remainder size {}",remainder_size.to_string());

src/planner.rs Outdated
Comment on lines 132 to 135
if frag.hard_link_to.is_some() {
//soft links don't count
current_layer_size += remainder_size;
}
Copy link
Owner

Choose a reason for hiding this comment

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

let's test this. i don't think this will do it because we want any file that's a link to occupy 0 bytes of space of content. because both hard link and softlinks are pointers.

@simon-mo
Copy link
Owner

How do run end to end testing:

  • Once the file is split and pushed, download the content to local disk, and then inspect the layer tar using tar cli command.

@simon-mo
Copy link
Owner

simon-mo commented Feb 7, 2024

How to inspect local "blobs". The blobs are in zstd compressed tar format. The way to depress them is to

cat blob-file | zstd -d > blob-file.tar
tar xf blob-file.tar # extract the content into current directory

tar has native support for zstd

tar xfz blob-file

tar can let you list the directory without untarring them

tar tvf blob-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants