Skip to content

Commit

Permalink
Merge branch 'master' into smi-conformace
Browse files Browse the repository at this point in the history
  • Loading branch information
leecalcote committed Jun 22, 2020
2 parents 76ab46e + c110733 commit 9e02a61
Show file tree
Hide file tree
Showing 8 changed files with 238 additions and 51 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Learn Layer5

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
docker:
name: Docker build and push
runs-on: ubuntu-latest
steps:
- name: Check out code
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Docker login
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker build & push
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
run: |
make build-img-service
make image-push
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
VER=$(shell git rev-parse --short HEAD)

build-service:
cd service && go build -a -o ./main .

run-service: build-service
run-service-a:
SERVICE_NAME="service-a" \
PORT=9091 \
./service/main

run-service-b:
SERVICE_NAME="service-b" \
PORT=9092 \
./service/main

build-img-service:
cd service && docker build -t layer5/sample-app-service:dev .
cd service && docker build -t layer5/learn-layer5:latest -t layer5/learn-layer5:$(VER) .

image-push:
docker push layer5/learn-layer5
70 changes: 58 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
# learn-layer5
<p style="text-align:center;" align="center">
<img align="center" src="https://raw.githubusercontent.com/layer5io/layer5/master/assets/images/layer5/layer5-tag-white-bg.png" width="45%" /></p>

# To check for smi conformance of a deployed service mesh
We use kuttl to check for SMI conformance. All the tests are writtten in smi-test directory of this repository.
Execute the following command to run the smi-conformace tests:-
![GitHub contributors](https://img.shields.io/github/contributors/layer5io/layer5.svg)
![GitHub](https://img.shields.io/github/license/layer5io/layer5.svg)
[![Docker Pulls](https://img.shields.io/docker/pulls/layer5/learn-layer5.svg)](https://hub.docker.com/r/layer5/learn-layer5)
[![Go Report Card](https://goreportcard.com/badge/github.com/layer5io/learn-layer5)](https://goreportcard.com/report/github.com/layer5io/learn-layer5)
[![GitHub issues by-label](https://img.shields.io/github/issues/layer5io/learn-layer5/help%20wanted.svg)](https://github.com/issues?utf8=✓&q=is%3Aopen+is%3Aissue+archived%3Afalse+org%3Alayer5io+label%3A%22help+wanted%22+")
[![Website](https://img.shields.io/website/https/layer5.io/meshery.svg)](https://layer5.io)
[![Twitter Follow](https://img.shields.io/twitter/follow/layer5.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mesheryio)
[![Slack](http://slack.layer5.io/badge.svg)](http://slack.layer5.io)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3564/badge)](https://bestpractices.coreinfrastructure.org/projects/3564)

```shell
kubectl kuttl test --skip-cluster-delete=true --start-kind=false ./smi-test
```
<p style="clear:both;">
<h2>Learn Layer5</h2>

The Learn Layer5 sample application is to be available for use across all service meshes that Meshery supports and is to used as:

- a learning device (for [service mesh workshops](https://layer5.io/workshops))
- for [Service Mesh Interface conformance](https://docs.google.com/document/d/1HL8Sk7NSLLj-9PRqoHYVIGyU6fZxUQFotrxbmfFtjwc/edit#)

## Service
## Application Architecture
The Learn Layer5 application includes three services: `app-a`, `app-b`, and `app-c`. Each service is listening on port `9091/tcp`.

### Service

The following are the routes defined by the `service` app and their functionality.

##### POST /call
#### POST /call

This is the route whose metrics will be collected by the app. This route can be used to make the service call any other web service.

Expand Down Expand Up @@ -75,7 +89,7 @@ curl --location --request POST 'http://localhost:9091/call' \
}
```

##### GET /metrics
#### GET /metrics

Gets the metrics from `service`
```shell
Expand All @@ -93,7 +107,7 @@ curl --location --request GET 'localhost:9091/metrics' \
}
```

##### DELETE /metrics
#### DELETE /metrics

Clears the counters in `service`
```shell
Expand All @@ -104,4 +118,36 @@ curl --location --request DELETE 'localhost:9091/metrics' \
"hello": "bye"
}'
# No Output
```
```

<br /><br /><p align="center"><i>If you’re using Learn Layer5 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>
</p>

<p style="clear:both;">
<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>
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 Contributor 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>.

<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>

<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>

<p>
✔️ <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 />
✔️ <em><strong>Watch</strong></em> community <a href="https://www.youtube.com/channel/UCFL1af7_wdnhHXL1InzaMvA?sub_confirmation=1">meeting recordings</a>.<br />
✔️ <em><strong>Access</strong></em> the <a href="https://drive.google.com/drive/u/4/folders/0ABH8aabN4WAKUk9PVA">community drive</a>.<br />
</p>
<p align="center">
<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>.
</p>

## About Layer5

**Community First**
<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>

**Open Source First**
<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>

**License**

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).
1 change: 1 addition & 0 deletions img/readme/community.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/readme/meshery-logo-light-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/readme/slack-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM golang:1.13.5 as bd
WORKDIR /github.com/layer5io/sample-app-service
ADD . .
RUN GOPROXY=direct GOSUMDB=off go build -a -o /main .
CMD ["/main"]
RUN GOPROXY=direct GOSUMDB=off go build -a -o ./main .
CMD ["./main"]
Loading

0 comments on commit 9e02a61

Please sign in to comment.