Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

move monitoring samples from python-docs-samples #51

Merged
merged 166 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
97a680d
Add Monitoring v3 Samples
Mar 16, 2016
1180a57
Update requirements
Mar 17, 2016
85fe219
Merge pull request #225 from GoogleCloudPlatform/monitor_reqs
waprin Mar 17, 2016
2689143
Fix metric.name
Mar 17, 2016
335a6e3
Merge pull request #226 from GoogleCloudPlatform/metrictype
waprin Mar 17, 2016
5d9c2b5
Monitoring Doc Fixups
Mar 21, 2016
a37bbe6
Merge pull request #228 from GoogleCloudPlatform/mondocs
waprin Mar 22, 2016
800ad00
Use Main Project (now whitelisted)
Mar 28, 2016
1d5f968
Merge pull request #235 from GoogleCloudPlatform/mondocs2
Mar 29, 2016
2e3aab7
Fix minor typo in custom_metric.py
gtaylor Apr 7, 2016
14f255c
Merge pull request #243 from gtaylor/patch-1
waprin Apr 7, 2016
efadd60
Mark Monitoring As Flaky
Apr 13, 2016
fa32371
Merge pull request #258 from GoogleCloudPlatform/flakymonitor
Apr 13, 2016
69bdbad
Updating requirements.
Apr 25, 2016
f13ebbb
Merge pull request #278 from GoogleCloudPlatform/update-reqs
Apr 25, 2016
9f689de
Don’t send name in create custom metric
May 5, 2016
d2c1964
Merge pull request #328 from GoogleCloudPlatform/metricname
waprin May 5, 2016
d7f8ba9
updating requirements [(#358)](https://github.com/GoogleCloudPlatform…
May 23, 2016
31eea9a
Update Reqs
Jun 27, 2016
4b3c58e
Fix flaky custom metric test.
Aug 2, 2016
653de82
Update requirements. [(#436)](https://github.com/GoogleCloudPlatform/…
Aug 3, 2016
480d131
Remove output only fields [(#454)](https://github.com/GoogleCloudPlat…
waprin Aug 16, 2016
507e05e
Auto-update dependencies. [(#459)](https://github.com/GoogleCloudPlat…
dpebot Aug 17, 2016
c387d54
Fix import order lint errors
Aug 19, 2016
43fb9c3
bump
Aug 19, 2016
01c2ef4
Merge pull request #468 from GoogleCloudPlatform/nox-lint-per-sample
dpebot Aug 19, 2016
d64317d
Auto-update dependencies. [(#470)](https://github.com/GoogleCloudPlat…
dpebot Aug 22, 2016
dafb751
Auto-update dependencies. [(#476)](https://github.com/GoogleCloudPlat…
dpebot Aug 24, 2016
bc4c383
Auto-update dependencies. [(#486)](https://github.com/GoogleCloudPlat…
dpebot Aug 30, 2016
87fab14
Stackdriver product rename [(#508)](https://github.com/GoogleCloudPla…
Sep 8, 2016
e742401
Auto-update dependencies. [(#537)](https://github.com/GoogleCloudPlat…
dpebot Sep 20, 2016
b350a80
Fix lint issues
Sep 20, 2016
386f7f2
Fix monitoring test
Oct 14, 2016
a6707f6
Auto-update dependencies. [(#584)](https://github.com/GoogleCloudPlat…
dpebot Oct 18, 2016
b8820ff
Generate readmes for most service samples [(#599)](https://github.com…
Oct 24, 2016
633f0f8
Auto-update dependencies. [(#609)](https://github.com/GoogleCloudPlat…
dpebot Oct 27, 2016
8e5a4b2
Auto-update dependencies. [(#625)](https://github.com/GoogleCloudPlat…
dpebot Oct 31, 2016
696d50c
Auto-update dependencies. [(#629)](https://github.com/GoogleCloudPlat…
dpebot Nov 2, 2016
af6ee34
Auto-update dependencies. [(#735)](https://github.com/GoogleCloudPlat…
dpebot Jan 12, 2017
955c923
Add region tags for writing time series [(#757)](https://github.com/G…
waprin Jan 12, 2017
468504f
Auto-update dependencies. [(#762)](https://github.com/GoogleCloudPlat…
dpebot Jan 31, 2017
414b609
Cleanup metric descriptors [(#776)](https://github.com/GoogleCloudPla…
waprin Feb 1, 2017
6db8b60
Auto-update dependencies. [(#783)](https://github.com/GoogleCloudPlat…
dpebot Feb 6, 2017
35f8d1d
Auto-update dependencies. [(#785)](https://github.com/GoogleCloudPlat…
dpebot Feb 7, 2017
76f224a
Auto-update dependencies. [(#790)](https://github.com/GoogleCloudPlat…
dpebot Feb 9, 2017
35138ab
Add Monitoring Google Cloud Samples [(#789)](https://github.com/Googl…
waprin Feb 10, 2017
6f4516a
Auto-update dependencies. [(#794)](https://github.com/GoogleCloudPlat…
dpebot Feb 10, 2017
48e6664
Monitoring Region Tags [(#796)](https://github.com/GoogleCloudPlatfor…
waprin Feb 10, 2017
276cf3e
Add get metric descriptor [(#797)](https://github.com/GoogleCloudPlat…
waprin Feb 10, 2017
85f0c80
Fix mon reginos [(#798)](https://github.com/GoogleCloudPlatform/pytho…
waprin Feb 10, 2017
614f236
Fix monitoring tests [(#799)](https://github.com/GoogleCloudPlatform/…
waprin Feb 10, 2017
da388bd
Fixing monitoring tests
Feb 16, 2017
aeefb56
Remove usage of GoogleCredentials [(#810)](https://github.com/GoogleC…
Feb 17, 2017
831a8c2
Update monitoring region tags [(#830)](https://github.com/GoogleCloud…
waprin Feb 28, 2017
060be85
Remove cloud config fixture [(#887)](https://github.com/GoogleCloudPl…
Apr 4, 2017
08d3a5b
Remove resource [(#890)](https://github.com/GoogleCloudPlatform/pytho…
Apr 5, 2017
05bd4f6
De-flake metric test
Apr 6, 2017
b0fe453
Fix lint issues
Apr 7, 2017
26b38dc
Fix reference to our testing tools
Apr 12, 2017
9f6f992
Auto-update dependencies. [(#914)](https://github.com/GoogleCloudPlat…
dpebot Apr 24, 2017
d0f34ae
Re-generate all readmes
Apr 27, 2017
8f45deb
Fix README rst links [(#962)](https://github.com/GoogleCloudPlatform/…
waprin May 24, 2017
2f7019c
Auto-update dependencies. [(#1004)](https://github.com/GoogleCloudPla…
dpebot Jun 27, 2017
12ffc45
Auto-update dependencies. [(#1055)](https://github.com/GoogleCloudPla…
dpebot Aug 7, 2017
a468e06
Update monitoring samples to use more descriptive variable names [(#1…
Aug 8, 2017
053aa38
Auto-update dependencies. [(#1093)](https://github.com/GoogleCloudPla…
dpebot Aug 29, 2017
6ae3d14
Auto-update dependencies. [(#1094)](https://github.com/GoogleCloudPla…
dpebot Aug 30, 2017
a59ac9d
Update all generated readme auth instructions [(#1121)](https://githu…
Sep 18, 2017
891c174
Auto-update dependencies. [(#1133)](https://github.com/GoogleCloudPla…
dpebot Sep 21, 2017
2082d65
Added Link to Python Setup Guide [(#1158)](https://github.com/GoogleC…
Oct 12, 2017
dfddc26
Auto-update dependencies. [(#1186)](https://github.com/GoogleCloudPla…
dpebot Nov 1, 2017
4100937
Auto-update dependencies. [(#1217)](https://github.com/GoogleCloudPla…
dpebot Nov 15, 2017
910ccb1
Added "Open in Cloud Shell" buttons to README files [(#1254)](https:/…
Dec 7, 2017
775de5f
Auto-update dependencies. [(#1309)](https://github.com/GoogleCloudPla…
dpebot Jan 10, 2018
dce1784
Auto-update dependencies. [(#1320)](https://github.com/GoogleCloudPla…
dpebot Feb 2, 2018
3a54f21
Auto-update dependencies. [(#1355)](https://github.com/GoogleCloudPla…
dpebot Feb 9, 2018
0595656
Auto-update dependencies. [(#1359)](https://github.com/GoogleCloudPla…
dpebot Feb 26, 2018
389bba1
Auto-update dependencies. [(#1377)](https://github.com/GoogleCloudPla…
dpebot Mar 5, 2018
a737469
Fix client instantiation [(#1396)](https://github.com/GoogleCloudPlat…
campionfellin Mar 12, 2018
dbbede4
Auto-update dependencies.
dpebot Apr 2, 2018
e3a4eed
Regenerate the README files and fix the Open in Cloud Shell link for …
Apr 7, 2018
817ff5f
Update READMEs to fix numbering and add git clone [(#1464)](https://g…
frankyn Apr 26, 2018
8e454a3
Fix monitoring region tags. [(#1472)](https://github.com/GoogleCloudP…
jmdobry May 7, 2018
16dc215
Sample's for stackdriver's uptime check api. [(#1478)](https://githu…
SurferJeffAtGoogle May 14, 2018
10059d7
Stackdriver monitoring alerts sample. [(#1475)](https://github.com/Go…
SurferJeffAtGoogle May 15, 2018
6180e19
Add more doc tags to alerts sample. [(#1483)](https://github.com/Goog…
SurferJeffAtGoogle May 17, 2018
201d7b3
Update monitoring samples to use version 0.29.0 of the client library…
SurferJeffAtGoogle May 18, 2018
c4185b3
Add sample to update a cloud monitoring uptime check. [(#1508)](https…
SurferJeffAtGoogle May 30, 2018
71d017a
Resolved conflicts.
michaelawyu Jun 29, 2018
941bcb0
Merge branch 'dpebot-repositorygardener' despite flaky dataproc tests
michaelawyu Jun 29, 2018
1a14c0d
Auto-update dependencies. [(#1658)](https://github.com/GoogleCloudPla…
dpebot Aug 28, 2018
7bc0405
Time series tests use random unique name to avoid limits [(#1776)](ht…
engelke Oct 19, 2018
ce09c55
Added new region tag [(#1844)](https://github.com/GoogleCloudPlatform…
engelke Nov 15, 2018
7fb37fc
Auto-update dependencies. [(#1846)](https://github.com/GoogleCloudPla…
dpebot Nov 20, 2018
0bcbd18
New snippet to delete notification channel [(#1920)](https://github.c…
engelke Dec 11, 2018
950e127
Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPla…
dpebot Feb 6, 2019
8fb8e61
monitoring/metrics: update from 5 to 20 minutes [(#2210)](https://git…
grayside Jun 19, 2019
53b8235
Make backup/restore file name a parameter [(#2248)](https://github.co…
engelke Jul 19, 2019
d7ac80d
Adds split updates for Firebase ... opencensus [(#2438)](https://gith…
gguuss Oct 8, 2019
d661e59
Auto-update dependencies. [(#2005)](https://github.com/GoogleCloudPla…
dpebot Dec 21, 2019
d4428f7
fix: monitoring tests [(#2995)](https://github.com/GoogleCloudPlatfor…
leahecole Feb 26, 2020
9ccc1af
chore(deps): update dependency google-auth to v1.11.2 [(#2724)](https…
leahecole Mar 5, 2020
9acadec
Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatf…
kurtisvg Apr 2, 2020
7e9f1db
[monitoring] fix: use retrying module in the fixture class [(#3285)](…
Apr 7, 2020
0f9a14f
[monitoring] testing: mitigate 409 conflicts [(#3311)](https://github…
Apr 8, 2020
c73dbad
switch to regular flaky in monitoring [(#3333)](https://github.com/Go…
leahecole Apr 10, 2020
9e69bf1
Update dependency tabulate to v0.8.7 [(#3202)](https://github.com/Goo…
renovate-bot Apr 16, 2020
331bde2
Update dependency google-auth to v1.14.0 [(#3148)](https://github.com…
renovate-bot Apr 17, 2020
2c6faed
chore(deps): update dependency google-api-python-client to v1.8.0 [(#…
renovate-bot Apr 17, 2020
73790c0
chore(deps): update dependency google-cloud-monitoring to v0.35.0 [(#…
renovate-bot Apr 22, 2020
c394fff
[monitoring] chore: remove gcp-devrel-py-tools [(#3480)](https://gith…
Apr 23, 2020
567482a
Update dependency google-api-python-client to v1.8.2 [(#3452)](https:…
renovate-bot Apr 24, 2020
b2f0d46
testing: replace @flaky with @pytest.mark.flaky [(#3496)](https://git…
Apr 25, 2020
eb03f5d
chore(deps): update dependency google-auth to v1.14.1 [(#3464)](https…
renovate-bot Apr 28, 2020
d162881
[monitoring] fix: use backoff for writing the value [(#3697)](https:/…
May 7, 2020
d818aa8
chore(deps): update dependency google-auth to v1.14.2 [(#3724)](https…
renovate-bot May 11, 2020
b61f55c
chore: some lint fixes [(#3748)](https://github.com/GoogleCloudPlatfo…
May 13, 2020
ae9b472
chore(deps): update dependency google-auth to v1.14.3 [(#3728)](https…
renovate-bot May 13, 2020
ba90d4f
Add request_method to create example. [(#3745)](https://github.com/Go…
slz250 May 13, 2020
8a50461
testing: multi project noxfile-template.py [(#3700)](https://github.c…
May 15, 2020
aaba7cb
[monitoring] testing: start using build specific projects [(#3771)](h…
May 16, 2020
9c429cc
chore(deps): update dependency google-cloud-monitoring to v0.36.0 [(#…
renovate-bot May 18, 2020
95d2d73
update google-auth to 1.15.0 final part [(#3819)](https://github.com/…
leahecole May 19, 2020
796f86f
update google-api-python-client to 1.8.3 final part [(#3827)](https:/…
leahecole May 19, 2020
246309a
chore(deps): update dependency google-api-python-client to v1.8.4 [(#…
renovate-bot May 27, 2020
09d7647
[monitoring] fix: use the same random value for retry [(#3900)](https…
May 28, 2020
9775c7f
chore(deps): update dependency google-auth to v1.16.0 [(#3903)](https…
renovate-bot May 28, 2020
2f083a3
chore(deps): update dependency google-api-python-client to v1.9.1 [(#…
renovate-bot Jun 2, 2020
cb152bc
chore(deps): update dependency google-cloud-monitoring to v1 [(#3950)…
renovate-bot Jun 3, 2020
03c2c01
final update for google-auth [(#3967)](https://github.com/GoogleCloud…
leahecole Jun 5, 2020
6ccc4a4
testing: start using btlr [(#3959)](https://github.com/GoogleCloudPla…
Jun 9, 2020
d487a50
Replace GCLOUD_PROJECT with GOOGLE_CLOUD_PROJECT. [(#4022)](https://g…
kurtisvg Jun 9, 2020
b9f1768
Update dependency google-api-python-client to v1.9.2 [(#4038)](https:…
renovate-bot Jun 10, 2020
ed06eee
Update dependency google-auth to v1.17.0 [(#4058)](https://github.com…
renovate-bot Jun 11, 2020
6ee0b7c
chore(deps): update dependency google-auth to v1.17.1 [(#4073)](https…
renovate-bot Jun 12, 2020
8c32add
Update dependency google-auth to v1.17.2 [(#4083)](https://github.com…
renovate-bot Jun 12, 2020
ffc8103
Update dependency google-api-python-client to v1.9.3 [(#4057)](https:…
renovate-bot Jun 12, 2020
65548b7
Update dependency google-auth to v1.18.0 [(#4125)](https://github.com…
renovate-bot Jun 19, 2020
01657d6
[monitoring] fix: mitigate flake [(#4153)](https://github.com/GoogleC…
Jun 24, 2020
b068845
fix(monitoring): also retry upon DeadlineExceeded [(#4202)](https://g…
Jun 30, 2020
f2dff82
Create example for POST check. [(#4082)](https://github.com/GoogleClo…
slz250 Jul 6, 2020
b92fd45
Update dependency google-auth-httplib2 to v0.0.4 [(#4255)](https://gi…
renovate-bot Jul 9, 2020
bf7fc36
chore(deps): pin dependencies [(#4280)](https://github.com/GoogleClou…
renovate-bot Jul 12, 2020
4ecdfab
chore(deps): update dependency pytest to v5.4.3 [(#4279)](https://git…
renovate-bot Jul 12, 2020
254a1e6
chore(deps): update dependency mock to v4 [(#4287)](https://github.co…
renovate-bot Jul 13, 2020
c38cd7a
chore(deps): update dependency google-auth to v1.19.0 [(#4293)](https…
renovate-bot Jul 13, 2020
9ae58f7
Update dependency flaky to v3.7.0 [(#4300)](https://github.com/Google…
renovate-bot Jul 16, 2020
e060911
Update dependency google-api-python-client to v1.10.0 [(#4302)](https…
renovate-bot Jul 16, 2020
a221c0c
chore(deps): update dependency google-auth to v1.19.1 [(#4304)](https…
renovate-bot Jul 17, 2020
d8d1421
chore(deps): update dependency google-auth to v1.19.2 [(#4321)](https…
renovate-bot Jul 18, 2020
0f33e00
Update dependency google-auth to v1.20.0 [(#4387)](https://github.com…
renovate-bot Jul 28, 2020
56be534
Update dependency pytest to v6 [(#4390)](https://github.com/GoogleClo…
renovate-bot Aug 1, 2020
39ec402
chore(deps): update dependency google-auth to v1.20.1 [(#4452)](https…
renovate-bot Aug 7, 2020
7709e32
chore(deps): update dependency google-api-python-client to v1.10.1 [(…
renovate-bot Aug 27, 2020
a3947c4
chore(deps): update dependency google-cloud-monitoring to v1.1.0 [(#4…
renovate-bot Aug 27, 2020
36fcbb5
Update dependency google-auth to v1.21.0 [(#4588)](https://github.com…
renovate-bot Aug 27, 2020
d277a54
Update dependency google-api-python-client to v1.11.0 [(#4587)](https…
renovate-bot Aug 28, 2020
eb2422a
chore(deps): update dependency google-auth to v1.21.1 [(#4634)](https…
renovate-bot Sep 9, 2020
43f7160
chore(deps): update dependency google-auth to v1.21.2 [(#4684)](https…
renovate-bot Sep 18, 2020
46ac39b
fix(monitoring): retry in the test setup [(#4702)](https://github.com…
Sep 18, 2020
e976d78
chore(deps): update dependency google-api-python-client to v1.12.1 [(…
renovate-bot Sep 22, 2020
ecfd159
chore(deps): update dependency google-auth to v1.21.3 [(#4754)](https…
renovate-bot Sep 23, 2020
45d508e
chore(deps): update dependency google-api-python-client to v1.12.2 [(…
renovate-bot Sep 24, 2020
85a1420
Merge branch 'snippets-v3-samples' into add-snippets-v3-samples
arithmetic1728 Sep 25, 2020
6e47c2b
chore: update template
arithmetic1728 Sep 25, 2020
7eb9d60
chore: add BUILD_SPECIFIC_GCLOUD_PROJECT env var
arithmetic1728 Sep 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# Generated by synthtool. DO NOT EDIT!
[run]
branch = True
omit =
google/cloud/__init__.py

[report]
fail_under = 100
Expand All @@ -32,4 +34,5 @@ omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
*/site-packages/*.py
google/cloud/__init__.py
Empty file added .github/snippet-bot.yml
Empty file.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pip-log.txt
# Built documentation
docs/_build
bigquery/docs/generated
docs.metadata

# Virtual environment
env/
Expand All @@ -57,4 +58,4 @@ system_tests/local_test_setup

# Make sure a generated file isn't accidentally committed.
pylintrc
pylintrc.test
pylintrc.test
8 changes: 7 additions & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ python3.6 -m pip uninstall --yes --quiet nox-automation
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version

python3.6 -m nox
# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
else
python3.6 -m nox
fi
98 changes: 98 additions & 0 deletions .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# 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
#
# http://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.

from ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

# Ensure local Python is preferred over distribution Python.
ENV PATH /usr/local/bin:$PATH

# Install dependencies.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
curl \
dirmngr \
git \
gpg-agent \
graphviz \
libbz2-dev \
libdb5.3-dev \
libexpat1-dev \
libffi-dev \
liblzma-dev \
libreadline-dev \
libsnappy-dev \
libssl-dev \
libsqlite3-dev \
portaudio19-dev \
redis-server \
software-properties-common \
ssh \
sudo \
tcl \
tcl-dev \
tk \
tk-dev \
uuid-dev \
wget \
zlib1g-dev \
&& add-apt-repository universe \
&& apt-get update \
&& apt-get -y install jq \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /var/cache/apt/archives/*.deb


COPY fetch_gpg_keys.sh /tmp
# Install the desired versions of Python.
RUN set -ex \
&& export GNUPGHOME="$(mktemp -d)" \
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
&& /tmp/fetch_gpg_keys.sh \
&& for PYTHON_VERSION in 3.7.8 3.8.5; do \
wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
&& rm python-${PYTHON_VERSION}.tar.xz \
&& cd /usr/src/python-${PYTHON_VERSION} \
&& ./configure \
--enable-shared \
# This works only on Python 2.7 and throws a warning on every other
# version, but seems otherwise harmless.
--enable-unicode=ucs4 \
--with-system-ffi \
--without-ensurepip \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
; done \
&& rm -rf "${GNUPGHOME}" \
&& rm -rf /usr/src/python* \
&& rm -rf ~/.cache/

RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3.7 /tmp/get-pip.py \
&& python3.8 /tmp/get-pip.py \
&& rm /tmp/get-pip.py

CMD ["python3.7"]
45 changes: 45 additions & 0 deletions .kokoro/docker/docs/fetch_gpg_keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/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
#
# http://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.

# A script to fetch gpg keys with retry.
# Avoid jinja parsing the file.
#

function retry {
if [[ "${#}" -le 1 ]]; then
echo "Usage: ${0} retry_count commands.."
exit 1
fi
local retries=${1}
local command="${@:2}"
until [[ "${retries}" -le 0 ]]; do
$command && return 0
if [[ $? -ne 0 ]]; then
echo "command failed, retrying"
((retries--))
fi
done
return 1
}

# 3.6.9, 3.7.5 (Ned Deily)
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D

# 3.8.0 (Łukasz Langa)
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
E3FF2839C048B25C084DEBE9B26995E310250568

#
21 changes: 19 additions & 2 deletions .kokoro/docs/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-monitoring/.kokoro/trampoline.sh"
build_file: "python-monitoring/.kokoro/trampoline_v2.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
value: "gcr.io/cloud-devrel-kokoro-resources/python-lib-docs"
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
Expand All @@ -28,6 +28,23 @@ env_vars: {
value: "docs-staging"
}

env_vars: {
key: "V2_STAGING_BUCKET"
value: "docs-staging-v2-staging"
}

# It will upload the docker image after successful builds.
env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "true"
}

# It will always build the docker image.
env_vars: {
key: "TRAMPOLINE_DOCKERFILE"
value: ".kokoro/docker/docs/Dockerfile"
}

# Fetch the token needed for reporting release status to GitHub
before_action {
fetch_keystore {
Expand Down
17 changes: 17 additions & 0 deletions .kokoro/docs/docs-presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "STAGING_BUCKET"
value: "gcloud-python-test"
}

env_vars: {
key: "V2_STAGING_BUCKET"
value: "gcloud-python-test"
}

# We only upload the image in the main `docs` build.
env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}
43 changes: 43 additions & 0 deletions .kokoro/populate-secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/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
#
# http://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.

set -eo pipefail

function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
function msg { println "$*" >&2 ;}
function println { printf '%s\n' "$(now) $*" ;}


# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
mkdir -p ${SECRET_LOCATION}
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
do
msg "Retrieving secret ${key}"
docker run --entrypoint=gcloud \
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
gcr.io/google.com/cloudsdktool/cloud-sdk \
secrets versions access latest \
--project cloud-devrel-kokoro-resources \
--secret ${key} > \
"${SECRET_LOCATION}/${key}"
if [[ $? == 0 ]]; then
msg "Secret written to ${SECRET_LOCATION}/${key}"
else
msg "Error retrieving secret ${key}"
fi
done
39 changes: 24 additions & 15 deletions .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,16 @@ set -eo pipefail
# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

cd github/python-monitoring

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
export PATH="${HOME}/.local/bin:${PATH}"

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

# build docs
nox -s docs

python3 -m pip install gcp-docuploader

# install a json parser
sudo apt-get update
sudo apt-get -y install software-properties-common
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get -y install jq
python3 -m pip install --user gcp-docuploader

# create metadata
python3 -m docuploader create-metadata \
Expand All @@ -52,4 +42,23 @@ python3 -m docuploader create-metadata \
cat docs.metadata

# upload docs
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket docs-staging
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"


# docfx yaml files
nox -s docfx

# create metadata.
python3 -m docuploader create-metadata \
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
--version=$(python3 setup.py --version) \
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
--distribution-name=$(python3 setup.py --name) \
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)

cat docs.metadata

# upload docs
python3 -m docuploader upload docs/_build/html/docfx_yaml --metadata-file docs.metadata --destination-prefix docfx --staging-bucket "${V2_STAGING_BUCKET}"
Loading