Skip to content

Commit 29471ea

Browse files
qzheng527jxiao1
authored andcommitted
Clean up aecs client for Occlum
Signed-off-by: Zheng, Qi <huaiqing.zq@antgroup.com>
1 parent 32520c2 commit 29471ea

File tree

4 files changed

+20
-46
lines changed

4 files changed

+20
-46
lines changed

client/cpp_occlum/bom_aecs_client_gnu.yaml

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,26 @@
11
# include other bom files
22
includes:
33
- base.yaml
4-
# This excludes will only take effect when copy directories. We will exclude files or dirs with following patterns.
5-
excludes:
6-
- .git
7-
- .gitignore
84
targets:
95
- target: /bin
106
copy:
117
- from: ../build/out
128
files:
13-
- aecs_client_get_secret
9+
- name: aecs_client_get_secret
10+
autodep: false
11+
# Put here to help detect the valid loader for glibc
12+
# Remove it in the script after copy_bom
13+
- files:
14+
- /opt/occlum/toolchains/busybox/glibc/busybox
1415
- target: /opt/occlum/glibc/lib/
1516
copy:
16-
- from: ../build/out
17-
files:
18-
- libaecs_client.so
19-
- libual.so
20-
- target: /opt/occlum/glibc/lib/
21-
copy:
22-
- from: /usr/local/occlum/x86_64-linux-gnu/lib
23-
files:
24-
- libcurl.so.4
25-
- libcrypto.so.1.1
26-
- libssl.so.1.1
27-
- target: /opt/occlum/glibc/lib/
28-
copy:
29-
- from: /usr/lib
30-
files:
31-
- libprotobuf.so.32
32-
- libgrpc++.so
33-
- libgrpc.so
34-
- libgpr.so
35-
- libcares.so.2
36-
- libaddress_sorting.so
37-
- target: /opt/occlum/glibc/lib/
38-
copy:
39-
- from: /usr/lib/x86_64-linux-gnu
40-
files:
41-
- libz.so.1
42-
- target: /opt/occlum/glibc/lib/
43-
copy:
44-
- from: /opt/occlum/glibc/lib
45-
files:
46-
- libc.so.6
47-
- libpthread.so.0
48-
- libdl.so.2
49-
- libnss_files.so.2
50-
- libnss_dns.so.2
51-
- libresolv.so.2
17+
- files:
18+
- ../build/out/libaecs_client.so
19+
- ../build/out/libual.so
20+
- /usr/local/occlum/x86_64-linux-gnu/lib/libcurl.so.4
21+
- /opt/occlum/glibc/lib/libnss_files.so.2
22+
- /opt/occlum/glibc/lib/libnss_dns.so.2
23+
- /opt/occlum/glibc/lib/libresolv.so.2
5224
- target: /etc/kubetee
5325
copy:
5426
- from: ../../../third_party/unified_attestation/deployment/conf/

client/cpp_occlum/occlum_aecs_client_lib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ add_library(
3636
target_link_libraries(
3737
${AECS_CLIENT_LIB}
3838
-L/usr/local/occlum/x86_64-linux-gnu/lib
39-
-Wl,--start-group ${${UAL_LIBS_LINK}} -lprotobuf -lgrpc++ -lgrpc++_reflection -Wl,--end-group
39+
-Wl,--start-group ${${UAL_LIBS_LINK}} -lprotobuf -lcares -laddress_sorting -lgpr -lgrpc -lgrpc++ -lgrpc++_reflection -Wl,--end-group
4040
-Wl,-rpath=/lib
4141
)
4242
add_dependencies(${AECS_CLIENT_LIB} ${UAL_LIBS_NAME})

client/cpp_occlum/occlum_build_prepare.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ THISDIR="$(dirname $(readlink -f $0))"
66

77
DEPSDIR="$THISDIR/deps"
88

9-
ALL_COMPONENTS="openssl libcurl cares protobuf grpc"
9+
ALL_COMPONENTS="libcurl cares protobuf grpc"
1010
OPENSSLDIR=openssl
1111
CURLDIR=curl
1212
PROTOBUFDIR=protobuf
@@ -115,7 +115,7 @@ libcurl_build() {
115115
fi
116116
./configure \
117117
--prefix=$OCCLUMINSTALLDIR \
118-
--with-ssl=$OCCLUMINSTALLDIR \
118+
--with-openssl \
119119
--without-zlib && \
120120
make -j && make install
121121
}
@@ -170,7 +170,6 @@ grpc_build() {
170170
cmake ../.. \
171171
-DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
172172
-DgRPC_INSTALL=ON \
173-
-DBUILD_SHARED_LIBS=TRUE \
174173
-DgRPC_CARES_PROVIDER=package \
175174
-DgRPC_PROTOBUF_PROVIDER=package \
176175
-DgRPC_SSL_PROVIDER=package \
@@ -231,7 +230,7 @@ BUILD_COMPONENTS="${1:-$ALL_COMPONENTS}"
231230

232231
# Download all components once here together
233232
mkdir -p $DEPSDIR && cd $DEPSDIR || exit 1
234-
TRYGET $OPENSSLDIR https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1k.tar.gz
233+
# TRYGET $OPENSSLDIR https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1k.tar.gz
235234
TRYGET $CURLDIR https://github.com/curl/curl/archive/curl-7_70_0.tar.gz
236235
#TRYGET $PROTOBUFDIR https://github.com/protocolbuffers/protobuf/releases/download/v21.6/protobuf-all-21.6.tar.gz
237236
#TRYGET $CARESDIR https://c-ares.haxx.se/download/c-ares-1.14.0.tar.gz

client/cpp_occlum/occlum_run_aecs_client.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ if [ "$ACTIONS" == "all" -o "$ACTIONS" == "build" ] ; then
4444
--file ${THISDIR}/bom_aecs_client_${OCCLUM_LIBC}.yaml \
4545
--root ./image
4646

47+
cp /lib/x86_64-linux-gnu/libcrypt.so.1 image/opt/occlum/glibc/lib/
48+
rm image/bin/busybox
49+
4750
new_json="$(jq '.env.default += ["LD_LIBRARY_PATH=/opt/occlum/glibc/lib"]' Occlum.json)" && \
4851
echo "${new_json}" > Occlum.json
4952

0 commit comments

Comments
 (0)