grpc-cloud-run-example's People
Forkers
murgatroid99 alejagapatrick tonyespley-pa jamesward osplaza32 psisoyev-ltq psisoyev tomyjwu bootstrapsp gsandoval tylerwilliams bblay chidakiyo marccardinal joserfjuniorllms farafonoff bozzlab gitexec bozz-srinikorn vlolla brotherlogic bettdouglas isabella232 metfit nicolasassi ptone bhavychawda moneybounce sreeshnap camilosoler pattypeii pinkdiamond1 zembunia shobhitjava jimyan ishaan2611 imitsuogrpc-cloud-run-example's Issues
Comparable Golang sample
Summarized here:
https://pretired.dazwilkin.com/posts/200320/
Does Cloud Run support grpc-web client requests?
Hey all, I figure this may be a decent spot to ask this question, but feel free to redirect it if necessary!
Does Cloud Run support grpc-web clients? I'm not sure about the status of the grpc-web project in general, but I would love to see or contribute an example in this repo if the support is there or is planned to be there.
Thanks!
Suggestion, feel free to close.
I'm extremely new to Golang, I don't know if this has room for these notes. Feel free to close the issue if it's not appropriate.
When containerizing the example code and you are using a private repository.
Since I'm not an expert in Golang I had a hard time understanding why running on host was trying to pull the code from bitbucket.
In order to fix that, I cloned the repo inside $GOPATH/src/[bitbucket.org|github.com|gitlab.com] like https://golang.org/doc/gopath_code.html
If you are using a private repo to test out this code, you will need to do a couple of changes.
Set the env for GOPRIVATE
ENV GOPRIVATE="domain.tld/your-name/your-project-name"
When adding the files inside the container, place them inside /go/src/ following the same path you used because the go.mod in this repo is pointing to a public repo, but you are using a private repo so you will try to fetch from the repo instead of pulling from the fs
I've also submitted a PR for a minor warning that popups when compiling the proto following this guide, that is #28
I'm using go 1.14 and this is my go env
{
"AR": "ar",
"CC": "gcc",
"CGO_CFLAGS": "-g -O2",
"CGO_CPPFLAGS": "",
"CGO_CXXFLAGS": "-g -O2",
"CGO_ENABLED": "1",
"CGO_FFLAGS": "-g -O2",
"CGO_LDFLAGS": "-g -O2",
"CXX": "g++",
"GCCGO": "gccgo",
"GO111MODULE": "on",
"GOARCH": "amd64",
"GOBIN": "",
"GOCACHE": "/home/jvazquez/.cache/go-build",
"GOENV": "/home/jvazquez/.config/go/env",
"GOEXE": "",
"GOFLAGS": "",
"GOGCCFLAGS": "-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build154605772=/tmp/go-build -gno-record-gcc-switches",
"GOHOSTARCH": "amd64",
"GOHOSTOS": "linux",
"GOINSECURE": "",
"GOMOD": "/home/jvazquez/go/src/bitbucket.org/jvazquezAR85/gcr-grpc/go.mod",
"GONOPROXY": "bitbucket.org/jvazquezAR85/gcr-grpc,github.com/jvazquez/*",
"GONOSUMDB": "bitbucket.org/jvazquezAR85/gcr-grpc,github.com/jvazquez/*",
"GOOS": "linux",
"GOPATH": "/home/jvazquez/go",
"GOPRIVATE": "bitbucket.org/jvazquezAR85/gcr-grpc,github.com/jvazquez/*",
"GOPROXY": "https://proxy.golang.org,direct",
"GOROOT": "/usr/lib/go-1.14",
"GOSUMDB": "sum.golang.org",
"GOTMPDIR": "",
"GOTOOLDIR": "/usr/lib/go-1.14/pkg/tool/linux_amd64",
"PKG_CONFIG": "pkg-config"
}
Node example works locally but not when deployed to Cloud Run
Hi, and thanks for the multiple, concise examples!
As the title says, using the Node example locally works fine. However, I am having issues using grpcurl
towards the Cloud Run URL. When doing so I get the error:
Failed to process proto source files.: could not parse given files: %!v(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)
I'm not unused to Docker but am not an expert either. Totally new to gRPC. My highly naive suspicions relate to:
a) Do proto files exist on the image? (Which I absolutely believe they do, since the local one works)
b) Some kind of error in the proto files? Do they need to be (re)built?
Thanks for any assistance.
grpc + Cloud Run + API Gateway + Firebase Authentication
I tried all possible ways.
why this did not work?
the calls still not falling unauthenticated
even the docs explain to uses this way
Authenticating users
type: google.api.Service
config_version: 3
name: "*.apigateway.PROJECT_ID.cloud.goog"
title: User Service API
apis:
- name: app.GC_PROJECT_ID.User
authentication:
providers:
- id: firebase
jwks_uri: https://www.googleapis.com/service_accounts/v1/metadata/x509/[email protected]
issuer: https://securetoken.google.com/FIREBASE_PROJECT_ID
audiences: FIREBASE_PROJECT_ID
rules:
- selector: "*"
requirements:
- provider_id: firebase
usage:
rules:
- selector: app.PROJECT_ID.User.CreateUser
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.LinkUser
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.AddProvider
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.RemoveProvider
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.GetUser
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.UpdateDisplayName
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.UpdateUsername
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.UpdatePhotoUrl
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.UpdateEmail
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.AddFriend
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.RemoveFriend
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.BlockFriend
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.GetFriends
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.DeleteUser
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.GetEmailByUsername
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.SearchUser
allow_unregistered_calls: false
- selector: app.PROJECT_ID.User.CheckUsernameExist
allow_unregistered_calls: false
backend:
rules:
- selector: "*"
jwt_audience: FIREBASE_PROJECT_ID
address: grpcs://user-service-HASH-uc.a.run.app
the gcloud commands
python3 -m grpc_tools.protoc --include_imports --include_source_info --proto_path=../proto --descriptor_set_out=../proto/api_descriptor.pb --python_out=../generated_pb2 --grpc_python_out=../generated_pb2 user.proto
gcloud api-gateway gateways delete grpc-user --location=us-central1
gcloud api-gateway api-configs delete grpc-user-config --api=grpc-user
gcloud api-gateway api-configs create grpc-user-config --api=grpc-user --project=PROJECT_ID --grpc-files=../proto/api_descriptor.pb,../api_config/user_api_config.yaml
gcloud api-gateway gateways create grpc-user --api=grpc-user --api-config=grpc-user-config --location=us-central1 --project=PROJECT_ID
running example on Mac OS X Catalina
had to change my grpcurl request paramter order to this to make it work:
grpcurl \
-d '{"first_operand": 2.0, "second_operand": 3.0, "operation": "ADD"}' \
-proto calculator.proto \
--plaintext \
localhost:50051 \
Calculator.Calculate
otherwise I get
Too many arguments.
Try 'grpcurl -help' for more details.
Golang example client code uses SystemCertPool which doesn't work on Windows
Dependent ticket: golang/go#16736
ccccccicvjuirrfhnidutjgjjjhnrbkkjdijfnlkkken
grpc cloud run example in java missing
Java example is highly desired
Comparable Rust sample
I've added a Rust sample to my fork.
I'm a Rust noob so there's likely plenty of feedback but:
- It works
- It's straightforward
- Google should show more Rust <3 :-)
I'm always confused by GitHub when PR'ing from different branches because, even though I started each sample from its own branch, the PRs show all my commits :-(
Is it possible to add gRPC sample for Dart?
I want to run the gRPC application that I will develop with Dart on Cloud Run. Is it possible to make an example for this?
Dart officially announced its support for gRPC. Moreover, I think it will be very useful to use it together for a language developed by Google and Cloud Run.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.