Giter Site home page Giter Site logo

yuan6785 / simple_calculate_service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harvardfly/simple_calculate_service

0.0 1.0 0.0 16 KB

基于python和grpc的简单计算服务,Docker化部署,使用ZooKeeper作为服务协调,nginx反向代理

Dockerfile 4.67% Python 95.33%

simple_calculate_service's Introduction

基于python3和grpc的简单计算服务

应用grpc的四种接口类型

Unary RPC (一元RPC):计算服务(加减乘除)
Server Streaming RPC ( 服务器流式RPC):通过学科获取对应的题型
Client Streaming RPC ( 客户端流式RPC):累加服务
Bidirectional Streaming RPC (双向流式RPC):竞猜服务

各组件及其版本

Protocol Buffers:proto3
zookeeper:3.4.13
grpcio-tools:1.18.0
kazoo:2.6.0
反向代理:nginx
部署:Docker

操作步骤

编译生成代码

$ cd protos
$ python3 -m grpc_tools.protoc -I. --python_out=.. --grpc_python_out=.. simple_calculate.proto

配置settings_local

$ cd simple_calculate_service
$ cp settings_local.py.example settings_local.py

server image

$ cd simple_calculate_service
$ sudo docker build -t simple_calculate -f Dockerfile .

nginx image

$ cd simple_calculate_service
$ sudo docker build -t simple_calculate_nginx -f common/nginx/Dockerfile .

部署

$ cp docker-compose.yml.example docker-compose.yml

$ sudo docker-compose up -d

simple_calculate_service's People

Contributors

harvardfly avatar

Watchers

James Cloos 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.