[docs] Add README.md for executor (#309)
diff --git a/README.md b/README.md
index af02e2a..b122cab 100644
--- a/README.md
+++ b/README.md
@@ -44,6 +44,7 @@
### Codebase
- [Teaclave Services](services)
+- [Function Executors](executor)
- [Configurations in Teaclave](config)
- [Data Center Attestation Service](dcap)
- [Keys and Certificates](keys)
diff --git a/executor/Cargo.toml b/executor/Cargo.toml
index b6428f4..cc18df0 100644
--- a/executor/Cargo.toml
+++ b/executor/Cargo.toml
@@ -23,6 +23,21 @@
"teaclave_runtime/mesalock_sgx"
]
+# Enable builtin functions for the builtin executor
+
+full_builtin_function = [
+ "builtin_echo",
+ "builtin_gbdt_predict",
+ "builtin_gbdt_train",
+ "builtin_logistic_regression_predict",
+ "builtin_logistic_regression_train"
+]
+builtin_echo = []
+builtin_gbdt_predict = []
+builtin_gbdt_train = []
+builtin_logistic_regression_predict = []
+builtin_logistic_regression_train = []
+
[dependencies]
log = { version = "0.4.6" }
anyhow = { version = "1.0.26" }
diff --git a/executor/README.md b/executor/README.md
new file mode 100644
index 0000000..9d3d1dc
--- /dev/null
+++ b/executor/README.md
@@ -0,0 +1,22 @@
+---
+permalink: /executor
+---
+
+# Function Executors
+
+Function executor is one of the core component in a FaaS platform to provide
+execution runtime for running user-defined functions. In Teaclave, we aim to
+provide safe, secure and versatile function executors, which can guarantee the
+confidentiality of security-sensitive data during computation, and also support
+functions written in different languages. In addition, we are working hard to
+achieve better security guarantees such as memory safety.
+
+In Teaclave, there are two executors to native and Python functions.
+- *Builtin Executor*: There are many useful built-in functions which are statically
+ compiled with Teaclave. Normally, these built-in functions are implemented in
+ Rust, and can provide better (native) performance. The Builtin executor is to
+ dispatch function invocation requests to corresponding built-in function
+ implementations.
+- *MesaPy Executor*: The MesaPy executor provides a Python interpreter in SGX.
+ User-defined Python functions can be executed in the MesaPy executor. The
+ executor also provides interfaces to fetch and store data through the runtime.
diff --git a/executor/src/builtin.rs b/executor/src/builtin.rs
index b5c37f6..9e9941f 100644
--- a/executor/src/builtin.rs
+++ b/executor/src/builtin.rs
@@ -37,10 +37,15 @@
runtime: FunctionRuntime,
) -> Result<String> {
match name.as_str() {
+ #[cfg(feature = "builtin_echo")]
Echo::NAME => Echo::new().run(arguments, runtime),
+ #[cfg(feature = "builtin_gbdt_predict")]
GbdtPredict::NAME => GbdtPredict::new().run(arguments, runtime),
+ #[cfg(feature = "builtin_gbdt_train")]
GbdtTrain::NAME => GbdtTrain::new().run(arguments, runtime),
+ #[cfg(feature = "builtin_logistic_regression_train")]
LogisticRegressionTrain::NAME => LogisticRegressionTrain::new().run(arguments, runtime),
+ #[cfg(feature = "builtin_logistic_regression_predict")]
LogisticRegressionPredict::NAME => {
LogisticRegressionPredict::new().run(arguments, runtime)
}
diff --git a/worker/Cargo.toml b/worker/Cargo.toml
index fe73855..fa403a9 100644
--- a/worker/Cargo.toml
+++ b/worker/Cargo.toml
@@ -27,7 +27,7 @@
serde_json = { version = "1.0.39" }
thiserror = { version = "1.0.9" }
teaclave_types = { path = "../types" }
-teaclave_executor = { path = "../executor" }
+teaclave_executor = { path = "../executor", features = ["full_builtin_function"] }
teaclave_runtime = { path = "../runtime" }
teaclave_test_utils = { path = "../tests/utils", optional = true }