Skip to content

Commit

Permalink
Modify fio job files to use ConfigMap
Browse files Browse the repository at this point in the history
Signed-off-by: jinhong.kim0 <[email protected]>
  • Loading branch information
hookak committed Sep 9, 2024
1 parent 8fd580c commit f33d1a8
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 3 deletions.
5 changes: 5 additions & 0 deletions deploy/fio-cmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ spec:
mountPath: /volume1/
- name: vol2
mountPath: /volume2/
- name: fio-config-volume
mountPath: /etc/fio-config
command: ["bash", "/fio/cmp_run.sh"]
#volumeDevices:
#- name: vol1
Expand All @@ -102,4 +104,7 @@ spec:
- name: vol2
persistentVolumeClaim:
claimName: kbench-pvc-2
- name: fio-config-volume
configMap:
name: fio-config
backoffLimit: 0
195 changes: 195 additions & 0 deletions deploy/fio-custom-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: fio-custom-config
data:
bandwidth-quick.fio: |
[rand-read-bw]
readwrite=randread
include bw-include.fio
include quick-include.fio
[rand-write-bw]
readwrite=randwrite
include bw-include.fio
include quick-include.fio
[seq-read-bw]
readwrite=read
include bw-include.fio
include quick-include.fio
[seq-write-bw]
readwrite=write
include bw-include.fio
include quick-include.fio
bandwidth-random-read.fio: |
[rand-read-bw]
readwrite=randread
include bw-include.fio
include common-include.fio
bandwidth-random-write.fio: |
[rand-write-bw]
readwrite=randwrite
include bw-include.fio
include common-include.fio
bandwidth-sequential-read.fio: |
[seq-read-bw]
readwrite=read
include bw-include.fio
include common-include.fio
bandwidth-sequential-write.fio: |
[seq-write-bw]
readwrite=write
include bw-include.fio
include common-include.fio
bandwidth.fio: |
[rand-read-bw]
readwrite=randread
include bw-include.fio
include common-include.fio
[rand-write-bw]
readwrite=randwrite
include bw-include.fio
include common-include.fio
[seq-read-bw]
readwrite=read
include bw-include.fio
include common-include.fio
[seq-write-bw]
readwrite=write
include bw-include.fio
include common-include.fio
bw-include.fio: |
bs=128k
iodepth=64
common-include.fio: |
stonewall=1
randrepeat=0
verify=0
ioengine=libaio
direct=1
time_based=1
ramp_time=5s
runtime=20s
iops-include.fio: |
bs=4K
iodepth=64
iops-quick.fio: |
[rand-read-iops]
readwrite=randread
include iops-include.fio
include quick-include.fio
[rand-write-iops]
readwrite=randwrite
include iops-include.fio
include quick-include.fio
[seq-read-iops]
readwrite=read
include iops-include.fio
include quick-include.fio
[seq-write-iops]
readwrite=write
include iops-include.fio
include quick-include.fio
iops-random-read.fio: |
[rand-read-iops]
readwrite=randread
include iops-include.fio
include common-include.fio
iops-random-write.fio: |
[rand-write-iops]
readwrite=randwrite
include iops-include.fio
include common-include.fio
iops-sequential-read.fio: |
[seq-read-iops]
readwrite=read
include iops-include.fio
include common-include.fio
iops-sequential-write.fio: |
[seq-write-iops]
readwrite=write
include iops-include.fio
include common-include.fio
iops.fio: |
[rand-read-iops]
readwrite=randread
include iops-include.fio
include common-include.fio
[rand-write-iops]
readwrite=randwrite
include iops-include.fio
include common-include.fio
[seq-read-iops]
readwrite=read
include iops-include.fio
include common-include.fio
[seq-write-iops]
readwrite=write
include iops-include.fio
include common-include.fio
lat-include.fio: |
bs=4k
iodepth=1
latency-quick.fio: |
[rand-read-lat]
readwrite=randread
include lat-include.fio
include quick-include.fio
[rand-write-lat]
readwrite=randwrite
include lat-include.fio
include quick-include.fio
[seq-read-lat]
readwrite=read
include lat-include.fio
include quick-include.fio
[seq-write-lat]
readwrite=write
include lat-include.fio
include quick-include.fio
latency-random-read.fio: |
[rand-read-lat]
readwrite=randread
include lat-include.fio
include common-include.fio
latency-random-write.fio: |
[rand-write-lat]
readwrite=randwrite
include lat-include.fio
include common-include.fio
latency-sequential-read.fio: |
[seq-read-lat]
readwrite=read
include lat-include.fio
include common-include.fio
latency-sequential-write.fio: |
[seq-write-lat]
readwrite=write
include lat-include.fio
include common-include.fio
latency.fio: |
[rand-read-lat]
readwrite=randread
include lat-include.fio
include common-include.fio
[rand-write-lat]
readwrite=randwrite
include lat-include.fio
include common-include.fio
[seq-read-lat]
readwrite=read
include lat-include.fio
include common-include.fio
[seq-write-lat]
readwrite=write
include lat-include.fio
include common-include.fio
quick-include.fio: |
stonewall=1
randrepeat=0
verify=0
ioengine=libaio
direct=1
time_based=1
ramp_time=1s
runtime=5s
5 changes: 5 additions & 0 deletions deploy/fio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
volumeMounts:
- name: vol
mountPath: /volume/
- name: fio-custom-config
mountPath: /etc/fio-custom-config
#volumeDevices:
#- name: vol
# devicePath: /volume/test
Expand All @@ -73,4 +75,7 @@ spec:
- name: vol
persistentVolumeClaim:
claimName: kbench-pvc
- name: fio-custom-config
configMap:
name: fio-custom-config
backoffLimit: 0
14 changes: 11 additions & 3 deletions fio/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
set -e

CURRENT_DIR="$(dirname "$(readlink -f "$0")")"
CONFIG_DIR="/etc/fio-custom-config"

if [ "$(ls -A "$CONFIG_DIR" 2>/dev/null)" ]; then
echo "Custom config files found in: $CONFIG_DIR"
else
CONFIG_DIR="$CURRENT_DIR"
echo "No files found, CONFIG_DIR is now set to default: $CONFIG_DIR"
fi

TEST_FILE=$1

Expand Down Expand Up @@ -150,19 +158,19 @@ keep_running="true"
while [ "$keep_running" == "true" ]; do
if [ -n "$IOPS_FIO" ]; then
echo Benchmarking $IOPS_FIO into $OUTPUT_IOPS
fio $CURRENT_DIR/$IOPS_FIO $IDLE_PROF --filename=$TEST_FILE --size=$TEST_SIZE \
fio $CONFIG_DIR/$IOPS_FIO $IDLE_PROF --filename=$TEST_FILE --size=$TEST_SIZE \
--output-format=json --output=$TEMP $rate_iops_flag $rate_flag
mv $TEMP $OUTPUT_IOPS
fi
if [ -n "$BW_FIO" ]; then
echo Benchmarking $BW_FIO into $OUTPUT_BW
fio $CURRENT_DIR/$BW_FIO $IDLE_PROF --filename=$TEST_FILE --size=$TEST_SIZE \
fio $CONFIG_DIR/$BW_FIO $IDLE_PROF --filename=$TEST_FILE --size=$TEST_SIZE \
--output-format=json --output=$TEMP $rate_iops_flag $rate_flag
mv $TEMP $OUTPUT_BW
fi
if [ -n "$LAT_FIO" ]; then
echo Benchmarking $LAT_FIO into $OUTPUT_LAT
fio $CURRENT_DIR/$LAT_FIO $IDLE_PROF --filename=$TEST_FILE --size=$TEST_SIZE \
fio $CONFIG_DIR/$LAT_FIO $IDLE_PROF --filename=$TEST_FILE --size=$TEST_SIZE \
--output-format=json --output=$TEMP $rate_iops_flag $rate_flag
mv $TEMP $OUTPUT_LAT
fi
Expand Down

0 comments on commit f33d1a8

Please sign in to comment.