ray/java/prepare.sh
Si-Yuan 84fae57ab5 Convert the raylet client (the code in local_scheduler_client.cc) to proper C++. (#3511)
* refactoring

* fix bugs

* create client class

* create client class for java; bug fix

* remove legacy code

* improve code by using std::string, std::unique_ptr rename private fields and removing legacy code

* rename class

* improve naming

* fix

* rename files

* fix names

* change name

* change return types

* make a mutex private field

* fix comments

* fix bugs

* lint

* bug fix

* bug fix

* move too short functions into the header file

* Loose crash conditions for some APIs.

* Apply suggestions from code review

Co-Authored-By: suquark <suquark@gmail.com>

* format

* update

* rename python APIs

* fix java

* more fixes

* change types of cpython interface

* more fixes

* improve error processing

* improve error processing for java wrapper

* lint

* fix java

* make fields const

* use pointers for [out] parameters

* fix java & error msg

* fix resource leak, etc.
2018-12-13 13:39:10 -08:00

102 lines
2.3 KiB
Bash
Executable file

#!/bin/bash
function usage() {
echo " -t|--target-dir <dir> local target directory for prepare a Ray cluster deployment package"
echo " [-s|--source-dir] <dir> local source directory to prepare a Ray cluster deployment package"
}
while [ $# -gt 0 ];do
key=$1
case $key in
-h|--help)
usage
exit 0
;;
-s|--source-dir)
ray_dir=$2
shift 2
;;
-t|--target-dir)
t_dir=$2
shift 2
;;
*)
echo "ERROR: unknown option $key"
echo
usage
exit -1
;;
esac
done
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
if [ -z $ray_dir ];then
scripts_path=`realpath $0`
ray_dir=`dirname $scripts_path`
ray_dir=`dirname $ray_dir`
fi
# echo "ray_dir = $ray_dir"
declare -a nativeBinaries=(
"./src/ray/thirdparty/redis/src/redis-server"
"./src/plasma/plasma_store_server"
"./src/ray/raylet/raylet"
"./src/ray/raylet/raylet_monitor"
)
declare -a nativeLibraries=(
"./src/ray/gcs/redis_module/libray_redis_module.so"
"./src/ray/raylet/libraylet_library_java.*"
"./src/plasma/libplasma_java.*"
"./src/ray/raylet/*lib.a"
)
declare -a javaBinaries=(
"api"
"common"
"worker"
"test"
)
function prepare_source()
{
if [ -z $t_dir ];then
echo "--target-dir not specified"
usage
exit -1
fi
# prepare native components under /ray/native/bin
mkdir -p $t_dir"/ray/native/bin/"
for i in "${!nativeBinaries[@]}"
do
cp $ray_dir/build/${nativeBinaries[$i]} $t_dir/ray/native/bin/
done
# prepare native libraries under /ray/native/lib
mkdir -p $t_dir"/ray/native/lib/"
for i in "${!nativeLibraries[@]}"
do
cp $ray_dir/build/${nativeLibraries[$i]} $t_dir/ray/native/lib/
done
# prepare java components under /ray/java/lib
mkdir -p $t_dir"/ray/java/lib/"
unzip -q $ray_dir/java/cli/target/ray-cli-ear.zip -d $ray_dir/java
cp $ray_dir/java/ray-cli/lib/* $t_dir/ray/java/lib/
rm -rf $ray_dir/java/ray-cli
cp -rf $ray_dir/java/ray.config.ini $t_dir/ray/
# prepare java apps directory
mkdir -p $t_dir"/ray/java/apps/"
# prepare run.sh
cp $ray_dir/java/run.sh $t_dir/
}
prepare_source