Merge pull request #60383 from nickitat/upd_liburing

Enable testing with `io_uring` back
This commit is contained in:
Mikhail f. Shiryaev 2024-03-05 15:26:35 +01:00 committed by GitHub
commit ec72800d78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 12 additions and 23 deletions

View File

@ -42,6 +42,7 @@ def get_run_command(
f"{ci_logs_args}"
f"--volume={result_path}:/test_output "
f"--volume={server_log_path}:/var/log/clickhouse-server "
"--security-opt seccomp=unconfined " # required to issue io_uring sys-calls
f"--cap-add=SYS_PTRACE {env_str} {image}"
)

View File

@ -37,9 +37,10 @@ def get_fasttest_cmd(
) -> str:
return (
f"docker run --cap-add=SYS_PTRACE --user={os.geteuid()}:{os.getegid()} "
"--security-opt seccomp=unconfined " # required to issue io_uring sys-calls
"--network=host " # required to get access to IAM credentials
f"-e FASTTEST_WORKSPACE=/fasttest-workspace -e FASTTEST_OUTPUT=/test_output "
f"-e FASTTEST_SOURCE=/ClickHouse --cap-add=SYS_PTRACE "
f"-e FASTTEST_SOURCE=/ClickHouse "
f"-e FASTTEST_CMAKE_FLAGS='-DCOMPILER_CACHE=sccache' "
f"-e PULL_REQUEST_NUMBER={pr_number} -e COMMIT_SHA={commit_sha} "
f"-e COPY_CLICKHOUSE_BINARY_TO_OUTPUT=1 "

View File

@ -107,6 +107,7 @@ def get_run_command(
f"{volume_with_broken_test}"
f"--volume={result_path}:/test_output "
f"--volume={server_log_path}:/var/log/clickhouse-server "
"--security-opt seccomp=unconfined " # required to issue io_uring sys-calls
f"--cap-add=SYS_PTRACE {env_str} {additional_options_str} {image}"
)

View File

@ -81,6 +81,7 @@ def get_run_command(
f"--volume={fuzzers_path}:/fuzzers "
f"--volume={repo_path}/tests:/usr/share/clickhouse-test "
f"--volume={result_path}:/test_output "
"--security-opt seccomp=unconfined " # required to issue io_uring sys-calls
f"--cap-add=SYS_PTRACE {env_str} {additional_options_str} {image}"
)

View File

@ -42,6 +42,7 @@ def get_run_command(
f"--volume={repo_tests_path}:/clickhouse-tests "
f"--volume={result_path}:/test_output "
f"--volume={server_log_path}:/var/log/clickhouse-server "
"--security-opt seccomp=unconfined " # required to issue io_uring sys-calls
f"--cap-add=SYS_PTRACE {image}"
)

View File

@ -176,6 +176,7 @@ def main():
run_command = (
f"docker run --cap-add=SYS_PTRACE --volume={tests_binary}:/unit_tests_dbms "
"--security-opt seccomp=unconfined " # required to issue io_uring sys-calls
f"--volume={test_output}:/test_output {docker_image}"
)

View File

@ -13,6 +13,7 @@ import sys
import os
import os.path
import glob
import platform
import signal
import re
import copy
@ -573,27 +574,6 @@ def get_localzone():
return os.getenv("TZ", "/".join(os.readlink("/etc/localtime").split("/")[-2:]))
def supports_io_uring():
return not subprocess.call(
[
args.binary,
"-q",
"select * from file('/dev/null', 'LineAsString')",
"--storage_file_read_method",
"io_uring",
],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
def get_local_filesystem_methods():
methods = ["read", "pread", "mmap", "pread_threadpool"]
if supports_io_uring():
methods.append("io_uring")
return methods
class SettingsRandomizer:
settings = {
"max_insert_threads": lambda: 0
@ -634,7 +614,10 @@ class SettingsRandomizer:
0.2, 0.5, 1, 10 * 1024 * 1024 * 1024
),
"local_filesystem_read_method": lambda: random.choice(
get_local_filesystem_methods()
# Allow to use uring only when running on Linux
["read", "pread", "mmap", "pread_threadpool", "io_uring"]
if platform.system().lower() == "linux"
else ["read", "pread", "mmap", "pread_threadpool"]
),
"remote_filesystem_read_method": lambda: random.choice(["read", "threadpool"]),
"local_filesystem_read_prefetch": lambda: random.randint(0, 1),