Skip to content

Commit 5c802a4

Browse files
leecalcotekumarabd
authored andcommitted
modified vendor and dockerfile
Signed-off-by: kumarabd <abishekkumar92@gmail.com>
2 parents 222c035 + fa3b810 commit 5c802a4

12 files changed

Lines changed: 1418 additions & 90 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@ curl --location --request DELETE 'http://34.68.35.174:9091/metrics'
110110
> Note: metrics are collected only for `/call` and `/echo`.
111111
112112
# Service Mesh Interface (SMI) Conformance
113-
The `learn-layer5` application serves as a sample application to validate the conformance of any service mesh with the SMI specifications. To verfiy SMI conformance, run Meshery and invoke the suite of SMI tests specific to the service mesh you would like to validate.
113+
The `learn-layer5` application serves as a sample application to validate the conformance of any service mesh with the SMI specifications. To verify SMI conformance, run Meshery and invoke the suite of SMI tests specific to the service mesh you would like to validate.
114114

115115
## Testing with Meshery
116-
Meshery allows you to sechedule tests and invoke them programmatically. Meshery will store these test results and allow you to retrieve them later.
116+
Meshery allows you to schedule tests and invoke them programmatically. Meshery will store these test results and allow you to retrieve them later.
117117

118118
## Testing Manually
119119

120120
To manually invoke SMI Conformance test for a deployed service mesh, you can apply tests from the `smi-test` directory of this repository. Execute the following command to run the smi-conformace tests:
121121

122122
# To check for smi conformance of a deployed service mesh
123-
We use kuttl to check for SMI conformance. All the tests are writtten in smi-test directory of this repository.
123+
We use kuttl to check for SMI conformance. All the tests are written in smi-test directory of this repository.
124124
Execute the following command in `./smi-conformance` to run the smi-conformace tests:-
125125

126126
```shell

smi-conformance/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM golang:1.14-alpine3.11 as build-img
2+
LABEL maintainer "Layer5.io"
3+
4+
RUN apk update && apk add --no-cache git libc-dev gcc pkgconf && mkdir /home/meshery
5+
COPY ${PWD} /go/src/github.com/layer5io/learn-layer5/smi-conformance/
6+
WORKDIR /go/src/github.com/layer5io/learn-layer5/smi-conformance/
7+
# RUN git rev-parse HEAD > /home/meshery/version
8+
# RUN git describe --tags `git rev-list --tags --max-count=1` >> /home/com/version
9+
10+
RUN go mod vendor && go build -a -ldflags "-s -w" -o /home/meshery/smi_conformance main.go
11+
12+
FROM alpine:latest
13+
14+
RUN apk --no-cache add ca-certificates
15+
COPY --from=build-img /home/meshery/** /home/
16+
WORKDIR /home/
17+
EXPOSE 10008
18+
CMD ["sh","-c","./smi_conformance"]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package conformance
2+
3+
import (
4+
context "context"
5+
6+
"github.com/sirupsen/logrus"
7+
"google.golang.org/grpc"
8+
)
9+
10+
// ConformanceClient represents a gRPC adapter client
11+
type ConformanceClient struct {
12+
CClient ConformanceTestingClient
13+
conn *grpc.ClientConn
14+
}
15+
16+
// CreateClient creates a ConformanceClient for the given params
17+
func CreateClient(ctx context.Context, conformanceLocationURL string) (*ConformanceClient, error) {
18+
var opts []grpc.DialOption
19+
// creds, err := credentials.NewClientTLSFromFile(*caFile, *serverHostOverride)
20+
// if err != nil {
21+
// logrus.Errorf("Failed to create TLS credentials %v", err)
22+
// }
23+
// opts = append(opts, grpc.WithTransportCredentials(creds))
24+
// } else {
25+
opts = append(opts, grpc.WithInsecure())
26+
// }
27+
conn, err := grpc.Dial(conformanceLocationURL, opts...)
28+
if err != nil {
29+
logrus.Errorf("fail to dial: %v", err)
30+
}
31+
32+
cClient := NewConformanceTestingClient(conn)
33+
34+
return &ConformanceClient{
35+
conn: conn,
36+
CClient: cClient,
37+
}, nil
38+
}
39+
40+
// Close closes the ConformanceClient
41+
func (c *ConformanceClient) Close() error {
42+
if c.conn != nil {
43+
return c.conn.Close()
44+
}
45+
return nil
46+
}

0 commit comments

Comments
 (0)