-
Notifications
You must be signed in to change notification settings - Fork 39
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
WIP: split veracruz-server and runtime-manager into platform-specific crates #112
Conversation
WIP: Reuse structures and functions from the parent crate (veracruz-server)
@@ -0,0 +1,133 @@ | |||
//! The Veracruz server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is very little in this file that is SGX-specific, and this file is likely to appear in all platform-specific servers.
Is there a way that we can use this code across all platforms instead of duplicating it?
@@ -0,0 +1,35 @@ | |||
//! Veracruz server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment in this one. As far as I can tell, there is no SGX-specific code in this one.
# See the `LICENSE.markdown` file in the Veracruz root director for licensing | ||
# and copyright information. | ||
|
||
.PHONY: all policy-files sgx trustzone deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trustzone
build target is now redundant here, I think.
webpki-roots = "0.16" | ||
|
||
|
||
[dependencies.veracruz-server-sgx] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use [dependencies.veracruz-server-sgx]
here?
)); | ||
rustls::ClientSession::new(&std::sync::Arc::new(client_config), dns_name) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superfluous newlines, here.
let rst = client_tls_send(&client_tls_tx, &client_tls_rx, &mut client_session, &request).unwrap(); | ||
let rst = protobuf::parse_from_bytes::<transport_protocol::RuntimeManagerResponse>(&rst); | ||
assert!(rst.is_ok()); | ||
//let response = rst.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented code should be deleted.
Ok(_) => (), | ||
Err(err) => return Err(format!("Error in tx.send() {:?}", err)), | ||
}; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This trailing else
can be deleted.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…ponder with a type parameter
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@gbryant-arm, the changes you made to the |
BTW, you should probably also rebase sooner rather than later, as there have been some fairly extensive changes in |
[package] | ||
name = "veracruz-server-sgx-fuzz" | ||
version = "0.0.0" | ||
authors = ["Shale Xiong"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably forgot to change here on authorship since the first initial commit and this fuzz test is no longer valid.
|
||
match res { | ||
Ok(_) => (), | ||
Err(err) => return Err(format!("Error in tx.send() {:?}", err)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map_err
in Result
type and ok_or
in Option
type, together with the ?
operator, can be useful in term of propagating Error, e.g.
let res = tx.send(output).map_err(|err|format!("Error in tx.send() {:?}", err))?;
In fact here if you never want to use the Ok(_)
case, you could try
tx.send(output).map_err(|err| format!("Error in tx.send() {:?}", err))?;
Just to say, there is no problem of use match
. However, these two functions can help you to write less code, especially less indentation for readability.
Are you still making progress, @gbryant-arm, or are you stuck? |
@@ -0,0 +1,40 @@ | |||
[package] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file needs the copyright/licensing header at the top that all other Cargo.toml
files have.
Thanks @dreemkiller @dominic-mulligan-arm @ShaleXIONG for your feedback. I will address the comments soon, but first I'd like to focus on splitting veracruz-server (that's my first MVP) |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Fix various errors
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Closing this as I have taken over the task. |
This PR aims at splitting platform-specific code (backend) from the runtime and the rest of the codebase (#81).
The goal is to make the codebase more modular and in particular to simplify the process of adding support for another platform.
Todo: