Skip to content

dhermes/gcloud-python-bigtable

Repository files navigation

Google Cloud BigTable Python Library (Alpha)

An extension to gcloud-python

The Google Cloud BigTable API only supports requests over HTTP/2. In order to suppor this, we'll rely on grpc. Unfortunately, the install story of gRPC is still developing. We are working with the gRPC team to rapidly make the install story more user-friendly.

In it's current form, this library attempted to support requests over HTTP/1.1. This is not allowed by the backend, and results in a 400 Bad Request:

{
  "error": {
    "code": 400,
    "message": "Proto over HTTP is not allowed for service 'bigtableclusteradmin.googleapis.com'.",
    "status": "FAILED_PRECONDITION"
  }
}

Building _pb2.py files

Calling the Google Cloud BigTable API requires

gcloud_bigtable/bigtable_data_pb2.py
gcloud_bigtable/bigtable_service_messages_pb2.py
gcloud_bigtable/bigtable_service_pb2.py

These are built from the .proto files provided with the Cloud BigTable client. Compiling them to Python files requires the latest version of the protoc compiler to support the proto3 syntax.

In order to install protoc version >= 3.0.0, follow the instructions on the project. They are roughly

$ sudo apt-get install autoconf libtool
$ git clone https://github.com/google/protobuf
$ cd protobuf
$ # Optionally checkout a tagged commit: git checkout v3.0.0-alpha-3.1
$ ./autogen.sh  # Generate the configure script
$ # Build and install C++ Protocol Buffer runtime and
$ # the Protocol Buffer compiler (protoc)
$ ./configure [--prefix=/usr/local]  # or [--prefix=/usr]
$ make
$ make check
$ # Make sure that `make check` passes
$ [sudo] make install
$ # May need to update dynamic linker config via:
$ # [sudo] ldconfig

After installing protoc version >= 3.0.0, you can generate the protobuf generated modules via

$ make generate

Also be sure to have the latest version of the Python protobuf library:

$ [sudo] pip install "protobuf>=3.0.0a3"

About

Early Attempt at Supporting Google Cloud Bigtable (an extension to gcloud-python)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors