All Projects → huawei-microservice-demo → mesher-example

huawei-microservice-demo / mesher-example

Licence: Apache-2.0 license
An example to illustrate the functionalities of Mesher

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to mesher-example

IsoMesh
IsoMesh is a group of related tools for Unity for converting meshes into signed distance field data, raymarching signed distance fields, and extracting signed distance field data back to meshes via surface nets or dual contouring.
Stars: ✭ 178 (+1012.5%)
Mutual labels:  meshes
unity-plumber
A component to procedurally generate pipe-like meshes in Unity
Stars: ✭ 55 (+243.75%)
Mutual labels:  meshes
sgcs
Hitchhiker's Guide to SGCS
Stars: ✭ 61 (+281.25%)
Mutual labels:  cse
BodyParts3D
Clone of the BodyParts3D/Anatomography 3D model files
Stars: ✭ 32 (+100%)
Mutual labels:  meshes
stripy
2D spherical and Cartesian triangulation toolkit using tripack, stripack, srfpack and ssrfpack
Stars: ✭ 33 (+106.25%)
Mutual labels:  meshes
bitpit
Open source library for scientific HPC
Stars: ✭ 80 (+400%)
Mutual labels:  meshes
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-Möller
Stars: ✭ 17 (+6.25%)
Mutual labels:  meshes
MeshViz.jl
Makie.jl recipes for visualization of Meshes.jl
Stars: ✭ 51 (+218.75%)
Mutual labels:  meshes
roadifier
Open Source road mesh generator script for Unity
Stars: ✭ 30 (+87.5%)
Mutual labels:  meshes
bd-stock-exchange-update-php
A PHP library to fetch updates from Bangladesh share market, including Dhaka and Chittagong Stock Exchange (DSE & CSE).
Stars: ✭ 20 (+25%)
Mutual labels:  cse
CGoGN 2
n-dimensional Meshes with Combinatorial Maps
Stars: ✭ 19 (+18.75%)
Mutual labels:  meshes
ameshref
Efficient Matlab Implementation of Adaptive Mesh Refinement in 2D
Stars: ✭ 28 (+75%)
Mutual labels:  meshes
MeshCore.jl
Curation and manipulation of general unstructured meshes for the Finite Element Methods (FEM).
Stars: ✭ 14 (-12.5%)
Mutual labels:  meshes
PolyDraw
✳️ PTSource PolyDraw is a free 3D polygonal modeller for Windows x86 and x64, for creating or modifying 3D objects using a mesh of 3D points and parametric NURBS Curves .Exports and imports to over 40 formats including WebVR and 3D Printing.
Stars: ✭ 17 (+6.25%)
Mutual labels:  meshes
skeletor
3D skeleton extraction from meshes.
Stars: ✭ 115 (+618.75%)
Mutual labels:  meshes
navis
Python 3 library for analysis of neuroanatomical data
Stars: ✭ 68 (+325%)
Mutual labels:  meshes
vtkbool
A new boolean operations filter for VTK
Stars: ✭ 77 (+381.25%)
Mutual labels:  meshes
ParallelQSlim
Shape Aware Parallel Mesh Simplification Algorithm
Stars: ✭ 84 (+425%)
Mutual labels:  meshes
flowers
Program to generate 3D models of abstract flowers.
Stars: ✭ 16 (+0%)
Mutual labels:  meshes
Cgal
The public CGAL repository, see the README below
Stars: ✭ 2,825 (+17556.25%)
Mutual labels:  meshes

Mesher Example

Making your service resilient using Mesher

This example shows you how to make your service as a Micro-Service using Mesher. In this example we have two simple services called client and server. We make this service use Mesher to do the communication between them and helps you to make your service robust and resilient.
You can watch a short demonstration of this example in this video and full tutorial of running this example with CSE Governance Console here.

Running Service in Cloud Service Engine(CSE) or with open source solution

You can run these services in Huawei Public Cloud or in your local Machine and register these micro-services in CSE. And make use of CSE Governance Console to mange and monitor the services.

Or you can connect to Service center without CSE, but you will lose monitoring, Hot-reconfigurarion and Governance web console features

Get Started

Run with Docker-Compose

One of the great options to run this example is to use docker-compose, you can follow this guideline to run this example.

Run locally

You can follow the below steps to run the services in your local VM's and use the CSE Service-Center to register the micro-service, you can also use the Config-Center of CSE to manage your configurations. CSE also provider monitoring sever which can help you to monitor your service statistics.

Notice: you should prepare 2 VM to run this demo

Step 1: Clone the code in VM1

export GOPATH=$PWD
go get github.com/huawei-microservice-demo/mesher-example/client

Clone in VM2

export GOPATH=$PWD
go get github.com/huawei-microservice-demo/mesher-example/server

Step 2: Start the server in VM2

cd bin
./server

this will start the Server exposing the below API's on 3000 port

    {Name: "latency", Method: rata.GET, Path: "/latency"}, 
    {Name: "error", Method: rata.GET, Path: "/errors"},
    {Name: "latency2", Method: rata.POST, Path: "/latency/:duration"},
    {Name: "error2", Method: rata.POST, Path: "/errors/:status"},

Step 3: Download and start the Mesher in both VM You can download the Mesher release from here and choose one of the below options for running the Mesher.

Running Mesher with Open Source Service-Center

One way for bringing up the Mesher easily is to download the open-source service-center and follow the guide to bring up the service-center locally. Once the Service-Center is running then you can follow the below steps to run Mesher in VM2.

1.Export the following variables in VM2

export CSE_REGISTRY_ADDR=http://127.0.0.1:30100
#tell mesher where is your service listen at
export SPECIFIC_ADDR=127.0.0.1:3000

2.edit conf/chassis.yaml change advertiseAddress and listenAddress to external IP Example:

  protocols:
    http:
      listenAddress: 192.168.1.1:30101

3.edit conf/microservice.yaml change name to demoServer

4.Run mesher

./mesher

this will make the Mesher Provider run at 30101 port

Running Mesher with CSE

Another way to bring up the Mesher is to use the CSE Service-Center and Governance Console. For registering your microservice to CSE service-center you will need the AK/SK of your project which can be found by following the steps here.
Once you got the AK/SK then you need to configure the AK/SK in mesher conf/auth.yaml by following the steps here

1.Export the following variables in VM2

#tell mesher where is your service listen at
export SPECIFIC_ADDR=127.0.0.1:3000 

2.edit conf/chassis.yaml change advertiseAddress and listenAddress to external IP Example:

  protocols:
    http:
      listenAddress: 192.168.1.1:30101

3.edit conf/microservice.yaml change name to demoServer

4.Run mesher

./mesher

this will make the Mesher Provider run at 30101 port

Step 4: Start the Mesher in VM1 Based on your selection of Service-Center in Step 3 you can configure the Mesher in VM1

Running Mesher with Open Source Service-Center

Export the following variables

#Based on where your opensource service-center is running you can configure the below IP
export CSE_REGISTRY_ADDR=http://127.0.0.1:30100

Run mesher

./mesher

This will bring up the Mesher in 30101 port

Running Mesher with CSE

You need to configure AK/SK as per steps given in Step3 and then follow the below commands.

1.edit conf/microservice.yaml change name to demoClient Run mesher

./mesher

This will bring up the Mesher in 30101 port

Step 5: Start the Client in VM1

cd src/github.com/huawei-microservice-demo/mesher-example/client
vi conf/app.conf

## Edit the below addr
PROVIDER_ADDR=http://demoServer

## Save the file and come out

### Export the http_proxy so that all calls going from Client is proxied through MesherConsumer

export http_proxy=127.0.0.1:30101

./client

This will bring up Client on 3000 port exposing the below Api's

    {Name: "latency", Method: rata.GET, Path: "/TestLatency"},
    {Name: "error", Method: rata.GET, Path: "/TestErrors"},

Congratulations, Now all your applications are running with Mesher

now you can call the Client Api's

root@mesher-01-eip:~# curl -v 117.78.44.191:3000/TestLatency
*   Trying 117.78.44.191...
* Connected to 117.78.44.191 (117.78.44.191) port 3000 (#0)
> GET /TestLatency HTTP/1.1
> Host: 117.78.44.191:3000
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Fri, 17 Nov 2017 11:33:21 GMT
< Content-Length: 110
< Content-Type: text/plain; charset=utf-8
< 
The Latency for this request is : 100ms
* Connection #0 to host 117.78.44.191 left intact
The host serving this request is mesher-02 and the IP is 192.168.1.155
root@mesher-01-eip:~# curl -v 117.78.44.191:3000/TestErrors
*   Trying 117.78.44.191...
* Connected to 117.78.44.191 (117.78.44.191) port 3000 (#0)
> GET /TestErrors HTTP/1.1
> Host: 117.78.44.191:3000
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 500 Internal Server Error
< Date: Fri, 17 Nov 2017 11:34:02 GMT
< Content-Length: 208
< Content-Type: text/plain; charset=utf-8
< 
* Connection #0 to host 117.78.44.191 left intact

You can manage your Micro-Service in Governance Console in CSE.

Please follow the steps here to Configure your application to monitor metrics in Grafana.

mesher-examples

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].