Skip to content
Permalink
Browse files
docs: add multiprocessing note (#13)
  • Loading branch information
yoshi-automation committed Jul 1, 2020
1 parent ce7a72a commit 840d67c09502ae99ce4771c66bde1cefb961a367
Showing with 2,007 additions and 915 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. +2 −2 docs/_templates/layout.html
  24. +3 −6 docs/conf.py
  25. +2 −0 docs/index.rst
  26. +7 −0 docs/multiprocessing.rst
  27. +4 −4 google/cloud/errorreporting_v1beta1/gapic/enums.py
  28. +43 −42 google/cloud/errorreporting_v1beta1/gapic/error_group_service_client.py
  29. +2 −2 google/cloud/errorreporting_v1beta1/gapic/error_group_service_client_config.py
  30. +118 −116 google/cloud/errorreporting_v1beta1/gapic/error_stats_service_client.py
  31. +3 −3 google/cloud/errorreporting_v1beta1/gapic/error_stats_service_client_config.py
  32. +16 −9 google/cloud/errorreporting_v1beta1/gapic/report_errors_service_client.py
  33. +12 −12 google/cloud/errorreporting_v1beta1/gapic/transports/error_group_service_grpc_transport.py
  34. +15 −15 google/cloud/errorreporting_v1beta1/gapic/transports/error_stats_service_grpc_transport.py
  35. +10 −3 google/cloud/errorreporting_v1beta1/gapic/transports/report_errors_service_grpc_transport.py
  36. +17 −10 google/cloud/errorreporting_v1beta1/proto/common.proto
  37. +119 −102 google/cloud/errorreporting_v1beta1/proto/common_pb2.py
  38. +1 −0 google/cloud/errorreporting_v1beta1/proto/common_pb2_grpc.py
  39. +25 −11 google/cloud/errorreporting_v1beta1/proto/error_group_service.proto
  40. +57 −53 google/cloud/errorreporting_v1beta1/proto/error_group_service_pb2.py
  41. +79 −18 google/cloud/errorreporting_v1beta1/proto/error_group_service_pb2_grpc.py
  42. +116 −86 google/cloud/errorreporting_v1beta1/proto/error_stats_service.proto
  43. +297 −191 google/cloud/errorreporting_v1beta1/proto/error_stats_service_pb2.py
  44. +112 −23 google/cloud/errorreporting_v1beta1/proto/error_stats_service_pb2_grpc.py
  45. +60 −24 google/cloud/errorreporting_v1beta1/proto/report_errors_service.proto
  46. +99 −66 google/cloud/errorreporting_v1beta1/proto/report_errors_service_pb2.py
  47. +53 −19 google/cloud/errorreporting_v1beta1/proto/report_errors_service_pb2_grpc.py
  48. +19 −12 noxfile.py
  49. +1 −0 samples/AUTHORING_GUIDE.md
  50. +1 −0 samples/CONTRIBUTING.md
  51. +33 −0 scripts/decrypt-secrets.sh
  52. +66 −0 scripts/readme-gen/readme_gen.py
  53. +87 −0 scripts/readme-gen/templates/README.tmpl.rst
  54. +9 −0 scripts/readme-gen/templates/auth.tmpl.rst
  55. +14 −0 scripts/readme-gen/templates/auth_api_key.tmpl.rst
  56. +29 −0 scripts/readme-gen/templates/install_deps.tmpl.rst
  57. +35 −0 scripts/readme-gen/templates/install_portaudio.tmpl.rst
  58. +5 −13 synth.metadata
  59. +51 −5 synth.py
  60. +3 −0 testing/.gitignore
  61. +1 −1 tests/system/gapic/v1beta1/test_system_report_errors_service_v1beta1.py
  62. +17 −17 tests/unit/gapic/v1beta1/test_error_group_service_client_v1beta1.py
  63. +43 −45 tests/unit/gapic/v1beta1/test_error_stats_service_client_v1beta1.py
  64. +1 −1 tests/unit/gapic/v1beta1/test_report_errors_service_client_v1beta1.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-error-reporting/.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-error-reporting/.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-error-reporting/.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-error-reporting/.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-error-reporting/.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-error-reporting/.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-error-reporting/.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-error-reporting/.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-error-reporting

# 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 840d67c

Please sign in to comment.