Skip to content

Commit 24be067

Browse files
andyz422copybara-github
authored andcommitted
Fix fio_object_storage filenames to refer to prefilled filenames. Also install blobfuse2 via git (and pin to 2.5.0).
PiperOrigin-RevId: 829638249
1 parent df9e9d8 commit 24be067

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

perfkitbenchmarker/linux_benchmarks/fio/fio_object_storage_benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from perfkitbenchmarker.linux_benchmarks.fio import constants
2020
from perfkitbenchmarker.linux_benchmarks.fio import flags as fio_flags
2121
from perfkitbenchmarker.linux_benchmarks.fio import utils
22-
from perfkitbenchmarker.linux_packages import fio
2322

2423

2524
FLAGS = flags.FLAGS
@@ -57,7 +56,7 @@ def GetConfig(user_config):
5756
def Prepare(spec: benchmark_spec.BenchmarkSpec):
5857
vm = spec.vms[0]
5958
vm.Install('fio')
60-
utils.PrefillIfEnabled(vm, fio.GetFioExec(), use_directory=True)
59+
utils.PrefillIfEnabled(vm, constants.FIO_PATH, use_directory=True)
6160

6261

6362
def Run(spec: benchmark_spec.BenchmarkSpec) -> list[sample.Sample]:

perfkitbenchmarker/linux_benchmarks/fio/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ def GetFilename(disks, device_path=None):
6464
else:
6565
# Since we pass --directory to fio, we must use relative file
6666
# paths or get an error.
67-
filename_base = f'{_FILENAME_PREFIX}.'
67+
# TODO(andytzhu): Support multiple numjobs.
68+
filename_base = f'{_FILENAME_PREFIX}.0'
6869
filenames = []
6970
for filenum in range(fio_flags.FIO_NR_FILES.value):
70-
filenames.append(f'{filename_base}{filenum}')
71+
filenames.append(f'{filename_base}.{filenum}')
7172
filename = ':'.join(filenames)
7273

7374
return filename
@@ -194,6 +195,8 @@ def FillDevice(vm, disk, fill_size, exec_path, use_directory=False):
194195
'--create_on_open=1'
195196
)
196197
vm.RobustRemoteCommand(command)
198+
# Clear the OS page cache
199+
vm.RobustRemoteCommand('sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"')
197200

198201

199202
def PrefillIfEnabled(vm, exec_path, use_directory=False):

perfkitbenchmarker/linux_packages/blobfuse2.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@
1313
# limitations under the License.
1414
"""Module for installing the Blobfuse2 package."""
1515

16-
from perfkitbenchmarker import os_types
1716

18-
19-
_UBUNTU24_PACKAGE_REPO = 'https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb'
17+
_BLOBFUSE2_REPO_URL = 'https://github.com/Azure/azure-storage-fuse.git'
18+
_BLOBFUSE2_REPO_NAME = 'azure-storage-fuse'
19+
_BLOBFUSE2_VERSION = 'blobfuse2-2.5.0'
2020

2121

2222
def AptInstall(vm):
2323
"""Installs Blobfuse2 on the VM."""
24-
if vm.OS_TYPE != os_types.UBUNTU2404:
25-
raise NotImplementedError(
26-
'Only installation of Blobfuse2 on Ubuntu 24.04 is supported.'
27-
)
28-
vm.InstallPackages('wget')
29-
vm.RemoteCommand(f'sudo wget {_UBUNTU24_PACKAGE_REPO}')
30-
vm.RemoteCommand('sudo dpkg -i packages-microsoft-prod.deb')
31-
vm.InstallPackages('libfuse3-dev fuse3 blobfuse2')
24+
vm.InstallPackages('golang-go libfuse3-dev fuse3')
25+
vm.RemoteCommand(f'git clone {_BLOBFUSE2_REPO_URL}')
26+
vm.RemoteCommand(
27+
f'cd {_BLOBFUSE2_REPO_NAME} && git checkout {_BLOBFUSE2_VERSION} &&'
28+
' ./build.sh'
29+
)
30+
vm.RemoteCommand(
31+
f'sudo cp {_BLOBFUSE2_REPO_NAME}/blobfuse2 /usr/local/bin/'
32+
)

tests/fio_util_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def testGetFilenameForDisk(self):
4141

4242
@flagsaver.flagsaver(fio_target_mode='against_file_with_fill')
4343
def testGetFilenameForDiskWorFile(self):
44-
self.assertEqual(utils.GetFilename(self.disks), 'fill-device.0')
44+
self.assertEqual(utils.GetFilename(self.disks), 'fill-device.0.0')
4545

4646
def testGetAllDiskPaths(self):
4747
test_disk = self.disks[0]

0 commit comments

Comments
 (0)