Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: client side metrics data model #923

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b5b62c8
feat!: add new v3.0.0 API skeleton (#745)
daniel-sanche Mar 14, 2023
7d51eeb
chore: merge branch 'main' into v3
daniel-sanche Mar 15, 2023
507da99
feat: improve rows filters (#751)
daniel-sanche Mar 23, 2023
71b0312
feat: read rows query model class (#752)
daniel-sanche Apr 3, 2023
c55099f
feat: implement row and cell model classes (#753)
daniel-sanche Apr 5, 2023
f9a1907
feat: add pooled grpc transport (#748)
daniel-sanche Apr 24, 2023
3de7a68
feat: implement read_rows (#762)
daniel-sanche May 24, 2023
9b81289
feat: implement mutate rows (#769)
daniel-sanche Jun 6, 2023
ec3fd01
feat: literal value filter (#767)
daniel-sanche Jun 6, 2023
5d65703
feat: row_exists and read_row (#778)
daniel-sanche Jun 16, 2023
432d159
feat: read_modify_write and check_and_mutate_row (#780)
daniel-sanche Jun 16, 2023
ec2b983
feat: sharded read rows (#766)
daniel-sanche Jun 23, 2023
ceaf598
feat: ping and warm with metadata (#810)
daniel-sanche Jun 26, 2023
1ecf65f
feat: mutate rows batching (#770)
daniel-sanche Jun 26, 2023
eedde1e
chore: restructure module paths (#816)
daniel-sanche Jun 28, 2023
07438ca
feat: improve timeout structure (#819)
daniel-sanche Jun 29, 2023
0d92a84
fix: api errors apply to all bulk mutations
daniel-sanche Jul 24, 2023
a8cdf7c
chore: reduce public api surface (#820)
daniel-sanche Aug 1, 2023
aa760b2
feat: improve error group tracebacks on < py11 (#825)
daniel-sanche Aug 16, 2023
0323dde
feat: optimize read_rows (#852)
daniel-sanche Aug 17, 2023
0b3606f
chore: add user agent suffix (#842)
daniel-sanche Aug 17, 2023
b6d232a
feat: optimize retries (#854)
daniel-sanche Aug 17, 2023
8708a25
feat: add test proxy (#836)
daniel-sanche Aug 18, 2023
1d3a7c1
chore(tests): add conformance tests to CI for v3 (#870)
daniel-sanche Oct 16, 2023
50531e5
chore(tests): turn off fast fail for conformance tets (#882)
daniel-sanche Oct 26, 2023
8ff1216
feat: add TABLE_DEFAULTS enum for table method arguments (#880)
daniel-sanche Oct 26, 2023
94bfe66
fix: pass None for retry in gapic calls (#881)
daniel-sanche Oct 27, 2023
3ac80a9
feat: replace internal dictionaries with protos in gapic calls (#875)
daniel-sanche Nov 22, 2023
b191451
chore: optimize gapic calls (#863)
daniel-sanche Dec 1, 2023
285cdd3
feat: expose retryable error codes to users (#879)
daniel-sanche Dec 1, 2023
9342e27
chore: update api_core submodule (#897)
daniel-sanche Dec 15, 2023
858b93a
chore: merge main into experimental_v3 (#900)
daniel-sanche Dec 15, 2023
cc79d8c
chore: pin conformance tests to v0.0.2 (#903)
daniel-sanche Dec 15, 2023
f0d75de
fix: bulk mutation eventual success (#909)
daniel-sanche Dec 19, 2023
11532ef
feat: pulled in data model for client side metrics
daniel-sanche Jan 26, 2024
874a9a8
stripped out handlers for future PR
daniel-sanche Jan 26, 2024
d905462
added metric controls to table
daniel-sanche Jan 26, 2024
5f42046
removed api_core from mypy install
daniel-sanche Jan 27, 2024
4369d57
improved comments
daniel-sanche Jan 27, 2024
cc79cde
always log metric errors
daniel-sanche Feb 1, 2024
f6831bb
ran blacken
daniel-sanche Feb 1, 2024
3ffc7c0
use ResponseParams proto to parse blob
daniel-sanche Feb 1, 2024
2ef2c3c
convert all time variables to explicitly use ms
daniel-sanche Feb 1, 2024
00d70db
pulled backoff generator into PR
daniel-sanche Feb 1, 2024
24432c8
fixed checks
daniel-sanche Feb 1, 2024
619d982
Merge branch 'main' into client_side_metrics_data_model
daniel-sanche Feb 8, 2024
2c8506d
removed exception flag
daniel-sanche Feb 9, 2024
7408722
added comments
daniel-sanche Feb 16, 2024
e1fe3ab
improved server timing regex
daniel-sanche Feb 16, 2024
6d2e9f4
change float ms to int ns for timestamps
daniel-sanche Feb 16, 2024
6bf526e
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 16, 2024
600ef0b
renamed variable
daniel-sanche Feb 23, 2024
10ef5d1
lint
daniel-sanche Feb 23, 2024
f9dab5d
turned backoff_generator into a class
daniel-sanche Mar 15, 2024
1986b06
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 15, 2024
035dab1
added backoff generator test
daniel-sanche Mar 15, 2024
5a63965
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 15, 2024
a5aceef
removed unused import
daniel-sanche Mar 20, 2024
24fe643
Merge branch 'main' into client_side_metrics_data_model
daniel-sanche Apr 22, 2024
b1d08c9
fixed test
daniel-sanche Apr 22, 2024
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
10 changes: 1 addition & 9 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
[run]
branch = True
omit =
google/cloud/__init__.py
google/__init__.py
google/cloud/bigtable_admin/__init__.py
google/cloud/bigtable_admin/gapic_version.py

[report]
fail_under = 100
fail_under = 99
show_missing = True
exclude_lines =
# Re-enable the standard pragma
Expand All @@ -33,11 +31,5 @@ exclude_lines =
def __repr__
# Ignore abstract methods
raise NotImplementedError
# Ignore setuptools-less fallback
except pkg_resources.DistributionNotFound:
omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
google/cloud/__init__.py
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:8555f0e37e6261408f792bfd6635102d2da5ad73f8f09bcb24f25e6afb5fac97
digest: sha256:230f7fe8a0d2ed81a519cfc15c6bb11c5b46b9fb449b8b1219b3771bcb520ad2
# created: 2023-12-09T15:16:25.430769578Z
2 changes: 1 addition & 1 deletion .github/auto-label.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
18 changes: 18 additions & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ branchProtectionRules:
- 'Kokoro'
- 'Kokoro system-3.8'
- 'cla/google'
- pattern: experimental_v3
# Can admins overwrite branch protection.
# Defaults to `true`
isAdminEnforced: false
# Number of approving reviews required to update matching branches.
# Defaults to `1`
requiredApprovingReviewCount: 1
# Are reviews from code owners required to update matching branches.
# Defaults to `false`
requiresCodeOwnerReviews: false
# Require up to date branches
requiresStrictStatusChecks: false
# List of required status check contexts that must pass for commits to be accepted to matching branches.
requiredStatusCheckContexts:
- 'Kokoro'
- 'Kokoro system-3.8'
- 'cla/google'
- 'Conformance / Async v3 Client / Python 3.8'
# List of explicit permissions to add (additive only)
permissionRules:
# Team slug to add to repository permissions
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/conformance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2023 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.
# Github action job to test core java library features on
# downstream client libraries before they are released.
on:
push:
branches:
- main
pull_request:
name: Conformance
jobs:
conformance:
runs-on: ubuntu-latest
strategy:
matrix:
test-version: [ "v0.0.2" ]
py-version: [ 3.8 ]
client-type: [ "Async v3", "Legacy" ]
fail-fast: false
name: "${{ matrix.client-type }} Client / Python ${{ matrix.py-version }} / Test Tag ${{ matrix.test-version }}"
steps:
- uses: actions/checkout@v3
name: "Checkout python-bigtable"
- uses: actions/checkout@v3
name: "Checkout conformance tests"
with:
repository: googleapis/cloud-bigtable-clients-test
ref: ${{ matrix.test-version }}
path: cloud-bigtable-clients-test
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py-version }}
- uses: actions/setup-go@v4
with:
go-version: '>=1.20.2'
- run: chmod +x .kokoro/conformance.sh
- run: pip install -e .
name: "Install python-bigtable from HEAD"
- run: go version
- run: .kokoro/conformance.sh
name: "Run tests"
env:
CLIENT_TYPE: ${{ matrix.client-type }}
PYTHONUNBUFFERED: 1

10 changes: 5 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install nox
Expand All @@ -24,11 +24,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.10"
- name: Install nox
run: |
python -m pip install --upgrade setuptools pip wheel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install nox
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install nox
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/system_emulated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ on:
jobs:

run-systests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Setup GCloud SDK
uses: google-github-actions/setup-gcloud@v1.1.0
uses: google-github-actions/setup-gcloud@v2.0.0

- name: Install / run Nox
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install nox
Expand All @@ -37,9 +37,9 @@ jobs:
- unit
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install coverage
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ docs.metadata

# Virtual environment
env/
venv/

# Test logs
coverage.xml
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "python-api-core"]
path = python-api-core
url = git@github.com:googleapis/python-api-core.git
[submodule "gapic-generator-fork"]
path = gapic-generator-fork
url = git@github.com:googleapis/gapic-generator-python.git
2 changes: 1 addition & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2018 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
52 changes: 52 additions & 0 deletions .kokoro/conformance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

# Copyright 2023 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

## cd to the parent directory, i.e. the root of the git repo
cd $(dirname $0)/..

PROXY_ARGS=""
TEST_ARGS=""
if [[ "${CLIENT_TYPE^^}" == "LEGACY" ]]; then
echo "Using legacy client"
PROXY_ARGS="--legacy-client"
# legacy client does not expose mutate_row. Disable those tests
TEST_ARGS="-skip TestMutateRow_"
fi

# Build and start the proxy in a separate process
PROXY_PORT=9999
pushd test_proxy
nohup python test_proxy.py --port $PROXY_PORT $PROXY_ARGS &
proxyPID=$!
popd

# Kill proxy on exit
function cleanup() {
echo "Cleanup testbench";
kill $proxyPID
}
trap cleanup EXIT

# Run the conformance test
pushd cloud-bigtable-clients-test/tests
eval "go test -v -proxy_addr=:$PROXY_PORT $TEST_ARGS"
RETURN_CODE=$?
popd

echo "exiting with ${RETURN_CODE}"
exit ${RETURN_CODE}
2 changes: 1 addition & 1 deletion .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/populate-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 Google LLC.
# Copyright 2023 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
6 changes: 6 additions & 0 deletions .kokoro/presubmit/conformance.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "NOX_SESSION"
value: "conformance"
}
2 changes: 1 addition & 1 deletion .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
9 changes: 9 additions & 0 deletions .kokoro/release/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}

# Store the packages we uploaded to PyPI. That way, we have a record of exactly
# what we published, which we can use to generate SBOMs and attestations.
action {
define_artifacts {
regex: "github/python-bigtable/**/*.tar.gz"
strip_prefix: "github/python-bigtable"
}
}
2 changes: 1 addition & 1 deletion .kokoro/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ typing-extensions
twine
wheel
setuptools
nox
nox>=2022.11.21 # required to remove dependency on py
charset-normalizer<3
click<8.1.0
Loading
Loading