Skip to content
Permalink
Browse files
fix: update retry configs (#29)
  • Loading branch information
yoshi-automation committed Jun 25, 2020
1 parent b33fa88 commit 39c16522f7bc97544c361f8e14dbc9a2a5d4c0e4
Showing with 11,573 additions and 6,274 deletions.
  1. +2 −0 .flake8
  2. +2 −0 .gitignore
  3. +0 −2 .kokoro/publish-docs.sh
  4. +0 −2 .kokoro/release.sh
  5. +34 −0 .kokoro/samples/lint/common.cfg
  6. +6 −0 .kokoro/samples/lint/continuous.cfg
  7. +6 −0 .kokoro/samples/lint/periodic.cfg
  8. +6 −0 .kokoro/samples/lint/presubmit.cfg
  9. +34 −0 .kokoro/samples/python3.6/common.cfg
  10. +7 −0 .kokoro/samples/python3.6/continuous.cfg
  11. +6 −0 .kokoro/samples/python3.6/periodic.cfg
  12. +6 −0 .kokoro/samples/python3.6/presubmit.cfg
  13. +34 −0 .kokoro/samples/python3.7/common.cfg
  14. +6 −0 .kokoro/samples/python3.7/continuous.cfg
  15. +6 −0 .kokoro/samples/python3.7/periodic.cfg
  16. +6 −0 .kokoro/samples/python3.7/presubmit.cfg
  17. +34 −0 .kokoro/samples/python3.8/common.cfg
  18. +6 −0 .kokoro/samples/python3.8/continuous.cfg
  19. +6 −0 .kokoro/samples/python3.8/periodic.cfg
  20. +6 −0 .kokoro/samples/python3.8/presubmit.cfg
  21. +104 −0 .kokoro/test-samples.sh
  22. +3 −0 MANIFEST.in
  23. +3 −6 docs/conf.py
  24. +3 −0 docs/index.rst
  25. +7 −0 docs/multiprocessing.rst
  26. +8 −3 google/cloud/vision_v1/__init__.py
  27. +3 −3 google/cloud/vision_v1/gapic/enums.py
  28. +99 −98 google/cloud/vision_v1/gapic/image_annotator_client.py
  29. +29 −20 google/cloud/vision_v1/gapic/image_annotator_client_config.py
  30. +312 −310 google/cloud/vision_v1/gapic/product_search_client.py
  31. +86 −67 google/cloud/vision_v1/gapic/product_search_client_config.py
  32. +23 −20 google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py
  33. +91 −91 google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py
  34. +42 −31 google/cloud/vision_v1/proto/geometry_pb2.py
  35. +1 −0 google/cloud/vision_v1/proto/geometry_pb2_grpc.py
  36. +669 −325 google/cloud/vision_v1/proto/image_annotator_pb2.py
  37. +146 −29 google/cloud/vision_v1/proto/image_annotator_pb2_grpc.py
  38. +79 −58 google/cloud/vision_v1/proto/product_search_pb2.py
  39. +1 −0 google/cloud/vision_v1/proto/product_search_pb2_grpc.py
  40. +496 −397 google/cloud/vision_v1/proto/product_search_service_pb2.py
  41. +676 −143 google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py
  42. +200 −96 google/cloud/vision_v1/proto/text_annotation_pb2.py
  43. +1 −0 google/cloud/vision_v1/proto/text_annotation_pb2_grpc.py
  44. +73 −51 google/cloud/vision_v1/proto/web_detection_pb2.py
  45. +1 −0 google/cloud/vision_v1/proto/web_detection_pb2_grpc.py
  46. +7 −3 google/cloud/vision_v1p1beta1/__init__.py
  47. +1 −1 google/cloud/vision_v1p1beta1/gapic/enums.py
  48. +5 −5 google/cloud/vision_v1p1beta1/gapic/image_annotator_client.py
  49. +18 −9 google/cloud/vision_v1p1beta1/gapic/image_annotator_client_config.py
  50. +4 −2 google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py
  51. +32 −26 google/cloud/vision_v1p1beta1/proto/geometry_pb2.py
  52. +1 −0 google/cloud/vision_v1p1beta1/proto/geometry_pb2_grpc.py
  53. +424 −186 google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py
  54. +47 −11 google/cloud/vision_v1p1beta1/proto/image_annotator_pb2_grpc.py
  55. +201 −97 google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py
  56. +1 −0 google/cloud/vision_v1p1beta1/proto/text_annotation_pb2_grpc.py
  57. +72 −50 google/cloud/vision_v1p1beta1/proto/web_detection_pb2.py
  58. +1 −0 google/cloud/vision_v1p1beta1/proto/web_detection_pb2_grpc.py
  59. +7 −1 google/cloud/vision_v1p1beta1/types.py
  60. +7 −3 google/cloud/vision_v1p2beta1/__init__.py
  61. +3 −3 google/cloud/vision_v1p2beta1/gapic/enums.py
  62. +50 −50 google/cloud/vision_v1p2beta1/gapic/image_annotator_client.py
  63. +23 −14 google/cloud/vision_v1p2beta1/gapic/image_annotator_client_config.py
  64. +17 −15 google/cloud/vision_v1p2beta1/gapic/transports/image_annotator_grpc_transport.py
  65. +41 −30 google/cloud/vision_v1p2beta1/proto/geometry_pb2.py
  66. +1 −0 google/cloud/vision_v1p2beta1/proto/geometry_pb2_grpc.py
  67. +566 −264 google/cloud/vision_v1p2beta1/proto/image_annotator_pb2.py
  68. +79 −16 google/cloud/vision_v1p2beta1/proto/image_annotator_pb2_grpc.py
  69. +200 −96 google/cloud/vision_v1p2beta1/proto/text_annotation_pb2.py
  70. +1 −0 google/cloud/vision_v1p2beta1/proto/text_annotation_pb2_grpc.py
  71. +72 −50 google/cloud/vision_v1p2beta1/proto/web_detection_pb2.py
  72. +1 −0 google/cloud/vision_v1p2beta1/proto/web_detection_pb2_grpc.py
  73. +8 −3 google/cloud/vision_v1p3beta1/__init__.py
  74. +3 −3 google/cloud/vision_v1p3beta1/gapic/enums.py
  75. +12 −15 google/cloud/vision_v1p3beta1/gapic/image_annotator_client.py
  76. +31 −12 google/cloud/vision_v1p3beta1/gapic/image_annotator_client_config.py
  77. +199 −216 google/cloud/vision_v1p3beta1/gapic/product_search_client.py
  78. +81 −62 google/cloud/vision_v1p3beta1/gapic/product_search_client_config.py
  79. +8 −6 google/cloud/vision_v1p3beta1/gapic/transports/image_annotator_grpc_transport.py
  80. +63 −63 google/cloud/vision_v1p3beta1/gapic/transports/product_search_grpc_transport.py
  81. +51 −37 google/cloud/vision_v1p3beta1/proto/geometry_pb2.py
  82. +1 −0 google/cloud/vision_v1p3beta1/proto/geometry_pb2_grpc.py
  83. +587 −273 google/cloud/vision_v1p3beta1/proto/image_annotator_pb2.py
  84. +79 −16 google/cloud/vision_v1p3beta1/proto/image_annotator_pb2_grpc.py
  85. +96 −51 google/cloud/vision_v1p3beta1/proto/product_search_pb2.py
  86. +1 −0 google/cloud/vision_v1p3beta1/proto/product_search_pb2_grpc.py
  87. +482 −390 google/cloud/vision_v1p3beta1/proto/product_search_service_pb2.py
  88. +632 −126 google/cloud/vision_v1p3beta1/proto/product_search_service_pb2_grpc.py
  89. +200 −96 google/cloud/vision_v1p3beta1/proto/text_annotation_pb2.py
  90. +1 −0 google/cloud/vision_v1p3beta1/proto/text_annotation_pb2_grpc.py
  91. +72 −50 google/cloud/vision_v1p3beta1/proto/web_detection_pb2.py
  92. +1 −0 google/cloud/vision_v1p3beta1/proto/web_detection_pb2_grpc.py
  93. +8 −3 google/cloud/vision_v1p4beta1/__init__.py
  94. +3 −3 google/cloud/vision_v1p4beta1/gapic/enums.py
  95. +116 −115 google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py
  96. +30 −24 google/cloud/vision_v1p4beta1/gapic/image_annotator_client_config.py
  97. +220 −220 google/cloud/vision_v1p4beta1/gapic/product_search_client.py
  98. +83 −64 google/cloud/vision_v1p4beta1/gapic/product_search_client_config.py
  99. +41 −38 google/cloud/vision_v1p4beta1/gapic/transports/image_annotator_grpc_transport.py
  100. +57 −57 google/cloud/vision_v1p4beta1/gapic/transports/product_search_grpc_transport.py
  101. +38 −32 google/cloud/vision_v1p4beta1/proto/face_pb2.py
  102. +1 −0 google/cloud/vision_v1p4beta1/proto/face_pb2_grpc.py
  103. +42 −31 google/cloud/vision_v1p4beta1/proto/geometry_pb2.py
  104. +1 −0 google/cloud/vision_v1p4beta1/proto/geometry_pb2_grpc.py
  105. +654 −318 google/cloud/vision_v1p4beta1/proto/image_annotator_pb2.py
  106. +146 −29 google/cloud/vision_v1p4beta1/proto/image_annotator_pb2_grpc.py
  107. +79 −58 google/cloud/vision_v1p4beta1/proto/product_search_pb2.py
  108. +1 −0 google/cloud/vision_v1p4beta1/proto/product_search_pb2_grpc.py
  109. +507 −409 google/cloud/vision_v1p4beta1/proto/product_search_service_pb2.py
  110. +688 −151 google/cloud/vision_v1p4beta1/proto/product_search_service_pb2_grpc.py
  111. +200 −96 google/cloud/vision_v1p4beta1/proto/text_annotation_pb2.py
  112. +1 −0 google/cloud/vision_v1p4beta1/proto/text_annotation_pb2_grpc.py
  113. +73 −51 google/cloud/vision_v1p4beta1/proto/web_detection_pb2.py
  114. +1 −0 google/cloud/vision_v1p4beta1/proto/web_detection_pb2_grpc.py
  115. +16 −11 noxfile.py
  116. +33 −0 scripts/decrypt-secrets.sh
  117. +66 −0 scripts/readme-gen/readme_gen.py
  118. +87 −0 scripts/readme-gen/templates/README.tmpl.rst
  119. +9 −0 scripts/readme-gen/templates/auth.tmpl.rst
  120. +14 −0 scripts/readme-gen/templates/auth_api_key.tmpl.rst
  121. +29 −0 scripts/readme-gen/templates/install_deps.tmpl.rst
  122. +35 −0 scripts/readme-gen/templates/install_portaudio.tmpl.rst
  123. +10 −22 synth.metadata
  124. +2 −0 synth.py
  125. +3 −0 testing/.gitignore
  126. +41 −41 tests/unit/gapic/v1/test_image_annotator_client_v1.py
  127. +108 −108 tests/unit/gapic/v1/test_product_search_client_v1.py
  128. +35 −35 tests/unit/gapic/v1p2beta1/test_image_annotator_client_v1p2beta1.py
  129. +3 −11 tests/unit/gapic/v1p3beta1/test_image_annotator_client_v1p3beta1.py
  130. +75 −90 tests/unit/gapic/v1p3beta1/test_product_search_client_v1p3beta1.py
  131. +74 −74 tests/unit/gapic/v1p4beta1/test_image_annotator_client_v1p4beta1.py
  132. +84 −80 tests/unit/gapic/v1p4beta1/test_product_search_client_v1p4beta1.py
@@ -21,6 +21,8 @@ exclude =
# Exclude generated code.
**/proto/**
**/gapic/**
**/services/**
**/types/**
*_pb2.py

# Standard linting exemptions.
@@ -10,6 +10,7 @@
dist
build
eggs
.eggs
parts
bin
var
@@ -49,6 +50,7 @@ bigquery/docs/generated
# Virtual environment
env/
coverage.xml
sponge_log.xml

# System test environment variables.
system_tests/local_test_setup
@@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

set -eo pipefail

# Disable buffering, so that the logs stream through.
@@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

set -eo pipefail

# Start the releasetool reporter
@@ -0,0 +1,34 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "lint"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-vision/.kokoro/test-samples.sh"
}

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
}

# Download secrets for samples
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-vision/.kokoro/trampoline.sh"
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "False"
}
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
@@ -0,0 +1,34 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.6"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-vision/.kokoro/test-samples.sh"
}

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
}

# Download secrets for samples
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-vision/.kokoro/trampoline.sh"
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}

@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "False"
}
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
@@ -0,0 +1,34 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.7"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-vision/.kokoro/test-samples.sh"
}

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
}

# Download secrets for samples
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-vision/.kokoro/trampoline.sh"
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "False"
}
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
@@ -0,0 +1,34 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.8"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-vision/.kokoro/test-samples.sh"
}

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
}

# Download secrets for samples
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-vision/.kokoro/trampoline.sh"
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "False"
}
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
@@ -0,0 +1,104 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# `-e` enables the script to automatically fail when a command fails
# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
set -eo pipefail
# Enables `**` to include files nested inside sub-folders
shopt -s globstar

cd github/python-vision

# Run periodic samples tests at latest release
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
LATEST_RELEASE=$(git describe --abbrev=0 --tags)
git checkout $LATEST_RELEASE
fi

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

# Debug: show build environment
env | grep KOKORO

# Install nox
python3.6 -m pip install --upgrade --quiet nox

# Use secrets acessor service account to get secrets
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
gcloud auth activate-service-account \
--key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \
--project="cloud-devrel-kokoro-resources"
fi

# This script will create 3 files:
# - testing/test-env.sh
# - testing/service-account.json
# - testing/client-secrets.json
./scripts/decrypt-secrets.sh

source ./testing/test-env.sh
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json

# For cloud-run session, we activate the service account for gcloud sdk.
gcloud auth activate-service-account \
--key-file "${GOOGLE_APPLICATION_CREDENTIALS}"

export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json

echo -e "\n******************** TESTING PROJECTS ********************"

# Switch to 'fail at end' to allow all tests to complete before exiting.
set +e
# Use RTN to return a non-zero value if the test fails.
RTN=0
ROOT=$(pwd)
# Find all requirements.txt in the samples directory (may break on whitespace).
for file in samples/**/requirements.txt; do
cd "$ROOT"
# Navigate to the project folder.
file=$(dirname "$file")
cd "$file"

echo "------------------------------------------------------------"
echo "- testing $file"
echo "------------------------------------------------------------"

# Use nox to execute the tests for the project.
python3.6 -m nox -s "$RUN_TESTS_SESSION"
EXIT=$?

# If this is a periodic build, send the test log to the Build Cop Bot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop
$KOKORO_GFILE_DIR/linux_amd64/buildcop
fi

if [[ $EXIT -ne 0 ]]; then
RTN=1
echo -e "\n Testing failed: Nox returned a non-zero exit code. \n"
else
echo -e "\n Testing completed.\n"
fi

done
cd "$ROOT"

# Workaround for Kokoro permissions issue: delete secrets
rm testing/{test-env.sh,client-secrets.json,service-account.json}

exit "$RTN"
@@ -20,3 +20,6 @@ recursive-include google *.json *.proto
recursive-include tests *
global-exclude *.py[co]
global-exclude __pycache__

# Exclude scripts for samples readmegen
prune scripts/readme-gen
Loading

0 comments on commit 39c1652

Please sign in to comment.