occlum/demos/fish/run_fish_test.sh
Zheng, Qi cbb326e3fd Update fish demo with copy_bom tool
Signed-off-by: Zheng, Qi <huaiqing.zq@antgroup.com>
2021-09-26 15:36:09 +08:00

22 lines
603 B
Bash
Executable File

#!/bin/bash
set -e
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
bomfile=${SCRIPT_DIR}/fish.yaml
rm -rf occlum-instance
occlum new occlum-instance
cd occlum-instance
new_json="$(jq '.resource_limits.user_space_size = "512MB" |
.resource_limits.kernel_space_heap_size = "64MB" |
.env.default = [ "OCCLUM=yes", "HOME=/root" ]' Occlum.json)" && \
echo "${new_json}" > Occlum.json
rm -rf image
copy_bom -f $bomfile --root image --include-dir /opt/occlum/etc/template
occlum build
echo -e "\nBuild done. Running fish script ..."
occlum run /bin/fish_script.sh