occlum/demos/grpc/run_client_on_occlum.sh
He Sun 4ab667461e Add gRPC demo
This demo shows how to run gRPC C++ sample client/server on Occlum.
2019-12-13 12:17:55 +00:00

46 lines
705 B
Bash
Executable File

#!/bin/bash
install_dir=/usr/local/occlum/x86_64-linux-musl
export PATH=$PATH:$install_dir/bin
cd client
make -j8
if [ $? -ne 0 ]
then
echo "demo make failed"
exit 1
fi
rm -rf occlum_context
mkdir occlum_context
cd occlum_context
occlum init
if [ $? -ne 0 ]
then
echo "occlum init failed"
exit 1
fi
mkdir -p image/etc
cp /etc/resolv.conf 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
occlum build
if [ $? -ne 0 ]
then
echo "occlum build failed"
exit 1
fi
occlum run /bin/greeter_client