From f9f8aca5b043197aa4471fec7000f4443824b818 Mon Sep 17 00:00:00 2001 From: Donna Dionne Date: Mon, 20 Apr 2015 09:52:44 -0700 Subject: [PATCH 1/5] Scripts to build java and cxx docker images from local (uncommitted) code and run interop tests in GCE VMs. --- tools/dockerfile/grpc_cxx/build.sh | 14 ++++++ tools/dockerfile/grpc_java/build.sh | 9 ++++ tools/gce_setup/private_build_and_test.sh | 54 +++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100755 tools/dockerfile/grpc_cxx/build.sh create mode 100755 tools/dockerfile/grpc_java/build.sh create mode 100755 tools/gce_setup/private_build_and_test.sh diff --git a/tools/dockerfile/grpc_cxx/build.sh b/tools/dockerfile/grpc_cxx/build.sh new file mode 100755 index 00000000000..8a9e95ccb82 --- /dev/null +++ b/tools/dockerfile/grpc_cxx/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +rm -rf /var/local/git +cp -R /var/local/git-clone /var/local/git + +cd /var/local/git/grpc/third_party/protobuf && \ + ./autogen.sh && \ + ./configure --prefix=/usr && \ + make -j12 && make check && make install && make clean + +cd /var/local/git/grpc && ls \ + && make clean \ + && make gens/test/cpp/util/messages.pb.cc \ + && make interop_client \ + && make interop_server diff --git a/tools/dockerfile/grpc_java/build.sh b/tools/dockerfile/grpc_java/build.sh new file mode 100755 index 00000000000..04212ceec22 --- /dev/null +++ b/tools/dockerfile/grpc_java/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash +rm -rf /var/local/git +cp -R /var/local/git-clone /var/local/git +cd /var/local/git/grpc-java/lib/netty && \ + mvn -pl codec-http2 -am -DskipTests install clean +cd /var/local/git/grpc-java && \ + ./gradlew build + +echo 'build finished' diff --git a/tools/gce_setup/private_build_and_test.sh b/tools/gce_setup/private_build_and_test.sh new file mode 100755 index 00000000000..c5c6c58a179 --- /dev/null +++ b/tools/gce_setup/private_build_and_test.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# This script has to be run from the same directory as grpc_docker.sh and after grpc_docker.sh is sourced +# +# Sample Usage: +# =============================== +# ./private_build_and_test.sh [language] [environment: interop|cloud] [test case] +# [git base directory] [server name in interop environment] +# sh private_build_and_test.sh java interop large_unary /usr/local/google/home/donnadionne/grpc-git grpc-docker-server1 +# sh private_build_and_test.sh java cloud large_unary /usr/local/google/home/donnadionne/grpc-git +# =============================== + +# Arguments +LANGUAGE=$1 +ENV=$2 +TEST=$3 +GIT=$4 +SERVER=${5:-"grpc-docker-server"} + +sudo docker run --name="private_images" -v $4:/var/local/git-clone grpc/$1 /var/local/git-clone/grpc/tools/dockerfile/grpc_$1/build.sh + +sudo docker commit -m "private image" -a "donnadionne" private_images grpc/private_images + +sudo docker tag -f grpc/private_images 0.0.0.0:5000/grpc/private_images + +sudo docker push 0.0.0.0:5000/grpc/private_images + +sudo docker rmi -f grpc/private_images + +sudo docker rm private_images + +gcloud compute --project "stoked-keyword-656" ssh --zone "asia-east1-a" "grpc-docker-testclients1" --command "sudo docker pull 0.0.0.0:5000/grpc/private_images" + +gcloud compute --project "stoked-keyword-656" ssh --zone "asia-east1-a" "grpc-docker-testclients1" --command "sudo docker tag 0.0.0.0:5000/grpc/private_images grpc/$1" + +source grpc_docker.sh + +if [ $ENV == 'interop' ] +then + grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER cxx + grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER java + grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER go + grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER ruby + grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER node + grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER python +else + if [ $ENV == 'cloud' ] + then + grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE + else + grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE + fi +fi + From 6db722453fe10179c7a6cebfb6fe027caaae8381 Mon Sep 17 00:00:00 2001 From: vjpai Date: Tue, 21 Apr 2015 10:50:12 -0700 Subject: [PATCH 2/5] Clamp at 1.0 on low end to handle rare possibility of sub-1 microsecond --- src/core/support/histogram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/support/histogram.c b/src/core/support/histogram.c index ed344b43e8d..673affde713 100644 --- a/src/core/support/histogram.c +++ b/src/core/support/histogram.c @@ -76,7 +76,7 @@ static size_t bucket_for_unchecked(gpr_histogram *h, double x) { /* bounds checked version of the above */ static size_t bucket_for(gpr_histogram *h, double x) { - size_t bucket = bucket_for_unchecked(h, GPR_CLAMP(x, 0, h->max_possible)); + size_t bucket = bucket_for_unchecked(h, GPR_CLAMP(x, 1.0, h->max_possible)); GPR_ASSERT(bucket < h->num_buckets); return bucket; } From 58ece612dcfef8f2d86b2705648eb291149ad642 Mon Sep 17 00:00:00 2001 From: Donna Dionne Date: Wed, 22 Apr 2015 12:41:15 -0700 Subject: [PATCH 3/5] Making modifications after comments Add uploading private result to GCS --- tools/gce_setup/private_build_and_test.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/gce_setup/private_build_and_test.sh b/tools/gce_setup/private_build_and_test.sh index c5c6c58a179..bab27b5fa31 100755 --- a/tools/gce_setup/private_build_and_test.sh +++ b/tools/gce_setup/private_build_and_test.sh @@ -17,9 +17,12 @@ TEST=$3 GIT=$4 SERVER=${5:-"grpc-docker-server"} +current_time=$(date "+%Y-%m-%d-%H-%M-%S") +result_file_name=private_result.$current_time.txt + sudo docker run --name="private_images" -v $4:/var/local/git-clone grpc/$1 /var/local/git-clone/grpc/tools/dockerfile/grpc_$1/build.sh -sudo docker commit -m "private image" -a "donnadionne" private_images grpc/private_images +sudo docker commit -m "private image" -a $USER private_images grpc/private_images sudo docker tag -f grpc/private_images 0.0.0.0:5000/grpc/private_images @@ -46,7 +49,8 @@ then else if [ $ENV == 'cloud' ] then - grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE + grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE > /tmp/$result_file_name 2>&1 + gsutil cp /tmp/$result_file_name gs://stoked-keyword-656-output/private_result/$result_file_name else grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE fi From 7451cf6ad02203c910bdbe7c80057772f49791d4 Mon Sep 17 00:00:00 2001 From: Donna Dionne Date: Wed, 22 Apr 2015 14:47:22 -0700 Subject: [PATCH 4/5] Adding more arguments and default values to allow the environment to be specified when using the script. --- tools/gce_setup/private_build_and_test.sh | 29 +++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/gce_setup/private_build_and_test.sh b/tools/gce_setup/private_build_and_test.sh index bab27b5fa31..9c5c347a304 100755 --- a/tools/gce_setup/private_build_and_test.sh +++ b/tools/gce_setup/private_build_and_test.sh @@ -15,12 +15,15 @@ LANGUAGE=$1 ENV=$2 TEST=$3 GIT=$4 -SERVER=${5:-"grpc-docker-server"} +PROJECT=${5:-"stoked-keyword-656"} +ZONE=${6:-"asia-east1-a"} +CLIENT=${7:-"grpc-docker-testclients1"} +SERVER=${8:-"grpc-docker-server"} current_time=$(date "+%Y-%m-%d-%H-%M-%S") result_file_name=private_result.$current_time.txt -sudo docker run --name="private_images" -v $4:/var/local/git-clone grpc/$1 /var/local/git-clone/grpc/tools/dockerfile/grpc_$1/build.sh +sudo docker run --name="private_images" -v $GIT:/var/local/git-clone grpc/$LANGUAGE /var/local/git-clone/grpc/tools/dockerfile/grpc_$LANGUAGE/build.sh sudo docker commit -m "private image" -a $USER private_images grpc/private_images @@ -32,27 +35,27 @@ sudo docker rmi -f grpc/private_images sudo docker rm private_images -gcloud compute --project "stoked-keyword-656" ssh --zone "asia-east1-a" "grpc-docker-testclients1" --command "sudo docker pull 0.0.0.0:5000/grpc/private_images" +gcloud compute --project $PROJECT ssh --zone $ZONE $CLIENT --command "sudo docker pull 0.0.0.0:5000/grpc/private_images" -gcloud compute --project "stoked-keyword-656" ssh --zone "asia-east1-a" "grpc-docker-testclients1" --command "sudo docker tag 0.0.0.0:5000/grpc/private_images grpc/$1" +gcloud compute --project $PROJECT ssh --zone $ZONE $CLIENT --command "sudo docker tag 0.0.0.0:5000/grpc/private_images grpc/$LANGUAGE" source grpc_docker.sh if [ $ENV == 'interop' ] then - grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER cxx - grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER java - grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER go - grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER ruby - grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER node - grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER python + grpc_interop_test $TEST $CLIENT $LANGUAGE $SERVER cxx + grpc_interop_test $TEST $CLIENT $LANGUAGE $SERVER java + grpc_interop_test $TEST $CLIENT $LANGUAGE $SERVER go + grpc_interop_test $TEST $CLIENT $LANGUAGE $SERVER ruby + grpc_interop_test $TEST $CLIENT $LANGUAGE $SERVER node + grpc_interop_test $TEST $CLIENT $LANGUAGE $SERVER python else if [ $ENV == 'cloud' ] then - grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE > /tmp/$result_file_name 2>&1 - gsutil cp /tmp/$result_file_name gs://stoked-keyword-656-output/private_result/$result_file_name + grpc_cloud_prod_test $TEST $CLIENT $LANGUAGE > /tmp/$result_file_name 2>&1 + gsutil cp /tmp/$result_file_name gs://$PROJECT-output/private_result/$result_file_name else - grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE + grpc_cloud_prod_auth_test $TEST $CLIENT $LANGUAGE fi fi From c23827beeb147accfcc11c9745fc67a395d7efea Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 23 Apr 2015 06:17:55 +0200 Subject: [PATCH 5/5] Avoid building shared libraries on Travis. This seems flaky. --- tools/run_tests/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 4e24f4b5104..5165983d970 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -259,7 +259,7 @@ class Build(object): return [] def make_targets(self): - return ['all'] + return ['static'] def build_steps(self): return []