Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-15136 client: Switch to using libfused #14077

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
df7aadc
DAOS-15136 client: Switch to using libfused
jolivier23 Mar 27, 2024
7bf9fb8
Merge branch 'master' into jvolivie/fused
jolivier23 Mar 28, 2024
20bf3b6
PR-repos: fused@1:28
jolivier23 Mar 28, 2024
1cff4e9
Fix whitespace issue
jolivier23 Mar 28, 2024
cb44999
Merge branch 'master' into jvolivie/fused
jolivier23 Apr 5, 2024
28e8479
PR-repos: fused@PR-1:28
jolivier23 Apr 5, 2024
1a37b21
fix bad merge
jolivier23 Apr 25, 2024
ef30117
Merge branch 'master' into jvolivie/fused
jolivier23 Apr 25, 2024
22ac591
PR-repos: fused@PR-1:29
jolivier23 Apr 25, 2024
926f43a
DAOS-15753 dfuse: Do not deadlock when failing to mount.
ashleypittman Apr 25, 2024
2a8ff90
PR-repos: fused@PR-1:29
jolivier23 Apr 25, 2024
e5fbffa
Merge branch 'master' into jvolivie/fused
jolivier23 Dec 20, 2024
e991acb
Empty commit for pragmas
jolivier23 Dec 20, 2024
18b1e5e
Remove the sed
jolivier23 Dec 20, 2024
a397c1e
Fix a few more issues
jolivier23 Dec 20, 2024
dc5d340
Features: dfuse
jolivier23 Dec 20, 2024
85041ed
Clean up rpm dependencies
jolivier23 Dec 20, 2024
0ed4c7c
empty commit for test
jolivier23 Dec 20, 2024
4b266cf
Add back valgrind testing
jolivier23 Dec 20, 2024
3f3a397
fix typo
jolivier23 Dec 20, 2024
515b136
Try again
jolivier23 Dec 21, 2024
7585023
Add missing FUSE_CAP for printing
jolivier23 Dec 21, 2024
45a2e77
Merge branch 'master' into jvolivie/fused
jolivier23 Dec 21, 2024
c1082d5
Merge branch 'master' into jvolivie/fused
jolivier23 Dec 23, 2024
7ba97a2
Merge branch 'master' into jvolivie/fused
jolivier23 Dec 26, 2024
6fd013c
Merge master again now that jenkins is back
jolivier23 Dec 26, 2024
53e307a
Merge branch 'master' into jvolivie/fused
jolivier23 Jan 7, 2025
c3c65a9
Test again
jolivier23 Jan 7, 2025
3a98c97
Merge branch 'master' into jvolivie/fused
jolivier23 Jan 8, 2025
f0002f9
Features: dfuse
jolivier23 Jan 8, 2025
fad1a2d
empty commit to retest
jolivier23 Jan 9, 2025
5752261
Use static library
jolivier23 Jan 11, 2025
02e8a79
Empty commit to retest
jolivier23 Jan 12, 2025
3487bc6
Try again to see if it picks up #4
jolivier23 Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
daos (2.7.101-3) unstable; urgency=medium
[ Jeff Olivier ]
* Switch from libfuse3 to libfused

-- Jeff Olivier <jeffolivier@google.com> Thu, 19 Dec 2024 20:15:00 +0000

daos (2.7.101-2) unstable; urgency=medium
[ Denis Barakhtanov ]
* Add pydaos.torch module to daos-client package
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Build-Depends: debhelper (>= 10),
python3-distro,
libabt-dev (>= 1.2),
libpmemobj-dev (>= 2.1.0),
libfuse3-dev,
libfused-dev,
libprotobuf-c-dev,
libjson-c-dev,
dpdk-dev (>= 21.11.2),
Expand Down
12 changes: 12 additions & 0 deletions site_scons/components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2016-2024 Intel Corporation
# Copyright 2025 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -307,6 +308,17 @@ def define_components(reqs):
required_progs=['libtoolize', 'ninja', 'meson'],
out_of_src_build=True)

reqs.define('fused', libs=['fused'], defines=['FUSE_USE_VERSION=35'],
retriever=GitRepoRetriever(),
commands=[['meson', 'setup', '--prefix=$FUSED_PREFIX', '-Ddisable-mtab=True',
'-Dudevrulesdir=$FUSED_PREFIX/udev', '-Dutils=False',
'--default-library', 'static', '../fused'],
['meson', 'setup', '--reconfigure', '../fused'],
['ninja', 'install']],
headers=['fused/fuse.h'],
required_progs=['libtoolize', 'ninja', 'meson'],
out_of_src_build=True)

# Tell SPDK which CPU to optimize for, by default this is native which works well unless you
# are relocating binaries across systems, for example in CI under GitHub actions etc. There
# isn't a minimum value needed here, but getting this wrong will cause daos server to exit
Expand Down
3 changes: 1 addition & 2 deletions site_scons/prereq_tools/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2024 Intel Corporation

Check failure on line 1 in site_scons/prereq_tools/base.py

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -461,7 +461,6 @@
opts.Add('USE_INSTALLED', 'Comma separated list of preinstalled dependencies', 'none')
opts.Add(('MPI_PKG', 'Specifies name of pkg-config to load for MPI', None))
opts.Add(BoolVariable('FIRMWARE_MGMT', 'Build in device firmware management.', False))
opts.Add(BoolVariable('STATIC_FUSE', "Build with static libfuse library", False))
opts.Add(EnumVariable('BUILD_TYPE', "Set the build type", 'release',
['dev', 'debug', 'release'], ignorecase=1))
opts.Add(EnumVariable('TARGET_TYPE', "Set the prerequisite type", 'default',
Expand Down Expand Up @@ -545,7 +544,7 @@
"""Build and dependencies"""
common_reqs = ['ofi', 'hwloc', 'mercury', 'boost', 'uuid', 'crypto', 'protobufc',
'lz4', 'isal', 'isal_crypto']
client_reqs = ['fuse', 'json-c', 'capstone', 'aio']
client_reqs = ['fused', 'json-c', 'capstone', 'aio']
server_reqs = ['argobots', 'pmdk', 'spdk', 'ipmctl']
test_reqs = ['cmocka']

Expand Down
34 changes: 5 additions & 29 deletions src/client/dfuse/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def check_ioctl_def(context, ctype):
context.Message(f'Checking if fuse ioctl is type {ctype} ')

# pylint: disable-next=consider-using-f-string
src = """#include <fuse3/fuse_lowlevel.h>
src = """#include <fused/fuse_lowlevel.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for working with various fuse versions, we should replace this with a simple version check.


extern void
my_ioctl (fuse_req_t req, fuse_ino_t ino, %s cmd,
Expand All @@ -178,31 +178,13 @@ def configure_fuse(cenv):

if check.CheckFuseIoctl('unsigned int'):
pass
elif check.CheckFuseIoctl('int'):
cenv.AppendUnique(CPPDEFINES={'FUSE_IOCTL_USE_INT': '1'})
else:
print('Could not determine type of fuse ioctl type')
print('Expected unsigned int ioctl type')
Exit(2)

check.Finish()


def find_static_fuse(cenv):
"""Find and copy static fuse library"""

fuse_prefix = '/usr'
if os.path.exists(cenv.subst('$FUSE_PREFIX')):
fuse_prefix = cenv.subst('$FUSE_PREFIX')

for path in ['lib64', 'lib/x86_64-linux-gnu', 'lib/aarch64-linux-gnu', 'lib']:
fuselib = os.path.join(fuse_prefix, path, "libfuse3.a")
if os.path.exists(fuselib):
return [File(fuselib)]

print("Could not find libfuse3.a")
return []


def scons():
"""Scons function"""

Expand Down Expand Up @@ -241,14 +223,8 @@ def scons():
cenv.AppendUnique(LIBS=['dfs', 'duns'])

cenv.require('hwloc')
if cenv.get('STATIC_FUSE'):
cenv.require('fuse', headers_only=True)
static_fuse = find_static_fuse(cenv)
extra_libs = ['dl']
else:
cenv.require('fuse')
static_fuse = []
extra_libs = ['dl']
cenv.require('fused')
extra_libs = ['dl']

configure_fuse(cenv)

Expand All @@ -258,7 +234,7 @@ def scons():
for src in OPS_SRC:
dfuse_obj += cenv.Object(os.path.join('ops', f'{src}.c'))
cenv.AppendUnique(LIBS=['gurt'] + extra_libs)
dfuse_bin = cenv.d_program('dfuse/dfuse', common + dfuse_obj + static_fuse)
dfuse_bin = cenv.d_program('dfuse/dfuse', common + dfuse_obj)

Default(dfuse_bin)

Expand Down
4 changes: 2 additions & 2 deletions src/client/dfuse/dfuse.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.

Check failure on line 2 in src/client/dfuse/dfuse.h

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand All @@ -9,8 +9,8 @@

#include <semaphore.h>

#include <fuse3/fuse.h>
#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse.h>
#include <fused/fuse_lowlevel.h>

#include <gurt/list.h>
#include <gurt/hash.h>
Expand Down
17 changes: 8 additions & 9 deletions src/client/dfuse/dfuse_fuseops.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* (C) Copyright 2016-2023 Intel Corporation.
* (C) Copyright 2016-2024 Intel Corporation.

Check failure on line 2 in src/client/dfuse/dfuse_fuseops.c

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/

#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse_lowlevel.h>

#include "dfuse_common.h"
#include "dfuse.h"
Expand Down Expand Up @@ -44,16 +44,15 @@
SHOW_FLAG(handle, cap, want, FUSE_CAP_PARALLEL_DIROPS);
SHOW_FLAG(handle, cap, want, FUSE_CAP_POSIX_ACL);
SHOW_FLAG(handle, cap, want, FUSE_CAP_HANDLE_KILLPRIV);

#ifdef FUSE_CAP_CACHE_SYMLINKS
SHOW_FLAG(handle, cap, want, FUSE_CAP_HANDLE_KILLPRIV_V2);
SHOW_FLAG(handle, cap, want, FUSE_CAP_CACHE_SYMLINKS);
#endif
#ifdef FUSE_CAP_NO_OPENDIR_SUPPORT
SHOW_FLAG(handle, cap, want, FUSE_CAP_NO_OPENDIR_SUPPORT);
#endif
#ifdef FUSE_CAP_EXPLICIT_INVAL_DATA
SHOW_FLAG(handle, cap, want, FUSE_CAP_EXPLICIT_INVAL_DATA);
#endif
SHOW_FLAG(handle, cap, want, FUSE_CAP_EXPIRE_ONLY);
SHOW_FLAG(handle, cap, want, FUSE_CAP_SETXATTR_EXT);
SHOW_FLAG(handle, cap, want, FUSE_CAP_DIRECT_IO_ALLOW_MMAP);
SHOW_FLAG(handle, cap, want, FUSE_CAP_PASSTHROUGH);
SHOW_FLAG(handle, cap, want, FUSE_CAP_NO_EXPORT_SUPPORT);

if (cap)
DFUSE_TRA_WARNING(handle, "Unknown capability flags %#x", cap);
Expand Down
4 changes: 2 additions & 2 deletions src/client/dfuse/dfuse_main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.

Check failure on line 2 in src/client/dfuse/dfuse_main.c

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand All @@ -8,8 +8,8 @@
#include <getopt.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <fuse3/fuse.h>
#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse.h>
#include <fused/fuse_lowlevel.h>
#include <string.h>

#include <sys/types.h>
Expand Down
4 changes: 2 additions & 2 deletions src/client/dfuse/dfuse_thread.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* (C) Copyright 2020-2023 Intel Corporation.
* (C) Copyright 2020-2024 Intel Corporation.

Check failure on line 2 in src/client/dfuse/dfuse_thread.c

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/

#include <pthread.h>

#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse_lowlevel.h>
#define D_LOGFAC DD_FAC(dfuse)
#include "dfuse.h"

Expand Down
5 changes: 2 additions & 3 deletions utils/build.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ component=daos

[commit_versions]
argobots=v1.2
fuse=fuse-3.16.2
fused=v1.0.0-rc3
pmdk=2.1.0
isal=v2.30.0
isal_crypto=v2.23.0
Expand All @@ -15,7 +15,7 @@ ucx=v1.14.1

[repos]
argobots=https://github.com/pmodels/argobots.git
fuse=https://github.com/libfuse/libfuse.git
fused=https://github.com/daos-stack/fused.git
pmdk=https://github.com/pmem/pmdk.git
isal=https://github.com/intel/isa-l.git
isal_crypto=https://github.com/intel/isa-l_crypto.git
Expand All @@ -27,7 +27,6 @@ ucx=https://github.com/openucx/ucx.git

[patch_versions]
spdk=https://github.com/spdk/spdk/commit/b0aba3fcd5aceceea530a702922153bc75664978.diff,https://github.com/spdk/spdk/commit/445a4c808badbad3942696ecf16fa60e8129a747.diff
fuse=https://github.com/libfuse/libfuse/commit/c9905341ea34ff9acbc11b3c53ba8bcea35eeed8.diff
mercury=https://raw.githubusercontent.com/daos-stack/mercury/f3dc286fb40ec1a3a38a2e17c45497bc2aa6290d/na_ucx.patch
pmdk=https://github.com/pmem/pmdk/commit/2abe15ac0b4eed894b6768cd82a3b0a7c4336284.diff
argobots=https://github.com/pmodels/argobots/pull/397/commits/411e5b344642ebc82190fd8b125db512e5b449d1.diff,https://github.com/pmodels/argobots/commit/bb0c908abfac4bfe37852eee621930634183c6aa.diff
17 changes: 5 additions & 12 deletions utils/rpms/daos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

Name: daos
Version: 2.7.101
Release: 3%{?relval}%{?dist}
Release: 4%{?relval}%{?dist}
Summary: DAOS Storage Engine

License: BSD-2-Clause-Patent
Expand Down Expand Up @@ -51,11 +51,7 @@ BuildRequires: libjson-c-devel
BuildRequires: boost-devel
%endif
BuildRequires: libpmemobj-devel >= 2.1.0
%if (0%{?rhel} >= 8)
BuildRequires: fuse3-devel >= 3
%else
BuildRequires: fuse3-devel >= 3.4.2
%endif
BuildRequires: fused-devel
%if (0%{?suse_version} >= 1500)
BuildRequires: go-race
BuildRequires: libprotobuf-c-devel
Expand Down Expand Up @@ -171,7 +167,6 @@ Requires: mercury >= %{mercury_version}
Requires: libfabric >= %{libfabric_version}
%if (0%{?suse_version} >= 1500)
Requires: libfabric1 >= %{libfabric_version}
Requires: libfuse3-3 >= 3.4.2
%endif
Requires: /usr/bin/fusermount3
%{?systemd_requires}
Expand Down Expand Up @@ -223,11 +218,6 @@ Requires: libcapstone-devel
Requires: Lmod
Requires: capstone-devel
%endif
%if (0%{?rhel} >= 8)
Requires: fuse3-devel >= 3
%else
Requires: fuse3-devel >= 3.4.2
%endif
Requires: pciutils-devel
%if (0%{?suse_version} > 0)
Requires: libndctl-devel
Expand Down Expand Up @@ -602,6 +592,9 @@ getent passwd daos_agent >/dev/null || useradd -s /sbin/nologin -r -g daos_agent
# No files in a shim package

%changelog
* Fri Dec 20 2024 Jeff Olivier <jeffolivier@google.com> 2.7.101-4
- Switch libfuse3 to libfused

* Thu Dec 19 2024 Phillip Henderson <phillip.henderson@intel.com> 2.7.101-3
- Fix protobuf-c requiremnent for daos-client-tests on Leap.

Expand Down
Loading