Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3be3128

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 5fcd891 + 3b1bb59 commit 3be3128

File tree

1,310 files changed

+13432
-59288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,310 files changed

+13432
-59288
lines changed

.github/CODEOWNERS

Lines changed: 57 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,56 +9,60 @@
99
# explicitly taken by someone else.
1010
* @GoogleCloudPlatform/python-samples-owners
1111

12-
/auth/ @busunkim96 @GoogleCloudPlatform/python-samples-owners
13-
/automl/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
14-
/bigquery/ @shollyman @GoogleCloudPlatform/python-samples-owners
15-
/bigquery_storage/ @shollyman @GoogleCloudPlatform/python-samples-owners
16-
/bigtable/ @GoogleCloudPlatform/bigtable-dpe @GoogleCloudPlatform/python-samples-owners
17-
/blog/ @GoogleCloudPlatform/python-samples-owners
18-
/cdn/ @mpwarres @elithrar @GoogleCloudPlatform/python-samples-owners
19-
/cloud-sql/ @GoogleCloudPlatform/cloud-sql-dpes @GoogleCloudPlatform/python-samples-owners
20-
/codelabs/ @GoogleCloudPlatform/python-samples-owners
21-
/composer/ @leahecole @GoogleCloudPlatform/python-samples-owners
22-
/compute/ @djmailhot @GoogleCloudPlatform/python-samples-owners
23-
/container_registry/ @DanSanche @GoogleCloudPlatform/python-samples-owners
24-
/datacatalog/ @shollyman @GoogleCloudPlatform/python-samples-owners
25-
/dataflow/ @davidcavazos @GoogleCloudPlatform/python-samples-owners
26-
/datalabeling/ @sgreenberg @GoogleCloudPlatform/python-samples-owners
27-
/dataproc/ @bradmiro @GoogleCloudPlatform/python-samples-owners
28-
/datastore/ @GoogleCloudPlatform/firestore-dpe @GoogleCloudPlatform/python-samples-owners
29-
/dialogflow/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
30-
/dlp/ @GoogleCloudPlatform/python-samples-owners
31-
/dns/ @michaelawyu @GoogleCloudPlatform/python-samples-owners
32-
/endpoints/ @DanSanche @GoogleCloudPlatform/python-samples-owners
33-
/error_reporting/ @GoogleCloudPlatform/python-samples-owners
34-
/firestore/ @GoogleCloudPlatform/firestore-dpe @GoogleCloudPlatform/python-samples-owners
35-
/functions/ @ace-n @GoogleCloudPlatform/python-samples-owners
36-
/healthcare/ @noerog @GoogleCloudPlatform/python-samples-owners
37-
/iam/ @melaniedejong @GoogleCloudPlatform/python-samples-owners
38-
/iap/ @GoogleCloudPlatform/python-samples-owners
39-
/iot/ @gguuss @GoogleCloudPlatform/python-samples-owners
40-
/jobs/ @GoogleCloudPlatform/python-samples-owners
41-
/kms/ @DanSanche @GoogleCloudPlatform/python-samples-owners
42-
/kubernetes_engine/ @GoogleCloudPlatform/python-samples-owners
43-
/language/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
44-
/logging/ @GoogleCloudPlatform/python-samples-owners
45-
/memorystore/ @GoogleCloudPlatform/python-samples-owners
46-
/ml_engine/ @alecglassford @GoogleCloudPlatform/python-samples-owners
47-
/monitoring/ @GoogleCloudPlatform/python-samples-owners
48-
/notebooks/ @alixhami @sirtorry @GoogleCloudPlatform/python-samples-owners
49-
/opencensus/ @GoogleCloudPlatform/python-samples-owners
50-
/profiler/ @jqll @GoogleCloudPlatform/python-samples-owners
51-
/pubsub/ @anguillanneuf @hongalex @GoogleCloudPlatform/python-samples-owners
52-
/run/ @dinagraves @GoogleCloudPlatform/python-samples-owners
53-
/scheduler/ @averikitsch @GoogleCloudPlatform/python-samples-owners
54-
/spanner/ @larkee @GoogleCloudPlatform/python-samples-owners
55-
/speech/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
56-
/storage/ @GoogleCloudPlatform/storage-dpe @GoogleCloudPlatform/python-samples-owners
57-
/tables/automl/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
58-
/tasks/ @averikitsch @GoogleCloudPlatform/python-samples-owners
59-
/texttospeech/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
60-
/third_party/apache-airflow/ @leahecole @GoogleCloudPlatform/python-samples-owners
61-
/trace/ @dukeng @ziweizhao @GoogleCloudPlatform/python-samples-owners
62-
/translate/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
63-
/video/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
64-
/vision/ @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
12+
/appengine/**/*.py @engelke @GoogleCloudPlatform/python-samples-owners
13+
/auth/**/*.py @busunkim96 @GoogleCloudPlatform/python-samples-owners
14+
/automl/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
15+
/billing/**/*.py @GoogleCloudPlatform/billing-samples-maintainers @GoogleCloudPlatform/python-samples-owners
16+
/bigquery/**/*.py @shollyman @GoogleCloudPlatform/python-samples-owners
17+
/bigquery_storage/**/*.py @shollyman @GoogleCloudPlatform/python-samples-owners
18+
/bigtable/**/*.py @GoogleCloudPlatform/bigtable-dpe @GoogleCloudPlatform/python-samples-owners
19+
/blog/**/*.py @GoogleCloudPlatform/python-samples-owners
20+
/cdn/**/*.py @mpwarres @elithrar @GoogleCloudPlatform/python-samples-owners
21+
/cloud-sql/**/*.py @GoogleCloudPlatform/cloud-sql-dpes @GoogleCloudPlatform/python-samples-owners
22+
/codelabs/**/*.py @GoogleCloudPlatform/python-samples-owners
23+
/composer/**/*.py @leahecole @GoogleCloudPlatform/python-samples-owners
24+
/compute/**/*.py @GoogleCloudPlatform/python-samples-owners
25+
/container_registry/**/*.py @donmccasland @dinagraves @kelsk @GoogleCloudPlatform/python-samples-owners
26+
/data-science-onramp/ @coleleah @bradmiro @GoogleCloudPlatform/python-samples-owners
27+
/datacatalog/**/*.py @shollyman @GoogleCloudPlatform/python-samples-owners
28+
/dataflow/**/*.py @davidcavazos @GoogleCloudPlatform/python-samples-owners
29+
/datalabeling/**/*.py @sgreenberg @GoogleCloudPlatform/python-samples-owners
30+
/dataproc/**/*.py @bradmiro @GoogleCloudPlatform/python-samples-owners
31+
/datastore/**/*.py @GoogleCloudPlatform/firestore-dpe @GoogleCloudPlatform/python-samples-owners
32+
/dialogflow/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
33+
/dlp/**/*.py @GoogleCloudPlatform/python-samples-owners
34+
/dns/**/*.py @michaelawyu @GoogleCloudPlatform/python-samples-owners
35+
/endpoints/**/*.py @GoogleCloudPlatform/python-samples-owners
36+
/error_reporting/**/*.py @GoogleCloudPlatform/python-samples-owners
37+
/eventarc/**/*.py @averikitsch @grant @GoogleCloudPlatform/python-samples-owners
38+
/firestore/**/*.py @GoogleCloudPlatform/firestore-dpe @GoogleCloudPlatform/python-samples-owners
39+
/functions/**/*.py @ace-n @grant @GoogleCloudPlatform/python-samples-owners
40+
/healthcare/**/*.py @noerog @GoogleCloudPlatform/python-samples-owners
41+
/iam/**/*.py @GoogleCloudPlatform/python-samples-owners
42+
/iap/**/*.py @GoogleCloudPlatform/python-samples-owners
43+
/iot/**/*.py @gguuss @GoogleCloudPlatform/python-samples-owners
44+
/jobs/**/*.py @GoogleCloudPlatform/python-samples-owners
45+
/kms/**/*.py @GoogleCloudPlatform/python-samples-owners
46+
/kubernetes_engine/**/*.py @GoogleCloudPlatform/python-samples-owners
47+
/language/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
48+
/logging/**/*.py @simonz130 @GoogleCloudPlatform/python-samples-owners
49+
/memorystore/**/*.py @GoogleCloudPlatform/python-samples-owners
50+
/ml_engine/**/*.py @alecglassford @GoogleCloudPlatform/python-samples-owners
51+
/monitoring/**/*.py @GoogleCloudPlatform/python-samples-owners
52+
/notebooks/**/*.py @alixhami @sirtorry @GoogleCloudPlatform/python-samples-owners
53+
/opencensus/**/*.py @GoogleCloudPlatform/python-samples-owners
54+
/profiler/**/*.py @kalyanac @GoogleCloudPlatform/python-samples-owners
55+
/pubsub/**/*.py @anguillanneuf @hongalex @GoogleCloudPlatform/python-samples-owners
56+
/run/**/*.py @averikitsch @grant @GoogleCloudPlatform/python-samples-owners
57+
/scheduler/**/*.py @averikitsch @GoogleCloudPlatform/python-samples-owners
58+
/spanner/**/*.py @larkee @GoogleCloudPlatform/python-samples-owners
59+
/speech/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
60+
/storage/**/*.py @GoogleCloudPlatform/storage-dpe @GoogleCloudPlatform/python-samples-owners
61+
/tables/automl/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
62+
/tasks/**/*.py @averikitsch @GoogleCloudPlatform/python-samples-owners
63+
/texttospeech/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
64+
/third_party/apache-airflow/**/*.py @leahecole @GoogleCloudPlatform/python-samples-owners
65+
/trace/**/*.py @dukeng @ziweizhao @GoogleCloudPlatform/python-samples-owners
66+
/translate/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
67+
/video/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners
68+
/vision/**/*.py @telpirion @sirtorry @GoogleCloudPlatform/python-samples-owners

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ Note: It's a good idea to open an issue first for discussion.
77
## Checklist
88
- [ ] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md)
99
- [ ] README is updated to include [all relevant information](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#readme-file)
10-
- [ ] **Tests** pass: `nox -s py-3.6` (see [Test Enviroment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup))
11-
- [ ] **Lint** pass: `nox -s lint` (see [Test Enviroment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup))
10+
- [ ] **Tests** pass: `nox -s py-3.6` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup))
11+
- [ ] **Lint** pass: `nox -s lint` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup))
1212
- [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones)
1313
- [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones)
1414
- [ ] Please **merge** this PR for me once it is approved.
15+
- [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/.github/CODEOWNERS) with the codeowners for this sample

.github/blunderbuss.yml

Lines changed: 125 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,133 @@
1+
assign_issues_by:
2+
- labels:
3+
- 'api: appengine'
4+
to:
5+
- engelke
6+
- labels:
7+
- 'api: automl'
8+
- 'api: dialogflow'
9+
- 'api: language'
10+
- 'api: speech'
11+
- 'api: texttospeech'
12+
- 'api: translate'
13+
- 'api: videointelligence'
14+
- 'api: vision'
15+
to:
16+
- sirtorry
17+
- telpirion
18+
- labels:
19+
- 'api: dataflow'
20+
to:
21+
- davidcavazos
22+
- labels:
23+
- 'api: bigquery'
24+
- 'api: datacatalog'
25+
to:
26+
- shollyman
27+
- labels:
28+
- 'api: bigtable'
29+
to:
30+
- billyjacobson
31+
- labels:
32+
- 'api: billingbudgets'
33+
to:
34+
- GoogleCloudPlatform/billing-samples-maintainers
35+
- labels:
36+
- 'api: cloudsql'
37+
to:
38+
- GoogleCloudPlatform/cloud-sql-dpes
39+
- labels:
40+
- 'api: containeranalysis'
41+
to:
42+
- donmccasland
43+
- dinagraves
44+
- kelsk
45+
- labels:
46+
- 'api: datalabeling'
47+
- 'api: iot'
48+
to:
49+
- sgreenberg
50+
- labels:
51+
- 'api: dataproc'
52+
to:
53+
- bradmiro
54+
- labels:
55+
- 'api: datastore'
56+
- 'api: firestore'
57+
to:
58+
- GoogleCloudPlatform/firestore-dpe
59+
- labels:
60+
- 'api: dns'
61+
to:
62+
- michaelawyu
63+
- labels:
64+
- 'api: functions'
65+
to:
66+
- ace-n
67+
- grant
68+
- labels:
69+
- 'api: healthcare'
70+
to:
71+
- noerog
72+
- labels:
73+
- 'api: logging'
74+
to:
75+
- simonz130
76+
- labels:
77+
- 'api: ml'
78+
to:
79+
- alecglassford
80+
- labels:
81+
- 'api: notebooks'
82+
to:
83+
- sirtorry
84+
- labels:
85+
- 'api: cloudprofiler'
86+
to:
87+
- kalyanac
88+
- labels:
89+
- 'api: pubsub'
90+
to:
91+
- anguillanneuf
92+
- labels:
93+
- 'api: run'
94+
to:
95+
- averikitsch
96+
- grant
97+
- labels:
98+
- 'api: cloudscheduler'
99+
- 'api: cloudtasks'
100+
- 'api: tasks'
101+
to:
102+
- averikitsch
103+
- labels:
104+
- 'api: spanner'
105+
to:
106+
- larkee
107+
- labels:
108+
- 'api: storage'
109+
to:
110+
- GoogleCloudPlatform/storage-dpe
111+
- labels:
112+
- 'api: cloudtrace'
113+
- 'api: trace'
114+
to:
115+
- dukeng
116+
- ziweizhao
117+
118+
1119
assign_issues:
2120
- busunkim96
3-
- kurtisvg
4121
- leahecole
5-
- gguuss
6-
- crwilcox
7122
- tmatsuo
123+
- engelke
124+
- kurtisvg
125+
- dinagraves
126+
8127
assign_prs:
9128
- busunkim96
10-
- kurtisvg
11129
- leahecole
12-
- gguuss
13-
- crwilcox
14130
- tmatsuo
131+
- engelke
132+
- kurtisvg
133+
- dinagraves

.kokoro/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ RUN rm /tmp/get-pip.py
148148
RUN pip install --no-cache-dir virtualenv
149149

150150
# Setup Cloud SDK
151-
ENV CLOUD_SDK_VERSION 293.0.0
151+
ENV CLOUD_SDK_VERSION 304.0.0
152152
# Use system python for cloud sdk.
153153
ENV CLOUDSDK_PYTHON python3.6
154154
RUN wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-$CLOUD_SDK_VERSION-linux-x86_64.tar.gz

.kokoro/python3.6/periodic.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ env_vars: {
2424
key: "REPORT_TO_BUILD_COP_BOT"
2525
value: "true"
2626
}
27+
28+
# Tell Trampoline to upload the Docker image after successfull build.
29+
env_vars: {
30+
key: "TRAMPOLINE_IMAGE_UPLOAD"
31+
value: "true"
32+
}

.kokoro/python3.7/periodic.cfg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,16 @@ env_vars: {
2424
key: "REPORT_TO_BUILD_COP_BOT"
2525
value: "true"
2626
}
27+
28+
# Run DRIFT test result injection
29+
# (only for Python 3.7 builds)
30+
env_vars: {
31+
key: "INJECT_REGION_TAGS"
32+
value: "true"
33+
}
34+
35+
# Tell Trampoline to upload the Docker image after successfull build.
36+
env_vars: {
37+
key: "TRAMPOLINE_IMAGE_UPLOAD"
38+
value: "true"
39+
}

.kokoro/tests/run_single_test.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,36 @@ fi
4141
nox -s "$RUN_TESTS_SESSION"
4242
EXIT=$?
4343

44+
echo "PWD: ${PWD}"
45+
46+
# Inject region tag data into the test log
47+
set +e # Don't fail the entire test if this step fails
48+
if [[ "${INJECT_REGION_TAGS:-}" == "true" ]]; then
49+
50+
export XUNIT_PATH="$PWD/sponge_log.xml"
51+
export XUNIT_TMP_PATH="$(mktemp)"
52+
53+
if [[ -f "$XUNIT_PATH" ]]; then
54+
echo "=== Injecting region tags into XUnit output ==="
55+
echo "Processing XUnit output file: $XUNIT_PATH (saving output to $XUNIT_TMP_PATH)"
56+
57+
# We use `python3` because it will work even if we remove old
58+
# python versions from the docker image.
59+
echo "Calling python3 ${PARSER_PATH} inject-snippet-mapping --output_file ${XUNIT_TMP_PATH} ${PWD}"
60+
cat "$XUNIT_PATH" | \
61+
python3 "$PARSER_PATH" inject-snippet-mapping --output_file "$XUNIT_TMP_PATH" "$PWD"
62+
if [[ $? -eq 0 ]] && [[ -s "$XUNIT_PATH" ]]; then
63+
mv $XUNIT_TMP_PATH $XUNIT_PATH
64+
else
65+
echo "Region tag injection FAILED; XUnit file not modified."
66+
fi
67+
else
68+
echo "No XUnit output file found!"
69+
fi
70+
echo "=== Region tag injection complete! ==="
71+
fi
72+
set -e
73+
4474
# If REPORT_TO_BUILD_COP_BOT is set to "true", send the test log
4575
# to the Build Cop Bot.
4676
# See:

.kokoro/tests/run_tests.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,32 @@ set +e
121121
RTN=0
122122
ROOT=$(pwd)
123123

124+
# Setup DRIFT region tag injector
125+
# (only run on *some* builds)
126+
if [[ "${INJECT_REGION_TAGS:-}" == "true" ]]; then
127+
echo "=== Setting up DRIFT region tag injector ==="
128+
# install PyYaml (used by the DRIFT region tag parsing system)
129+
echo "--- Installing PyYaml ---"
130+
python3 -m pip install --user pyyaml
131+
132+
# Use ${HOME} because trampoline will automatically clean up this
133+
# directory.
134+
export REGION_TAG_PARSER_DIR="${HOME}/region-tag-parser"
135+
export PARSER_PATH="${REGION_TAG_PARSER_DIR}/wizard-py/cli.py"
136+
137+
if [[ ! -f $PARSER_PATH ]]; then
138+
echo "--- Fetching injection script from HEAD (via GitHub) ---"
139+
git clone https://github.com/GoogleCloudPlatform/repo-automation-playground "$REGION_TAG_PARSER_DIR" --single-branch
140+
chmod +x $PARSER_PATH
141+
fi
142+
echo "=== Region tag injector setup complete ==="
143+
fi
144+
124145
test_prog="${PROJECT_ROOT}/.kokoro/tests/run_single_test.sh"
125146

126147
btlr_args=(
127148
"run"
149+
"--max-cmd-duration=30m"
128150
"**/requirements.txt"
129151
)
130152

.kokoro/tests/run_tests_orig.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,16 @@ if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
7575
./scripts/decrypt-secrets.sh
7676
fi
7777

78-
source ./testing/test-env.sh
78+
if [[ -f ./testing/test-env.sh ]]; then
79+
source ./testing/test-env.sh
80+
fi
7981
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json
8082

8183
# For cloud-run session, we activate the service account for gcloud sdk.
82-
gcloud auth activate-service-account \
83-
--key-file "${GOOGLE_APPLICATION_CREDENTIALS}"
84+
if [[ -f "${GOOGLE_APPLICATION_CREDENTIALS}" ]]; then
85+
gcloud auth activate-service-account \
86+
--key-file "${GOOGLE_APPLICATION_CREDENTIALS}"
87+
fi
8488

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

0 commit comments

Comments
 (0)