GithubHelp home page GithubHelp logo

rajendrakumaryadav / grpcserver Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 29 KB

This is simple GRPC implementation. It will be handle grpcserver and keep the information.

Dockerfile 6.03% Shell 0.61% Python 93.35%

grpcserver's Introduction

To run this application you need two repo

| This is simple Demo Application as Microservices between 2 server.

  1. webServer: which is running Flask-Server and also sending some traces to the grpcServer
  2. grpcServer: It is accepting data like
Message Received: page_name: "http://127.0.0.1:5000/"      
client_address: "127.0.0.1:5000"                           
request_body: "{}"                                         
, content: <grpc._server._Context object at 0x7f9beb477290>

Now, Let's discuss how we can start it.

  1. clone the repos
  2. build docker with following command
$ docker build -t flaskserver:latest .
$ docker build -it grpcserver:latest .
  1. before running the docker image, create a network
$ docker network create idocnet
  1. now, run the images in the network
$ docker run --rm -it --network idocnet --name flaskserver -p 5000:5000 flaskserver
$ docker run --rm -it --network idocnet --name grpcserer grpcserer

Now, we can set environment to the container while firing it up either using method mentioned in step 4 or through kubernetes. Default port is 50051 for GRPC. we can customize it during runtime.

$ docker run --rm -it --network idocnet -e HOST='50051' --name grpcserer grpcserer
  1. now, inspect the network and take a look if all services are attached to network or not.
$  docker network inspect idocnet
[                                                                                
    {                                                                            
        "Name": "idocnet",                                                       
        "Id": "fff1e17551e5c315e1772141dba01e7e979714356e871bd43233af96f90d3256",
        "Created": "2023-09-28T17:42:02.731392123Z",                             
        "Scope": "local",                                                        
        "Driver": "bridge",                                                      
        "EnableIPv6": false,                                                     
        "IPAM": {                                                                
            "Driver": "default",                                                 
            "Options": {},                                                       
            "Config": [                                                          
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "14079458ae315679da810aed7332e9918e9d52470b46b1be24d020755d5ba54d": {
                "Name": "grpcserver",
                "EndpointID": "23e69e42f8a1195df1a129c4f1eff2bc1da11643e0bd4a9fc08c0ba73d1eaf52",
                "MacAddress": "02:42:ac:12:00:03",
                "IPv4Address": "172.18.0.3/16",
                "IPv6Address": ""
            },
            "b80ad8039194321acafb089ee7a74e78ea86455df7271bf021ea6f0656b578be": {
                "Name": "flaskserver",
                "EndpointID": "f97f33183a5191d07165e3f060f33b00cbd9fbcc360b64d770163e6b152a21e6",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

grpcserver's People

Contributors

rajendrakumaryadav avatar

Watchers

 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.