From 59988f9491d9eb2056b1495f1b56f57b6edd21e5 Mon Sep 17 00:00:00 2001 From: "zongmin.gu" Date: Sun, 26 Sep 2021 13:42:04 +0800 Subject: [PATCH] Update ping/pong demo with bom file --- demos/golang/grpc_pingpong/ping.yaml | 11 +++++++++++ demos/golang/grpc_pingpong/pong.yaml | 11 +++++++++++ demos/golang/grpc_pingpong/run_ping_on_occlum.sh | 4 ++-- demos/golang/grpc_pingpong/run_pong_on_occlum.sh | 4 ++-- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 demos/golang/grpc_pingpong/ping.yaml create mode 100644 demos/golang/grpc_pingpong/pong.yaml diff --git a/demos/golang/grpc_pingpong/ping.yaml b/demos/golang/grpc_pingpong/ping.yaml new file mode 100644 index 00000000..67418888 --- /dev/null +++ b/demos/golang/grpc_pingpong/ping.yaml @@ -0,0 +1,11 @@ +includes: + - base.yaml +targets: + - target: /bin + copy: + - files: + - ../occlum_ping + - target: /etc + copy: + - files: + - /etc/hosts diff --git a/demos/golang/grpc_pingpong/pong.yaml b/demos/golang/grpc_pingpong/pong.yaml new file mode 100644 index 00000000..8995eb93 --- /dev/null +++ b/demos/golang/grpc_pingpong/pong.yaml @@ -0,0 +1,11 @@ +includes: + - base.yaml +targets: + - target: /bin + copy: + - files: + - ../occlum_pong + - target: /etc + copy: + - files: + - /etc/hosts diff --git a/demos/golang/grpc_pingpong/run_ping_on_occlum.sh b/demos/golang/grpc_pingpong/run_ping_on_occlum.sh index f5262187..19dc0356 100755 --- a/demos/golang/grpc_pingpong/run_ping_on_occlum.sh +++ b/demos/golang/grpc_pingpong/run_ping_on_occlum.sh @@ -25,8 +25,8 @@ new_json="$(jq '.resource_limits.user_space_size = "2560MB" | echo "${new_json}" > Occlum.json # 2. Copy program into Occlum Workspace and build -cp ../occlum_ping image/bin -cp /etc/hosts image/etc/ +rm -rf image && \ +copy_bom -f ../ping.yaml --root image --include-dir /opt/occlum/etc/template && \ occlum build # 3. Run the hello world sample diff --git a/demos/golang/grpc_pingpong/run_pong_on_occlum.sh b/demos/golang/grpc_pingpong/run_pong_on_occlum.sh index 033f21b4..1e2c3bed 100755 --- a/demos/golang/grpc_pingpong/run_pong_on_occlum.sh +++ b/demos/golang/grpc_pingpong/run_pong_on_occlum.sh @@ -25,8 +25,8 @@ new_json="$(jq '.resource_limits.user_space_size = "2560MB" | echo "${new_json}" > Occlum.json # 2. Copy program into Occlum Workspace and build -cp ../occlum_pong image/bin -cp /etc/hosts image/etc/ +rm -rf image && \ +copy_bom -f ../pong.yaml --root image --include-dir /opt/occlum/etc/template && \ occlum build # 3. Run the hello world sample