Skip to content

Commit f99b245

Browse files
ebattatcursoragent
andauthored
Update Workloads Fedora versions (#1179)
* Use fedora37 container disk for benchmark-operator workloads Update fedora container disk selection to use fedora37 for benchmark-operator workloads (stressng, hammerdb, uperf) and fedora39 for all other workloads. This ensures compatibility with benchmark-wrapper dependencies. Changes: - Add dynamic fedora_container_disk logic in environment_variables.py based on workload namespace - Update golden_files.py to set correct container disk during YAML generation - Update uperf_vm_template.yaml to use fedora_container_disk variable - Regenerate golden files with correct fedora37/fedora39 container disk images Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add Build Fedora for benchmark-operator guide Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 62bf292 commit f99b245

File tree

37 files changed

+293
-51
lines changed

37 files changed

+293
-51
lines changed

benchmark_runner/common/oc/oc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,12 +1353,11 @@ def _build_virtctl_cmds(self, vm_name: str, namespace: str):
13531353
Returns a tuple of (virtctl_cmd, check_cmd) for the given VM and namespace,
13541354
depending on the virtctl version.
13551355
"""
1356-
base = f"virtctl ssh --local-ssh=true --local-ssh-opts='-o BatchMode=yes' " \
1357-
f"--local-ssh-opts='-o PasswordAuthentication=no' --local-ssh-opts='-o ConnectTimeout=2'"
1356+
base = "virtctl ssh --local-ssh-opts='-o BatchMode=yes' --local-ssh-opts='-o PasswordAuthentication=no' --local-ssh-opts='-o ConnectTimeout=2' --local-ssh-opts='-o StrictHostKeyChecking=no' --local-ssh-opts='-o UserKnownHostsFile=/dev/null'"
13581357

13591358
if self.is_virtctl_ge(min_version="1.6.0"):
13601359
virtctl_cmd = f"{base} root@vm/{vm_name}/{namespace}"
1361-
check_cmd = f"{virtctl_cmd} 2>&1 | egrep 'denied|verification failed' && echo True || echo False"
1360+
check_cmd = f"{virtctl_cmd} 2>&1 | egrep -qi 'permission denied|denied|verification failed' && echo True || echo False"
13621361
else:
13631362
virtctl_cmd = f"{base} root@{vm_name} -n {namespace}"
13641363
check_cmd = f"{virtctl_cmd} 2>&1 | egrep 'denied|verification failed' && echo True || echo False"

benchmark_runner/common/template_operations/templates/uperf/internal_data/uperf_vm_template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ spec:
7171
sockets: {{ sockets }}
7272
cores: {{ cores }}
7373
threads: 1
74-
image: quay.io/ebattat/fedora37-container-disk:latest
74+
image: {{ fedora_container_disk }}
7575
limits:
7676
memory: {{ limits_memory }}
7777
requests:

benchmark_runner/grafana/perf/jsonnet/main.libsonnet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4845,7 +4845,7 @@ g.dashboard.new('PerfCI-Regression-Summary')
48454845
+ g.panel.row.withId(176)
48464846

48474847
+ g.panel.row.withPanels([
4848-
g.panel.stateTimeline.new('240 Fedora37 VMs(Sec)')
4848+
g.panel.stateTimeline.new('240 Fedora43 VMs(Sec)')
48494849
+ stateTimeline.queryOptions.withDatasource('Elasticsearch-bootstorm-results')
48504850
+ g.panel.stateTimeline.withDescription('Time till VM Login - Lower is better')
48514851

@@ -5124,7 +5124,7 @@ g.dashboard.new('PerfCI-Regression-Summary')
51245124

51255125
////////////////////////
51265126

5127-
g.panel.stateTimeline.new('240 Fedora37 VM Memory')
5127+
g.panel.stateTimeline.new('240 Fedora43 VM Memory')
51285128
+ stateTimeline.queryOptions.withDatasource('Elasticsearch-bootstorm-results')
51295129
+ g.panel.stateTimeline.withDescription('Time till VM Login - Lower is better')
51305130

benchmark_runner/main/environment_variables.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def __init__(self):
8484
# prometheus snap interval
8585
self._environment_variables_dict['prometheus_snap_interval'] = EnvironmentVariables.get_env('PROMETHEUS_SNAP_INTERVAL', '30')
8686

87-
# based on: quay.io/openshift-cnv/qe-cnv-tests-fedora:39
88-
self._environment_variables_dict['fedora_container_disk'] = EnvironmentVariables.get_env('FEDORA_CONTAINER_DISK','quay.io/benchmark-runner/fedora39-container-disk:latest')
87+
self._environment_variables_dict['fedora_container_disk'] = EnvironmentVariables.get_env(
88+
'FEDORA_CONTAINER_DISK', 'quay.io/benchmark-runner/fedora-containerdisk:43')
8989
# windows url
9090
self._environment_variables_dict['windows_url'] = EnvironmentVariables.get_env('WINDOWS_URL', '')
9191
# Delete all resources before and after the run, default True
@@ -132,11 +132,11 @@ def __init__(self):
132132
'postgres': 13,
133133
'mariadb': 10.5,
134134
'db_vm_os_version': 'centos-stream9',
135-
'vm_os_version': 'fedora39',
135+
'vm_os_version': 'fedora43',
136136
'hammerdb': 4.0
137137
}
138138

139-
# Update namespace
139+
# Set namespace based on workload
140140
base_workload = self._environment_variables_dict['workload'].split('_')[0]
141141
if EnvironmentVariables.get_env('NAMESPACE'):
142142
self._environment_variables_dict['namespace'] = EnvironmentVariables.get_env('NAMESPACE')
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
# Build Fedora for benchmark-operator
2+
3+
## Download Fedora VM
4+
5+
### Install the following
6+
7+
```bash
8+
dnf -y update
9+
dnf install -y python3-pip git redis wget podman
10+
dnf -y install @virt
11+
sudo dnf install -y /usr/bin/virt-customize
12+
dnf install -y qemu-kvm libvirt libguestfs-tools virt-install virt-top
13+
systemctl enable --now libvirtd
14+
```
15+
16+
### Download qcow2 Fedora image
17+
18+
https://fedoraproject.org/cloud/download/
19+
20+
## Update password using guestfish for qcow2 (pass: fedora)
21+
22+
```bash
23+
sudo guestfish --rw -a Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2
24+
run
25+
list-filesystems
26+
# Find the one with root
27+
mount /dev/sda5 /
28+
ls /
29+
```
30+
31+
Create password hash (run in Linux terminal):
32+
33+
```bash
34+
openssl passwd -1 fedora
35+
```
36+
37+
In guestfish, edit shadow:
38+
39+
```bash
40+
vi /root/etc/shadow
41+
# Change user root line to use the hash, e.g.:
42+
# root:$1$3hZtZC4X$.oTYM300EkNra8pqYh3T.1::0:99999:7:::
43+
```
44+
45+
Edit SSH config to allow root login:
46+
47+
```bash
48+
vi /root/etc/ssh/sshd_config
49+
# Set: PermitRootLogin yes
50+
exit
51+
```
52+
53+
## Run Fedora VM
54+
55+
```bash
56+
virt-install --name fedora43 --memory 16384 --vcpus 4 --disk Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2 --import --os-variant fedora41
57+
```
58+
59+
## Connect to Fedora VM
60+
61+
```bash
62+
virsh net-dhcp-leases default
63+
ssh root@192.168.122.114
64+
```
65+
66+
### Add user fedora
67+
68+
```bash
69+
sudo useradd -m fedora
70+
sudo passwd fedora
71+
```
72+
73+
## Install Python 3.11.2 inside Fedora VM
74+
75+
Benchmark-operator requires Python 3.11.2. The following instructions explain how to install it on a fresh Fedora VM.
76+
77+
### 1. Install required system packages
78+
79+
These are needed to build Python from source:
80+
81+
```bash
82+
sudo dnf update -y
83+
sudo dnf install -y \
84+
gcc make patch bzip2 bzip2-devel zlib-devel \
85+
xz-devel libffi-devel readline-devel sqlite-devel \
86+
openssl-devel wget curl python3-pip python3.11-setuptools git redis podman
87+
```
88+
89+
### 2. Install pyenv
90+
91+
Install pyenv for your current user:
92+
93+
```bash
94+
curl https://pyenv.run | bash
95+
```
96+
97+
### 3. Configure your shell
98+
99+
Add the following to `~/.bashrc` (or `~/.bash_profile` for login shells):
100+
101+
```bash
102+
# pyenv setup
103+
export PYENV_ROOT="$HOME/.pyenv"
104+
export PATH="$PYENV_ROOT/bin:$PATH"
105+
eval "$(pyenv init --path)" # for login shells
106+
eval "$(pyenv init -)" # for interactive shells
107+
eval "$(pyenv virtualenv-init -)" # optional if using pyenv-virtualenv
108+
```
109+
110+
Reload your shell:
111+
112+
```bash
113+
source ~/.bashrc
114+
```
115+
116+
Check pyenv is working:
117+
118+
```bash
119+
pyenv --version
120+
```
121+
122+
### 4. Install Python 3.11.2
123+
124+
Install the desired Python version:
125+
126+
```bash
127+
pyenv install 3.11.2
128+
```
129+
130+
Check the installed versions:
131+
132+
```bash
133+
pyenv versions
134+
```
135+
136+
### 5. Set Python 3.11.2 as global
137+
138+
Make Python 3.11.2 your default for the user:
139+
140+
```bash
141+
pyenv global 3.11.2
142+
```
143+
144+
Verify:
145+
146+
```bash
147+
python --version
148+
# should show Python 3.11.2
149+
which python
150+
# should show ~/.pyenv/shims/python
151+
```
152+
153+
### Use a specific Python version in a project folder
154+
155+
```bash
156+
cd /path/to/project
157+
pyenv local 3.11.2
158+
python --version # Python 3.11.2 only in this folder
159+
```
160+
161+
Set default python for application:
162+
163+
```bash
164+
sudo alternatives --install /usr/bin/python python /usr/bin/python3.14 10
165+
sudo alternatives --install /usr/bin/python python /root/.pyenv/versions/3.11.2/bin/python 20
166+
sudo alternatives --config python
167+
```
168+
169+
### Install Python 3.11.2 from source (altinstall)
170+
171+
```bash
172+
# Install build dependencies
173+
sudo dnf groupinstall "Development Tools" -y
174+
sudo dnf install gcc bzip2 bzip2-devel libffi-devel zlib-devel xz-devel wget make -y
175+
176+
# Download Python 3.11.2
177+
cd /usr/src
178+
sudo wget https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tgz
179+
sudo tar xzf Python-3.11.2.tgz
180+
cd Python-3.11.2
181+
182+
# Build and install in /usr/local
183+
sudo ./configure --enable-optimizations --prefix=/usr/local
184+
sudo make -j$(nproc)
185+
sudo make altinstall # altinstall avoids overwriting system python3
186+
```
187+
188+
## Install benchmark-wrapper and verify
189+
190+
```bash
191+
pip install git+https://github.com/cloud-bulldozer/benchmark-wrapper
192+
```
193+
194+
Verify:
195+
196+
```bash
197+
run_snafu
198+
```
199+
200+
Expected output:
201+
202+
```
203+
usage: run_snafu [-v] [--config CONFIG] -t TOOL [--run-id [RUN_ID]] [--archive-file ARCHIVE_FILE] [--create-archive]
204+
run_snafu: error: the following arguments are required: -t/--tool
205+
```
206+
207+
Seeing this message confirms the installation succeeded.
208+
209+
## Build container disk
210+
211+
### Create Dockerfile
212+
213+
```bash
214+
cat > Dockerfile << 'EOF'
215+
FROM registry.access.redhat.com/ubi8/ubi:latest AS builder
216+
ADD --chown=107:107 Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2 /disk/
217+
RUN chmod 0440 /disk/*
218+
219+
FROM scratch
220+
COPY --from=builder /disk/* /disk/
221+
EOF
222+
```
223+
224+
### Build and push the updated qcow2 image
225+
226+
```bash
227+
podman build -t quay.io/benchmark-runner/fedora-container-disks:43 . --no-cache
228+
podman push quay.io/benchmark-runner/fedora-container-disks:43
229+
```
230+
231+
## Stop / destroy KVM
232+
233+
```bash
234+
virsh list --all
235+
# stop
236+
virsh destroy fedora43
237+
# shutdown / start
238+
virsh shutdown fedora43
239+
virsh start fedora43
240+
# delete
241+
virsh undefine fedora43 --remove-all-storage
242+
```

docs/source/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ prometheus
3737
customworkload
3838
develop
3939
scaleVM
40+
build_fedora_benchmark_operator
4041
```

tests/unittest/benchmark_runner/common/template_operations/golden_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def __init__(self):
3131
'hammerdb_pod_postgres', 'hammerdb_vm_postgres', 'hammerdb_kata_postgres',
3232
'hammerdb_pod_mssql', 'hammerdb_vm_mssql', 'hammerdb_kata_mssql',
3333
'vdbench_pod', 'vdbench_kata', 'vdbench_vm', 'bootstorm_vm', 'windows_vm', 'winmssql_vm']
34-
3534
def __clear_directory_yaml(self, dir):
3635
if os.path.isdir(dir):
3736
for file in os.listdir(dir):
@@ -65,6 +64,7 @@ def __generate_golden_yaml_files__(self, dest: str=None):
6564
for run_type in environment_variables.run_types_list:
6665
environment_variables.environment_variables_dict['run_type'] = run_type
6766
for workload in environment_variables.workloads_list:
67+
environment_variables.environment_variables_dict['fedora_container_disk'] = 'quay.io/benchmark-runner/fedora-container-disk:43'
6868
environment_variables.environment_variables_dict['namespace'] = environment_variables.get_workload_namespace(workload)
6969
template = TemplateOperations(workload)
7070
srcdir = template.get_current_run_path()

tests/unittest/benchmark_runner/common/template_operations/golden_files/chaos_ci_bootstorm_vm_ODF_PVC_False/bootstorm_vm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
terminationGracePeriodSeconds: 180
3737
volumes:
3838
- containerDisk:
39-
image: quay.io/benchmark-runner/fedora39-container-disk:latest
39+
image: quay.io/benchmark-runner/fedora-container-disk:43
4040
name: containerdisk
4141
- cloudInitNoCloud:
4242
userData: |-

tests/unittest/benchmark_runner/common/template_operations/golden_files/chaos_ci_bootstorm_vm_ODF_PVC_True/bootstorm_vm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
terminationGracePeriodSeconds: 180
3737
volumes:
3838
- containerDisk:
39-
image: quay.io/benchmark-runner/fedora39-container-disk:latest
39+
image: quay.io/benchmark-runner/fedora-container-disk:43
4040
name: containerdisk
4141
- cloudInitNoCloud:
4242
userData: |-

tests/unittest/benchmark_runner/common/template_operations/golden_files/chaos_ci_stressng_vm_ODF_PVC_False/stressng_vm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
sockets: 2
4141
cores: 1
4242
threads: 1
43-
image: quay.io/benchmark-runner/fedora39-container-disk:latest
43+
image: quay.io/benchmark-runner/fedora-container-disk:43
4444
limits:
4545
memory: 1Gi
4646
requests:

0 commit comments

Comments
 (0)