Skip to content

Commit

Permalink
Refactor benchmark bundles
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Nov 10, 2023
1 parent 415cce9 commit 66fcb89
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 58 deletions.
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,39 +76,35 @@ make timoni-push
Run the benchmark for OCI artifact pull and Flux Kustomization install:

```shell
KS=100 timoni bundle apply -f timoni/bundles/flux-kustomize-benchmark.cue --runtime-from-env --timeout=10m
KS=100 timoni bundle apply -f timoni/bundles/flux-benchmark.cue --runtime-from-env --timeout=10m
```

Run the benchmark for Flux Kustomization upgrade:

```shell
KS=100 MCPU=2 timoni bundle apply -f timoni/bundles/flux-kustomize-benchmark.cue --runtime-from-env --timeout=10m
```

Teardown:

```shell
timoni bundle delete flux-kustomize-benchmark
KS=100 MCPU=2 timoni bundle apply -f timoni/bundles/flux-benchmark.cue --runtime-from-env --timeout=10m
```

### Flux HelmRelease Benchmark

Run the benchmark for Helm chart pull and Flux HelmRelease install:

```shell
HR=100 timoni bundle apply -f timoni/bundles/flux-helm-benchmark.cue --runtime-from-env --timeout=10m
HR=100 timoni bundle apply -f timoni/bundles/flux-benchmark.cue --runtime-from-env --timeout=10m
```

Run the benchmark for Flux HelmRelease upgrade:

```shell
HR=100 MCPU=2 timoni bundle apply -f timoni/bundles/flux-helm-benchmark.cue --runtime-from-env --timeout=10m
HR=100 MCPU=2 timoni bundle apply -f timoni/bundles/flux-benchmark.cue --runtime-from-env --timeout=10m
```

Teardown:
### Teardown

Remove all Flux resources and the benchmark namespaces with:

```shell
timoni bundle delete flux-helm-benchmark
timoni bundle delete flux-benchmark
```

## MTTP Benchmark Results (Flux v2.2 RC)
Expand Down
2 changes: 1 addition & 1 deletion manifests/podinfo/podinfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ metadata:
app.kubernetes.io/version: "6.5.3"
app.kubernetes.io/managed-by: Flux
spec:
replicas: 0
replicas: ${PODS:=0}
strategy:
type: RollingUpdate
rollingUpdate:
Expand Down
36 changes: 36 additions & 0 deletions timoni/bundles/flux-benchmark.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
bundle: {
_ks: 0 @timoni(runtime:number:KS)
_hr: 0 @timoni(runtime:number:HR)

apiVersion: "v1alpha1"
name: "flux-benchmark"
instances: {
if _ks > 0 {
"podinfo-ks": {
module: url: "oci://localhost:5555/modules/flux-ks-bench"
namespace: "kustomize-benchmark"
values: {
syncs: _ks
pods: 0 @timoni(runtime:number:PODS)
mcpu: 1 @timoni(runtime:number:MCPU)
}
}
}
if _hr > 0 {
"podinfo-hr": {
module: url: "oci://localhost:5555/modules/flux-hr-bench"
namespace: "helm-benchmark"
values: {
chart: {
name: "podinfo"
version: "6.5.3"
interval: 60
}
releases: _hr
pods: 0 @timoni(runtime:number:PODS)
mcpu: 1 @timoni(runtime:number:MCPU)
}
}
}
}
}
22 changes: 0 additions & 22 deletions timoni/bundles/flux-helm-benchmark.cue

This file was deleted.

14 changes: 0 additions & 14 deletions timoni/bundles/flux-kustomize-benchmark.cue

This file was deleted.

1 change: 0 additions & 1 deletion timoni/modules/flux-hr-bench/debug_values.cue
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ package main
// Debug example 'cue cmd -t debug -t name=test -t namespace=test -t mv=1.0.0 -t kv=1.28.0 build'.
values: {
releases: 100
replicas: 0
}
4 changes: 2 additions & 2 deletions timoni/modules/flux-hr-bench/templates/config.cue
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
runTests: bool | *false

releases: int | *1
replicas: int | *2
requests: cpu: int | *1
pods: int | *1
mcpu: int | *1
}

// Instance takes the config values and outputs the Kubernetes objects.
Expand Down
10 changes: 5 additions & 5 deletions timoni/modules/flux-hr-bench/templates/helmrelease.cue
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ import (
}
install: crds: "Create"
upgrade: crds: "CreateReplace"
if _config.replicas > 0 {
if _config.pods > 0 {
test: enable: _config.runTests
}
values: {
replicaCount: _config.replicas
if _config.replicas > 0 {
replicaCount: _config.pods
if _config.pods > 0 {
hpa: {
enabled: true
maxReplicas: _config.replicas
maxReplicas: _config.pods
cpu: 99
}
}
Expand All @@ -49,7 +49,7 @@ import (
className: "nginx"
}
resources: requests: {
cpu: "\(_config.requests.cpu)m"
cpu: "\(_config.mcpu)m"
memory: "16Mi"
}
}
Expand Down
2 changes: 1 addition & 1 deletion timoni/modules/flux-ks-bench/debug_values.cue
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ package main
// Values used by debug_tool.cue.
// Debug example 'cue cmd -t debug -t name=test -t namespace=test -t mv=1.0.0 -t kv=1.28.0 build'.
values: {

syncs: 100
}
1 change: 1 addition & 0 deletions timoni/modules/flux-ks-bench/templates/config.cue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
}

syncs: int | *1
pods: int | *1
mcpu: int | *1
}

Expand Down
1 change: 1 addition & 0 deletions timoni/modules/flux-ks-bench/templates/kustomization.cue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

postBuild: substitute: {
"INDEX": "\(_index)app"
"PODS": "\(_config.pods)"
"MCPU": "\(_config.mcpu)m"
}

Expand Down

0 comments on commit 66fcb89

Please sign in to comment.