Update redis demo with copy_bom tool
Signed-off-by: Zheng, Qi <huaiqing.zq@antgroup.com>
This commit is contained in:
		
							parent
							
								
									ae5dd3b313
								
							
						
					
					
						commit
						09b79083b2
					
				| @ -1,4 +1,4 @@ | ||||
| ./run_occlum_redis.sh & | ||||
| sleep 20 | ||||
| echo 'start client' | ||||
| /usr/local/occlum/x86_64-linux-musl/bin/redis-benchmark -n 1000 | ||||
| /usr/local/occlum/x86_64-linux-musl/redis/bin/redis-benchmark -n 1000 | ||||
|  | ||||
| @ -28,7 +28,7 @@ build_redis() { | ||||
|     export CC=/opt/occlum/toolchains/gcc/bin/occlum-gcc | ||||
|     export CXX=/opt/occlum/toolchains/gcc/bin/occlum-g++ | ||||
|     make -j `getconf _NPROCESSORS_ONLN` BUILD_TLS=yes | ||||
|     make  PREFIX=$PREFIX install | ||||
|     make  PREFIX=$PREFIX/redis install | ||||
|     popd | ||||
| } | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										9
									
								
								demos/redis/redis.yaml
									
									
									
									
									
										Normal file
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										9
									
								
								demos/redis/redis.yaml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| includes: | ||||
|   - base.yaml | ||||
| # musl redis | ||||
| targets: | ||||
|   # copy redis | ||||
|   - target: / | ||||
|     copy: | ||||
|       - dirs: | ||||
|         - /usr/local/occlum/x86_64-linux-musl/redis/bin | ||||
							
								
								
									
										9
									
								
								demos/redis/redis_glibc.yaml
									
									
									
									
									
										Normal file
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										9
									
								
								demos/redis/redis_glibc.yaml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| includes: | ||||
|   - base.yaml | ||||
| # glibc redis | ||||
| targets: | ||||
|   # copy redis | ||||
|   - target: / | ||||
|     copy: | ||||
|       - dirs: | ||||
|         - /usr/local/redis/bin | ||||
| @ -1,7 +1,9 @@ | ||||
| #!/bin/bash | ||||
| occlum_dir=/usr/local/occlum/x86_64-linux-musl | ||||
| set -e | ||||
| 
 | ||||
| SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||||
| bomfile=${SCRIPT_DIR}/redis.yaml | ||||
| 
 | ||||
| # 1. Init Occlum Workspace | ||||
| rm -rf occlum_instance | ||||
| occlum new occlum_instance | ||||
| @ -11,10 +13,9 @@ new_json="$(jq '.resource_limits.user_space_size = "320MB" | | ||||
| echo "${new_json}" > Occlum.json | ||||
| 
 | ||||
| # 2. Copy files into Occlum Workspace and Build | ||||
| cp $occlum_dir/bin/redis* image/bin | ||||
| cp $occlum_dir/lib/libssl* image/lib | ||||
| cp $occlum_dir/lib/libcrypto* image/lib | ||||
| #occlum build | ||||
| rm -rf image | ||||
| copy_bom -f $bomfile --root image --include-dir /opt/occlum/etc/template | ||||
| 
 | ||||
| occlum build | ||||
| # 3. Run redis server | ||||
| occlum run /bin/redis-server --save "" --appendonly no & | ||||
|  | ||||
| @ -1,8 +1,9 @@ | ||||
| #!/bin/bash | ||||
| redis_dir=/usr/local/redis/ | ||||
| occlum_glibc=/opt/occlum/glibc/lib/ | ||||
| set -e | ||||
| 
 | ||||
| SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||||
| bomfile=${SCRIPT_DIR}/redis_glibc.yaml | ||||
| 
 | ||||
| # 1. Init Occlum Workspace | ||||
| rm -rf occlum_instance | ||||
| occlum new occlum_instance | ||||
| @ -11,14 +12,9 @@ new_json="$(jq '.resource_limits.user_space_size = "320MB" | | ||||
|                 .process.default_mmap_size = "256MB"' Occlum.json)" && \ | ||||
| echo "${new_json}" > Occlum.json | ||||
| 
 | ||||
| # 2. Copy files into Occlum Workspace and Build | ||||
| cp $redis_dir/bin/redis* image/bin | ||||
| cp /usr/local/bin/openssl* image/bin | ||||
| cp /usr/local/lib/libssl* image/$occlum_glibc | ||||
| cp /usr/local/lib/libcrypto* image/$occlum_glibc | ||||
| 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 | ||||
| rm -rf image | ||||
| copy_bom -f $bomfile --root image --include-dir /opt/occlum/etc/template | ||||
| 
 | ||||
| #occlum build | ||||
| occlum build | ||||
| # 3. Run redis server | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user