-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from PhanLe1010/main
Add more test modes and Implement a metric exporter
- Loading branch information
Showing
34 changed files
with
1,350 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Rancher | ||
.dapper | ||
trash.lock | ||
.trash-conf | ||
bin/ | ||
|
||
# patch tmp files | ||
*.orig | ||
*.rej | ||
|
||
# editors | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM golang:1.17-alpine | ||
|
||
RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates | ||
|
||
ENV DAPPER_ENV REPO TAG | ||
ENV DAPPER_SOURCE /go/src/github.com/yasker/kbench/ | ||
ENV DAPPER_OUTPUT ./bin | ||
ENV DAPPER_DOCKER_SOCKET true | ||
ENV HOME ${DAPPER_SOURCE} | ||
WORKDIR ${DAPPER_SOURCE} | ||
|
||
ENTRYPOINT ["./scripts/entry"] | ||
CMD ["ci"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
TARGETS := all | ||
TARGETS := $(shell ls scripts) | ||
|
||
.dapper: | ||
@echo Downloading dapper | ||
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp | ||
@@chmod +x .dapper.tmp | ||
@./.dapper.tmp -v | ||
@mv .dapper.tmp .dapper | ||
|
||
$(TARGETS): .dapper | ||
./.dapper $@ | ||
|
||
deps: .dapper | ||
./.dapper -m bind env GO111MODULE=on go mod vendor | ||
./.dapper -m bind chown -R $$(id -u) vendor dist bin go.mod go.sum .cache | ||
|
||
clean: | ||
rm -rf bin dist | ||
|
||
.DEFAULT_GOAL := ci | ||
|
||
.PHONY: $(TARGETS) | ||
|
||
$(TARGETS): | ||
docker build -t yasker/kbench . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# Long-running test with prometheus metric exporter to monitor the data | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: test-sts | ||
namespace: default | ||
labels: | ||
app: test-sts | ||
spec: | ||
selector: | ||
app: test-sts | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: metrics | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: test-sts | ||
namespace: default | ||
spec: | ||
serviceName: test-sts | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: test-sts | ||
podManagementPolicy: Parallel | ||
template: | ||
metadata: | ||
labels: | ||
app: test-sts | ||
spec: | ||
containers: | ||
- name: kbench | ||
image: phanle1010/kbench:dev | ||
imagePullPolicy: Always | ||
env: | ||
- name: MODE | ||
value: "random-read-iops" | ||
- name: OUTPUT | ||
value: /test-result/device | ||
- name: FILE_NAME | ||
value: "/volume/test" | ||
- name: SIZE | ||
value: "15G" | ||
- name: CPU_IDLE_PROF | ||
value: "disabled" | ||
- name: SKIP_PARSE | ||
value: "true" | ||
- name: LONG_RUN | ||
value: "true" | ||
# - name: RATE_IOPS | ||
# value: "617" | ||
volumeMounts: | ||
- name: vol | ||
mountPath: /volume/ | ||
- name: shared-data | ||
mountPath: /test-result | ||
- name: metric-exporter | ||
image: phanle1010/kbench:dev | ||
imagePullPolicy: Always | ||
readinessProbe: | ||
exec: | ||
command: | ||
- sh | ||
- -c | ||
- '[ "$(ls -A /test-result)" ]' | ||
initialDelaySeconds: 30 | ||
periodSeconds: 10 | ||
command: | ||
- metric-exporter | ||
- -d | ||
- start | ||
env: | ||
- name: DATA_DIR | ||
value: /test-result | ||
- name: VOLUME_ACCESS_MODE | ||
value: rwo | ||
- name: TEST_MODE | ||
value: read-only | ||
- name: RATE_LIMIT_TYPE | ||
value: no-rate-limit | ||
ports: | ||
- containerPort: 8080 | ||
name: metrics | ||
volumeMounts: | ||
- name: vol | ||
mountPath: /volume/ | ||
- name: shared-data | ||
mountPath: /test-result | ||
volumes: | ||
- name: shared-data | ||
emptyDir: {} | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: vol | ||
spec: | ||
accessModes: ["ReadWriteOnce"] | ||
storageClassName: "local-path" | ||
resources: | ||
requests: | ||
storage: 20Gi | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: test-sts-servicemonitor | ||
namespace: default | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: test-sts | ||
namespaceSelector: | ||
matchNames: | ||
- default | ||
endpoints: | ||
- port: http | ||
interval: 30s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[rand-read-bw] | ||
readwrite=randread | ||
include bw-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[rand-write-bw] | ||
readwrite=randwrite | ||
include bw-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[seq-read-bw] | ||
readwrite=read | ||
include bw-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[seq-write-bw] | ||
readwrite=write | ||
include bw-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[rand-read-iops] | ||
readwrite=randread | ||
include iops-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[rand-write-iops] | ||
readwrite=randwrite | ||
include iops-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[seq-read-iops] | ||
readwrite=read | ||
include iops-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[seq-write-iops] | ||
readwrite=write | ||
include iops-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[rand-read-lat] | ||
readwrite=randread | ||
include lat-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[rand-write-lat] | ||
readwrite=randwrite | ||
include lat-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[seq-read-lat] | ||
readwrite=read | ||
include lat-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[seq-write-lat] | ||
readwrite=write | ||
include lat-include.fio | ||
include common-include.fio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.