Skip to content

Commit 968be52

Browse files
committed
init commit
Signed-off-by: kumarabd <[email protected]>
1 parent 79c6fa2 commit 968be52

38 files changed

+3806
-122
lines changed

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@kumarabd
2+
@leecalcote

CONTRIBUTING.md

Lines changed: 2 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,4 @@
1-
# <a name="contributing">Contributing Overview</a>
2-
Please do! Thanks for your help improving the project! :balloon:
1+
# Contributing
32

4-
All contributors are welcome. Please see the [newcomers welcome guide](https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit) for how, where and why to contribute. This project is community-built and welcomes collaboration. Contributors are expected to adhere to our [Code of Conduct](.CODE_OF_CONDUCT.md).
3+
You want to contribute to the project? Yay! We want you to! Visit our centralized instructions for [contributing](https://github.com/layer5io/meshery/blob/master/CONTRIBUTING.md#contributing).
54

6-
Not sure where to start? First, see the [newcomers welcome guide](https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit). Grab an open issue with the [help-wanted label](../../labels/help%20wanted) and jump in. Join the [Slack account](http://slack.layer5.io) and engage in conversation. Create a [new issue](/../../issues/new/choose) if needed. All [pull requests](/../../pulls) should reference an open [issue](/../../issues). Include keywords in your pull request descriptions, as well as commit messages, to [automatically close issues in GitHub](https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords).
7-
8-
**Sections**
9-
- <a name="contributing">General Contribution Flow</a>
10-
- <a href="#commit-signing">Developer Certificate of Origin</a>
11-
12-
Relevant coding style guidelines are the Go Code Review Comments and the Formatting and style section of Peter Bourgon's Go: Best Practices for Production Environments.
13-
14-
# <a name="contributing">General Contribution Flow</a>
15-
16-
In order to contribute to Meshery, please follow the fork-and-pull request workflow described [here](./CONTRIBUTING-gitflow.md).
17-
18-
## <a name="commit-signing">Signing-off on Commits (Developer Certificate of Origin)</a>
19-
20-
To contribute to this project, you must agree to the Developer Certificate of
21-
Origin (DCO) for each commit you make. The DCO is a simple statement that you,
22-
as a contributor, have the legal right to make the contribution.
23-
24-
See the [DCO](https://developercertificate.org) file for the full text of what you must agree to
25-
and how it works [here](https://github.com/probot/dco#how-it-works).
26-
To signify that you agree to the DCO for contributions, you simply add a line to each of your
27-
git commit messages:
28-
29-
```
30-
Signed-off-by: Jane Smith <[email protected]>
31-
```
32-
33-
In most cases, you can add this signoff to your commit automatically with the
34-
`-s` or `--signoff` flag to `git commit`. You must use your real name and a reachable email
35-
address (sorry, no pseudonyms or anonymous contributions). An example of signing off on a commit:
36-
```
37-
$ commit -s -m “my commit message w/signoff”
38-
```
39-
40-
To ensure all your commits are signed, you may choose to add this alias to your global ```.gitconfig```:
41-
42-
*~/.gitconfig*
43-
```
44-
[alias]
45-
amend = commit -s --amend
46-
cm = commit -s -m
47-
commit = commit -s
48-
```
49-
Or you may configure your IDE, for example, Visual Studio Code to automatically sign-off commits for you:
50-
51-
<a href="https://user-images.githubusercontent.com/7570704/64490167-98906400-d25a-11e9-8b8a-5f465b854d49.png" ><img src="https://user-images.githubusercontent.com/7570704/64490167-98906400-d25a-11e9-8b8a-5f465b854d49.png" width="50%"><a>
52-
53-
## <a name="contributing-docs">Documentation Contribution Flow</a>
54-
Please contribute! Layer5 documentation uses Jekyll and GitHub Pages to host docs sites. Learn more about [Layer5's documentation framework](https://docs.google.com/document/d/17guuaxb0xsfutBCzyj2CT6OZiFnMu9w4PzoILXhRXSo/edit?usp=sharing). The process of contributing follows this flow:
55-
56-
1. Create a fork, if you have not already, by following the steps described [here](./CONTRIBUTING-gitflow.md)
57-
1. In the local copy of your fork, navigate to the docs folder.
58-
`cd docs`
59-
1. Create and checkout a new branch to make changes within
60-
`git checkout -b <my-changes>`
61-
1. Edit/add documentation.
62-
`vi <specific page>.md`
63-
1. Run site locally to preview changes.
64-
`make site`
65-
1. Commit, [sign-off](#commit-signing), and push changes to your remote branch.
66-
`git push origin <my-changes>`
67-
1. Open a pull request (in your web browser) against the repo.
68-
69-
70-
#### Tests
71-
Users can now test their code on their local machine against the CI checks implemented using `make run-tests`.
72-
73-
To test code changes on your local machine, run the following command:
74-
```
75-
make run-tests
76-
```
77-
78-
#### Building Docker image
79-
To build a Docker image of the project, please ensure you have `Docker` installed to be able to build the image. Now, run the following command to build the Docker image:
80-
```sh
81-
make docker
82-
```
83-
84-
### UI Lint Rules
85-
86-
Layer5 uses ES-Lint to maintain code quality & consistency in our UI Code.
87-
88-
# <a name="maintaining"> Reviews</a>
89-
All contributors are invited to review pull requests. See this short video on [how to review a pull request](https://www.youtube.com/watch?v=isLfo7jfE6g&feature=youtu.be).
90-
91-
# New to Git?
92-
Resources: https://lab.github.com and https://try.github.com/
93-
94-
### License
95-
96-
This repository and site are available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).
97-
98-
### About Layer5
99-
100-
**Community First**
101-
<p>The <a href="https://layer5.io">Layer5</a> community represents the largest collection of service mesh projects and their maintainers in the world.</p>
102-
103-
**Open Source First**
104-
<p>Our projects establish industry standards and enable service developers, owners, and operators with repeatable patterns and best practices for managing all aspects of distributed services. Our shared commitment to the open source spirit push the Layer5 community and its projects forward.</p>

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM golang:1.14-stretch as bd
2+
ARG CONFIG_PROVIDER="viper"
3+
RUN apt update && apt install git libc-dev gcc pkgconf -y
4+
COPY ${PWD} /go/src/github.com/layer5io/meshery-nginx/
5+
WORKDIR /go/src/github.com/layer5io/meshery-nginx/
6+
RUN go build -mod=vendor -ldflags="-w -s -X main.configProvider=$CONFIG_PROVIDER" -a -o meshery-nginx
7+
8+
FROM golang:1.14-stretch
9+
RUN apt update && apt install ca-certificates curl -y
10+
# Install kubectl
11+
RUN curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl" && \
12+
chmod +x ./kubectl && \
13+
mv ./kubectl /usr/local/bin/kubectl
14+
15+
RUN mkdir ${HOME}/.meshery/nginx/ && \
16+
mkdir /home/scripts/ && \
17+
mkdir -p ${HOME}/.kube/
18+
19+
COPY --from=bd /go/src/github.com/layer5io/meshery-nginx/meshery-nginx /home/
20+
COPY ${PWD}/scripts /home/scripts
21+
WORKDIR /home
22+
CMD ./meshery-nginx

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2020 Layer5, Inc.
189+
Copyright 2019, 2020 Layer5, Inc.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
protoc-setup:
2+
cd meshes
3+
wget https://raw.githubusercontent.com/layer5io/meshery/master/meshes/meshops.proto
4+
5+
proto:
6+
protoc -I meshes/ meshes/meshops.proto --go_out=plugins=grpc:./meshes/
7+
8+
docker:
9+
docker build -t layer5/meshery-nginx .
10+
11+
docker-run:
12+
(docker rm -f meshery-nginx) || true
13+
docker run --name meshery-nginx -d \
14+
-p 10007:10007 \
15+
-e DEBUG=true \
16+
layer5/meshery-nginx
17+
18+
run:
19+
DEBUG=true go run main.go

README.md

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,59 @@
1-
# Meshery Adapter for NGINX Service Mesh
1+
<p style="text-align:center;" align="center"><a href="https://layer5.io/meshery"><img align="center" style="margin-bottom:20px;" src="https://raw.githubusercontent.com/layer5io/layer5/master/assets/images/meshery/meshery-logo-tag-light-text-side.png" width="70%" /></a><br /><br /></p>
22

3+
# Meshery Adapter for Kuma
34

4-
<div>&nbsp;</div>
5+
[![Docker Pulls](https://img.shields.io/docker/pulls/layer5/meshery-kuma.svg)](https://hub.docker.com/r/layer5/meshery-kuma)
6+
[![Go Report Card](https://goreportcard.com/badge/github.com/layer5io/meshery-nginx)](https://goreportcard.com/report/github.com/layer5io/meshery-nginx)
7+
[![Build Status](https://github.com/layer5io/meshery-nginx/workflows/Meshery-Kuma/badge.svg)](https://github.com/layer5io/meshery-nginx/actions)
8+
[![GitHub](https://img.shields.io/github/license/layer5io/meshery-kuma.svg)](https://github.com/layer5io/meshery-nginx/blob/master/LICENSE)
9+
[![GitHub issues by-label](https://img.shields.io/github/issues/layer5io/meshery-kuma/help%20wanted.svg)](https://github.com/layer5io/meshery-nginx/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
10+
[![Website](https://img.shields.io/website/https/layer5.io/meshery.svg)](https://layer5.io/meshery)
11+
[![Twitter Follow](https://img.shields.io/twitter/follow/layer5.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=layer5)
12+
[![Slack](http://slack.layer5.io/badge.svg)](http://slack.layer5.io)
13+
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3564/badge)](https://bestpractices.coreinfrastructure.org/projects/3564)
514

6-
## Join the service mesh community!
7-
8-
<a name="contributing"></a><a name="community"></a>
9-
Our projects are community-built and welcome collaboration. 👍 Be sure to see the <a href="https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit">Layer5 Community Welcome Guide</a> for a tour of resources available to you and jump into our <a href="http://slack.layer5.io">Slack</a>!
15+
<br />
16+
<br />
1017

1118
<p style="clear:both;">
12-
<a href ="https://layer5.io/community/meshmates"><img alt="MeshMates" src=".github/readme/images/Layer5-MeshMentors.png" style="margin-right:10px; margin-bottom:7px;" width="28%" align="left" /></a>
13-
<h3>Find your MeshMate</h3>
14-
15-
<p>MeshMates are experienced Layer5 community members, who will help you learn your way around, discover live projects and expand your community network.
16-
Become a <b>Meshtee</b> today!</p>
17-
18-
Find out more on the <a href="https://layer5.io/community">Layer5 community</a>. <br />
19-
<br /><br /><br /><br />
19+
<h2><a href="https://layer5.io/meshery">Meshery</a></h2>
20+
<a href="https://meshery.io"><img src="img/readme/meshery-logo-light-text.svg"
21+
style="margin:10px;" width="125px"
22+
alt="Meshery - the Service Mesh Management Plane" align="left" /></a>
23+
<a href="https://meshery.io">Meshery</a> is the multi-service mesh management plane offering lifecycle management of more types of service meshes than any other tool available today. Meshery facilitates adopting, configuring, operating and managing performance of different service meshes and incorporates the collection and display of metrics from applications running on top of any service mesh.
24+
<br /><br /><p align="center"><i>If you’re using Meshery or if you like the project, please <a href="https://github.com/layer5io/meshery/stargazers">★</a> star this repository to show your support! 🤩</i></p>
2025
</p>
2126

22-
<div>&nbsp;</div>
27+
<br />
2328

24-
<a href="https://meshery.io/community"><img alt="Layer5 Service Mesh Community" src=".github/readme/images//slack-128.png" style="margin-left:10px;padding-top:5px;" width="110px" align="right" /></a>
29+
<p style="clear:both;">
30+
<h2><a name="contributing"></a><a name="community"></a> <a href="http://slack.layer5.io">Community</a> and <a href="https://github.com/layer5io/layer5/blob/master/CONTRIBUTING.md">Contributing</a></h2>
31+
Our projects are community-built and welcome collaboration. 👍 Be sure to see the <a href="https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit">Layer5 Community Welcome Guide</a> for a tour of resources available to you and jump into our <a href="http://slack.layer5.io">Slack</a>! Contributors are expected to adhere to the <a href="https://github.com/cncf/foundation/blob/master/code-of-conduct.md">CNCF Code of Conduct</a>.
32+
33+
<a href="https://meshery.io/community"><img alt="Layer5 Service Mesh Community" src="img/readme/slack-128.png" style="margin-left:10px;padding-top:5px;" width="110px" align="right" /></a>
2534

26-
<a href="http://slack.layer5.io"><img alt="Layer5 Service Mesh Community" src=".github/readme/images//community.svg" style="margin-right:8px;padding-top:5px;" width="140px" align="left" /></a>
35+
<a href="http://slack.layer5.io"><img alt="Layer5 Service Mesh Community" src="img/readme/community.svg" style="margin-right:8px;padding-top:5px;" width="140px" align="left" /></a>
2736

2837
<p>
29-
✔️ <em><strong>Join</strong></em> any or all of the weekly meetings on <a href="https://calendar.google.com/calendar/b/1?cid=bGF5ZXI1LmlvX2VoMmFhOWRwZjFnNDBlbHZvYzc2MmpucGhzQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20">community calendar</a>.<br />
30-
✔️ <em><strong>Watch</strong></em> community <a href="https://www.youtube.com/playlist?list=PL3A-A6hPO2IMPPqVjuzgqNU5xwnFFn3n0">meeting recordings</a>.<br />
38+
✔️ <em><strong>Join</strong></em> <a href="https://drive.google.com/open?id=1c07UO9dS7_tFD-ClCWHIrEzRnzUJoFQ10EzfJTpS7FY">weekly community meeting</a> on <a href="https://bit.ly/2SbrRhe">Fridays from 10am - 11am Central</a>.<br />
39+
✔️ <em><strong>Watch</strong></em> community <a href="https://www.youtube.com/channel/UCFL1af7_wdnhHXL1InzaMvA?sub_confirmation=1">meeting recordings</a>.<br />
3140
✔️ <em><strong>Access</strong></em> the <a href="https://drive.google.com/drive/u/4/folders/0ABH8aabN4WAKUk9PVA">community drive</a>.<br />
3241
</p>
3342
<p align="center">
3443
<i>Not sure where to start?</i> Grab an open issue with the <a href="https://github.com/issues?utf8=✓&q=is%3Aopen+is%3Aissue+archived%3Afalse+org%3Alayer5io+label%3A%22help+wanted%22+">help-wanted label</a>.
3544
</p>
45+
46+
<br />
47+
<br />
48+
49+
## About Layer5
50+
51+
**Community First**
52+
<p>The <a href="https://layer5.io">Layer5</a> community represents the largest collection of service mesh projects and their maintainers in the world.</p>
53+
54+
**Open Source First**
55+
<p>We build projects to provide learning environments, deployment and operational best practices, performance benchmarks, create documentation, share networking opportunities, and more. Our shared commitment to the open source spirit pushes Layer5 projects forward.</p>
56+
57+
**License**
58+
59+
This repository and site are available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).

api/grpc/error.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package grpc
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/layer5io/gokit/errors"
7+
)
8+
9+
var (
10+
ErrRequestInvalid = errors.New("603", "Apply Request invalid")
11+
)
12+
13+
// ErrPanic is the error object for panic errors
14+
func ErrPanic(r interface{}) error {
15+
return errors.New(errors.ErrPanic, fmt.Sprintf("%v", r))
16+
}
17+
18+
// ErrGrpcListener is the error object for grpc listener
19+
func ErrGrpcListener(err error) error {
20+
return errors.New(errors.ErrGrpcListener, fmt.Sprintf("Error during grpc listener initialization : %v", err))
21+
}
22+
23+
// ErrGrpcServer is the error object for grpc server
24+
func ErrGrpcServer(err error) error {
25+
return errors.New(errors.ErrGrpcServer, fmt.Sprintf("Error during grpc server initialization : %v", err))
26+
}

api/grpc/grpc.go

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package grpc
2+
3+
import (
4+
"fmt"
5+
"net"
6+
"time"
7+
8+
middleware "github.com/grpc-ecosystem/go-grpc-middleware"
9+
// grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
10+
11+
"google.golang.org/grpc"
12+
13+
"github.com/layer5io/meshery-nginx/meshes"
14+
"github.com/layer5io/meshery-nginx/nginx"
15+
)
16+
17+
// Service object holds all the information about the server parameters.
18+
type Service struct {
19+
Name string `json:"name"`
20+
Port string `json:"port"`
21+
Version string `json:"version"`
22+
StartedAt time.Time `json:"startedat,string"`
23+
TraceURL string `json:"traceurl"`
24+
Handler nginx.Handler
25+
Channel chan interface{}
26+
}
27+
28+
// Options holds the dependency optional objects for the server.
29+
type Options struct{}
30+
31+
// panicHandler is the handler function to handle panic errors
32+
func panicHandler(r interface{}) error {
33+
fmt.Println("600 Error")
34+
return ErrPanic(r)
35+
}
36+
37+
// Start starts grpc server
38+
func Start(s *Service, options ...Options) error {
39+
40+
address := fmt.Sprintf(":%s", s.Port)
41+
listener, err := net.Listen("tcp", address)
42+
if err != nil {
43+
return ErrGrpcListener(err)
44+
}
45+
46+
middlewares := middleware.ChainUnaryServer(
47+
// grpc_recovery.UnaryServerInterceptor(
48+
// grpc_recovery.WithRecoveryHandler(panicHandler),
49+
// ),
50+
)
51+
// if tr != nil {
52+
// middlewares = middleware.ChainUnaryServer(
53+
// grpctrace.UnaryServerInterceptor(tr.Tracer(s.Name).(apitrace.Tracer)),
54+
// )
55+
// }
56+
57+
server := grpc.NewServer(
58+
grpc.UnaryInterceptor(middlewares),
59+
)
60+
61+
//Register Proto
62+
meshes.RegisterMeshServiceServer(server, s)
63+
64+
// Start serving requests
65+
if err = server.Serve(listener); err != nil {
66+
return ErrGrpcServer(err)
67+
}
68+
return nil
69+
70+
}

0 commit comments

Comments
 (0)