henrysun007 commented on code in PR #685: URL: https://github.com/apache/incubator-teaclave/pull/685#discussion_r1160428276
########## services/execution/enclave/src/lib.rs: ########## @@ -84,36 +81,49 @@ fn start_service(config: &RuntimeConfig) -> Result<()> { service.start() } -#[handle_ecall] -fn handle_start_service(input: &StartServiceInput) -> TeeServiceResult<StartServiceOutput> { - match start_service(&input.config) { - Ok(_) => Ok(StartServiceOutput), - // terminate the enclave for executor - Err(e) => { - log::error!("Service shutdown, reason: {}", e); - Err(TeeServiceError::EnclaveForceTermination) +#[cfg(feature = "mesalock_sgx")] +pub mod handle_ecall { Review Comment: `ecall` or `ecall_handle` seems better here. ########## docs/executing-in-occlum.md: ########## @@ -0,0 +1,66 @@ +--- +permalink: /docs/executing-in-occlum +--- + +# Executing builtin-functions in Occlum + +The example shows how to run teaclave builtin-functions in Occlum. + +## Build + +1. Clone the teaclave project. + +``` +git clone https://github.com/apache/incubator-teaclave.git ./teaclave && cd ./teaclave +``` + +2. Edit the config/build.config.toml and add the executable binary as accepted inbound service of scheduler. The following is an example that uses teaclave_execution_service_libos as the name of binary. + +``` +scheduler = ["teaclave_execution_service", "teaclave_execution_service_libos"] +``` + +Note that the same name should be used in the build.config.toml and enclave_info.toml. + +3. Build teaclave project. After building the project, you can find the binary teaclave_execution_service_libos in ${TEACLAVE_BIN_INSTALL_DIR}. Work at teaclave project source directory. + +``` +mkdir build && cd build +cmake .. +make +``` + +4. Build occlum instance. Cmake/scripts/build_occlum_instance.sh is a demo script to build an instance. Review Comment: Better highlight file path like `Cmake/scripts/build_occlum_instance.sh`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@teaclave.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@teaclave.apache.org For additional commands, e-mail: notifications-h...@teaclave.apache.org