diff --git a/demos/remote_attestation/init_ra_flow/README.md b/demos/remote_attestation/init_ra_flow/README.md index c443d431..cdb798fe 100644 --- a/demos/remote_attestation/init_ra_flow/README.md +++ b/demos/remote_attestation/init_ra_flow/README.md @@ -6,7 +6,7 @@ Remote attestation is a key part in the confidential computing. Occlum provides Occlum provides a `Init RA` way to seperate the RA operation and the actual application. With this way, the APP developers don't need know too much about the RA and the application doesn't need to be modified for RA. -This demo shows the `Init RA` way with a sample [`Flask TLS web application`](../../python/flask/), based on [`GRPC-RATLS`](../../ra_tls/) server/client implementation and a modified [`init`](./init_ra/) for Occlum InitFS. +This demo shows the `Init RA` way with a sample [`Flask TLS web application`](../../python/flask/), based on [`GRPC-RATLS`](../../../tools/toolchains/grpc_ratls/ra_tls/) server/client implementation and a modified [`init`](./init_ra/) for Occlum InitFS. ![Arch Overview](./arch.png) diff --git a/demos/remote_attestation/init_ra_flow/build_content.sh b/demos/remote_attestation/init_ra_flow/build_content.sh index dd57aab9..58f09bec 100755 --- a/demos/remote_attestation/init_ra_flow/build_content.sh +++ b/demos/remote_attestation/init_ra_flow/build_content.sh @@ -3,21 +3,14 @@ set -e script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -export DEP_LIBS_DIR="${script_dir}/dep_libs" export INITRA_DIR="${script_dir}/init_ra" export FLASK_DIR="${script_dir}/../../python/flask" -export RATLS_DIR="${script_dir}/../../ra_tls" +export RATLS_DIR="${script_dir}/../../../tools/toolchains/grpc_ratls/" function build_ratls() { - rm -rf ${DEP_LIBS_DIR} && mkdir ${DEP_LIBS_DIR} pushd ${RATLS_DIR} - ./download_and_prepare.sh - ./build_and_install.sh musl - - cp ./grpc-src/examples/cpp/ratls/build/libgrpc_ratls_client.so ${DEP_LIBS_DIR}/ - cp ./grpc-src/examples/cpp/ratls/build/libhw_grpc_proto.so ${DEP_LIBS_DIR}/ - + ./build.sh popd } diff --git a/demos/remote_attestation/init_ra_flow/init_ra/build.rs b/demos/remote_attestation/init_ra_flow/init_ra/build.rs index 8a70a4cd..cc3578d7 100644 --- a/demos/remote_attestation/init_ra_flow/init_ra/build.rs +++ b/demos/remote_attestation/init_ra_flow/init_ra/build.rs @@ -1,5 +1,7 @@ fn main() { - println!("cargo:rustc-link-search=native=../dep_libs"); + println!("cargo:rustc-link-search=native=/opt/occlum/toolchains/dcap_lib/musl"); + println!("cargo:rustc-link-search=native=/opt/occlum/toolchains/grpc_ratls/musl"); println!("cargo:rustc-link-lib=dylib=grpc_ratls_client"); println!("cargo:rustc-link-lib=dylib=hw_grpc_proto"); + println!("cargo:rustc-link-lib=dylib=occlum_dcap"); } \ No newline at end of file diff --git a/demos/remote_attestation/init_ra_flow/init_ra_client.yaml b/demos/remote_attestation/init_ra_flow/init_ra_client.yaml index 300599d1..47fe9553 100644 --- a/demos/remote_attestation/init_ra_flow/init_ra_client.yaml +++ b/demos/remote_attestation/init_ra_flow/init_ra_client.yaml @@ -8,12 +8,14 @@ targets: - target: /lib/ copy: - files: - - ${DEP_LIBS_DIR}/libgrpc_ratls_client.so + - /opt/occlum/toolchains/grpc_ratls/musl/libgrpc_ratls_client.so + - /opt/occlum/toolchains/grpc_ratls/musl/libhw_grpc_proto.so + - /opt/occlum/toolchains/dcap_lib/musl/libocclum_dcap.so.0.1.0 - target: / copy: - files: - dynamic_config.json - - target: /usr/share/grpc/ + - target: /etc copy: - - files: - - ${RATLS_DIR}/grpc-src/etc/roots.pem + - dirs: + - /etc/ssl diff --git a/demos/remote_attestation/init_ra_flow/ra_server.yaml b/demos/remote_attestation/init_ra_flow/ra_server.yaml index d7225594..450360b1 100644 --- a/demos/remote_attestation/init_ra_flow/ra_server.yaml +++ b/demos/remote_attestation/init_ra_flow/ra_server.yaml @@ -4,13 +4,15 @@ targets: - target: /bin/ copy: - files: - - ${RATLS_DIR}/grpc-src/examples/cpp/ratls/build/server + - /opt/occlum/toolchains/grpc_ratls/musl/server + - target: /lib/ + copy: + - files: + - /opt/occlum/toolchains/grpc_ratls/musl/libgrpc_ratls_server.so + - /opt/occlum/toolchains/grpc_ratls/musl/libhw_grpc_proto.so + - /opt/occlum/toolchains/dcap_lib/musl/libocclum_dcap.so.0.1.0 - target: / copy: - files: - dynamic_config.json - ../secret_config.json - - target: /usr/share/grpc/ - copy: - - files: - - ${RATLS_DIR}/grpc-src/etc/roots.pem