Skip to content

Commit 8e5aedf

Browse files
authored
HTTP and gRPC Grafana and removal of extraneous parts (#1565)
* HTTP Grafana dashboard Signed-off-by: Alan Cha <[email protected]> * Clean up Signed-off-by: Alan Cha <[email protected]> * Add grafana option to HTTP task Signed-off-by: Alan Cha <[email protected]> * Fix some tests Signed-off-by: Alan Cha <[email protected]> * More clean up Signed-off-by: Alan Cha <[email protected]> * Fix import Signed-off-by: Alan Cha <[email protected]> * Improve custom metrics tests Signed-off-by: Alan Cha <[email protected]> * Fix http task Signed-off-by: Alan Cha <[email protected]> * Add test for HTTP Grafana dashboard Signed-off-by: Alan Cha <[email protected]> * Additional tests Signed-off-by: Alan Cha <[email protected]> * Fix test Signed-off-by: Alan Cha <[email protected]> * Address Michael's comments Signed-off-by: Alan Cha <[email protected]> * gRPC Grafana dashboard Signed-off-by: Alan Cha <[email protected]> * Rename functions Signed-off-by: Alan Cha <[email protected]> * Address Michael's comments Signed-off-by: Alan Cha <[email protected]> * Rename to getGRPCDashboard Signed-off-by: Alan Cha <[email protected]> * Delete assess, report, SLOs, rewards Signed-off-by: Alan Cha <[email protected]> * Remove assess, report, autox, and reports Signed-off-by: Alan Cha <[email protected]> * Fix workflows Signed-off-by: Alan Cha <[email protected]> * Modify error message Signed-off-by: Alan Cha <[email protected]> * Remove cronjob Signed-off-by: Alan Cha <[email protected]> * Revert ready taskin workflows Signed-off-by: Alan Cha <[email protected]> * Remove looped experiments in workflows Signed-off-by: Alan Cha <[email protected]> * Remove grafana flag Signed-off-by: Alan Cha <[email protected]> * Remove extraneous consts and func Signed-off-by: Alan Cha <[email protected]> * Add assert Signed-off-by: Alan Cha <[email protected]> * Fix test Signed-off-by: Alan Cha <[email protected]> * Remove custommetrics Signed-off-by: Alan Cha <[email protected]> * Remove testdata for autoX and custommetrics Signed-off-by: Alan Cha <[email protected]> * Gut insights Signed-off-by: Alan Cha <[email protected]> * Fix http tests Signed-off-by: Alan Cha <[email protected]> * Fix gRPC tests Signed-off-by: Alan Cha <[email protected]> * Fix experiment tests Signed-off-by: Alan Cha <[email protected]> * Fix server tests Delete fields in the test data after fields were delete in type structs Signed-off-by: Alan Cha <[email protected]> * Fix file driver tests Signed-off-by: Alan Cha <[email protected]> * Fix server tests Signed-off-by: Alan Cha <[email protected]> * Fix assert tests Signed-off-by: Alan Cha <[email protected]> * Fix kubedriver tests Signed-off-by: Alan Cha <[email protected]> * Fix tests Signed-off-by: Alan Cha <[email protected]> * Refactor MockMetricsServer as test helper Signed-off-by: Alan Cha <[email protected]> * Remove metrics and extraneous Signed-off-by: Alan Cha <[email protected]> * Remove extraneous code Signed-off-by: Alan Cha <[email protected]> * Add comments to mock server functions/types Signed-off-by: Alan Cha <[email protected]> * Remove extraneous Signed-off-by: Alan Cha <[email protected]> * Remove extraneous Signed-off-by: Alan Cha <[email protected]> * Add routemap tests Signed-off-by: Alan Cha <[email protected]> * Remove SLOs Signed-off-by: Alan Cha <[email protected]> * Remove error message Signed-off-by: Alan Cha <[email protected]> * Add UnmarshalJSON() test Signed-off-by: Alan Cha <[email protected]> * Remove rewards Signed-off-by: Alan Cha <[email protected]> * Add better multiple endpoint support to HTTP Signed-off-by: Alan Cha <[email protected]> * Better gRPC multiple endpoint support Signed-off-by: Alan Cha <[email protected]> * Add single endpoint multiple call test for gRPC Signed-off-by: Alan Cha <[email protected]> * Remove runner option Signed-off-by: Alan Cha <[email protected]> * Fix worfkflow Signed-off-by: Alan Cha <[email protected]> * Remove if parameter from github and slack tasks Signed-off-by: Alan Cha <[email protected]> * Remove custommetrics template Signed-off-by: Alan Cha <[email protected]> * Add name and namespace to experiment result For github and slack tasks Signed-off-by: Alan Cha <[email protected]> * Add space Signed-off-by: Alan Cha <[email protected]> * Remove reuseResult Signed-off-by: Alan Cha <[email protected]> * Performance result has result instead of insights Signed-off-by: Alan Cha <[email protected]> * Remove NumLoops Signed-off-by: Alan Cha <[email protected]> * Add dashboardSummary type Signed-off-by: Alan Cha <[email protected]> * Bump version Signed-off-by: Alan Cha <[email protected]> * Add get experiment result methods Signed-off-by: Alan Cha <[email protected]> * Temp Signed-off-by: Alan Cha <[email protected]> * Cannot cast interface into HTTPResult Signed-off-by: Alan Cha <[email protected]> * Only write experimentResult to metrics store Signed-off-by: Alan Cha <[email protected]> * Remove assert command Signed-off-by: Alan Cha <[email protected]> * Uncomment test Signed-off-by: Alan Cha <[email protected]> * Remove assert Signed-off-by: Alan Cha <[email protected]> * Remove original Write() implmentation Signed-off-by: Alan Cha <[email protected]> * Update tests Signed-off-by: Alan Cha <[email protected]> * Fix tests Signed-off-by: Alan Cha <[email protected]> * Rename traffic controller to controller Signed-off-by: Alan Cha <[email protected]> * Fix test Signed-off-by: Alan Cha <[email protected]> * Rename kustomize/iter8 to kustomize/controller Signed-off-by: Alan Cha <[email protected]> * Update Grafana dashboard to use ExperimentResult Signed-off-by: Alan Cha <[email protected]> * Comment other workflows Signed-off-by: Alan Cha <[email protected]> * Comment testperformance workflow Signed-off-by: Alan Cha <[email protected]> * Add test Signed-off-by: Alan Cha <[email protected]> * Print env Signed-off-by: Alan Cha <[email protected]> * Move test into assets Signed-off-by: Alan Cha <[email protected]> * Add load test Signed-off-by: Alan Cha <[email protected]> * Fix test Signed-off-by: Alan Cha <[email protected]> * Add version and tag Signed-off-by: Alan Cha <[email protected]> * Move echo to beginning Signed-off-by: Alan Cha <[email protected]> * Delete assets test Signed-off-by: Alan Cha <[email protected]> * Tweeking Signed-off-by: Alan Cha <[email protected]> * Add output Signed-off-by: Alan Cha <[email protected]> * Directly use outputs Signed-off-by: Alan Cha <[email protected]> * Fix link using quotes Signed-off-by: Alan Cha <[email protected]> * Add more logging Signed-off-by: Alan Cha <[email protected]> * Fix logging Signed-off-by: Alan Cha <[email protected]> * Job working but needed more logging Signed-off-by: Alan Cha <[email protected]> * Add wait Signed-off-by: Alan Cha <[email protected]> * Clean up Signed-off-by: Alan Cha <[email protected]> * Add Docker login Signed-off-by: Alan Cha <[email protected]> * Clean up Signed-off-by: Alan Cha <[email protected]> * Correct image repo name Signed-off-by: Alan Cha <[email protected]> * Add everything Signed-off-by: Alan Cha <[email protected]> * Adjust comments Signed-off-by: Alan Cha <[email protected]> * Uncomment Signed-off-by: Alan Cha <[email protected]> * Add controller and check to testcharts.yaml Signed-off-by: Alan Cha <[email protected]> * Uncomment testkustomize.yaml Signed-off-by: Alan Cha <[email protected]> * Uncomment testcharts.yaml Signed-off-by: Alan Cha <[email protected]> * Add build-push-test-image to testperformance.yaml Signed-off-by: Alan Cha <[email protected]> * Uncomment assets.yaml Signed-off-by: Alan Cha <[email protected]> * Add controller to assets Signed-off-by: Alan Cha <[email protected]> * Uncomment again Signed-off-by: Alan Cha <[email protected]> * Temp changes Signed-off-by: Alan Cha <[email protected]> * Respond to Sri's comments about workflows Signed-off-by: Alan Cha <[email protected]> * Revert chart and kustomize changes Signed-off-by: Alan Cha <[email protected]> * Fix paths Signed-off-by: Alan Cha <[email protected]> * Revert version to v0.15 Signed-off-by: Alan Cha <[email protected]> * Fix test Signed-off-by: Alan Cha <[email protected]> * Remove extraneous logging Signed-off-by: Alan Cha <[email protected]> * Remove extaneous logging Signed-off-by: Alan Cha <[email protected]> * Update README.md Signed-off-by: Alan Cha <[email protected]> * Update wordlist Signed-off-by: Alan Cha <[email protected]> * Change name Signed-off-by: Alan Cha <[email protected]> --------- Signed-off-by: Alan Cha <[email protected]>
1 parent 118e0c4 commit 8e5aedf

File tree

127 files changed

+3300
-7652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+3300
-7652
lines changed

.github/wordlist.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,5 @@ Shubham
167167
Sood
168168
Toolchains
169169
jetic
170-
Öztürk
170+
Öztürk
171+
reconfigures

.github/workflows/assets/grpcurl.yaml

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: sleep
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: sleep
10+
template:
11+
metadata:
12+
labels:
13+
app: sleep
14+
spec:
15+
containers:
16+
- name: sleep
17+
image: fullstorydev/grpcurl:latest-alpine
18+
command: ["/bin/sh", "-c", "source command.sh"]
19+
workingDir: /demo
20+
imagePullPolicy: IfNotPresent
21+
volumeMounts:
22+
- name: config-volume
23+
mountPath: /demo
24+
volumes:
25+
- name: config-volume
26+
configMap:
27+
name: demo-input
28+
---
29+
apiVersion: v1
30+
kind: ConfigMap
31+
metadata:
32+
name: demo-input
33+
data:
34+
route_guide.proto: |
35+
// Copyright 2015 gRPC authors.
36+
//
37+
// Licensed under the Apache License, Version 2.0 (the "License");
38+
// you may not use this file except in compliance with the License.
39+
// You may obtain a copy of the License at
40+
//
41+
// http://www.apache.org/licenses/LICENSE-2.0
42+
//
43+
// Unless required by applicable law or agreed to in writing, software
44+
// distributed under the License is distributed on an "AS IS" BASIS,
45+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
46+
// See the License for the specific language governing permissions and
47+
// limitations under the License.
48+
49+
syntax = "proto3";
50+
51+
option go_package = "google.golang.org/grpc/examples/route_guide/routeguide";
52+
option java_multiple_files = true;
53+
option java_package = "io.grpc.examples.routeguide";
54+
option java_outer_classname = "RouteGuideProto";
55+
56+
package routeguide;
57+
58+
// Interface exported by the server.
59+
service RouteGuide {
60+
// A simple RPC.
61+
//
62+
// Obtains the feature at a given position.
63+
//
64+
// A feature with an empty name is returned if there's no feature at the given
65+
// position.
66+
rpc GetFeature(Point) returns (Feature) {}
67+
68+
// A server-to-client streaming RPC.
69+
//
70+
// Obtains the Features available within the given Rectangle. Results are
71+
// streamed rather than returned at once (e.g. in a response message with a
72+
// repeated field), as the rectangle may cover a large area and contain a
73+
// huge number of features.
74+
rpc ListFeatures(Rectangle) returns (stream Feature) {}
75+
76+
// A client-to-server streaming RPC.
77+
//
78+
// Accepts a stream of Points on a route being traversed, returning a
79+
// RouteSummary when traversal is completed.
80+
rpc RecordRoute(stream Point) returns (RouteSummary) {}
81+
82+
// A Bidirectional streaming RPC.
83+
//
84+
// Accepts a stream of RouteNotes sent while a route is being traversed,
85+
// while receiving other RouteNotes (e.g. from other users).
86+
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
87+
}
88+
89+
// Points are represented as latitude-longitude pairs in the E7 representation
90+
// (degrees multiplied by 10**7 and rounded to the nearest integer).
91+
// Latitudes should be in the range +/- 90 degrees and longitude should be in
92+
// the range +/- 180 degrees (inclusive).
93+
message Point {
94+
int32 latitude = 1;
95+
int32 longitude = 2;
96+
}
97+
98+
// A latitude-longitude rectangle, represented as two diagonally opposite
99+
// points "lo" and "hi".
100+
message Rectangle {
101+
// One corner of the rectangle.
102+
Point lo = 1;
103+
104+
// The other corner of the rectangle.
105+
Point hi = 2;
106+
}
107+
108+
// A feature names something at a given point.
109+
//
110+
// If a feature could not be named, the name is empty.
111+
message Feature {
112+
// The name of the feature.
113+
string name = 1;
114+
115+
// The point where the feature is detected.
116+
Point location = 2;
117+
}
118+
119+
// A RouteNote is a message sent while at a given point.
120+
message RouteNote {
121+
// The location from which the message is sent.
122+
Point location = 1;
123+
124+
// The message to be sent.
125+
string message = 2;
126+
}
127+
128+
// A RouteSummary is received in response to a RecordRoute rpc.
129+
//
130+
// It contains the number of individual points received, the number of
131+
// detected features, and the total distance covered as the cumulative sum of
132+
// the distance between each point.
133+
message RouteSummary {
134+
// The number of points received.
135+
int32 point_count = 1;
136+
137+
// The number of known features passed while traversing the route.
138+
int32 feature_count = 2;
139+
140+
// The distance covered in metres.
141+
int32 distance = 3;
142+
143+
// The duration of the traversal in seconds.
144+
int32 elapsed_time = 4;
145+
}
146+
unary.json: |
147+
{
148+
"latitude": 407838351,
149+
"longitude": -746143763
150+
}
151+
command.sh: |
152+
cat unary.json | grpcurl -plaintext -proto route_guide.proto -d @ routeguide:50051 routeguide.RouteGuide.GetFeature

.github/workflows/draftrelease.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Release drafter
22

3+
# Runs when changes are pushed
4+
35
on:
46
push:
5-
# branches to consider in the event; optional, defaults to all
67
branches:
78
- master
89

.github/workflows/golangci-lint.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
name: golangci-lint
22

3+
# Only runs when there are golang code changes
4+
5+
# Lint golang files
6+
37
on:
48
pull_request:
9+
branches:
10+
- master
11+
paths:
12+
- '**.go'
513

614
permissions:
715
contents: read

.github/workflows/linkcheck.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Link checker
22

3+
# Only runs when there are markdown changes and intermittently
4+
5+
# Check links across markdown files
6+
37
on:
48
pull_request:
59
branches:
610
- master
11+
paths:
12+
- '**.md'
713
schedule:
814
- cron: "0 0 1 * *"
915

.github/workflows/lintcharts.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Lint Helm charts
22

3+
# Only runs when charts have changed
4+
5+
# Lint Helm charts
6+
37
on:
48
pull_request:
59
branches:
610
- master
11+
paths:
12+
- charts/**
713

814
jobs:
915
# Get the paths for the Helm charts to lint

.github/workflows/lintcharts2.yaml

+9-79
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,23 @@ name: Additional Helm chart linting
44
# This workflow builds on the other workflow by producing Kubernetes YAML files from the templates and running kube-linter on those files
55
# See iter8-tools/iter8#1452
66

7+
# Only runs when charts have changed
8+
9+
# Lint Helm charts
10+
# Use templates to create Kubernetes YAML files and lint them
11+
712
on:
813
pull_request:
914
branches:
1015
- master
16+
paths:
17+
- charts/**
1118

1219
jobs:
1320
http-experiment:
1421
name: Lint HTTP experiment
1522
runs-on: ubuntu-latest
1623

17-
steps:
18-
- name: Check out code
19-
uses: actions/checkout@v3
20-
21-
- name: Get modified files in the charts/iter8 folder
22-
id: modified-files
23-
uses: tj-actions/changed-files@v35
24-
with:
25-
files: charts/iter8
26-
27-
- uses: azure/setup-helm@v3
28-
if: steps.modified-files.outputs.any_modified == 'true'
29-
with:
30-
token: ${{ secrets.GITHUB_TOKEN }}
31-
32-
- name: Create Kubernetes YAML file
33-
if: steps.modified-files.outputs.any_modified == 'true'
34-
run: |
35-
helm template charts/iter8 \
36-
--set "tasks={ready,http,assess}" \
37-
--set ready.deploy=httpbin \
38-
--set ready.service=httpbin \
39-
--set ready.timeout=60s \
40-
--set http.url=http://httpbin.default/get \
41-
--set assess.SLOs.upper.http/latency-mean=50 \
42-
--set assess.SLOs.upper.http/error-count=0 \
43-
--set runner=job >> iter8.yaml
44-
45-
- name: Lint Kubernetes YAML file
46-
if: steps.modified-files.outputs.any_modified == 'true'
47-
uses: stackrox/kube-linter-action@v1
48-
with:
49-
directory: iter8.yaml
50-
51-
http-looped-experiment:
52-
name: Lint HTTP looped experiment
53-
runs-on: ubuntu-latest
54-
5524
steps:
5625
- name: Check out code
5726
uses: actions/checkout@v3
@@ -72,9 +41,7 @@ jobs:
7241
run: |
7342
helm template charts/iter8 \
7443
--set tasks={http} \
75-
--set http.url="http://httpbin.default/get" \
76-
--set runner=cronjob \
77-
--set cronjobSchedule="*/1 * * * *" >> iter8.yaml
44+
--set http.url=http://httpbin.default/get >> iter8.yaml
7845
7946
- name: Lint Kubernetes YAML file
8047
if: steps.modified-files.outputs.any_modified == 'true'
@@ -108,47 +75,10 @@ jobs:
10875
--set tasks={grpc} \
10976
--set grpc.host="hello.default:50051" \
11077
--set grpc.call="helloworld.Greeter.SayHello" \
111-
--set grpc.protoURL="https://raw.githubusercontent.com/grpc/grpc-go/master/examples/helloworld/helloworld/helloworld.proto" \
112-
--set runner=job >> iter8.yaml
78+
--set grpc.protoURL="https://raw.githubusercontent.com/grpc/grpc-go/master/examples/helloworld/helloworld/helloworld.proto" >> iter8.yaml
11379
11480
- name: Lint Kubernetes YAML file
11581
if: steps.modified-files.outputs.any_modified == 'true'
11682
uses: stackrox/kube-linter-action@v1
11783
with:
11884
directory: iter8.yaml
119-
120-
grpc-looped-experiment:
121-
name: Lint gRPC looped experiment
122-
runs-on: ubuntu-latest
123-
124-
steps:
125-
- name: Check out code
126-
uses: actions/checkout@v3
127-
128-
- name: Get modified files in the charts/iter8 folder
129-
id: modified-files
130-
uses: tj-actions/changed-files@v35
131-
with:
132-
files: charts/iter8
133-
134-
- uses: azure/setup-helm@v3
135-
if: steps.modified-files.outputs.any_modified == 'true'
136-
with:
137-
token: ${{ secrets.GITHUB_TOKEN }}
138-
139-
- name: Create Kubernetes YAML file
140-
if: steps.modified-files.outputs.any_modified == 'true'
141-
run: |
142-
helm template charts/iter8 \
143-
--set tasks={grpc} \
144-
--set grpc.host="hello.default:50051" \
145-
--set grpc.call="helloworld.Greeter.SayHello" \
146-
--set grpc.protoURL="https://raw.githubusercontent.com/grpc/grpc-go/master/examples/helloworld/helloworld/helloworld.proto" \
147-
--set runner=cronjob \
148-
--set cronjobSchedule="*/1 * * * *" >> iter8.yaml
149-
150-
- name: Lint Kubernetes YAML file
151-
if: steps.modified-files.outputs.any_modified == 'true'
152-
uses: stackrox/kube-linter-action@v1
153-
with:
154-
directory: iter8.yaml

0 commit comments

Comments
 (0)