You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by ms...@apache.org on 2020/05/08 21:38:15 UTC
[incubator-teaclave] branch master updated: [docs] Add instructions
to run in simulaiton mode
This is an automated email from the ASF dual-hosted git repository.
mssun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git
The following commit(s) were added to refs/heads/master by this push:
new 11218c7 [docs] Add instructions to run in simulaiton mode
11218c7 is described below
commit 11218c7717b6df3e24abfbeb0d9481f76ea3998f
Author: Mingshen Sun <bo...@mssun.me>
AuthorDate: Fri May 8 14:03:57 2020 -0700
[docs] Add instructions to run in simulaiton mode
---
docs/my-first-function.md | 39 ++++++++++++++++++++++++++++++++++++---
1 file changed, 36 insertions(+), 3 deletions(-)
diff --git a/docs/my-first-function.md b/docs/my-first-function.md
index 934fc48..7498764 100644
--- a/docs/my-first-function.md
+++ b/docs/my-first-function.md
@@ -14,7 +14,8 @@ can found in
If you don't have an SGX supported hardware at hand, Teaclave can also run in
simulation mode. However some functions like remote attestation will be disable
-at this mode.
+at this mode. Please start from [here](#simulation-mode) if you plan to try in
+simulation mode.
## Clone and Build Teaclave
@@ -41,8 +42,6 @@ $ docker run --rm -v $(pwd):/teaclave -w /teaclave \
make"
```
-To build in simulation mode, you can add `-DSGX_SIM_MODE=ON` to `cmake`.
-
## Setup Attestation Service
For simplicity, we use Intel Attestation Service (IAS) in this tutorial. To get
@@ -85,3 +84,37 @@ Starting teaclave-execution-service ... done
Starting teaclave-frontend-service ... done
Attaching to ...
```
+
+## Simulation Mode
+
+To try Teaclave in SGX simulation mode, please install Intel SGX SDK first with instructions in
+[Intel SGX Installation Guide](https://download.01.org/intel-sgx/sgx-linux/2.9/docs/Intel_SGX_Installation_Guide_Linux_2.9_Open_Source.pdf).
+
+Then clone and build Teaclave (with the `-DSGX_SIM_MODE=ON` option in `cmake`).
+
+```
+$ git clone https://github.com/apache/incubator-teaclave.git
+$ cd incubator-teaclave
+$ docker run --rm -v $(pwd):/teaclave -w /teaclave \
+ -it teaclave/teaclave-build-ubuntu-1804-sgx-2.9:latest \
+ bash -c ". /root/.cargo/env && \
+ mkdir -p build && cd build && \
+ cmake -DTEST_MODE=ON -DSGX_SIM_MODE=ON .. && \
+ make"
+```
+
+Since the attestation is disabled in the simulation mode, related environment
+variables can be set to any values.
+
+```
+$ export AS_SPID="00000000000000000000000000000000"
+$ export AS_KEY="00000000000000000000000000000000"
+$ export AS_ALGO="sgx_epid"
+$ export AS_URL="https://api.trustedservices.intel.com:443"
+```
+
+At last, launch all services with `docker-compose`:
+
+```
+$ (cd docker && docker-compose -f docker-compose-ubuntu-1804.yml up --build)
+```
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org