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

Create td-shim-interface crate for publishig #657

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

OuyangHang33
Copy link
Collaborator

Fix: #654

@jyao1
Copy link
Member

jyao1 commented Feb 27, 2024

@NK-fengsf, @studychao, would you please take a look?

@NK-fengsf
Copy link

@OuyangHang33 , would you mind move TdShimLoader from td_shim_tools crate to td-shim-interface crate?

@OuyangHang33
Copy link
Collaborator Author

OuyangHang33 commented Feb 27, 2024

@NK-fengsf I'll check the feasibility today, and will let you know if move the td-shim-loader crate.

@OuyangHang33
Copy link
Collaborator Author

Hi @NK-fengsf ,
Because TdShimLoader defined the specific file operation and it's the consumer of metadata, it's not suitable to move loader.rs fromtd-shim-tool to the object of consumption td-shim-interface.

Could you give the reason why you need TdShimLoader, and how do you want to use it.

@NK-fengsf
Copy link

Hi @NK-fengsf , Because TdShimLoader defined the specific file operation and it's the consumer of metadata, it's not suitable to move loader.rs fromtd-shim-tool to the object of consumption td-shim-interface.

Could you give the reason why you need TdShimLoader, and how do you want to use it.

Dragonball VMM parse tdshim image and get Vec using TdShimLoader::parse(filename:&String)。
impl TdShimLoader {
pub fn parse(filename: &String) -> Option<(TdxMetadataDescriptor, Vec)> {}
}

I can make a copy of loader.rs into Dragonball sandbox , if it is not suitable to move loader.rs fromtd-shim-tool to td-shim-interface.

@jyao1
Copy link
Member

jyao1 commented Feb 28, 2024

Dragonball VMM parse tdshim image and get Vec using TdShimLoader::parse(filename:&String)。
impl TdShimLoader {
pub fn parse(filename: &String) -> Option<(TdxMetadataDescriptor, Vec)> {}
}

If my understanding is correct, you just need to have a parse() function.
Can we change the API to accept a binary string and output the metadata descriptor?

The reason is that we are NOT able to handle file operation in non-std env.

@NK-fengsf
Copy link

g and output the me

yes, I just need the parse function. It's okay for me to change the API to accept a binary string and output the metadata descriptor.

@OuyangHang33
Copy link
Collaborator Author

OuyangHang33 commented Feb 29, 2024

Hi @jyao1 @NK-fengsf , I create the PR to change the API and split the read_file operation: #660.
If the new parse function has no problems, I can move it to the td-shim-interface.

@NK-fengsf
Copy link

@OuyangHang33 , would you mind move TdShimLoader from td_shim_tools crate to td-shim-interface crate?

Hi @OuyangHang33 , I have no other needs apart from this. Thank you very much.

@OuyangHang33
Copy link
Collaborator Author

Hi @NK-fengsf , I have moved TdShimLoader from td_shim_tools crate to td-shim-interface crate.

@OuyangHang33
Copy link
Collaborator Author

OuyangHang33 commented Mar 5, 2024

Hi @NK-fengsf , could you test the new crate? if it can meet your requirement, we will publish it after merged.
Thank you!

@NK-fengsf
Copy link

Hi @NK-fengsf , could you test the new crate? if it can meet your requirement, we will publish it after merged. Thank you!

@OuyangHang33 Okay, I will finish the test before tomorrow evening。

@NK-fengsf
Copy link

Hi @NK-fengsf , could you test the new crate? if it can meet your requirement, we will publish it after merged. Thank you!

I have tested the td-shim-interface crate, it works well in dragonball-sandbox. @OuyangHang33 , CC @jyao1

@jyao1 jyao1 merged commit 6c780e6 into confidential-containers:main Mar 7, 2024
17 checks passed
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.

Publish td-shim in crate.io
4 participants