diff --git a/demos/grpc/grpc_client.yaml b/demos/grpc/grpc_client.yaml new file mode 100644 index 00000000..13de34ce --- /dev/null +++ b/demos/grpc/grpc_client.yaml @@ -0,0 +1,7 @@ +includes: + - base.yaml +targets: + - target: /bin/ + copy: + - files: + - ../greeter_client diff --git a/demos/grpc/grpc_server.yaml b/demos/grpc/grpc_server.yaml new file mode 100644 index 00000000..c571fc96 --- /dev/null +++ b/demos/grpc/grpc_server.yaml @@ -0,0 +1,7 @@ +includes: + - base.yaml +targets: + - target: /bin/ + copy: + - files: + - ../greeter_server diff --git a/demos/grpc/run_client_on_occlum.sh b/demos/grpc/run_client_on_occlum.sh index 966330d6..17da8542 100755 --- a/demos/grpc/run_client_on_occlum.sh +++ b/demos/grpc/run_client_on_occlum.sh @@ -23,18 +23,10 @@ then exit 1 fi -mkdir -p image/etc -cp ../greeter_client image/bin -cp $INSTALL_DIR/lib/libprotobuf.so.3.10.0.0 image/lib -cp $INSTALL_DIR/lib/libcares.so.2 image/lib -cp $INSTALL_DIR/lib/libz.so.1 image/lib -if [ $? -ne 0 ] -then - echo "libraries copied failed" - exit 1 -fi - +rm -rf image && \ +copy_bom -f ../grpc_client.yaml --root image --include-dir /opt/occlum/etc/template && \ occlum build + if [ $? -ne 0 ] then echo "occlum build failed" diff --git a/demos/grpc/run_server_on_occlum.sh b/demos/grpc/run_server_on_occlum.sh index 73db227a..e67a0af3 100755 --- a/demos/grpc/run_server_on_occlum.sh +++ b/demos/grpc/run_server_on_occlum.sh @@ -22,18 +22,10 @@ then exit 1 fi -mkdir -p image/etc -cp ../greeter_server image/bin -cp $INSTALL_DIR/lib/libprotobuf.so.3.10.0.0 image/lib -cp $INSTALL_DIR/lib/libcares.so.2 image/lib -cp $INSTALL_DIR/lib/libz.so.1 image/lib -if [ $? -ne 0 ] -then - echo "libraries copied failed" - exit 1 -fi - +rm -rf image && \ +copy_bom -f ../grpc_server.yaml --root image --include-dir /opt/occlum/etc/template && \ occlum build + if [ $? -ne 0 ] then echo "occlum build failed"