-
Notifications
You must be signed in to change notification settings - Fork 28
Enable java cluster test in CI. #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
cc7ba07
b1acc10
0d38bf7
12d59bd
e022b73
8826341
b76d5b8
df4d581
0561c8d
d1f1340
db481b3
81984a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,30 +2,71 @@ | |
|
|
||
| ############################# | ||
| # build deploy file and deploy cluster | ||
| sh cleanup.sh | ||
| rm -rf local_deploy | ||
| ./prepare.sh -t local_deploy | ||
| pushd local_deploy | ||
| local_ip=`ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` | ||
| #echo "use local_ip" $local_ip | ||
| OVERWRITE="ray.java.start.redis_port=34222;ray.java.start.node_ip_address=$local_ip;ray.java.start.deploy=true;ray.java.start.run_mode=CLUSTER" | ||
| echo OVERWRITE is $OVERWRITE | ||
| ./run.sh start --head --overwrite=$OVERWRITE > cli.log 2>&1 & | ||
| popd | ||
| sleep 10 | ||
|
|
||
| # auto-pack zip for app example | ||
| pushd example | ||
| if [ ! -d "app1/" ];then | ||
| mkdir app1 | ||
| fi | ||
| cp -rf target/ray-tutorial-1.0.jar app1/ | ||
| zip -r app1.zip app1 | ||
| popd | ||
|
|
||
| # run with cluster mode | ||
| pushd local_deploy | ||
| export RAY_CONFIG=ray/ray.config.ini | ||
| ARGS=" --package ../example/app1.zip --class org.ray.example.HelloWorld --args=test1,test2 --redis-address=$local_ip:34222" | ||
| ../local_deploy/run.sh submit $ARGS | ||
| popd | ||
|
|
||
| function run_test() { | ||
| use_raylet="false" | ||
| if [ "$1" == "raylet" ]; then | ||
| sed -i 's/^use_raylet.*$/use_raylet = true/g' ray.config.ini | ||
| else | ||
| sed -i 's/^use_raylet.*$/use_raylet = false/g' ray.config.ini | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if it's a real problem. But I'd prefer not editing the file in place, because it makes the git state dirty.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this way is not great, I will try distinguishing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using overwrite is fine, or you can create a temp config file |
||
| fi | ||
|
|
||
| sh cleanup.sh | ||
| rm -rf local_deploy | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what will be stored in
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does |
||
| ./prepare.sh -t local_deploy | ||
| pushd local_deploy | ||
| local_ips=`ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` | ||
| local_ip=$(echo $local_ips | awk -F " " '{print $NF}') | ||
| echo "use local_ip" $local_ip | ||
|
|
||
| OVERWRITE="ray.java.start.redis_port=34222;ray.java.start.node_ip_address=$local_ip;ray.java.start.deploy=true;ray.java.start.run_mode=CLUSTER;ray.java.start.raylet_port=35567;" | ||
|
|
||
| echo OVERWRITE is $OVERWRITE | ||
| ./run.sh start --head --overwrite=$OVERWRITE > cli.log 2>&1 & | ||
| popd | ||
| sleep 10 | ||
|
|
||
| # auto-pack zip for app example | ||
| if [ ! -d "example/" ]; then | ||
| mkdir example | ||
| fi | ||
|
|
||
| pushd example | ||
| if [ ! -d "app1/" ]; then | ||
| mkdir app1 | ||
| fi | ||
| popd | ||
|
|
||
| cp -rf tutorial/target/ray-tutorial-1.0.jar example/app1/ | ||
| pushd example | ||
| zip -r app1.zip app1 | ||
| popd | ||
|
|
||
| # run with cluster mode | ||
| pushd local_deploy | ||
| export RAY_CONFIG=ray/ray.config.ini | ||
| ARGS=" --package ../example/app1.zip --class org.ray.exercise.Exercise02 --args=test1,test2 --redis-address=$local_ip:34222" | ||
| ../local_deploy/run.sh submit $ARGS | ||
| popd | ||
|
|
||
| # clean up | ||
| rm -rf example | ||
|
|
||
| sleep 3 | ||
| # Remove raylet socket file. | ||
| if [[ -a /tmp/raylet35567 ]]; then | ||
| rm /tmp/raylet35567 | ||
| fi | ||
|
|
||
| # Check the result | ||
| start_process_log=$(cat "./local_deploy/cli.log") | ||
| [[ ${start_process_log} =~ "Started Ray head node" ]] || exit 1 | ||
| echo "Check: Ray all processes started." | ||
|
|
||
| execution_log=$(cat "./local_deploy/ray/run/org.ray.exercise.Exercise02/0.out.txt") | ||
| [[ ${execution_log} =~ "hello,world!" ]] || exit 1 | ||
| echo "Check: The tests ran successfully." | ||
| } | ||
|
|
||
| run_test non-raylet | ||
| run_test raylet | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this?