In this workshop, you will learn using Golang or Python how to build a gRPC server, a gRPC client and how to deploy a gRPC server using docker.
Based on the official gRPC workshop - https://codelabs.developers.google.com/codelabs/cloud-grpc/index.html - Where I extended to include deploying gRPC server using docker and learn to implement a gRPC client/gRPC server using Golang and Python.
$ mkdir -p $GOPATH/src/github.com/mresti && cd $_
$ git clone https://github.com/mresti/grpc-workshop.git
$ go get github.com/mresti/grpc-workshop
- gRPC version 1.16.0
- golang version 1.10.3 or above
- python version 3.6 or above
- Install text editors or IDE
- Install docker
- Install docker-compose
- Install Golang
- Install Protocol Buffers
- Install protoc plugin for golang:
$ go get -u google.golang.org/grpc
$ go get -u github.com/golang/protobuf/proto
$ go get -u github.com/golang/protobuf/protoc-gen-go
- Create a virtualenv:
$ pip install virtualenv
$ virtualenv venv
$ source venv/bin/activate
- Install protoc plugin for python:
(venv) $ pip install grpcio
(venv) $ pip install grpcio-tools
(venv) $ pip install googleapis-common-protos
(venv) $ pip install pyee
Or using requirements.txt
file:
(venv) $ pip install -r requirements.txt
What we covered with this workshop:
- The Protocol Buffer Language
- How to implement a gRPC server using Go or Python
- How to implement a gRPC client using Go or Python
- How to deploy on docker a gRPC server using Go or Python language
Slides that go along with the talk.
Also, see this video for general introduction to gRPC: Talk