Update python-musl demo with copy_bom
This commit is contained in:
parent
436e427fbf
commit
16384b8b0e
41
demos/python/python_musl/python_musl.yaml
Normal file
41
demos/python/python_musl/python_musl.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
includes:
|
||||||
|
- base.yaml
|
||||||
|
targets:
|
||||||
|
# python
|
||||||
|
- target: /bin
|
||||||
|
copy:
|
||||||
|
- files:
|
||||||
|
- /root/alpine_python/usr/local/bin/python3.7
|
||||||
|
# dependencies
|
||||||
|
- target: /lib
|
||||||
|
copy:
|
||||||
|
- from: /root/alpine_python/usr/local/lib
|
||||||
|
files:
|
||||||
|
- libpython3.7m.so.1.0
|
||||||
|
- libpython3.so
|
||||||
|
dirs:
|
||||||
|
- python3.7
|
||||||
|
- from: /root/alpine_python/usr/lib
|
||||||
|
files:
|
||||||
|
- libblas.so.3
|
||||||
|
- libcblas.so.3
|
||||||
|
- libbz2.so.1
|
||||||
|
- libffi.so.6
|
||||||
|
- libgcc_s.so.1
|
||||||
|
- libgfortran.so.5
|
||||||
|
- liblapack.so.3
|
||||||
|
- liblzma.so.5
|
||||||
|
- libquadmath.so.0
|
||||||
|
- from: /root/alpine_python/lib
|
||||||
|
files:
|
||||||
|
- libz.so.1
|
||||||
|
- files:
|
||||||
|
- /opt/occlum/toolchains/gcc/x86_64-linux-musl/lib/libstdc++.so.6
|
||||||
|
# below are python code and data
|
||||||
|
- target: /
|
||||||
|
copy:
|
||||||
|
- from: ..
|
||||||
|
dirs:
|
||||||
|
- dataset
|
||||||
|
files:
|
||||||
|
- demo.py
|
@ -18,22 +18,8 @@ cd occlum_instance
|
|||||||
|
|
||||||
# 2. Copy files into Occlum Workspace and build
|
# 2. Copy files into Occlum Workspace and build
|
||||||
if [ ! -d "image/lib/python3.7" ];then
|
if [ ! -d "image/lib/python3.7" ];then
|
||||||
cp -f $alpine_fs/usr/local/bin/python3.7 image/bin
|
rm -rf image
|
||||||
cp -f $alpine_fs/usr/local/lib/libpython3.7m.so.1.0 image/lib
|
copy_bom -f ../python_musl.yaml --root image --include-dir /opt/occlum/etc/template
|
||||||
cp -f $alpine_fs/usr/local/lib/libpython3.so image/lib
|
|
||||||
cp -rf $alpine_fs/usr/local/lib/python3.7 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/libblas.so.3 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/libcblas.so.3 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/libbz2.so.1 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/libffi.so.6 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/libgcc_s.so.1 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/libgfortran.so.5 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/liblapack.so.3 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/liblzma.so.5 image/lib
|
|
||||||
cp -f $alpine_fs/usr/lib/libquadmath.so.0 image/lib
|
|
||||||
cp -f $alpine_fs/lib/libz.so.1 image/lib
|
|
||||||
cp -rf ../dataset image
|
|
||||||
cp -f ../demo.py image
|
|
||||||
new_json="$(jq '.resource_limits.user_space_size = "320MB" |
|
new_json="$(jq '.resource_limits.user_space_size = "320MB" |
|
||||||
.resource_limits.kernel_space_heap_size = "256MB" |
|
.resource_limits.kernel_space_heap_size = "256MB" |
|
||||||
.process.default_mmap_size = "256MB"' Occlum.json)" && \
|
.process.default_mmap_size = "256MB"' Occlum.json)" && \
|
||||||
|
Loading…
Reference in New Issue
Block a user