occlum/demos/grpc/run_server_on_occlum.sh
2021-09-26 16:34:52 +08:00

36 lines
537 B
Bash
Executable File

#!/bin/bash
INSTALL_DIR=/usr/local/occlum/x86_64-linux-musl
export PATH=$PATH:$INSTALL_DIR/bin
cd server
make -j$(nproc)
if [ $? -ne 0 ]
then
echo "demo make failed"
exit 1
fi
rm -rf occlum_instance
mkdir occlum_instance
cd occlum_instance
occlum init
if [ $? -ne 0 ]
then
echo "occlum init 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"
exit 1
fi
occlum run /bin/greeter_server