Skip to content

Commit 2ca7438

Browse files
authored
Merge pull request #17 from redhat-performance/documenation
Add documenation and make sure runs without options.
2 parents b8665bb + 7700599 commit 2ca7438

2 files changed

Lines changed: 162 additions & 3 deletions

File tree

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Automation wrapper for fio
2+
3+
Description:
4+
Fio spawns a number of threads or processes doing a particular type
5+
of I/O action as specified by the user. fio takes a number of global
6+
parameters, each inherited by the thread unless other parameters
7+
provided for that thread overrides the global settings. The typical use of
8+
fio is to write a job file matching the I/O load one wants to simulate.
9+
10+
Location of underlying workload: https://fio.readthedocs.io/en/latest/fio_doc.html
11+
benchmark loaded via dnf
12+
13+
Packages required: gcc,numactl,python3,bc,fio
14+
15+
To run:
16+
```
17+
[root@hawkeye ~]# git clone https://github.com/redhat-performance/fio-wrapper
18+
[root@hawkeye ~]# fio-wrapper/fio/fio_run
19+
```
20+
21+
Defaults for the script are the following:
22+
```
23+
devices: No default, if not provided will be prompted
24+
run time: 120 seconds
25+
test type: read and write
26+
ioengine: libaio
27+
jobs min: 1
28+
jobs max: # numa nodes
29+
block size: 4k and 1024k
30+
io depth: 1 2 4 8 16 32
31+
32+
If regression option is selected, only one set of runs with all the disks.
33+
devices: No default, if not provided will be prompted
34+
run time: 120 seconds
35+
test type: read and write
36+
ioengine: libaio
37+
jobs min: 1
38+
jobs max: # numa nodes
39+
block size: 4k and 1024k
40+
io depth: 1 16 64
41+
```
42+
Options
43+
```
44+
Usage: fio-wrapper/fio/fio_run
45+
--block_size: comma separated lists of block sizes to use
46+
--disk_size: size in M, use this as the size of the disk instead of lsblk
47+
--disks: comma separated list of disks to use.
48+
--ioengine: comma separated list of ioengines to use
49+
--iodepth_list: how many ios are allowed outstanding
50+
--jobs_list: comma separated list of jobs, overrides jobs max and jobs_min, numa_node means use
51+
number of numa nodes or 2, which ever is greater
52+
--jobs_max: maximum number of jobs to run
53+
--jobs_min: minimum number of jobs to run
54+
--max_disks: maximum number of disks to run with
55+
--max_disks_only: Perform the run only with maximum disks
56+
--pbench_samples: number of times pbench is to run each data point, default is 5
57+
--regression: regression run
58+
--runtime: run for the designated period, 60 seconds is the default
59+
--test_type: type of io doing.
60+
--use_pbench_version: Instead of running the wrappers version
61+
of fio, use pbench-fio when pbench is requested
62+
General options
63+
--home_parent <value>: Our parent home directory. If not set, defaults to current working directory.
64+
--host_config <value>: default is the current host name.
65+
--iterations <value>: Number of times to run the test, defaults to 1.
66+
--pbench: use pbench-user-benchmark and place information into pbench, defaults to do not use.
67+
--pbench_user <value>: user who started everything. Defaults to the current user.
68+
--pbench_copy: Copy the pbench data, not move it.
69+
--pbench_stats: What stats to gather. Defaults to all stats.
70+
--run_label: the label to associate with the pbench run. No default setting.
71+
--run_user: user that is actually running the test on the test system. Defaults to user running wrapper.
72+
--sys_type: Type of system working with, aws, azure, hostname. Defaults to hostname.
73+
--sysname: name of the system running, used in determining config files. Defaults to hostname.
74+
--tuned_setting: used in naming the tar file, default for RHEL is the current active tuned. For non
75+
RHEL systems, default is none.
76+
--usage: this usage message.
77+
```
78+
79+
Note: The script does not install pbench for you. You need to do that manually.

fio/fio_run

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,62 @@
2121
# Automate the exection of the fio workload.
2222

2323
arguments="$@"
24+
disk_options=""
25+
26+
provide_disks()
27+
{
28+
echo You need to designate disks, following are currently not mounted.
29+
tools_bin/grab_disks grab_disks
30+
cat disks
31+
echo "Enter comma separated list of devices to use: "
32+
read devices_to_use
33+
device_list=`echo $devices_to_use | sed "s/,/,\/dev\//g"`
34+
device_list=/dev/${device_list}
35+
disk_options="--disks ${device_list}"
36+
}
37+
38+
gen_args_back="$@"
39+
echo $1
40+
disks_found=0
41+
i=1
42+
j=$#
43+
while [ $i -le $j ]
44+
do
45+
#
46+
# Ansible causing problems again, getting passed }} for some reason from random workloads, filter it out.
47+
#
48+
case "$1" in
49+
--disks)
50+
disks_found=1
51+
break
52+
;;
53+
--usage)
54+
#
55+
# Do not need disks
56+
#
57+
disks_found=1
58+
break
59+
;;
60+
--)
61+
break
62+
;;
63+
*)
64+
i=$((i + 1))
65+
shift 1
66+
;;
67+
esac
68+
done
69+
70+
if [ $disks_found -eq 0 ]; then
71+
provide_disks
72+
fi
73+
74+
set -- ${gen_args_back}
2475

2576
source ~/.bashrc
2677

2778
curdir=`pwd`
79+
2880
if [[ $0 == "./"* ]]; then
2981
chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'`
3082
if [[ $chars == 1 ]]; then
@@ -33,9 +85,15 @@ if [[ $0 == "./"* ]]; then
3385
run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-`
3486
run_dir="${curdir}${run_dir}"
3587
fi
88+
elif [[ $0 != "/"* ]]; then
89+
dir=`echo $0 | rev | cut -d'/' -f2- | rev`
90+
run_dir="${curdir}/${dir}"
3691
else
3792
chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'`
3893
run_dir=`echo $0 | cut -d'/' -f 1-${chars}`
94+
if [[ $run_dir != "/"* ]]; then
95+
run_dir=${curdir}/${run_dir}
96+
fi
3997
fi
4098

4199
os_info=`uname -a`
@@ -55,7 +113,7 @@ jobs_max=""
55113
jobs_min="1"
56114
tested=0
57115
run_time=120
58-
disks_passed="grab_disks"
116+
disks_passed=""
59117
tuning_info=""
60118
disks=""
61119
numb_disks=0
@@ -87,8 +145,7 @@ RESULTSDIR=""
87145
target_count=0
88146

89147
if [ ! -f "/tmp/${test_name}.out" ]; then
90-
command="${0} $@"
91-
echo $command
148+
command="${0} $@ ${disk_options}"
92149
$command &> /tmp/${test_name}.out
93150
rtc=$?
94151
if [ -f /tmp/${test_name}.out ]; then
@@ -426,6 +483,9 @@ setup_run_information()
426483
io_engine_list=`echo $ioengine | sed "s/,/ /g"`
427484
}
428485

486+
487+
arguments="$@"
488+
429489
#
430490
# Retrieve the disks to use.
431491
#
@@ -992,6 +1052,25 @@ while [[ $# -gt 0 ]]; do
9921052
;;
9931053
esac
9941054
done
1055+
#
1056+
# Verify device info.
1057+
#
1058+
if [ $file_count -eq 0 ]; then
1059+
#
1060+
# Using disks
1061+
#
1062+
if [[ $disks_passed != "grab_disks" ]]; then
1063+
device_list=`echo $disks_passed | sed "s/,/ /g"`
1064+
for item in $device_list; do
1065+
value=`file $item`
1066+
echo $value | grep "block special" > /dev/null
1067+
if [ $? -ne 0 ]; then
1068+
exit_out "Error: $item is not a block device" 1
1069+
fi
1070+
done
1071+
fi
1072+
fi
1073+
9951074
#
9961075
# One results dir for the entire run. Only create when $to_pbench is
9971076
# 0. The directory will get created when we call back in.
@@ -1008,6 +1087,7 @@ iodepth_list=`echo $iodepth_list | sed "s/,/ /g"`
10081087

10091088
obtain_disks
10101089

1090+
10111091
if [[ $ct_disk_size == "undef" ]]; then
10121092
disk_temp=`mktemp /tmp/confg.XXXXX`
10131093
disk_temp1=`mktemp /tmp/confg.XXXXX`

0 commit comments

Comments
 (0)