CLI tool for uploading RouteViews files to Google.
Project description
RouteViews Google Cloud Storage Client
This project provides a (Python) client that takes a file and sends it to the Google Cloud Storage solution for the Google+RouteViews project.
Install
This solution is deployed to PyPI, so you can install it simply using the command pip install routeviews-google-upload
.
pip install routeviews-google-upload
Examples
Below are a couple of examples showing how to use this tool.
Run the tool with the
--help
argument to see all the expected and available arguments.
Example: gRPC Served via a Cloud Run Instance, with Authentication
This example works with our current production environment.
This example covers the case when the targeted gRPC server is backed by a Google Cloud Run instance, and requires authentication.
For this workflow, we've added the --key-file
argument.
This argument requires a Google Service Account Key file (tested with a JSON key).
routeviews-google-upload --dest grpc.routeviews.org --key-file <your-key.json> --file routeviews.sfmix/bgpdata/2021.03/UPDATES/update.20210331.2345.bz2
Example: Local "Debug::Echo" test server
If you are interested in running the solution end-to-end but don't have a gRPC target server in-mind, then you might
be interested in running a local "debug echo gRPC server".
Fortunately, we have baked a simple gRPC server into this package for testing!
To use this debug server, you'll need two terminals open -- one for the server
and one for the client
.
First, in the 'server terminal' window, run the routeviews-google-upload-test-server
CLI tool:
routeviews-google-upload-test-server
RouteViews gRPC debug server is running...
Then, in the 'client terminal' window, you can run the upload tool with --dest localhost:50051
.
Expect the server to respond with a failure status (2) and an 'Error Message' that contains the entire request (including the file contents).
routeviews-google-upload --dest localhost:50051 --file requirements.txt
Status: 2
Error Message: DEBUG::ECHO::
filename: "requirements.txt"
md5: "1af62f45fdf90b6a1addfb2b86043acb"
content: "grpcio==1.37.0\ngrpcio-tools==1.37.0\nprotobuf==3.15.8\nsix==1.15.0\n"
project: ROUTEVIEWS
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file routeviews-google-upload-0.2.0.tar.gz
.
File metadata
- Download URL: routeviews-google-upload-0.2.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4db01e05544f8db1b710bbd700cbadc055698b0b096bc098add5bbcf1ddcadb8 |
|
MD5 | c31041e51d2aa48ee2a2f1d961ae9253 |
|
BLAKE2b-256 | b1c5aa6a53090df17d98829f6fb72ba44b3a19a067c89d21dc8c0f2d63dbf3f6 |