[demos] Update init_ra demo with grpc ratls libs

This commit is contained in:
Zheng, Qi 2023-02-24 12:32:45 +08:00 committed by volcano
parent fa5dfc690d
commit c72a46bd41
5 changed files with 19 additions and 20 deletions

@ -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. 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) ![Arch Overview](./arch.png)

@ -3,21 +3,14 @@ set -e
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 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 INITRA_DIR="${script_dir}/init_ra"
export FLASK_DIR="${script_dir}/../../python/flask" 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() function build_ratls()
{ {
rm -rf ${DEP_LIBS_DIR} && mkdir ${DEP_LIBS_DIR}
pushd ${RATLS_DIR} pushd ${RATLS_DIR}
./download_and_prepare.sh ./build.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}/
popd popd
} }

@ -1,5 +1,7 @@
fn main() { 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=grpc_ratls_client");
println!("cargo:rustc-link-lib=dylib=hw_grpc_proto"); println!("cargo:rustc-link-lib=dylib=hw_grpc_proto");
println!("cargo:rustc-link-lib=dylib=occlum_dcap");
} }

@ -8,12 +8,14 @@ targets:
- target: /lib/ - target: /lib/
copy: copy:
- files: - 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: / - target: /
copy: copy:
- files: - files:
- dynamic_config.json - dynamic_config.json
- target: /usr/share/grpc/ - target: /etc
copy: copy:
- files: - dirs:
- ${RATLS_DIR}/grpc-src/etc/roots.pem - /etc/ssl

@ -4,13 +4,15 @@ targets:
- target: /bin/ - target: /bin/
copy: copy:
- files: - 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: / - target: /
copy: copy:
- files: - files:
- dynamic_config.json - dynamic_config.json
- ../secret_config.json - ../secret_config.json
- target: /usr/share/grpc/
copy:
- files:
- ${RATLS_DIR}/grpc-src/etc/roots.pem