diff --git a/README.md b/README.md index 964d0d5..5480187 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,9 @@ Benk uses [FIO](https://github.com/axboe/fio) in client and server mode. # Synopsis -Starter examples below. Build your own library of configuration files and reporting templates. +Starter examples below. Build your own library of configuration files and reporting templates. A walkthrough of some of these examples are available in a blog post on HPE Developer Community. + +- [Working with Benk: A storage provisioning and IO performance benchmark suite for Kubernetes](https://developer.hpe.com/blog/working-with-benk-a-storage-provisioning-and-io-performance-benchmark-suite-for-kubernetes/) ## Hello World @@ -44,7 +46,7 @@ Two helper shell scripts allows simple sequencing of multiple jobs and the repor Assumes `kustomize/base/config.env` and `kustomize/base/storagclass.yaml` exists along with a `Namespace` named "benk" on the cluster. ```text -for i in `seq 8`; do cp -a kustomize/overlays/default kustomize/overlays/mytest-${i}; done +for i in {1..8}; do cp -a kustomize/overlays/default kustomize/overlays/mytest-${i}; done # Edit kustomize/overlays/mytest-*/config.env for each iteration ./sequencer.sh mytest- ./src/benk/outputter.py -l logs/run-mytest-*.log -t jinja2/example-single.tsv.j2 @@ -55,8 +57,8 @@ for i in `seq 8`; do cp -a kustomize/overlays/default kustomize/overlays/mytest- Assumes `kustomize/base/config.env` and `kustomize/base/storagclass.yaml` exists along with a `Namespace` named "benk" on the cluster. ```text -for i in `seq 8`; do cp -a kustomize/overlays/default kustomize/overlays/mytest-a-${i}; done -for i in `seq 8`; do cp -a kustomize/overlays/default kustomize/overlays/mytest-b-${i}; done +for i in {1..8}; do cp -a kustomize/overlays/default kustomize/overlays/mytest-a-${i}; done +for i in {1..8}; do cp -a kustomize/overlays/default kustomize/overlays/mytest-b-${i}; done # Edit kustomize/overlays/mytest-*/config.env for each iteration ./sequencer.sh mytest-a- ./sequencer.sh mytest-b- diff --git a/jinja2/example-default-ab.md.j2 b/jinja2/example-default-ab.md.j2 new file mode 100644 index 0000000..69fc733 --- /dev/null +++ b/jinja2/example-default-ab.md.j2 @@ -0,0 +1,5 @@ +| Threads | A (MB/s) | B (MB/s) | Diff | +| ------- | -------- | -------- | ---- | +{% for _ in a %} +| {{ "%-7s" | format(a[loop.index0].benk.metadata.parameters.config.workloadThreads) }} | {{ "%-8s" | format(((a[loop.index0].benk.fio.data.read.bw + a[loop.index0].benk.fio.data.write.bw) / 1024) | round | int) }} | {{ "%-8s" | format(((b[loop.index0].benk.fio.data.read.bw + b[loop.index0].benk.fio.data.write.bw) / 1024) | round | int) }} | {{ "%-3sx" | format((((b[loop.index0].benk.fio.data.read.bw + b[loop.index0].benk.fio.data.write.bw) / 1024) / ((a[loop.index0].benk.fio.data.read.bw + a[loop.index0].benk.fio.data.write.bw) / 1024)) | round(1)) }} | +{% endfor %} diff --git a/jinja2/example-default.yaml.j2 b/jinja2/example-default.yaml.j2 new file mode 100644 index 0000000..23b1df8 --- /dev/null +++ b/jinja2/example-default.yaml.j2 @@ -0,0 +1,12 @@ +--- +report: + name: Example YAML template + logfile: {{ meta.log }} + jobs: +{% for run in log %} + - threads: {{ run.benk.fio.metadata.job.numjobs }} + runtime: {{ (run.benk.metadata.destruction.runtime + run.benk.metadata.provisioning.runtime) | round | int }}s + iops: {{ (run.benk.fio.data.read.iops + run.benk.fio.data.write.iops) | round | int }} + bandwidth: {{ ((run.benk.fio.data.read.bw + run.benk.fio.data.write.bw) / 1024) | round | int }}MB/s + bs: {{ run.benk.fio.metadata.job.bs }} +{% endfor %}