Coder Social home page Coder Social logo

grpc's Introduction

说明

R grpc 依赖于 grpc core C-API,而这层的 api 是不稳定的,我 fork 的这个版本只针对于特定的环境解决特定的问题。

grpc

An R library for GRPC a high-performance, open-source universal RPC framework.

Installation - Debian

Pre-requisites

The following is copied from gRPC C++ - Building from source

sudo apt-get install build-essential autoconf libtool pkg-config
## If you plan to build from source and run tests, install the following as well:
sudo apt-get install libgflags-dev libgtest-dev
sudo apt-get install clang libc++-dev

Download and Install grpc

export GRPC_INSTALL_DIR=$HOME/.local
mkdir -p $GRPC_INSTALL_DIR
export PATH="$GRPC_INSTALL_DIR/bin:$PATH"

sudo apt install -y cmake

LATEST_VER=$(curl -L "https://api.github.com/repos/grpc/grpc/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
git clone --recurse-submodules -b $LATEST_VER https://github.com/grpc/grpc grpc_base

cd grpc_base
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON \
      -DgRPC_BUILD_TESTS=OFF \
      -DCMAKE_INSTALL_PREFIX=$GRPC_INSTALL_DIR \
      ../..
make -j4
sudo make install
popd

mkdir -p third_party/abseil-cpp/cmake/build
pushd third_party/abseil-cpp/cmake/build
cmake -DCMAKE_INSTALL_PREFIX=$GRPC_INSTALL_DIR \
      -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
      ../..
make -j4
sudo make install
popd

Original

Build Status

Easily create gRPC clients and servers from protobuf descriptions to build distributed services.

Copyright 2015 Google Inc, 2017 Neal Fultz

Dependencies

  • grpc
  • protobuf
  • RProtoBuf

See install for my installation notes...

Examples

There are runnable examples in the demo/ folder.

Hello, World!

To start a HelloWorld server:

R -e 'demo("helloserver", "grpc")'

Or with much more detailed logging:

R -e 'library(futile.logger); flog.threshold(TRACE); demo("helloserver", "grpc")'

To run a client against a running HelloWorld server:

R -e 'demo("helloclient", "grpc")'

Both are cross compatible with the Node, Python and C++ Greeter examples provided by the grpc library.

Health check

This server implements the above service along with the standard GRPC Health Checking Protocol:

R -e 'demo("health-check-server", "grpc")'

The client runs a health-check then calls the Hello, World! method once:

R -e 'demo("health-check-client", "grpc")'

Please check the sources of the server to see how to bundle services defined in multiple proto files.

Live scoring

There's a simple trained on the iris dataset and making that available for scoring via a gRPC service:

R -e 'demo("iris-server", "grpc")'

An example client to this service from R:

R -e 'demo("iris-client", "grpc")'

Todo

  • Streaming services
  • Authentication and Encryption
  • Error handling
  • Docs

Contributing

grpc's People

Contributors

daroczig avatar nfultz avatar hellojinjie avatar florianschwendinger avatar shehab7osny avatar sieverssj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.