Skip to content

Commit

Permalink
Fix grpc-ra-tls merge error
Browse files Browse the repository at this point in the history
Signed-off-by: Bu Jianlin <[email protected]>
  • Loading branch information
BuJianlin authored and RodgerZhu committed Aug 19, 2022
1 parent 3557804 commit 1d7d989
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 33 deletions.
24 changes: 24 additions & 0 deletions cczoo/common/docker/gramine/configs/root/start_aesm_service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

unset http_proxy https_proxy

# Start AESM service required by Intel SGX SDK if it is not running
if ! pgrep "aesm_service" > /dev/null ; then
mkdir -p /var/run/aesmd
LD_LIBRARY_PATH="/opt/intel/sgx-aesm-service/aesm:$LD_LIBRARY_PATH" /opt/intel/sgx-aesm-service/aesm/aesm_service
fi
6 changes: 3 additions & 3 deletions cczoo/grpc-ra-tls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ images for developing the gRPC RA-TLS application.
./build_docker_image.sh ${base_image} ${image_tag}
```

`gramine-sgx-dev:v1.2-ubuntu20.04-latest` and `gramine-sgx-dev:v1.2-ubuntu-20.04-latest`

`gramine-sgx-dev:v1.2-ubuntu20.04-latest` and `gramine-sgx-dev:v1.2-ubuntu-20.04-latest`
could be selected as base_image.

- On Occlum
Expand All @@ -128,7 +127,8 @@ images for developing the gRPC RA-TLS application.
./build_docker_image.sh ${base_image} ${image_tag}
```

`occlum-sgx-dev:0.26.3-ubuntu18.04` and `occlum-sgx-dev:0.26.3-ubuntu20.04` could be selected as base_image.
`occlum-sgx-dev:0.26.3-ubuntu18.04` and `occlum-sgx-dev:0.26.3-ubuntu20.04`
could be selected as base_image.

## Config the remote attestation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ fs.mounts = [
{ type = "tmpfs", path = "/var/tmp" },
{ path = "{{ python.stdlib }}", uri = "file:{{ python.stdlib }}" },
{ path = "{{ python.distlib }}", uri = "file:{{ python.distlib }}" },
{ path = "/usr/local/lib/python3.8/dist-packages/", uri = "file:/usr/local/lib/python3.8/dist-packages/" }
#{ path = "/usr/local/lib/python3.6/dist-packages/", uri = "file:/usr/local/lib/python3.6/dist-packages/" } # for ubuntu:18.04
{ path = "/usr/local/lib/python3.8/dist-packages/", uri = "file:/usr/local/lib/python3.8/dist-packages/" } # for ubuntu:20.04
]

sgx.debug = false
Expand All @@ -62,8 +63,8 @@ sgx.trusted_files = [
"file:/usr/{{ arch_libdir }}/",
"file:{{ python.stdlib }}/",
"file:{{ python.distlib }}/",
#"file:/usr/local/lib/python3.6/dist-packages/",
"file:/usr/local/lib/python3.8/dist-packages/",
#"file:/usr/local/lib/python3.6/dist-packages/", # for ubuntu:18.04
"file:/usr/local/lib/python3.8/dist-packages/", # for ubuntu:20.04
"file:/etc/ssl/certs/ca-certificates.crt",
"file:server.py",
"file:client.py",
Expand Down
17 changes: 0 additions & 17 deletions cczoo/grpc-ra-tls/grpc/common/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,13 @@ if [ -z ${BUILD_TYPE} ]; then
fi

if [ -z ${SGX_RA_TLS_BACKEND} ]; then
<<<<<<< HEAD
=======
<<<<<<< HEAD:cczoo/attestation-secret-provision/grpc_overlay/common/build_cpp.sh
export SGX_RA_TLS_BACKEND=GRAMINE # GRAMINE,OCCLUM,TDX,DUMMY
=======
>>>>>>> branch0.1/grpc-ra-tls
export SGX_RA_TLS_BACKEND=GRAMINE # GRAMINE,OCCLUM,DUMMY
fi

if [ -z ${SGX_RA_TLS_SDK} ]; then
export SGX_RA_TLS_SDK=DEFAULT # DEFAULT,LIBRATS
elif [ "${SGX_RA_TLS_SDK}" == "LIBRATS" ]; then
${GRPC_PATH}/build_librats_sdk.sh
<<<<<<< HEAD
=======
>>>>>>> branch0.1/grpc-ra-tls:cczoo/grpc-ra-tls/grpc/common/build_cpp.sh
>>>>>>> branch0.1/grpc-ra-tls
fi

# build and install abseil library
Expand Down Expand Up @@ -68,14 +58,7 @@ cmake -DgRPC_INSTALL=ON \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
<<<<<<< HEAD
-DSGX_RA_TLS_SDK=${SGX_RA_TLS_SDK} \
=======
<<<<<<< HEAD:cczoo/attestation-secret-provision/grpc_overlay/common/build_cpp.sh
=======
-DSGX_RA_TLS_SDK=${SGX_RA_TLS_SDK} \
>>>>>>> branch0.1/grpc-ra-tls:cczoo/grpc-ra-tls/grpc/common/build_cpp.sh
>>>>>>> branch0.1/grpc-ra-tls
-DSGX_RA_TLS_BACKEND=${SGX_RA_TLS_BACKEND} \
..
make -j `nproc`
Expand Down
3 changes: 2 additions & 1 deletion cczoo/grpc-ra-tls/grpc/common/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ cd -

ldd ${GRPC_PATH}/python_build/lib.linux-x86_64-*/grpc/_cython/cygrpc.cpython-*-x86_64-linux-gnu.so

pip3 uninstall -y grpcio
# install grpc python wheel
pip3 uninstall -y grpcio protobuf
pip3 install ${GRPC_PATH}/dist/*.whl
pip3 install grpcio-tools==1.38.1

Expand Down
15 changes: 9 additions & 6 deletions cczoo/grpc-ra-tls/occlum/demos/ra_tls/build_occlum_instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ build_instance() {

mkdir -p image/usr/share/grpc
cp -rf ${INSTALL_PREFIX}/share/grpc/* image/usr/share/grpc/
cp ${OCCLUM_GLIBC}/libdl.so.2 image/${OCCLUM_GLIBC}
cp ${OCCLUM_GLIBC}/librt.so.1 image/${OCCLUM_GLIBC}
cp ${OCCLUM_GLIBC}/libm.so.6 image/${OCCLUM_GLIBC}
cp /lib/x86_64-linux-gnu/libtinfo.so.5 image/${OCCLUM_GLIBC}
cp /lib/x86_64-linux-gnu/libnss*.so.2 image/${OCCLUM_GLIBC}
cp /lib/x86_64-linux-gnu/libresolv.so.2 image/${OCCLUM_GLIBC}
cp ${OCCLUM_GLIBC}/libdl.so* image/${OCCLUM_GLIBC}
cp ${OCCLUM_GLIBC}/librt.so* image/${OCCLUM_GLIBC}
cp ${OCCLUM_GLIBC}/libm.so* image/${OCCLUM_GLIBC}
cp /usr/lib/x86_64-linux-gnu/libtinfo.so* image/${OCCLUM_GLIBC}
cp /usr/lib/x86_64-linux-gnu/libnss*.so* image/${OCCLUM_GLIBC}
cp /usr/lib/x86_64-linux-gnu/libresolv.so* image/${OCCLUM_GLIBC}
# cp /lib/x86_64-linux-gnu/libtinfo.so* image/${OCCLUM_GLIBC}
# cp /lib/x86_64-linux-gnu/libnss*.so* image/${OCCLUM_GLIBC}
# cp /lib/x86_64-linux-gnu/libresolv.so* image/${OCCLUM_GLIBC}
cp -rf /etc/hostname image/etc/
cp -rf /etc/ssl image/etc/
cp -rf /etc/passwd image/etc/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ images for developing the gRPC RA-TLS application.
./build_docker_image.sh ${base_image} ${image_tag}
```

`gramine-sgx-dev:v1.2-ubuntu20.04-latest` and `gramine-sgx-dev:v1.2-ubuntu-20.04-latest`

`gramine-sgx-dev:v1.2-ubuntu20.04-latest` and `gramine-sgx-dev:v1.2-ubuntu-20.04-latest`
could be selected as base_image.

- On Occlum
Expand All @@ -128,7 +127,8 @@ images for developing the gRPC RA-TLS application.
./build_docker_image.sh ${base_image} ${image_tag}
```

`occlum-sgx-dev:0.26.3-ubuntu18.04` and `occlum-sgx-dev:0.26.3-ubuntu20.04` could be selected as base_image.
`occlum-sgx-dev:0.26.3-ubuntu18.04` and `occlum-sgx-dev:0.26.3-ubuntu20.04`
could be selected as base_image.

## Config the remote attestation

Expand Down

0 comments on commit 1d7d989

Please sign in to comment.