confidential-containers / guest-components

Confidential Containers Guest Tools and Components
Apache License 2.0
81 stars 89 forks source link

Image-rs & CDH | Refactoring and use the same ImageClient #708

Open Xynnn007 opened 3 weeks ago

Xynnn007 commented 3 weeks ago

This PR organizes the code of image-rs to make it more modular and allows CDH and image-rs to share the same image pull configuration file.

With the modular refactoring, we found some hidden bugs that caused by static/global variables. This refactoring tries to get rid of static/global variables to promote the reentrancy.

Please see each commit for a more structured view.

cc @fitzthum @ChengyuZhu6

Xynnn007 commented 2 weeks ago

I think there are still some improvements to make in image-rs, but this is a step forward.

Yes. Please give some ideas about this, and I will try to figure out if we can promote in this pr together

Xynnn007 commented 4 days ago

Rebased to resolve the conflicts.

fitzthum commented 4 days ago

I've noticed that some comments in the code of the repo use three slashes ///, while others use two //. Are there specific scenarios for using these two types of comments? For example, is it recommended to use /// in one comment type and // in another comment type?

Three slash comments get used to generate the rustdocs. You can also use /** */ to do block doc comments. Ideally we should have one of these comments at the top of all our public functions in components that can be used as crates.

ChengyuZhu6 commented 4 days ago

I've noticed that some comments in the code of the repo use three slashes ///, while others use two //. Are there specific scenarios for using these two types of comments? For example, is it recommended to use /// in one comment type and // in another comment type?

Three slash comments get used to generate the rustdocs. You can also use /** */ to do block doc comments. Ideally we should have one of these comments at the top of all our public functions in components that can be used as crates.

Thanks Tobin. I noticed that some public structures or variables in the structure in the code are commented with //, while others are commented with ///. This seems curious to me.

ChengyuZhu6 commented 4 days ago

BTW, do we need to cut a minor release and bump guest-components and image-rs to the new minor release in kata, according to the community meeting? If so, I recommend holding off on merging this PR until the release is cut.

fitzthum commented 4 days ago

BTW, do we need to cut a minor release and bump guest-components and image-rs to the new minor release in kata, according to the community meeting? If so, I recommend holding off on merging this PR until the release is cut.

It sounds like we don't need another release, but we still might want to wait until next week to merge this stuff just in case.

fitzthum commented 4 days ago

I noticed that some public structures or variables in the structure in the code are commented with //, while others are commented with ///. This seems curious to me.

Yeah I think we have not been very consistent so far.