Skip to content

Commit

Permalink
[skip ci] WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ReToCode committed Aug 22, 2023
1 parent 587de3d commit 01194ad
Show file tree
Hide file tree
Showing 236 changed files with 4,879 additions and 55,397 deletions.
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/google/go-containerregistry v0.13.0
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20230209165335-3624968304fd
github.com/google/gofuzz v1.2.0
github.com/google/mako v0.0.0-20190821191249-122f8dcef9e3
github.com/gorilla/websocket v1.5.0
github.com/hashicorp/golang-lru v0.5.4
github.com/influxdata/influxdb-client-go/v2 v2.9.0
Expand Down Expand Up @@ -95,13 +94,10 @@ require (
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20230209165335-3624968304fd // indirect
github.com/google/go-github/v27 v27.0.6 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
Expand Down
7 changes: 0 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQA
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -287,16 +286,10 @@ github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20230209165335-
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20230209165335-3624968304fd/go.mod h1:x5fIlj5elU+/eYF60q4eASMQ9kDc+GMFa7UU9M3mFFw=
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20230209165335-3624968304fd h1:AQZlI371LcvBYY/7Q55TjxrpZJs6wtEXMw4Wq38XLy8=
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20230209165335-3624968304fd/go.mod h1:6pjZpt+0dg+Z0kUEn53qLtD57raiZo/bqWzsuX6dDjo=
github.com/google/go-github/v27 v27.0.6 h1:oiOZuBmGHvrGM1X9uNUAUlLgp5r1UUO/M/KnbHnLRlQ=
github.com/google/go-github/v27 v27.0.6/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/mako v0.0.0-20190821191249-122f8dcef9e3 h1:/o5e44nTD/QEEiWPGSFT3bSqcq3Qg7q27N9bv4gKh5M=
github.com/google/mako v0.0.0-20190821191249-122f8dcef9e3/go.mod h1:YzLcVlL+NqWnmUEPuhS1LxDDwGO9WNbVlEXaF4IH35g=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
Expand Down
3 changes: 0 additions & 3 deletions hack/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ import (
// Migration job.
_ "knative.dev/pkg/apiextensions/storageversion/cmd/migrate"

// Mako stub
_ "knative.dev/pkg/test/mako/stub-sidecar"

_ "k8s.io/code-generator/cmd/client-gen"
_ "k8s.io/code-generator/cmd/deepcopy-gen"
_ "k8s.io/code-generator/cmd/defaulter-gen"
Expand Down
19 changes: 0 additions & 19 deletions test/config/ytt/performance/influx/influx-secret.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions test/config/ytt/performance/kperf-test-namespace.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions test/config/ytt/performance/overlay-activator-min-replicas.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions test/config/ytt/performance/overlay-config-autoscaler.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions test/config/ytt/performance/overlay-config-network.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export ENABLE_HA=0
export ENABLE_TLS=${ENABLE_TLS:-0}
export MESH=0
export AMBIENT=${AMBIENT:-0}
export PERF=0
export KIND=${KIND:-0}
export CLUSTER_DOMAIN=${CLUSTER_DOMAIN:-cluster.local}

Expand Down Expand Up @@ -131,10 +130,6 @@ function parse_flags() {
readonly MESH=0
return 1
;;
--perf)
readonly PERF=1
return 1
;;
--enable-ha)
readonly ENABLE_HA=1
return 1
Expand Down Expand Up @@ -312,10 +307,6 @@ function install() {
YTT_FILES+=("${REPO_ROOT_DIR}/test/config/ytt/ha")
fi

if (( PERF )); then
YTT_FILES+=("${REPO_ROOT_DIR}/test/config/ytt/performance")
fi

if (( KIND )); then
YTT_FILES+=("${REPO_ROOT_DIR}/test/config/ytt/kind/core")
fi
Expand Down
File renamed without changes.
57 changes: 50 additions & 7 deletions test/performance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Knative performance tests are tests geared towards producing useful performance
metrics of the knative system. As such they can choose to take a closed-box
point-of-view of the system and use it just like an end-user might see it. They
can also go more open-boxy to narrow down the components under test.
can also go more open-box to narrow down the components under test.

## Load Generator

Expand All @@ -15,11 +15,29 @@ different rate, you can write your own pacer by implementing
interface. Custom pacer implementations used in Knative tests are under
[pacers](https://github.com/knative/pkg/tree/main/test/vegeta/pacers).

## Benchmarking using Mako

The benchmarks were originally built to use [mako](https://github.com/google/mako), but currently
running without connecting to the Mako backend, and collecting the data using
a Mako sidecar stub.
## Testing architecture



## Benchmarks

Knative Serving has different benchmarking scenarios:

* [deployment-probe](./benchmarks/deployment-probe) = Measure deployment latency
*


## Running the benchmarks

### Development

You can run all the benchmarks directly by calling the `main()` method in `main.go` in the respective [benchmarks](./benchmarks) folders.

### On cluster




### Run without Mako

Expand All @@ -41,6 +59,31 @@ To run a benchmark once, and use the result from `mako-stub` for plotting:

**Note:** Running `performance-tests-mako.sh` creates a cluster and runs all the benchmarks in sequence. Results are downloaded in a temp folder

### Benchmarking using Kperf

Running `performance-tests.sh` runs performance tests using [kperf](https://github.com/knative-extensions/kperf)
## Forwarding the results to Prometheus

Prerequisites
* You need a running Prometheus instance
* If you want to visualize the results, you also need Grafana and install the [dashboards](./TODO)
* For a local-setup you can use the following resources

```bash
# Setup Influx DB in local cluster
helm repo add influxdata https://helm.influxdata.com/
kubectl create ns influx
helm upgrade --install -n influx local-influx influxdata/influxdb2
echo $(kubectl get secret local-influx-influxdb2-auth -o "jsonpath={.data['admin-password']}" --namespace influx | base64 --decode)
kubectl port-forward -n influx svc/local-influx-influxdb2 8080:80
```

### Influx DB Setup

* Log in to influx UI and create an organization `Knativetest` with bucket `knative-serving`.
* Create a new user (or use admin) and grab it's token:
* Load Data -> API Tokens -> Generate API token
* Pass the token and URL to your tests using env variables:

```bash
export INFLUX_URL=
export INFLUX_TOKEN=xxx
```
Loading

0 comments on commit 01194ad

Please sign in to comment.