Allow the ruby tests to have service account info

pull/389/head
Tim Emiola 10 years ago
parent f2c8901f7e
commit d535bf3bc8
  1. 96
      tools/gce_setup/grpc_docker.sh
  2. 5
      tools/gce_setup/shared_startup_funcs.sh

@ -822,7 +822,6 @@ grpc_interop_gen_ruby_cmd() {
echo $the_cmd echo $the_cmd
} }
# constructs the full dockerized java interop test cmd. # constructs the full dockerized java interop test cmd.
# #
# call-seq: # call-seq:
@ -832,12 +831,43 @@ grpc_cloud_prod_gen_ruby_cmd() {
local cmd_prefix="sudo docker run grpc/ruby bin/bash -l -c" local cmd_prefix="sudo docker run grpc/ruby bin/bash -l -c"
local test_script="/var/local/git/grpc/src/ruby/bin/interop/interop_client.rb" local test_script="/var/local/git/grpc/src/ruby/bin/interop/interop_client.rb"
local test_script+=" --use_tls" local test_script+=" --use_tls"
local gfe_flags=" --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com" local gfe_flags=$(_grpc_prod_gfe_flags)
local env_prefix="SSL_CERT_FILE=/cacerts/roots.pem" local env_prefix="SSL_CERT_FILE=/cacerts/roots.pem"
local the_cmd="$cmd_prefix '$env_prefix ruby $test_script $gfe_flags $@'" local the_cmd="$cmd_prefix '$env_prefix ruby $test_script $gfe_flags $@'"
echo $the_cmd echo $the_cmd
} }
# constructs the full dockerized ruby service_account auth interop test cmd.
#
# call-seq:
# flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_auth_service_account_creds_gen_ruby_cmd() {
local cmd_prefix="sudo docker run grpc/ruby bin/bash -l -c";
local test_script="/var/local/git/grpc/src/ruby/bin/interop/interop_client.rb"
local test_script+=" --use_tls"
local gfe_flags=$(_grpc_prod_gfe_flags)
local added_gfe_flags=$(_grpc_svc_acc_test_flags)
local env_prefix="SSL_CERT_FILE=/cacerts/roots.pem"
local the_cmd="$cmd_prefix '$env_prefix ruby $test_script $gfe_flags $added_gfe_flag $@'"
echo $the_cmd
}
# constructs the full dockerized ruby gce auth interop test cmd.
#
# call-seq:
# flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_auth_compute_engine_creds_gen_ruby_cmd() {
local cmd_prefix="sudo docker run grpc/ruby bin/bash -l -c";
local test_script="/var/local/git/grpc/src/ruby/bin/interop/interop_client.rb"
local test_script+=" --use_tls"
local gfe_flags=$(_grpc_prod_gfe_flags)
local added_gfe_flags=$(_grpc_gce_test_flags)
local env_prefix="SSL_CERT_FILE=/cacerts/roots.pem"
local the_cmd="$cmd_prefix '$env_prefix ruby $test_script $gfe_flags $added_gfe_flag $@'"
echo $the_cmd
}
# constructs the full dockerized Go interop test cmd. # constructs the full dockerized Go interop test cmd.
# #
@ -888,7 +918,7 @@ grpc_cloud_prod_gen_java_cmd() {
local cmd_prefix="sudo docker run grpc/java"; local cmd_prefix="sudo docker run grpc/java";
local test_script="/var/local/git/grpc-java/run-test-client.sh"; local test_script="/var/local/git/grpc-java/run-test-client.sh";
local test_script+=" --use_tls=true" local test_script+=" --use_tls=true"
local gfe_flags=" --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com" local gfe_flags=$(_grpc_prod_gfe_flags)
local the_cmd="$cmd_prefix $test_script $gfe_flags $@"; local the_cmd="$cmd_prefix $test_script $gfe_flags $@";
echo $the_cmd echo $the_cmd
} }
@ -909,19 +939,11 @@ grpc_interop_gen_php_cmd() {
echo $the_cmd echo $the_cmd
} }
# constructs the full dockerized cpp interop test cmd. # constructs the full dockerized node interop test cmd.
#
# #
# call-seq: # call-seq:
# flags= .... # generic flags to include the command # flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags) # cmd=$($grpc_gen_test_cmd $flags)
grpc_interop_gen_cxx_cmd() {
local cmd_prefix="sudo docker run grpc/cxx";
local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl";
local the_cmd="$cmd_prefix $test_script $@";
echo $the_cmd
}
grpc_interop_gen_node_cmd() { grpc_interop_gen_node_cmd() {
local cmd_prefix="sudo docker run grpc/node"; local cmd_prefix="sudo docker run grpc/node";
local test_script="/usr/bin/nodejs /var/local/git/grpc/src/node/interop/interop_client.js --use_tls=true"; local test_script="/usr/bin/nodejs /var/local/git/grpc/src/node/interop/interop_client.js --use_tls=true";
@ -931,46 +953,70 @@ grpc_interop_gen_node_cmd() {
# constructs the full dockerized cpp interop test cmd. # constructs the full dockerized cpp interop test cmd.
# #
# call-seq:
# flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags)
grpc_interop_gen_cxx_cmd() {
local cmd_prefix="sudo docker run grpc/cxx";
local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl";
local the_cmd="$cmd_prefix $test_script $@";
echo $the_cmd
}
# constructs the full dockerized cpp gce=>prod interop test cmd.
# #
# call-seq: # call-seq:
# flags= .... # generic flags to include the command # flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags) # cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_gen_cxx_cmd() { grpc_cloud_prod_gen_cxx_cmd() {
local cmd_prefix="sudo docker run grpc/cxx"; local cmd_prefix="sudo docker run grpc/cxx";
local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl"; local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots";
local gfe_flags=" --use_prod_roots --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com" local gfe_flags=$(_grpc_prod_gfe_flags)
local the_cmd="$cmd_prefix $test_script $gfe_flags $@"; local the_cmd="$cmd_prefix $test_script $gfe_flags $@";
echo $the_cmd echo $the_cmd
} }
# constructs the full dockerized cpp interop test cmd. # constructs the full dockerized cpp service_account auth interop test cmd.
#
# #
# call-seq: # call-seq:
# flags= .... # generic flags to include the command # flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags) # cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_auth_service_account_creds_gen_cxx_cmd() { grpc_cloud_prod_auth_service_account_creds_gen_cxx_cmd() {
local cmd_prefix="sudo docker run grpc/cxx"; local cmd_prefix="sudo docker run grpc/cxx";
local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl"; local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots";
local gfe_flags=" --use_prod_roots --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com" local gfe_flags=$(_grpc_prod_gfe_flags)
local added_gfe_flags=" --service_account_key_file=/service_account/stubbyCloudTestingTest-7dd63462c60c.json --oauth_scope=https://www.googleapis.com/auth/xapi.zoo" local added_gfe_flags=$(_grpc_svc_acc_test_flags)
local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@";
echo $the_cmd echo $the_cmd
} }
# constructs the full dockerized cpp interop test cmd. # constructs the full dockerized cpp gce auth interop test cmd.
#
# #
# call-seq: # call-seq:
# flags= .... # generic flags to include the command # flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags) # cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() { grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() {
local cmd_prefix="sudo docker run grpc/cxx"; local cmd_prefix="sudo docker run grpc/cxx";
local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl"; local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots";
local gfe_flags=" --use_prod_roots --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com" local gfe_flags=$(_grpc_prod_gfe_flags)
local added_gfe_flags=" --default_service_account=155450119199-r5aaqa2vqoa9g5mv2m6s3m1l293rlmel@developer.gserviceaccount.com --oauth_scope=https://www.googleapis.com/auth/xapi.zoo" local added_gfe_flags=$(_grpc_gce_test_flags)
local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@";
echo $the_cmd echo $the_cmd
} }
# TODO(grpc-team): add grpc_interop_gen_xxx_cmd for python|nodejs # outputs the flags passed to gfe tests
_grpc_prod_gfe_flags() {
echo " --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com"
}
# outputs the flags passed to the service account auth tests
_grpc_svc_acc_test_flags() {
echo " --service_account_key_file=/service_account/stubbyCloudTestingTest-7dd63462c60c.json --oauth_scope=https://www.googleapis.com/auth/xapi.zoo"
}
# outputs the flags passed to the gcloud auth tests
_grpc_gce_test_flags() {
echo " --default_service_account=155450119199-r5aaqa2vqoa9g5mv2m6s3m1l293rlmel@developer.gserviceaccount.com --oauth_scope=https://www.googleapis.com/auth/xapi.zoo"
}
# TODO(grpc-team): add grpc_interop_gen_xxx_cmd for python

@ -372,7 +372,9 @@ grpc_dockerfile_install() {
[[ -d $dockerfile_dir ]] || { echo "$FUNCNAME: not a valid dir: $dockerfile_dir"; return 1; } [[ -d $dockerfile_dir ]] || { echo "$FUNCNAME: not a valid dir: $dockerfile_dir"; return 1; }
# For specific base images, sync the ssh key into the .ssh dir in the dockerfile context # For specific base images, sync private files.
#
# - the ssh key, ssh certs and/or service account info.
[[ $image_label == "grpc/base" ]] && { [[ $image_label == "grpc/base" ]] && {
grpc_docker_sync_github_key $dockerfile_dir/.ssh 'base_ssh_key' || return 1; grpc_docker_sync_github_key $dockerfile_dir/.ssh 'base_ssh_key' || return 1;
} }
@ -384,6 +386,7 @@ grpc_dockerfile_install() {
} }
[[ $image_label == "grpc/ruby" ]] && { [[ $image_label == "grpc/ruby" ]] && {
grpc_docker_sync_roots_pem $dockerfile_dir/cacerts || return 1; grpc_docker_sync_roots_pem $dockerfile_dir/cacerts || return 1;
grpc_docker_sync_service_account $dockerfile_dir/service_account || return 1;
} }
[[ $image_label == "grpc/cxx" ]] && { [[ $image_label == "grpc/cxx" ]] && {
grpc_docker_sync_service_account $dockerfile_dir/service_account || return 1; grpc_docker_sync_service_account $dockerfile_dir/service_account || return 1;

Loading…
Cancel
Save