Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
tianxiaoliang committed Sep 7, 2018
1 parent 4757edb commit 4a8e83b
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 9,621 deletions.
4 changes: 2 additions & 2 deletions README.md
@@ -1,6 +1,6 @@
# Mesher

[![Build Status](https://travis-ci.org/go-chassis/mesher.svg?branch=master)](https://travis-ci.org/go-chassis/mesher) [![Coverage Status](https://coveralls.io/repos/github/go-chassis/mesher/badge.svg?branch=master)](https://coveralls.io/github/go-chassis/mesher?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/go-chassis/mesher)](https://goreportcard.com/report/github.com/go-chassis/mesher) [![GoDoc](https://godoc.org/github.com/go-chassis/mesher?status.svg)](https://godoc.org/github.com/go-chassis/mesher) [![HitCount](http://hits.dwyl.io/go-chassis/mesher.svg)](http://hits.dwyl.io/go-chassis/mesher) [![Join Slack](https://img.shields.io/badge/Join-Slack-orange.svg)](https://join.slack.com/t/go-chassis/shared_invite/enQtMzk0MzAyMjEzNzEyLTRjOWE3NzNmN2IzOGZhMzZkZDFjODM1MDc5ZWI0YjcxYjM1ODNkY2RkNmIxZDdlOWI3NmQ0MTg3NzBkNGExZGU)
[![Build Status](https://travis-ci.org/go-mesh/mesher.svg?branch=master)](https://travis-ci.org/go-mesh/mesher) [![Coverage Status](https://coveralls.io/repos/github/go-mesh/mesher/badge.svg?branch=master)](https://coveralls.io/github/go-mesh/mesher?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/go-mesh/mesher)](https://goreportcard.com/report/github.com/go-mesh/mesher) [![GoDoc](https://godoc.org/github.com/go-mesh/mesher?status.svg)](https://godoc.org/github.com/go-mesh/mesher) [![HitCount](http://hits.dwyl.io/go-mesh/mesher.svg)](http://hits.dwyl.io/go-mesh/mesher) [![Join Slack](https://img.shields.io/badge/Join-Slack-orange.svg)](https://join.slack.com/t/go-chassis/shared_invite/enQtMzk0MzAyMjEzNzEyLTRjOWE3NzNmN2IzOGZhMzZkZDFjODM1MDc5ZWI0YjcxYjM1ODNkY2RkNmIxZDdlOWI3NmQ0MTg3NzBkNGExZGU)

A service mesh implementation based on [go chassis](https://github.com/go-chassis/go-chassis).

Expand All @@ -20,7 +20,7 @@ a go micro service framework


# Get started
Refer to [mesher-examples](https://github.com/go-chassis/mesher-examples)
Refer to [mesher-examples](https://github.com/go-mesh/mesher-examples)

### How to build and run

Expand Down
2 changes: 1 addition & 1 deletion docs/getstarted/install.md
Expand Up @@ -40,7 +40,7 @@ just same service center default listen address.
### Run on different infrastructure

Mesher does not bind to any platform or infrastructures, plz refer to
https://github.com/go-chassis/mesher-examples/tree/master/Infrastructure
https://github.com/go-mesh/mesher-examples/tree/master/Infrastructure
to know how to run mesher on different infra

### Sidecar injector
Expand Down
4 changes: 4 additions & 0 deletions docs/protocols/grpc.md
Expand Up @@ -29,3 +29,7 @@ after modify
return net.DialTimeout("tcp", "127.0.0.1:40101", time)
}))
```


## example
A gRPC example is [here](https://github.com/go-mesh/mesher-examples/tree/master/protocol/grpc-go)
14 changes: 12 additions & 2 deletions go.mod
@@ -1,9 +1,19 @@
module github.com/go-chassis/mesher
module github.com/go-mesh/mesher

replace (
golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac => github.com/golang/crypto v0.0.0-20180820150726-614d502a4dac
golang.org/x/net v0.0.0-20180824152047-4bcd98cce591 => github.com/golang/net v0.0.0-20180824152047-4bcd98cce591
golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87 => github.com/golang/sys v0.0.0-20180824143301-4910a1d54f87
golang.org/x/text v0.3.0 => github.com/golang/text v0.3.0
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 => github.com/golang/time v0.0.0-20180412165947-fbb02b2291d2
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 => github.com/google/go-genproto v0.0.0-20180817151627-c66870c02cf8
google.golang.org/grpc v1.14.0 => github.com/grpc/grpc-go v1.14.0
)

require (
github.com/emicklei/go-restful-swagger12 v0.0.0-20170926063155-7524189396c6 // indirect
github.com/go-chassis/go-cc-client v0.0.0-20180831085349-c2bb6cef1640
github.com/go-chassis/go-chassis v0.8.2-0.20180831125844-6a2f0ab47244
github.com/go-chassis/go-chassis v0.8.3-0.20180904011159-fcc43e7cb6ea
github.com/go-chassis/gohessian v0.0.0-20180702061429-e5130c25af55
github.com/gogo/protobuf v1.1.1
github.com/patrickmn/go-cache v2.1.0+incompatible
Expand Down
20 changes: 11 additions & 9 deletions scripts/build/build.sh
Expand Up @@ -3,13 +3,20 @@ set -e
set -x
export PATH=$PATH:/usr/local/go/bin
export GOPATH=/var/lib/jenkins/workspace/Mesher
rm -rf /var/lib/jenkins/workspace/Mesher
rm -rf /var/lib/jenkins/workspace/Mesher/src
export BUILD_DIR=/var/lib/jenkins/workspace/Mesher
export PROJECT_DIR=$(dirname $BUILD_DIR)

mkdir -p /var/lib/jenkins/workspace/Mesher/src/github.com/go-chassis/mesher
mkdir -p /var/lib/jenkins/workspace/Mesher/src/github.com/go-mesh/mesher

cp -r /var/lib/jenkins/workspace/mesher/* /var/lib/jenkins/workspace/Mesher/src/github.com/go-chassis/mesher/
#To checkout to particular commit or tag
if [ $CHECKOUT_VERSION == "latest" ]; then
echo "using latest code"
else
git checkout $CHECKOUT_VERSION
fi

cp -r /var/lib/jenkins/workspace/mesher/* /var/lib/jenkins/workspace/Mesher/src/github.com/go-mesh/mesher/

release_dir=$PROJECT_DIR/release
repo="github.com"
Expand All @@ -21,12 +28,7 @@ fi
mkdir -p $release_dir

cd $BUILD_DIR/src/$repo/$project/mesher
#To checkout to particular commit or tag
if [ $CHECKOUT_VERSION == "latest" ]; then
echo "using latest code"
else
git checkout $CHECKOUT_VERSION
fi

GO111MODULE=on go mod download
GO111MODULE=on go mod vendor
go build -o mesher -a
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/build_image.sh
Expand Up @@ -2,7 +2,7 @@
set -e
set -x

cd /var/lib/jenkins/workspace/Mesher/src/github.com/go-chassis/mesher/
cd /var/lib/jenkins/workspace/Mesher/src/github.com/go-mesh/mesher/

repo="github.com"
project="go-chassis"
Expand Down
2 changes: 1 addition & 1 deletion scripts/travis/unit_test.sh
Expand Up @@ -9,7 +9,7 @@ for d in $(go list ./... | grep -v vendor); do
if [ $(ls | grep _test.go | wc -l) -gt 0 ]; then
go test -cover -covermode atomic -coverprofile coverage.out
if [ -f coverage.out ]; then
sed '1d;$d' coverage.out >> $GOPATH/src/github.com/go-chassis/mesher/coverage.txt
sed '1d;$d' coverage.out >> $GOPATH/src/github.com/go-mesh/mesher/coverage.txt
fi
fi
done
21 changes: 21 additions & 0 deletions start.sh
Expand Up @@ -101,6 +101,27 @@ service_description:
EOF
fi

#add instance_properties if any provided
if [ ! -z "$MD" ]; then
echo " instance_properties:" >> $MESHER_CONF_DIR/$MICROSERVICE_YAML
while :
do
KeyArray=$(echo $MD | cut -d '|' -f1)
RestArray=$(echo $MD | cut -d '|' -f2-)
Writer="-"
Key=$(echo $KeyArray | cut -d '=' -f1)
Value=$(echo $KeyArray | cut -d '=' -f2-)
Writer=" $Writer$Key"
Writer="$Writer: $Value"
echo $Writer| sed 's/-/ /'
echo $Writer | sed 's/-/ /'>> $MESHER_CONF_DIR/$MICROSERVICE_YAML
if [ "$KeyArray" = "$RestArray" ]; then
break
fi
MD=$RestArray
done
fi

# ENABLE_PROXY_TLS decide whether mesher is https proxy or http proxy
if [[ $TLS_ENABLE && $TLS_ENABLE == true ]]; then
sed -i '/ssl:/a \ \ mesher.Provider.cipherPlugin: default \n \ mesher.Provider.verifyPeer: false \n \ mesher.Provider.cipherSuits: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 \n \ mesher.Provider.protocol: TLSv1.2 \n \ mesher.Provider.caFile: \n \ mesher.Provider.certFile: /etc/ssl/meshercert/kubecfg.crt \n \ mesher.Provider.keyFile: /etc/ssl/meshercert/kubecfg.key \n \ mesher.Provider.certPwdFile: \n' $MESHER_CONF_DIR/$TLS_YAML
Expand Down
7 changes: 0 additions & 7 deletions test/conf/auth.yaml

This file was deleted.

114 changes: 0 additions & 114 deletions test/conf/chassis.yaml

This file was deleted.

51 changes: 0 additions & 51 deletions test/conf/fault.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions test/conf/lager.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions test/conf/mesher.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions test/conf/microservice.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions test/conf/router.yaml

This file was deleted.

0 comments on commit 4a8e83b

Please sign in to comment.