Giter Club home page Giter Club logo

cdm-rpc's Introduction

CDM RPC

This is a project to explore the use of javascript and python to communicate with a new Remote Procedure Call (RPC) service, tentatively called gCDM. gCDM is based on the gRPC framework. The service and message structures are defined using Protocol Buffers, Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. Protocol Buffer message definition files (.proto files) can be compiled into source code for multiple languages using the protoc compiler. gRPC services defined using Protocol Buffer definitions can be compiled into client and server code using additional compiler plugins. This project uses the protobuf-gradle-plugin to manage the generation of javascript and python source code for both the messages and service associated with gCDM. Javascript gRPC code is generated using the grpc-web plugin, and python gRPC code is generated using the python gRPC plugin obtained from https://packages.grpc.io/.

Minimum Requirements

  • JDK 8 or later
  • docker and docker-compose

Source Code Generation

From the top level directory of this repository, simply run:

./gradlew clean build

and gradle will do the rest.

Generated javascript code will appear under grpc-web/src/main/js/, and generated python code will appear under grpc-python/src/main/python/. These generated files are removed when the clean task is called. Generated python files will end with _pb2.py or _pb2_grpc.py. Generated JavaScript files will end with _pb.js. Be sure that you do not name your development files in a way that uses those endings! git will ignore them by default, and they will be removed by the clean task (bad times).

Local servers for development

In order to develop code that speaks to a gCDM server, you will need to spin-up a local server for development. Please see gcdm-local/README.md for more information on how to use gradle and docker to manage this without (hopefully) much heartache.

TL;DR

If you just want to get up and running quickly, use

./gradlew :gcdm-local:composeUp

At this point, you should be ready to interact with the server using the code in either the grpc-python or grpc-web subprojects. When finished, be sure to run:

./gradlew :gcdm-local:composeDown

to tear down the local gCDM server.

cdm-rpc's People

Contributors

jtroberts avatar lesserwhirls avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

jtroberts

cdm-rpc's Issues

Spin-up a local cdmr server for use in development

Need to extend Gradle to start and stop a local cdmr server for developing/testing client code against.

It also looks like we will need a grpc-web proxy to translate the normal HTTP requests from the JavaScript client to the gRPC service and to respond with something the browser can understand:

https://grpc.io/blog/state-of-grpc-web/#the-tech

It looks like the Envoy proxy is the way to go, which can be run using Docker.

The easiest path might be to spin up a docker container with both cdmr and the Envoy proxy. Gradle can manage this as long as Docker is available. Again, probably the easiest, especially since we are just testing.

Thoughts @jtroberts?

Longer-term, there is a gRPC-web in-process proxy that can be added to a Java based gRPC service that would eliminate the need to run a separate proxy. For now, I think it's best to keep them separate

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.