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

support conversion progress #68

Merged
merged 18 commits into from
Oct 21, 2024

Conversation

rawdaGastan
Copy link
Contributor

@rawdaGastan rawdaGastan commented Jul 28, 2024

@rawdaGastan rawdaGastan changed the base branch from master to development_fl_server July 28, 2024 14:22
@rawdaGastan rawdaGastan force-pushed the development_support_conversion_progress branch from ce69c5e to e1ce143 Compare July 29, 2024 10:55
@rawdaGastan rawdaGastan force-pushed the development_support_conversion_progress branch from e450cfc to f867407 Compare August 18, 2024 12:11
@rawdaGastan rawdaGastan marked this pull request as ready for review August 20, 2024 08:26
Copy link
Member

@muhamadazmy muhamadazmy left a comment

Choose a reason for hiding this comment

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

Thank you Rawda for create the PR. but i have few comments you can see on the PR. I would always recommend in general to document your code (special docs over function names to make it easier to follow the logic.

I was also wondering if the rfs library should provide a better progress callback mechanism than just a channel that you send number of files over. And every user of the rfs library can then render progress directly. For example a CLI can show directories, file names, progress of file download etc. While a WEB ui like yours can show just number of files processes. (maybe later?)

A more important note is that in many cases where u use copy a shared reference would be more than enough.

Dockerfile Outdated Show resolved Hide resolved
rfs/src/pack.rs Outdated Show resolved Hide resolved
rfs/src/pack.rs Outdated Show resolved Hide resolved
fl-server/src/serve_flists.rs Outdated Show resolved Hide resolved
fl-server/src/serve_flists.rs Outdated Show resolved Hide resolved
@rawdaGastan rawdaGastan force-pushed the development_fl_server branch 2 times, most recently from 056aabf to 2efda5e Compare September 18, 2024 11:48
Comment on lines 102 to 104
self.files_count = WalkDir::new(self.docker_tmp_dir_path.as_path())
.into_iter()
.count();
Copy link
Member

Choose a reason for hiding this comment

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

Since you doing extract already is it possible to make extract_image return the number of files instead of doing this iteration (that can be intensive) just to return the number of files.

docker2fl/src/docker2fl.rs Show resolved Hide resolved
docker2fl/src/docker2fl.rs Show resolved Hide resolved
docker2fl/src/main.rs Outdated Show resolved Hide resolved
docker2fl/src/main.rs Outdated Show resolved Hide resolved
fl-server/src/handlers.rs Outdated Show resolved Hide resolved
@@ -268,12 +334,13 @@ pub async fn get_flist_state_handler(
pub async fn list_flists_handler(State(state): State<Arc<config::AppState>>) -> impl IntoResponse {
Copy link
Member

Choose a reason for hiding this comment

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

does this list all flists or per user? what if we have too many of them? should you consider pagination ? and or filtering as well.

Does it make sense to use some small db (say sqlite) to track the flists instead of scanning the entire directory of all flists everytime ?

The db can be recreated from fs when/if needed but it will be way more efficient to hit the db for queries like what flists we have, what users, what flists for that user, etc.. than scanning the fs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#77

@rawdaGastan rawdaGastan added this to the 2.1.X milestone Sep 25, 2024
command = (entrypoint.first().unwrap()).to_string();
let entrypoint = container_config
.entrypoint
.expect("failed to get entry point");
Copy link
Member

Choose a reason for hiding this comment

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

Why this should cause the entire process to panic? What if the container I am using is not configured with an entrypoint.

I really think all expect and unwrap here should instead return a suitable errors that can be handled instead of panicing

Base automatically changed from development_fl_server to master October 20, 2024 10:41
@rawdaGastan rawdaGastan force-pushed the development_support_conversion_progress branch from 9d61ac7 to 70b4933 Compare October 20, 2024 11:03
@rawdaGastan rawdaGastan force-pushed the development_support_conversion_progress branch from 70b4933 to 674ca75 Compare October 20, 2024 11:12
@rawdaGastan rawdaGastan merged commit 0dfa7ee into master Oct 21, 2024
2 checks passed
@rawdaGastan rawdaGastan deleted the development_support_conversion_progress branch October 21, 2024 09:29
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