diff options
author | Tim Emiola <tbetbetbe@users.noreply.github.com> | 2015-02-05 10:27:20 -0800 |
---|---|---|
committer | Tim Emiola <tbetbetbe@users.noreply.github.com> | 2015-02-05 10:27:20 -0800 |
commit | 9bd60e39924035a49f2ede7c06bc6f48fb5213bd (patch) | |
tree | b306a4f899bb4487f8f3687c49d72568f3487f5d | |
parent | 69115529f49e4557d61a859fcc20302cf324f0e9 (diff) | |
parent | 93b1f3d18bc6a1d38d0ae46739f9ad340343092b (diff) |
Merge pull request #406 from donnadionne/docker
Docker
-rwxr-xr-x | tools/gce_setup/builder.sh | 29 | ||||
-rwxr-xr-x | tools/gce_setup/cloud_prod_runner.sh | 4 | ||||
-rwxr-xr-x | tools/gce_setup/grpc_docker.sh | 22 | ||||
-rwxr-xr-x | tools/gce_setup/interop_test_runner.sh | 42 | ||||
-rw-r--r-- | tools/gce_setup/post.html | 12 | ||||
-rw-r--r-- | tools/gce_setup/pre.html | 14 |
6 files changed, 90 insertions, 33 deletions
diff --git a/tools/gce_setup/builder.sh b/tools/gce_setup/builder.sh new file mode 100755 index 0000000000..49b3c436fe --- /dev/null +++ b/tools/gce_setup/builder.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +main() { + # restart builder vm and wait for images to sync to it + source grpc_docker.sh + ./new_grpc_docker_builder.sh -igrpc-docker-builder-alt-2 -anone + cd ../../ + sleep 3600 + + # build images for all languages + languages=(cxx java go ruby node) + for lan in "${languages[@]}" + do + grpc_update_image $lan + done + + # restart client and server vm and wait for images to sync to them + cd tools/gce_setup + ./new_grpc_docker_builder.sh -igrpc-docker-testclients -anone + ./new_grpc_docker_builder.sh -igrpc-docker-server -anone + sleep 3600 + + # launch images for all languages on server + grpc_launch_servers grpc-docker-server + +} + +set -x +main "$@" diff --git a/tools/gce_setup/cloud_prod_runner.sh b/tools/gce_setup/cloud_prod_runner.sh index 0c1163ad7d..200f859ede 100755 --- a/tools/gce_setup/cloud_prod_runner.sh +++ b/tools/gce_setup/cloud_prod_runner.sh @@ -2,8 +2,8 @@ main() { source grpc_docker.sh - test_cases=(large_unary empty_unary client_streaming server_streaming) - clients=(cxx java go ruby) + test_cases=(large_unary empty_unary ping_pong client_streaming server_streaming) + clients=(cxx java go ruby node) for test_case in "${test_cases[@]}" do for client in "${clients[@]}" diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 2ac75f3cc5..2e02653864 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -762,7 +762,16 @@ grpc_interop_test() { echo " $ssh_cmd" echo "on $host" [[ $dry_run == 1 ]] && return 0 # don't run the command on a dry run - gcloud compute $project_opt ssh $zone_opt $host --command "$cmd" + gcloud compute $project_opt ssh $zone_opt $host --command "$cmd" & + PID=$! + sleep 10 + echo "pid is $PID" + if ps -p $PID + then + kill $PID + return 1 + fi + } # Runs a test command on a docker instance. @@ -808,7 +817,16 @@ grpc_cloud_prod_test() { echo " $ssh_cmd" echo "on $host" [[ $dry_run == 1 ]] && return 0 # don't run the command on a dry run - gcloud compute $project_opt ssh $zone_opt $host --command "$cmd" + gcloud compute $project_opt ssh $zone_opt $host --command "$cmd" & + PID=$! + sleep 10 + echo "pid is $PID" + if ps -p $PID + then + kill $PID + return 1 + fi + } # Runs a test command on a docker instance. diff --git a/tools/gce_setup/interop_test_runner.sh b/tools/gce_setup/interop_test_runner.sh index 1244307912..456ad4b472 100755 --- a/tools/gce_setup/interop_test_runner.sh +++ b/tools/gce_setup/interop_test_runner.sh @@ -1,33 +1,8 @@ #!/bin/bash thisfile=$(readlink -ne "${BASH_SOURCE[0]}") - -run_test() { - local test_case=$1 - shift - local client=$1 - shift - local server=$1 - if grpc_interop_test $test_case grpc-docker-testclients $client grpc-docker-server $server - then - echo "$test_case $client $server passed" >> /tmp/interop_result.txt - else - echo "$test_case $client $server failed" >> /tmp/interop_result.txt - fi -} - -time_out() { - local test_case=$1 - shift - local client=$1 - shift - local server=$1 - if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then - if ! timeout 20s bash -l -c "source $thisfile && run_test $test_case $client $server" - then - echo "$test_case $client $server timed out" >> /tmp/interop_result.txt - fi - fi -} +current_time=$(date "+%Y-%m-%d-%H-%M-%S") +result_file_name=interop_result.$current_time.html +echo $result_file_name main() { source grpc_docker.sh @@ -40,13 +15,22 @@ main() { do for server in "${servers[@]}" do - time_out $test_case $client $server + if grpc_interop_test $test_case grpc-docker-testclients $client grpc-docker-server $server + then + echo " ['$test_case', '$client', '$server', true]," >> /tmp/interop_result.txt + else + echo " ['$test_case', '$client', '$server', false]," >> /tmp/interop_result.txt + fi done done done if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + cat pre.html /tmp/interop_result.txt post.html > /tmp/interop_result.html gsutil cp /tmp/interop_result.txt gs://stoked-keyword-656-output/interop_result.txt + gsutil cp /tmp/interop_result.html gs://stoked-keyword-656-output/interop_result.html + gsutil cp /tmp/interop_result.html gs://stoked-keyword-656-output/result_history/$result_file_name rm /tmp/interop_result.txt + rm /tmp/interop_result.html fi } diff --git a/tools/gce_setup/post.html b/tools/gce_setup/post.html new file mode 100644 index 0000000000..57cbc8c369 --- /dev/null +++ b/tools/gce_setup/post.html @@ -0,0 +1,12 @@ + ]); + + var table = new google.visualization.Table(document.getElementById('table_div')); + + table.draw(data, {showRowNumber: true}); + } + </script> + </head> + <body> + <div id="table_div"></div> + </body> +</html> diff --git a/tools/gce_setup/pre.html b/tools/gce_setup/pre.html new file mode 100644 index 0000000000..74ce5ce202 --- /dev/null +++ b/tools/gce_setup/pre.html @@ -0,0 +1,14 @@ +<html> + <head> + <script type="text/javascript" src="https://www.google.com/jsapi"></script> + <script type="text/javascript"> + google.load("visualization", "1", {packages:["table"]}); + google.setOnLoadCallback(drawTable); + + function drawTable() { + var data = new google.visualization.DataTable(); + data.addColumn('string', 'TestCase'); + data.addColumn('string', 'Client'); + data.addColumn('string', 'Server'); + data.addColumn('boolean', 'Pass'); + data.addRows([ |