Add hratls_pubkey parameter to deploy_enclave function and update related calls
This commit is contained in:
parent
e9063cba61
commit
6f92688a3c
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -410,7 +410,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "detee-shared"
|
name = "detee-shared"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+ssh://git@gitea.detee.cloud/noormohammedb/detee-shared?branch=stable_01#a6baa4059d2836b88d52cd56216993e92e83ecbc"
|
source = "git+ssh://git@gitea.detee.cloud/noormohammedb/detee-shared?branch=stable_01#9ba3bc318617b08d8c761767a23abd77519b7e6d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"prost",
|
"prost",
|
||||||
|
@ -6,6 +6,7 @@ pub fn deploy_enclave(
|
|||||||
enclave_path: &str,
|
enclave_path: &str,
|
||||||
container_name_uuid: String,
|
container_name_uuid: String,
|
||||||
port_map: Vec<(u16, u16)>,
|
port_map: Vec<(u16, u16)>,
|
||||||
|
hratls_pubkey: String,
|
||||||
) -> Result<i32> {
|
) -> Result<i32> {
|
||||||
let port_maping_string = port_map
|
let port_maping_string = port_map
|
||||||
.iter()
|
.iter()
|
||||||
@ -15,8 +16,9 @@ pub fn deploy_enclave(
|
|||||||
|
|
||||||
info!("Deploying enclave: {:?}", enclave_path);
|
info!("Deploying enclave: {:?}", enclave_path);
|
||||||
let docker_deploy_str = format!(
|
let docker_deploy_str = format!(
|
||||||
r#"docker run -d --name {container_name_uuid} -v {enclave_path}:/enclave_packager \
|
r#"docker run -d --name {container_name_uuid} -v {enclave_path}:/enclave_package \
|
||||||
--device /dev/sgx/enclave --device /dev/sgx/provision {port_maping_string} noormohammedb/occlum-enclave:v1"#
|
--device /dev/sgx/enclave --device /dev/sgx/provision \
|
||||||
|
{port_maping_string} noormohammedb/occlum-enclave:v1 {hratls_pubkey}"#
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut child = Command::new("sh")
|
let mut child = Command::new("sh")
|
||||||
|
@ -122,7 +122,12 @@ impl App {
|
|||||||
let package_path =
|
let package_path =
|
||||||
handle_package(package_url, app_uuid.clone(), host_config.delete_archive).await?;
|
handle_package(package_url, app_uuid.clone(), host_config.delete_archive).await?;
|
||||||
|
|
||||||
let exit_code = deploy_enclave(&package_path, app_name.clone(), mapped_ports.clone())?;
|
let exit_code = deploy_enclave(
|
||||||
|
&package_path,
|
||||||
|
app_name.clone(),
|
||||||
|
mapped_ports.clone(),
|
||||||
|
new_app_req.hratls_pubkey,
|
||||||
|
)?;
|
||||||
|
|
||||||
if exit_code != 0 {
|
if exit_code != 0 {
|
||||||
// TODO: cleanup unarchive_dir
|
// TODO: cleanup unarchive_dir
|
||||||
|
Loading…
Reference in New Issue
Block a user