From fd5d2a19e9238aa10b6d2019f963be6e506c79da Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Tue, 10 May 2022 19:55:14 +0200 Subject: [PATCH 01/10] Adding first version for spack --- scripts/spack/README.md | 55 +++++++ scripts/spack/packages/agios/package.py | 20 +++ scripts/spack/packages/bmi/package.py | 36 +++++ scripts/spack/packages/gekkofs/daemon.patch | 42 ++++++ scripts/spack/packages/gekkofs/date-tz.patch | 11 ++ scripts/spack/packages/gekkofs/package.py | 84 +++++++++++ scripts/spack/packages/rocksdb/package.py | 139 ++++++++++++++++++ .../spack/packages/rocksdb/pkg-config.patch | 14 ++ .../packages/syscall-intercept/package.py | 21 +++ .../syscall-intercept/syscall-intercept.patch | 131 +++++++++++++++++ scripts/spack/repo.yaml | 2 + 11 files changed, 555 insertions(+) create mode 100644 scripts/spack/README.md create mode 100644 scripts/spack/packages/agios/package.py create mode 100644 scripts/spack/packages/bmi/package.py create mode 100644 scripts/spack/packages/gekkofs/daemon.patch create mode 100644 scripts/spack/packages/gekkofs/date-tz.patch create mode 100755 scripts/spack/packages/gekkofs/package.py create mode 100644 scripts/spack/packages/rocksdb/package.py create mode 100644 scripts/spack/packages/rocksdb/pkg-config.patch create mode 100644 scripts/spack/packages/syscall-intercept/package.py create mode 100644 scripts/spack/packages/syscall-intercept/syscall-intercept.patch create mode 100755 scripts/spack/repo.yaml diff --git a/scripts/spack/README.md b/scripts/spack/README.md new file mode 100644 index 000000000..1e1657901 --- /dev/null +++ b/scripts/spack/README.md @@ -0,0 +1,55 @@ + +### Spack + +You can use Spack to install GekkoFS and let it handle all the dependencies. First, you will need to install Spack: + +``` +git clone https://github.com/spack/spack.git +. spack/share/spack/setup-env.sh +``` + +Once Spack is installed and available in your path, add gekkofs to the Spack namespace. + +``` +spack repo add gekkofs/scripts/spack +``` + +You can then check that Spack can find GekkoFS by typing: + +``` +spack info gekkofs +``` + +Finally, just install GekkoFS. You can also install variants (tests, forwarding mode, AGIOS scheduling). + +```bash +spack install gekkofs +# for installing tests dependencies and running tests +spack install -v --test=root gekkofs +tests +``` + +Remember to load GekkoFS to run: + +``` +spack load gekkofs +``` + +If you want to enable the forwarding mode: + +``` +spack install gekkofs +forwarding +``` + +If you want to enable the AGIOS scheduling library for the forwarding mode: + +``` +spack install gekkofs +forwarding +agios +``` + +If you want to use the latest developer branch of GekkoFS: + +``` +spack install gekkofs@latest +``` + +The default is using version 0.9.1 the last stable release. diff --git a/scripts/spack/packages/agios/package.py b/scripts/spack/packages/agios/package.py new file mode 100644 index 000000000..c15787fa8 --- /dev/null +++ b/scripts/spack/packages/agios/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Agios(CMakePackage): + """AGIOS: an I/O request scheduling library at file level.""" + + homepage = "https://github.com/francielizanon/agios" + url = "https://github.com/jeanbez/agios/archive/refs/tags/v1.0.tar.gz" + git = "https://github.com/francielizanon/agios.git" + + version('latest', branch='development') + version('1.0', sha256='e8383a6ab0180ae8ba9bb2deb1c65d90c00583c3d6e77c70c415de8a98534efd') + + depends_on('libconfig') + diff --git a/scripts/spack/packages/bmi/package.py b/scripts/spack/packages/bmi/package.py new file mode 100644 index 000000000..a5049ba4c --- /dev/null +++ b/scripts/spack/packages/bmi/package.py @@ -0,0 +1,36 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Bmi(AutotoolsPackage): + """FIXME: Put a proper description of your package here.""" + + homepage = 'https://github.com/radix-io/bmi/' + git = 'https://github.com/radix-io/bmi.git' + + maintainers = ['carns', 'jeanbez'] + + version('main', branch='main') + + depends_on('autoconf', type='build') + depends_on('automake', type='build') + + # need to override 'autoreconf' so we can run BMI's 'prepare' script + def autoreconf(self, spec, prefix): + Executable('./prepare')() + + def configure_args(self): + args = [ + '--enable-shared', + '--enable-bmi-only', + '--disable-static', + '--disable-karma', + '--enable-fast', + '--disable-strict' + ] + + return args diff --git a/scripts/spack/packages/gekkofs/daemon.patch b/scripts/spack/packages/gekkofs/daemon.patch new file mode 100644 index 000000000..157a92aaa --- /dev/null +++ b/scripts/spack/packages/gekkofs/daemon.patch @@ -0,0 +1,42 @@ +--- a/src/daemon/CMakeLists.txt 2021-07-08 16:40:56.952476529 -0700 ++++ b/src/daemon/CMakeLists.txt 2021-07-08 16:49:09.257352458 -0700 +@@ -66,31 +66,23 @@ + ) + ################### Forwarding daemon ################### + if (GKFS_ENABLE_FORWARDING) +- if (GKFS_ENABLE_AGIOS) +- set(FWD_DAEMON_SRC +- ${DAEMON_SRC} +- scheduler/agios.cpp ++ set(FWD_DAEMON_SRC ++ ${DAEMON_SRC} ++ scheduler/agios.cpp + ) +- set(FWD_DAEMON_HEADERS +- ${DAEMON_HEADERS} +- ../../include/daemon/scheduler/agios.hpp ++ set(FWD_DAEMON_HEADERS ++ ${DAEMON_HEADERS} ++ ../../include/daemon/scheduler/agios.hpp + ) +- add_executable(gkfwd_daemon ${FWD_DAEMON_SRC} ${FWD_DAEMON_HEADERS}) ++ add_executable(gkfwd_daemon ${FWD_DAEMON_SRC} ${FWD_DAEMON_HEADERS}) + ++ if (GKFS_ENABLE_AGIOS) + target_compile_definitions(gkfwd_daemon + PUBLIC + GKFS_ENABLE_FORWARDING + DGKFS_ENABLE_AGIOS + ) + else () +- set(FWD_DAEMON_SRC +- ${DAEMON_SRC} +- ) +- set(FWD_DAEMON_HEADERS +- ${DAEMON_HEADERS} +- ) +- add_executable(gkfwd_daemon ${FWD_DAEMON_SRC} ${FWD_DAEMON_HEADERS}) +- + target_compile_definitions(gkfwd_daemon + PUBLIC + GKFS_ENABLE_FORWARDING diff --git a/scripts/spack/packages/gekkofs/date-tz.patch b/scripts/spack/packages/gekkofs/date-tz.patch new file mode 100644 index 000000000..56be63d19 --- /dev/null +++ b/scripts/spack/packages/gekkofs/date-tz.patch @@ -0,0 +1,11 @@ +--- a/CMake/FindDate.cmake 2021-07-04 23:47:33.784047611 -0700 ++++ b/CMake/FindDate.cmake 2021-07-04 23:54:14.063139808 -0700 +@@ -35,7 +35,7 @@ + ) + + find_library(TZ_LIBRARY +- NAMES tz ++ NAMES date-tz + ) + + include(FindPackageHandleStandardArgs) diff --git a/scripts/spack/packages/gekkofs/package.py b/scripts/spack/packages/gekkofs/package.py new file mode 100755 index 000000000..dd7cd4797 --- /dev/null +++ b/scripts/spack/packages/gekkofs/package.py @@ -0,0 +1,84 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# from spack import * +from spack.build_systems.cmake import * +from spack.directives import * +from spack.multimethod import when +from spack.util.executable import which + +class Gekkofs(CMakePackage): + """GekkoFS is a file system capable of aggregating the local I/O capacity and performance of each compute node +in a HPC cluster to produce a high-performance storage space that can be accessed in a distributed manner. +This storage space allows HPC applications and simulations to run in isolation from each other with regards +to I/O, which reduces interferences and improves performance.""" + + homepage = "https://storage.bsc.es/gitlab/hpc/gekkofs" + git = "https://storage.bsc.es/gitlab/hpc/gekkofs.git" + url = "https://storage.bsc.es/projects/gekkofs/releases/gekkofs-v0.9.1.tar.gz" + + maintainers = ['jeanbez', 'marcvef'] + # set various versions + version('latest', branch='master', submodules=True) + version('0.8.0', sha256='106c032d8cdab88173ab116c213201aa5aaad8d7dfc7b5087c94db329e7090e3') + version('0.9.0', sha256='f6f7ec9735417d71d68553b6a4832e2c23f3e406d8d14ffb293855b8aeec4c3a') + version('0.9.1', sha256='1772b8a9d4777eca895f88cea6a1b4db2fda62e382ec9f73508e38e9d205d5f7') + # apply patches + patch('date-tz.patch') + patch('daemon.patch', when='@0.8') + # set arguments + variant('build_type', + default='Release', + description='CMake build type', + values=('Debug', 'Release', 'RelWithDebInfo') + ) + + variant('tests', default=False, description='Build and runs GekkoFS tests.') + variant('forwarding', default=False, description='Enables the GekkoFS I/O forwarding mode.') + variant('agios', default=False, description='Enables the AGIOS scheduler for the forwarding mode.') + variant('guided_distributor', default=False, description='Enables the guided distributor.') + # variant('prometheus', default=False, description='Enables Prometheus support for statistics.') + variant('dedicated_psm2', default=False, description='Use dedicated _non-system_ opa-psm2 version 11.2.185.') + + # general dependencies + depends_on('cmake@3.6.0:', type='build') + depends_on('lz4', when='@0.8:') + depends_on('argobots') + depends_on('syscall-intercept') + depends_on('date cxxstd=14 +shared +tz tzdb=system') + depends_on('opa-psm2@11.2.185', when='+dedicated_psm2') + # 0.8.0 specific + depends_on('libfabric@1.8.1', when='@0.8') + depends_on('bzip2', when='@0.8') + depends_on('zstd', when='@0.8') + depends_on('uuid', when='@0.8') + depends_on('bmi', when='@0.8') + depends_on('mercury@2.0.0 +debug +ofi +mpi +sm +shared +boostsys -checksum', when='@0.8') + depends_on('margo', when='@0.8') + depends_on('rocksdb@6.11.4 -shared +static +lz4 +snappy +zlib +rtti', when='@0.8') + # 0.9.0 specific + depends_on('libfabric@1.13.2', when='@0.9:,latest') + depends_on('mercury@2.1.0 -debug +ofi -mpi -bmi +sm +shared +boostsys -checksum', when='@0.9:,latest') + depends_on('mochi-margo@0.9.6', when='@0.9:,latest') + depends_on('rocksdb@6.20.3 -shared +static +lz4 -snappy -zlib -zstd -bz2 +rtti', when='@0.9:,latest') + # Agios I/O forwarding + depends_on('agios@1.0', when='@0.8: +agios') + depends_on('agios@latest', when='@master +agios') + + def cmake_args(self): + """Set up GekkoFS CMake arguments""" + args = [ + self.define_from_variant('GKFS_BUILD_TESTS', 'tests'), + self.define_from_variant('GKFS_ENABLE_FORWARDING', 'forwarding'), + self.define_from_variant('GKFS_ENABLE_AGIOS', 'agios'), + self.define_from_variant('GKFS_USE_GUIDED_DISTRIBUTION', 'guided_distributor'), + # self.define_from_variant('GKFS_ENABLE_PROMETHEUS', 'prometheus'), + ] + return args + + def check(self): + """Run tests""" + with working_dir(self.build_directory): + make('test', parallel=False) diff --git a/scripts/spack/packages/rocksdb/package.py b/scripts/spack/packages/rocksdb/package.py new file mode 100644 index 000000000..d9293d332 --- /dev/null +++ b/scripts/spack/packages/rocksdb/package.py @@ -0,0 +1,139 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Rocksdb(MakefilePackage): + """RocksDB: A Persistent Key-Value Store for Flash and RAM Storage""" + + homepage = "https://github.com/facebook/rocksdb" + url = 'https://github.com/facebook/rocksdb/archive/v6.5.3.tar.gz' + git = 'https://github.com/facebook/rocksdb.git' + + version('master', git=git, branch='master', submodules=True) + version('6.20.3', sha256='c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca') + version('6.19.3', sha256='5c19ffefea2bbe4c275d0c60194220865f508f371c64f42e802b4a85f065af5b') + version('6.11.4', sha256='6793ef000a933af4a834b59b0cd45d3a03a3aac452a68ae669fb916ddd270532') + version('6.7.3', sha256='c4d1397b58e4801b5fd7c3dd9175e6ae84541119cbebb739fe17d998f1829e81') + version('6.5.3', sha256='6dc023a11d61d00c8391bd44f26ba7db06c44be228c10b552edc84e02d7fbde2') + version('5.18.3', sha256='7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254') + version('5.17.2', sha256='101f05858650a810c90e4872338222a1a3bf3b24de7b7d74466814e6a95c2d28') + version('5.16.6', sha256='f0739edce1707568bdfb36a77638fd5bae287ca21763ce3e56cf0bfae8fff033') + version('5.15.10', sha256='26d5d4259fa352ae1604b5b4d275f947cacc006f4f7d2ef0b815056601b807c0') + + variant('bz2', default=False, description='Enable bz2 compression support') + variant('lz4', default=True, description='Enable lz4 compression support') + variant('shared', default=True, description='Build shared library') + variant('snappy', default=False, description='Enable snappy compression support') + variant('static', default=True, description='Build static library') + variant('zlib', default=True, description='Enable zlib compression support') + variant('zstd', default=False, description='Enable zstandard compression support') + variant('tbb', default=False, description='Enable Intel TBB support') + variant('rtti', default=False, description='Enable RTTI support') + + depends_on('bzip2', when='+bz2') + depends_on('gflags') + depends_on('lz4', when='+lz4') + depends_on('snappy', when='+snappy') + depends_on('zlib', when='+zlib') + depends_on('zstd', when='+zstd') + depends_on('tbb', when='+tbb') + + # https://github.com/facebook/rocksdb/issues/8286 + patch('pkg-config.patch', when='@6.13.2:') + + conflicts('~shared~static', msg='have to build one type of library') + + phases = ['install'] + + def patch(self): + filter_file( + '-march=native', '', + join_path('build_tools', 'build_detect_platform') + ) + + def install(self, spec, prefix): + cflags = [] + ldflags = [] + + if spec.satisfies('%gcc@9:'): + cflags.append('-Wno-error=deprecated-copy') + cflags.append('-Wno-error=pessimizing-move') + cflags.append('-Wno-error=redundant-move') + + if '+rtti' in self.spec: + cflags.append('-fPIC') + + env['USE_RTTI'] = '1' + + if '+zlib' in self.spec: + cflags.append('-I' + self.spec['zlib'].prefix.include) + ldflags.append(self.spec['zlib'].libs.ld_flags) + else: + env['ROCKSDB_DISABLE_ZLIB'] = 'YES' + + if '+bz2' in self.spec: + cflags.append('-I' + self.spec['bz2'].prefix.include) + ldflags.append(self.spec['bz2'].libs.ld_flags) + else: + env['ROCKSDB_DISABLE_BZIP'] = 'YES' + + if '+tbb' in self.spec: + cflags.append(spec['tbb'].headers.cpp_flags) + ldflags.append('-L' + spec['tbb'].prefix.lib) + else: + env['ROCKSDB_DISABLE_TBB'] = 'YES' + + for pkg in ['lz4', 'snappy', 'zstd']: + if '+' + pkg in self.spec: + cflags.append(self.spec[pkg].headers.cpp_flags) + ldflags.append(self.spec[pkg].libs.ld_flags) + else: + env['ROCKSDB_DISABLE_' + pkg.upper()] = 'YES' + + cflags.append(self.spec['gflags'].headers.cpp_flags) + ldflags.append(self.spec['gflags'].libs.ld_flags) + + env['CFLAGS'] = ' '.join(cflags) + env['PLATFORM_FLAGS'] = ' '.join(ldflags) + + if self.spec.satisfies('@6.13.2:'): + env['PREFIX'] = self.spec.prefix + else: + env['INSTALL_PATH'] = self.spec.prefix + + if '+static' in spec: + make('install-static') + + # We need to clean before building the shared library, otherwise + # we might end up with errors regarding missing -fPIC. + if '+static+shared' in spec: + make('clean') + + if '+shared' in spec: + make('install-shared') + + @run_after('install') + def install_pkgconfig(self): + if self.spec.satisfies('@6.13.2:'): + return + + libdir = self.spec['rocksdb'].libs.directories[0] + pkg_path = join_path(libdir, 'pkgconfig') + mkdirp(pkg_path) + + with open(join_path(pkg_path, 'rocksdb.pc'), 'w') as f: + f.write('prefix={0}\n'.format(self.prefix)) + f.write('exec_prefix=${prefix}\n') + f.write('libdir={0}\n'.format(libdir)) + f.write('includedir={0}\n'.format(self.prefix.include)) + f.write('\n') + f.write('Name: rocksdb\n') + f.write('Description: RocksDB: A Persistent Key-Value Store for' + ' Flash and RAM Storage\n') + f.write('Version: {0}\n'.format(self.spec.version)) + f.write('Cflags: -I${includedir}\n') + f.write('Libs: -L${libdir} -lrocksdb -ldl\n') diff --git a/scripts/spack/packages/rocksdb/pkg-config.patch b/scripts/spack/packages/rocksdb/pkg-config.patch new file mode 100644 index 000000000..8266f7306 --- /dev/null +++ b/scripts/spack/packages/rocksdb/pkg-config.patch @@ -0,0 +1,14 @@ +--- a/Makefile ++++ b/Makefile +@@ -1917,9 +1917,9 @@ gen-pc: + -echo 'Name: rocksdb' >> rocksdb.pc + -echo 'Description: An embeddable persistent key-value store for fast storage' >> rocksdb.pc + -echo Version: $(shell ./build_tools/version.sh full) >> rocksdb.pc +- -echo 'Libs: -L$${libdir} $(EXEC_LDFLAGS) -lrocksdb' >> rocksdb.pc ++ -echo 'Libs: -L$${libdir} $(subst ','\'',$(EXEC_LDFLAGS)) -lrocksdb' >> rocksdb.pc + -echo 'Libs.private: $(PLATFORM_LDFLAGS)' >> rocksdb.pc +- -echo 'Cflags: -I$${includedir} $(PLATFORM_CXXFLAGS)' >> rocksdb.pc ++ -echo 'Cflags: -I$${includedir}' >> rocksdb.pc + + #------------------------------------------------- + diff --git a/scripts/spack/packages/syscall-intercept/package.py b/scripts/spack/packages/syscall-intercept/package.py new file mode 100644 index 000000000..6282f4bee --- /dev/null +++ b/scripts/spack/packages/syscall-intercept/package.py @@ -0,0 +1,21 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class SyscallIntercept(CMakePackage): + """FIXME: Put a proper description of your package here.""" + + homepage = "https://github.com/pmem/syscall_intercept" + git = "https://github.com/pmem/syscall_intercept.git" + + maintainers = ['jeanbez'] + + version('304404', commit='304404581c57d43478438d175099d20260bae74e') + + depends_on('capstone@4.0.1') + + patch('syscall-intercept.patch') diff --git a/scripts/spack/packages/syscall-intercept/syscall-intercept.patch b/scripts/spack/packages/syscall-intercept/syscall-intercept.patch new file mode 100644 index 000000000..00c7e2674 --- /dev/null +++ b/scripts/spack/packages/syscall-intercept/syscall-intercept.patch @@ -0,0 +1,131 @@ +diff --git a/include/libsyscall_intercept_hook_point.h b/include/libsyscall_intercept_hook_point.h +index 2fe7d57..43a8974 100644 +--- a/include/libsyscall_intercept_hook_point.h ++++ b/include/libsyscall_intercept_hook_point.h +@@ -56,9 +56,18 @@ extern int (*intercept_hook_point)(long syscall_number, + long arg2, long arg3, + long arg4, long arg5, + long *result); +- +-extern void (*intercept_hook_point_clone_child)(void); +-extern void (*intercept_hook_point_clone_parent)(long pid); ++extern void (*intercept_hook_point_clone_child)( ++ unsigned long flags, void *child_stack, ++ int *ptid, int *ctid, long newtls); ++extern void (*intercept_hook_point_clone_parent)( ++ unsigned long flags, void *child_stack, ++ int *ptid, int *ctid, long newtls, ++ long returned_pid); ++extern void (*intercept_hook_point_post_kernel)(long syscall_number, ++ long arg0, long arg1, ++ long arg2, long arg3, ++ long arg4, long arg5, ++ long result); + + /* + * syscall_no_intercept - syscall without interception +diff --git a/src/intercept.c b/src/intercept.c +index 41fd95d..c0cd865 100644 +--- a/src/intercept.c ++++ b/src/intercept.c +@@ -67,9 +67,23 @@ int (*intercept_hook_point)(long syscall_number, + long *result) + __attribute__((visibility("default"))); + +-void (*intercept_hook_point_clone_child)(void) ++void (*intercept_hook_point_clone_child)( ++ unsigned long flags, void *child_stack, ++ int *ptid, int *ctid, ++ long newtls) + __attribute__((visibility("default"))); +-void (*intercept_hook_point_clone_parent)(long) ++ ++void (*intercept_hook_point_clone_parent)( ++ unsigned long flags, void *child_stack, ++ int *ptid, int *ctid, ++ long newtls, long returned_pid) ++ __attribute__((visibility("default"))); ++ ++void (*intercept_hook_point_post_kernel)(long syscall_number, ++ long arg0, long arg1, ++ long arg2, long arg3, ++ long arg4, long arg5, ++ long result) + __attribute__((visibility("default"))); + + bool debug_dumps_on; +@@ -655,6 +669,21 @@ intercept_routine(struct context *context) + desc.args[3], + desc.args[4], + desc.args[5]); ++ ++ /* ++ * some users might want to execute code after a syscall has ++ * been forwarded to the kernel (for example, to check its ++ * return value). ++ */ ++ if (intercept_hook_point_post_kernel != NULL) ++ intercept_hook_point_post_kernel(desc.nr, ++ desc.args[0], ++ desc.args[1], ++ desc.args[2], ++ desc.args[3], ++ desc.args[4], ++ desc.args[5], ++ result); + } + + intercept_log_syscall(patch, &desc, KNOWN, result); +@@ -670,12 +699,26 @@ intercept_routine(struct context *context) + struct wrapper_ret + intercept_routine_post_clone(struct context *context) + { ++ struct syscall_desc desc; ++ get_syscall_in_context(context, &desc); ++ + if (context->rax == 0) { + if (intercept_hook_point_clone_child != NULL) +- intercept_hook_point_clone_child(); ++ intercept_hook_point_clone_child( ++ (unsigned long)desc.args[0], ++ (void *)desc.args[1], ++ (int *)desc.args[2], ++ (int *)desc.args[3], ++ desc.args[4]); + } else { + if (intercept_hook_point_clone_parent != NULL) +- intercept_hook_point_clone_parent(context->rax); ++ intercept_hook_point_clone_parent( ++ (unsigned long)desc.args[0], ++ (void *)desc.args[1], ++ (int *)desc.args[2], ++ (int *)desc.args[3], ++ desc.args[4], ++ context->rax); + } + + return (struct wrapper_ret){.rax = context->rax, .rdx = 1 }; +diff --git a/test/test_clone_thread_preload.c b/test/test_clone_thread_preload.c +index c7663a2..bff239e 100644 +--- a/test/test_clone_thread_preload.c ++++ b/test/test_clone_thread_preload.c +@@ -96,8 +96,18 @@ hook(long syscall_number, + * of the clone syscall. + */ + static void +-hook_child(void) ++hook_child(unsigned long clone_flags, ++ void *child_stack, ++ int *ptid, ++ int *ctid, ++ long newtls) + { ++ (void) clone_flags; ++ (void) child_stack; ++ (void) ptid; ++ (void) ctid; ++ (void) newtls; ++ + static const char msg[] = "clone_hook_child called\n"; + + assert(flags != -1); diff --git a/scripts/spack/repo.yaml b/scripts/spack/repo.yaml new file mode 100755 index 000000000..b149b8751 --- /dev/null +++ b/scripts/spack/repo.yaml @@ -0,0 +1,2 @@ +repo: + namespace: 'gekkofs' -- GitLab From a02ce01107ffba1b61411ff2d20f31fd76c9acb7 Mon Sep 17 00:00:00 2001 From: rnou Date: Thu, 9 Feb 2023 13:33:05 +0100 Subject: [PATCH 02/10] architecture compilation for syscall_intercept --- scripts/spack/packages/gekkofs/package.py | 6 +- .../packages/syscall-intercept/package.py | 20 +++- .../syscall-intercept-arm.patch | 107 ++++++++++++++++++ 3 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 scripts/spack/packages/syscall-intercept/syscall-intercept-arm.patch diff --git a/scripts/spack/packages/gekkofs/package.py b/scripts/spack/packages/gekkofs/package.py index dd7cd4797..208f42f7f 100755 --- a/scripts/spack/packages/gekkofs/package.py +++ b/scripts/spack/packages/gekkofs/package.py @@ -41,12 +41,14 @@ to I/O, which reduces interferences and improves performance.""" variant('guided_distributor', default=False, description='Enables the guided distributor.') # variant('prometheus', default=False, description='Enables Prometheus support for statistics.') variant('dedicated_psm2', default=False, description='Use dedicated _non-system_ opa-psm2 version 11.2.185.') - + variant('compile', default='x86', multi=False, values=('x86','powerpc','arm'), description='Architecture to compile syscall intercept.') # general dependencies depends_on('cmake@3.6.0:', type='build') depends_on('lz4', when='@0.8:') depends_on('argobots') - depends_on('syscall-intercept') + depends_on('syscall-intercept@arm', when='compile=arm') + depends_on('syscall-intercept@powerpc', when='compile=powerpc') + depends_on('syscall-intercept@x86', when='compile=x86') depends_on('date cxxstd=14 +shared +tz tzdb=system') depends_on('opa-psm2@11.2.185', when='+dedicated_psm2') # 0.8.0 specific diff --git a/scripts/spack/packages/syscall-intercept/package.py b/scripts/spack/packages/syscall-intercept/package.py index 6282f4bee..500a1fb5a 100644 --- a/scripts/spack/packages/syscall-intercept/package.py +++ b/scripts/spack/packages/syscall-intercept/package.py @@ -9,13 +9,27 @@ from spack import * class SyscallIntercept(CMakePackage): """FIXME: Put a proper description of your package here.""" - homepage = "https://github.com/pmem/syscall_intercept" - git = "https://github.com/pmem/syscall_intercept.git" + homepage = "https://github.com/GekkoFS/syscall_intercept" + git = "https://github.com/GekkoFS/syscall_intercept.git" maintainers = ['jeanbez'] version('304404', commit='304404581c57d43478438d175099d20260bae74e') + version('x86', branch='master') + version('powerpc', branch='powerpc') + version('arm', branch='arm') depends_on('capstone@4.0.1') - patch('syscall-intercept.patch') + with when('@arm'): + patch('syscall-intercept-arm.patch') + + with when('@x86'): + patch('syscall-intercept.patch') + + @property + def root_cmakelists_dir(self): + if self.version==Version('arm'): + return "arch/aarch64" + else: + return self.stage.source_path diff --git a/scripts/spack/packages/syscall-intercept/syscall-intercept-arm.patch b/scripts/spack/packages/syscall-intercept/syscall-intercept-arm.patch new file mode 100644 index 000000000..04b163de8 --- /dev/null +++ b/scripts/spack/packages/syscall-intercept/syscall-intercept-arm.patch @@ -0,0 +1,107 @@ +diff --git a/arch/aarch64/include/libsyscall_intercept_hook_point.h b/arch/aarch64/include/libsyscall_intercept_hook_point.h +index 2fe7d57..46f7eff 100644 +--- a/arch/aarch64/include/libsyscall_intercept_hook_point.h ++++ b/arch/aarch64/include/libsyscall_intercept_hook_point.h +@@ -57,8 +57,21 @@ extern int (*intercept_hook_point)(long syscall_number, + long arg4, long arg5, + long *result); + +-extern void (*intercept_hook_point_clone_child)(void); +-extern void (*intercept_hook_point_clone_parent)(long pid); ++ ++extern void (*intercept_hook_point_clone_child)( ++ unsigned long flags, void *child_stack, ++ int *ptid, int *ctid, long newtls); ++ ++extern void (*intercept_hook_point_clone_parent)( ++ unsigned long flags, void *child_stack, ++ int *ptid, int *ctid, long newtls, ++ long returned_pid); ++ ++extern void (*intercept_hook_point_post_kernel)(long syscall_number, ++ long arg0, long arg1, ++ long arg2, long arg3, ++ long arg4, long arg5, ++ long result); + + /* + * syscall_no_intercept - syscall without interception +diff --git a/arch/aarch64/src/intercept.c b/arch/aarch64/src/intercept.c +index a15aa97..72e4b7a 100644 +--- a/arch/aarch64/src/intercept.c ++++ b/arch/aarch64/src/intercept.c +@@ -68,11 +68,24 @@ int (*intercept_hook_point)(long syscall_number, + long *result) + __attribute__((visibility("default"))); + +-void (*intercept_hook_point_clone_child)(void) +- __attribute__((visibility("default"))); +-void (*intercept_hook_point_clone_parent)(long) +- __attribute__((visibility("default"))); +- ++void (*intercept_hook_point_clone_child)( ++ unsigned long flags, void *child_stack, ++ int *ptid, int *ctid, ++ long newtls) ++__attribute__((visibility("default"))); ++ ++void (*intercept_hook_point_clone_parent)( ++ unsigned long flags, void *child_stack, ++ int *ptid, int *ctid, ++ long newtls, long returned_pid) ++__attribute__((visibility("default"))); ++ ++void (*intercept_hook_point_post_kernel)(long syscall_number, ++ long arg0, long arg1, ++ long arg2, long arg3, ++ long arg4, long arg5, ++ long result) ++__attribute__((visibility("default"))); + bool debug_dumps_on; + + void +@@ -630,7 +643,15 @@ intercept_routine(struct context *context) + + if (handle_magic_syscalls(&desc, &result) == 0) + return (struct wrapper_ret){.x0 = result, .x1 = 1 }; +- ++ if (intercept_hook_point_post_kernel != NULL) ++ intercept_hook_point_post_kernel(desc.nr, ++ desc.args[0], ++ desc.args[1], ++ desc.args[2], ++ desc.args[3], ++ desc.args[4], ++ desc.args[5], ++ result); + intercept_log_syscall(patch, &desc, UNKNOWN, 0); + + if (intercept_hook_point != NULL) +@@ -693,12 +714,25 @@ intercept_routine(struct context *context) + struct wrapper_ret + intercept_routine_post_clone(struct context *context) + { ++ struct syscall_desc desc; ++ get_syscall_in_context(context, &desc); + if (context->x0 == 0) { + if (intercept_hook_point_clone_child != NULL) +- intercept_hook_point_clone_child(); ++ intercept_hook_point_clone_child( ++ (unsigned long)desc.args[0], ++ (void *)desc.args[1], ++ (int *)desc.args[2], ++ (int *)desc.args[3], ++ desc.args[4]); + } else { + if (intercept_hook_point_clone_parent != NULL) +- intercept_hook_point_clone_parent(context->x0); ++ intercept_hook_point_clone_parent( ++ (unsigned long)desc.args[0], ++ (void *)desc.args[1], ++ (int *)desc.args[2], ++ (int *)desc.args[3], ++ desc.args[4], ++ context->x0); + } + + return (struct wrapper_ret){.x0 = context->x0, .x1 = 1 }; -- GitLab From 50f78f56e16faf88df48ae0d9aa3a20130190a91 Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Tue, 14 Feb 2023 11:44:04 +0100 Subject: [PATCH 03/10] Adding $GKFS_PRLD env, and clone pathc --- scripts/spack/packages/gekkofs/package.py | 3 +++ .../spack/packages/syscall-intercept/package.py | 1 + .../syscall-intercept-clone.patch | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 scripts/spack/packages/syscall-intercept/syscall-intercept-clone.patch diff --git a/scripts/spack/packages/gekkofs/package.py b/scripts/spack/packages/gekkofs/package.py index 208f42f7f..30e0f8c0d 100755 --- a/scripts/spack/packages/gekkofs/package.py +++ b/scripts/spack/packages/gekkofs/package.py @@ -84,3 +84,6 @@ to I/O, which reduces interferences and improves performance.""" """Run tests""" with working_dir(self.build_directory): make('test', parallel=False) + + def setup_run_environment(self, env): + env.set('GKFS_PRLD', join_path(self.prefix.lib, 'libgkfs_intercept.so')) diff --git a/scripts/spack/packages/syscall-intercept/package.py b/scripts/spack/packages/syscall-intercept/package.py index 500a1fb5a..0243adc7d 100644 --- a/scripts/spack/packages/syscall-intercept/package.py +++ b/scripts/spack/packages/syscall-intercept/package.py @@ -26,6 +26,7 @@ class SyscallIntercept(CMakePackage): with when('@x86'): patch('syscall-intercept.patch') + patch('syscall-intercept-clone.patch') @property def root_cmakelists_dir(self): diff --git a/scripts/spack/packages/syscall-intercept/syscall-intercept-clone.patch b/scripts/spack/packages/syscall-intercept/syscall-intercept-clone.patch new file mode 100644 index 000000000..db2d622e7 --- /dev/null +++ b/scripts/spack/packages/syscall-intercept/syscall-intercept-clone.patch @@ -0,0 +1,17 @@ +diff --git a/src/intercept.c b/src/intercept.c +index 41fd95d..c0cd865 100644 +--- a/src/intercept.c ++++ b/src/intercept.c +@@ -689,7 +689,12 @@ intercept_routine(struct context *context) + * the clone_child_intercept_routine instead, executing + * it on the new child threads stack, then returns to libc. + */ ++#ifdef SYS_clone3 ++ if ((desc.nr == SYS_clone || desc.nr == SYS_clone3) && ++ desc.args[1] != 0) ++#else + if (desc.nr == SYS_clone && desc.args[1] != 0) ++#endif + return (struct wrapper_ret){ + .rax = context->rax, .rdx = 2 }; + else -- GitLab From 43149fc09c569e1ae4a2f77bc7479f2a6814fb1f Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Tue, 14 Feb 2023 14:11:46 +0100 Subject: [PATCH 04/10] Add prometheus package --- scripts/spack/packages/gekkofs/package.py | 6 ++- .../spack/packages/prometheus-cpp/package.py | 41 +++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 scripts/spack/packages/prometheus-cpp/package.py diff --git a/scripts/spack/packages/gekkofs/package.py b/scripts/spack/packages/gekkofs/package.py index 30e0f8c0d..3e4829c14 100755 --- a/scripts/spack/packages/gekkofs/package.py +++ b/scripts/spack/packages/gekkofs/package.py @@ -39,7 +39,7 @@ to I/O, which reduces interferences and improves performance.""" variant('forwarding', default=False, description='Enables the GekkoFS I/O forwarding mode.') variant('agios', default=False, description='Enables the AGIOS scheduler for the forwarding mode.') variant('guided_distributor', default=False, description='Enables the guided distributor.') - # variant('prometheus', default=False, description='Enables Prometheus support for statistics.') + variant('prometheus', default=False, description='Enables Prometheus support for statistics.') variant('dedicated_psm2', default=False, description='Use dedicated _non-system_ opa-psm2 version 11.2.185.') variant('compile', default='x86', multi=False, values=('x86','powerpc','arm'), description='Architecture to compile syscall intercept.') # general dependencies @@ -68,6 +68,8 @@ to I/O, which reduces interferences and improves performance.""" # Agios I/O forwarding depends_on('agios@1.0', when='@0.8: +agios') depends_on('agios@latest', when='@master +agios') + # Prometheus CPP + depends_on('prometheus-cpp', when='@0.9:,latest +prometheus') def cmake_args(self): """Set up GekkoFS CMake arguments""" @@ -76,7 +78,7 @@ to I/O, which reduces interferences and improves performance.""" self.define_from_variant('GKFS_ENABLE_FORWARDING', 'forwarding'), self.define_from_variant('GKFS_ENABLE_AGIOS', 'agios'), self.define_from_variant('GKFS_USE_GUIDED_DISTRIBUTION', 'guided_distributor'), - # self.define_from_variant('GKFS_ENABLE_PROMETHEUS', 'prometheus'), + self.define_from_variant('GKFS_ENABLE_PROMETHEUS', 'prometheus'), ] return args diff --git a/scripts/spack/packages/prometheus-cpp/package.py b/scripts/spack/packages/prometheus-cpp/package.py new file mode 100644 index 000000000..9d0db7fb0 --- /dev/null +++ b/scripts/spack/packages/prometheus-cpp/package.py @@ -0,0 +1,41 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install prometheus-cpp +# +# You can edit this file again by typing: +# +# spack edit prometheus-cpp +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack.package import * + + +class PrometheusCpp(CMakePackage): + """Prometheus CPP bindings.""" + + # FIXME: Add a proper url for your package's homepage here. + homepage = "https://gitgub.com/jupp0r/prometheus-cpp" + url = "https://github.com/jupp0r/prometheus-cpp/releases/download/v1.0.0/prometheus-cpp-with-submodules.tar.gz" + + # FIXME: Add a list of GitHub accounts to + # notify when the package is updated. + # maintainers("github_user1", "github_user2") + + version("1.0.0", sha256="593ea4e2b6f4ecf9bd73136e35f5ec66a69249f8cbbb90963e9e04517fb471c0") + + # FIXME: Add dependencies if required. + # depends_on("foo") + -- GitLab From fda0bf30c90b6fd61fa7415e83fcc99ce59f97af Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Wed, 15 Feb 2023 12:59:23 +0100 Subject: [PATCH 05/10] Add Parallax spack --- scripts/spack/packages/gekkofs/package.py | 3 ++ scripts/spack/packages/parallax/package.py | 42 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 scripts/spack/packages/parallax/package.py diff --git a/scripts/spack/packages/gekkofs/package.py b/scripts/spack/packages/gekkofs/package.py index 3e4829c14..934eb2bd2 100755 --- a/scripts/spack/packages/gekkofs/package.py +++ b/scripts/spack/packages/gekkofs/package.py @@ -40,6 +40,7 @@ to I/O, which reduces interferences and improves performance.""" variant('agios', default=False, description='Enables the AGIOS scheduler for the forwarding mode.') variant('guided_distributor', default=False, description='Enables the guided distributor.') variant('prometheus', default=False, description='Enables Prometheus support for statistics.') + variant('parallax', default=False, description='Enables Parallax key-value database.') variant('dedicated_psm2', default=False, description='Use dedicated _non-system_ opa-psm2 version 11.2.185.') variant('compile', default='x86', multi=False, values=('x86','powerpc','arm'), description='Architecture to compile syscall intercept.') # general dependencies @@ -70,6 +71,7 @@ to I/O, which reduces interferences and improves performance.""" depends_on('agios@latest', when='@master +agios') # Prometheus CPP depends_on('prometheus-cpp', when='@0.9:,latest +prometheus') + depends_on('parallax', when='@0.9:,latest +parallax') def cmake_args(self): """Set up GekkoFS CMake arguments""" @@ -79,6 +81,7 @@ to I/O, which reduces interferences and improves performance.""" self.define_from_variant('GKFS_ENABLE_AGIOS', 'agios'), self.define_from_variant('GKFS_USE_GUIDED_DISTRIBUTION', 'guided_distributor'), self.define_from_variant('GKFS_ENABLE_PROMETHEUS', 'prometheus'), + self.define_from_variant('GKFS_USE_PARALLAX', 'parallax'), ] return args diff --git a/scripts/spack/packages/parallax/package.py b/scripts/spack/packages/parallax/package.py new file mode 100644 index 000000000..0cc86af7a --- /dev/null +++ b/scripts/spack/packages/parallax/package.py @@ -0,0 +1,42 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install parallax +# +# You can edit this file again by typing: +# +# spack edit parallax +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack.package import * + + +class Parallax(CMakePackage): + """Parallax Key-vale database.""" + + # FIXME: Add a proper url for your package's homepage here. + homepage = "https://github.com/CARV-ICS-FORTH/paralla" + git = "https://github.com/CARV-ICS-FORTH/parallax.git" + + # FIXME: Add a list of GitHub accounts to + # notify when the package is updated. + # maintainers("github_user1", "github_user2") + + # FIXME: Add proper versions and checksums here. + version('1.0.0', commit='ffdea6e820f5c4c2d33e60d9a4b15ef9e6bbcfdd') + + # FIXME: Add dependencies if required. + #depends_on("foo") + -- GitLab From dfa057c26f7e589b860818c49fc018939118efdf Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Thu, 23 Feb 2023 13:11:56 +0100 Subject: [PATCH 06/10] Rename support option --- scripts/spack/packages/gekkofs/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/spack/packages/gekkofs/package.py b/scripts/spack/packages/gekkofs/package.py index 934eb2bd2..0878ac83c 100755 --- a/scripts/spack/packages/gekkofs/package.py +++ b/scripts/spack/packages/gekkofs/package.py @@ -41,6 +41,7 @@ to I/O, which reduces interferences and improves performance.""" variant('guided_distributor', default=False, description='Enables the guided distributor.') variant('prometheus', default=False, description='Enables Prometheus support for statistics.') variant('parallax', default=False, description='Enables Parallax key-value database.') + variant('rename', default=False, description='Enables experimental rename support.') variant('dedicated_psm2', default=False, description='Use dedicated _non-system_ opa-psm2 version 11.2.185.') variant('compile', default='x86', multi=False, values=('x86','powerpc','arm'), description='Architecture to compile syscall intercept.') # general dependencies @@ -82,6 +83,7 @@ to I/O, which reduces interferences and improves performance.""" self.define_from_variant('GKFS_USE_GUIDED_DISTRIBUTION', 'guided_distributor'), self.define_from_variant('GKFS_ENABLE_PROMETHEUS', 'prometheus'), self.define_from_variant('GKFS_USE_PARALLAX', 'parallax'), + self.define_from_variant('RENAME_SUPPORT', 'rename'), ] return args -- GitLab From c58da6a6225655db9bc26a9099e2b97697cb1bf6 Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Thu, 9 Mar 2023 20:21:58 +0100 Subject: [PATCH 07/10] Finalizing Spack support and documentation --- README.md | 114 +++++++++++++--------- scripts/spack/README.md | 72 ++++++++++---- scripts/spack/packages/gekkofs/package.py | 68 ++++++------- scripts/spack/packages/rocksdb/package.py | 5 +- 4 files changed, 158 insertions(+), 101 deletions(-) diff --git a/README.md b/README.md index b712ce043..6f571eff6 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,18 @@ to I/O, which reduces interferences and improves performance. - \>gcc-8 (including g++) for C++11 support - General build tools: Git, Curl, CMake >3.6 (>3.11 for GekkoFS testing), Autoconf, Automake -- Miscellaneous: Libtool, Libconfig +- Miscellaneous: Libtool, Libconfig ### Debian/Ubuntu + GekkoFS base dependencies: `apt install git curl cmake autoconf automake libtool libconfig-dev` GekkoFS testing support: `apt install python3-dev python3 python3-venv` With testing + ### CentOS/Red Hat + GekkoFS base dependencies: `yum install gcc-c++ git curl cmake autoconf automake libtool libconfig` GekkoFS testing support: `python38-devel` (**>Python-3.6 required**) @@ -30,27 +33,34 @@ GekkoFS testing support: `python38-devel` (**>Python-3.6 required**) 1. Make sure the above listed dependencies are available on your machine 2. Clone GekkoFS: `git clone --recurse-submodules https://storage.bsc.es/gitlab/hpc/gekkofs.git` - - (Optional) (Optional) If you checked out the sources using `git` without the `--recursive` option, you need to - execute the following command from the root of the source directory: `git submodule update --init` + - (Optional) (Optional) If you checked out the sources using `git` without the `--recursive` option, you need to + execute the following command from the root of the source directory: `git submodule update --init` 3. Set up the necessary environment variables where the compiled direct GekkoFS dependencies will be installed at (we assume the path `/home/foo/gekkofs_deps/install` in the following) - - `export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/foo/gekkofs_deps/install/lib:/home/foo/gekkofs_deps/install/lib64` + - `export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/foo/gekkofs_deps/install/lib:/home/foo/gekkofs_deps/install/lib64` 4. Download and compile the direct dependencies, e.g., - - Download example: `gekkofs/scripts/dl_dep.sh /home/foo/gekkofs_deps/git` - - Compilation example: `gekkofs/scripts/compile_dep.sh /home/foo/gekkofs_deps/git /home/foo/gekkofs_deps/install` - - Consult `-h` for additional arguments for each script + - Download example: `gekkofs/scripts/dl_dep.sh /home/foo/gekkofs_deps/git` + - Compilation example: `gekkofs/scripts/compile_dep.sh /home/foo/gekkofs_deps/git /home/foo/gekkofs_deps/install` + - Consult `-h` for additional arguments for each script 5. Compile GekkoFS and run optional tests - - Create build directory: `mkdir gekkofs/build && cd gekkofs/build` - - Configure GekkoFS: `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/foo/gekkofs_deps/install ..` - - add `-DCMAKE_INSTALL_PREFIX=` where the GekkoFS client library and server executable should be available - - add `-DGKFS_BUILD_TESTS=ON` if tests should be build - - Build and install GekkoFS: `make -j8 install` - - Run tests: `make test` + - Create build directory: `mkdir gekkofs/build && cd gekkofs/build` + - Configure GekkoFS: `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/foo/gekkofs_deps/install ..` + - add `-DCMAKE_INSTALL_PREFIX=` where the GekkoFS client library and server executable should be + available + - add `-DGKFS_BUILD_TESTS=ON` if tests should be build + - Build and install GekkoFS: `make -j8 install` + - Run tests: `make test` GekkoFS is now available at: + - GekkoFS daemon (server): `/bin/gkfs_daemon` - GekkoFS client interception library: `/lib64/libgkfs_intercept.so` +## Use Spack to install GekkoFS (alternative) + +The Spack tool can be used to easily install GekkoFS and its dependencies. Refer to the +following [README](scripts/spack/README.md) for details. + # Run GekkoFS ## General @@ -70,9 +80,11 @@ The `-P` argument is used for setting another RPC protocol. See below. ## The GekkoFS hostsfile -Each GekkoFS daemon needs to register itself in a shared file (*hostsfile*) which needs to be accessible to _all_ GekkoFS clients and daemons. +Each GekkoFS daemon needs to register itself in a shared file (*hostsfile*) which needs to be accessible to _all_ +GekkoFS clients and daemons. Therefore, the hostsfile describes a file system and which node is part of that specific GekkoFS file system instance. -In a typical cluster environment this hostsfile should be placed within a POSIX-compliant parallel file system, such as GPFS or Lustre. +In a typical cluster environment this hostsfile should be placed within a POSIX-compliant parallel file system, such as +GPFS or Lustre. *Note: NFS is not strongly consistent and cannot be used for the hosts file!* @@ -80,7 +92,9 @@ In a typical cluster environment this hostsfile should be placed within a POSIX- tl;dr example: `/bin/gkfs_daemon -r -m -H ` -Run the GekkoFS daemon on each node specifying its locally used directory where the file system data and metadata is stored (`-r/--rootdir `), e.g., the node-local SSD; +Run the GekkoFS daemon on each node specifying its locally used directory where the file system data and metadata is +stored (`-r/--rootdir `), e.g., the node-local SSD; + 2. the pseudo mount directory used by clients to access GekkoFS (`-m/--mountdir `); and 3. the hostsfile path (`-H/--hostsfile `). @@ -191,28 +205,28 @@ to `/tmp/gkfs_client.log`. The following modules are available: - `none`: don't print any messages - - `syscalls`: Trace system calls: print the name of each system call, its - arguments, and its return value. All system calls are printed after being - executed save for those that may not return, such as `execve()`, - `execve_at()`, `exit()`, and `exit_group()`. This module will only be - available if the client library is built in `Debug` mode. - - `syscalls_at_entry`: Trace system calls: print the name of each system call - and its arguments. All system calls are printed before being executed and - therefore their return values are not available in the log. This module will - only be available if the client library is built in `Debug` mode. - - `info`: Print information messages. - - `critical`: Print critical errors. - - `errors`: Print errors. - - `warnings`: Print warnings. - - `mercury`: Print Mercury messages. - - `debug`: Print debug messages. This module will only be available if the - client library is built in `Debug` mode. - - `most`: All previous options combined except `syscalls_at_entry`. This - module will only be available if the client library is built in `Debug` - mode. - - `all`: All previous options combined. - - `trace_reads`: Generate log line with extra information in read operations for guided distributor - - `help`: Print a help message and exit. +- `syscalls`: Trace system calls: print the name of each system call, its + arguments, and its return value. All system calls are printed after being + executed save for those that may not return, such as `execve()`, + `execve_at()`, `exit()`, and `exit_group()`. This module will only be + available if the client library is built in `Debug` mode. +- `syscalls_at_entry`: Trace system calls: print the name of each system call + and its arguments. All system calls are printed before being executed and + therefore their return values are not available in the log. This module will + only be available if the client library is built in `Debug` mode. +- `info`: Print information messages. +- `critical`: Print critical errors. +- `errors`: Print errors. +- `warnings`: Print warnings. +- `mercury`: Print Mercury messages. +- `debug`: Print debug messages. This module will only be available if the + client library is built in `Debug` mode. +- `most`: All previous options combined except `syscalls_at_entry`. This + module will only be available if the client library is built in `Debug` + mode. +- `all`: All previous options combined. +- `trace_reads`: Generate log line with extra information in read operations for guided distributor +- `help`: Print a help message and exit. When tracing sytem calls, specific syscalls can be removed from log messages by setting the `LIBGKFS_LOG_SYSCALL_FILTER` environment variable. For instance, @@ -230,28 +244,33 @@ environment variable. ## External functions -GekkoFS allows to use external functions on your client code, via LD_PRELOAD. +GekkoFS allows to use external functions on your client code, via LD_PRELOAD. Source code needs to be compiled with -fPIC. We include a pfind io500 substitution, - `examples/gfind/gfind.cpp` and a non-mpi version `examples/gfind/sfind.cpp` +`examples/gfind/gfind.cpp` and a non-mpi version `examples/gfind/sfind.cpp` ## Data distributors + The data distribution can be selected at compilation time, we have 2 distributors available: ### Simple Hash (Default) + Chunks are distributed randomly to the different GekkoFS servers. ### Guided Distributor -The guided distributor allows defining a specific distribution of data on a per directory or file basis. -The distribution configurations are defined within a shared file (called `guided_config.txt` henceforth) with the following format: +The guided distributor allows defining a specific distribution of data on a per directory or file basis. +The distribution configurations are defined within a shared file (called `guided_config.txt` henceforth) with the +following format: ` ` To enable the distributor, the following CMake compilation flags are required: + * `GKFS_USE_GUIDED_DISTRIBUTION` ON * `GKFS_USE_GUIDED_DISTRIBUTION_PATH` `` -To use a custom distribution, a path needs to have the prefix `#` (e.g., `#/mdt-hard 0 0`), in which all the data of all files in that directory goes to the same place as the metadata. -Note, that a chunk/host configuration is inherited to all children files automatically even if not using the prefix. +To use a custom distribution, a path needs to have the prefix `#` (e.g., `#/mdt-hard 0 0`), in which all the data of all +files in that directory goes to the same place as the metadata. +Note, that a chunk/host configuration is inherited to all children files automatically even if not using the prefix. In this example, `/mdt-hard/file1` is therefore also using the same distribution as the `/mdt-hard` directory. If no prefix is used, the Simple Hash distributor is used. @@ -260,12 +279,15 @@ If no prefix is used, the Simple Hash distributor is used. Creating a guided configuration file is based on an I/O trace file of a previous execution of the application. For this the `trace_reads` tracing module is used (see above). -The `trace_reads` module enables a `TRACE_READS` level log at the clients writing the I/O information of the client which is used as the input for a script that creates the guided distributor setting. +The `trace_reads` module enables a `TRACE_READS` level log at the clients writing the I/O information of the client +which is used as the input for a script that creates the guided distributor setting. Note that capturing the necessary trace records can involve performance degradation. -To capture the I/O of each client within a SLURM environment, i.e., enabling the `trace_reads` module and print its output to a user-defined path, the following example can be used: +To capture the I/O of each client within a SLURM environment, i.e., enabling the `trace_reads` module and print its +output to a user-defined path, the following example can be used: `srun -N 10 -n 320 --export="ALL" /bin/bash -c "export LIBGKFS_LOG=trace_reads;LIBGKFS_LOG_OUTPUT=${HOME}/test/GLOBAL.txt;LD_PRELOAD=${GKFS_PRLD} "` Then, the `examples/distributors/guided/generate.py` scrpt is used to create the guided distributor configuration file: + * `python examples/distributors/guided/generate.py ~/test/GLOBAL.txt >> guided_config.txt` Finally, modify `guided_config.txt` to your distribution requirements. diff --git a/scripts/spack/README.md b/scripts/spack/README.md index 1e1657901..7f2a581d0 100644 --- a/scripts/spack/README.md +++ b/scripts/spack/README.md @@ -1,55 +1,89 @@ +## Spack -### Spack +Spack is a package manager for supercomputers and Linux. It makes it easy to install scientific software for regular +users. +Spack is another method to install GekkoFS where Spack handles all the dependencies and setting up the environment. -You can use Spack to install GekkoFS and let it handle all the dependencies. First, you will need to install Spack: +### Install Spack -``` +First, install Spack. You can find the instructions here: https://spack.readthedocs.io/en/latest/getting_started.html + +```bash git clone https://github.com/spack/spack.git . spack/share/spack/setup-env.sh ``` -Once Spack is installed and available in your path, add gekkofs to the Spack namespace. +Note that the second line needs to be executed every time you open a new terminal. It sets up the environment for Spack +and the corresponding environment variables, e.g., $PATH. -``` +### Install GekkoFS with Spack + +To install GekkoFS with Spack, the GekkoFS repository needs to be added to Spack as it is not part of the official Spack +repository. + +```bash spack repo add gekkofs/scripts/spack ``` -You can then check that Spack can find GekkoFS by typing: +When added, the GekkoFS package is available. Its installation variants and options can be checked via: -``` +```bash spack info gekkofs ``` -Finally, just install GekkoFS. You can also install variants (tests, forwarding mode, AGIOS scheduling). +Then install GekkoFS with Spack: ```bash spack install gekkofs # for installing tests dependencies and running tests -spack install -v --test=root gekkofs +tests +spack install -v --test=root gekkofs ``` -Remember to load GekkoFS to run: +Finally, GekkoFS is loaded into the currently used environment: -``` +```bash spack load gekkofs ``` -If you want to enable the forwarding mode: +This installs the latest release version including its required Git submodules. The installation directory is +`$SPACK_ROOT/opt/spack/linux-///gekkofs-`. The GekkoFS daemon (`gkfs_daemon`) is +located in the `bin` directory and the GekkoFS client (`libgkfs_intercept.so`) is located in the `lib` directory. -``` -spack install gekkofs +forwarding -``` +Note that loading the environment adds the GekkoFS daemon to the `$PATH` environment variable. Therefore, the GekkoFS +daemon is started by running `gkfs_daemon`. Loading GekkoFS in Spack further provides the `$GKFS_CLIENT` environment +variable pointing to the interception library. -If you want to enable the AGIOS scheduling library for the forwarding mode: +Therefore, the following commands can be run to use GekkoFS: +```bash +# Consult `-h` or the Readme for further options +gkfs_daemon -r /tmp/gkfs_rootdir -m /tmp/gkfs_mountdir & +LD_PRELOAD=$GKFS_CLIENT ls -l /tmp/gkfs_mountdir +LD_PRELOAD=$GKFS_CLIENT touch /tmp/gkfs_mountdir/foo +LD_PRELOAD=$GKFS_CLIENT ls -l /tmp/gkfs_mountdir ``` -spack install gekkofs +forwarding +agios + +When done using GekkoFS, unload it from the environment: + +```bash +spack unload gekkofs ``` -If you want to use the latest developer branch of GekkoFS: +### Alternative deployment (on many nodes) + +`gekkofs/scripts/run/gkfs` provides a script to deploy GekkoFS in a single command on several nodes by using `srun`. +Consult the main [README](../../README.md) or GekkoFS documentation for details. + +### Miscellaneous + +Use GekkoFS's latest version (master branch) with Spack: ``` spack install gekkofs@latest ``` -The default is using version 0.9.1 the last stable release. +Use a specific compiler on your system, e.g., gcc-11.2.0: + +```bash +spack install gekkofs@latest%gcc@11.2.0 +``` \ No newline at end of file diff --git a/scripts/spack/packages/gekkofs/package.py b/scripts/spack/packages/gekkofs/package.py index 0878ac83c..f23dd6f54 100755 --- a/scripts/spack/packages/gekkofs/package.py +++ b/scripts/spack/packages/gekkofs/package.py @@ -1,33 +1,34 @@ -# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -# from spack import * -from spack.build_systems.cmake import * -from spack.directives import * -from spack.multimethod import when -from spack.util.executable import which +from spack import * -class Gekkofs(CMakePackage): - """GekkoFS is a file system capable of aggregating the local I/O capacity and performance of each compute node -in a HPC cluster to produce a high-performance storage space that can be accessed in a distributed manner. -This storage space allows HPC applications and simulations to run in isolation from each other with regards -to I/O, which reduces interferences and improves performance.""" +# for Clion. Comment out when using spack +# from spack.build_systems.cmake import * +# from spack.directives import * +# from spack.multimethod import when +# from spack.util.executable import which +# from spack.package import PackageBase + +class Gekkofs(CMakePackage): + """GekkoFS is a distributed burst buffer file system in user space. It is capable of aggregating the local I/O + capacity and performance of each compute node in a HPC cluster to produce a high-performance storage space that + can be accessed in a distributed manner. This storage space allows HPC applications and simulations to run in + isolation from each other with regards to I/O, which reduces interferences and improves performance.""" homepage = "https://storage.bsc.es/gitlab/hpc/gekkofs" git = "https://storage.bsc.es/gitlab/hpc/gekkofs.git" url = "https://storage.bsc.es/projects/gekkofs/releases/gekkofs-v0.9.1.tar.gz" - maintainers = ['jeanbez', 'marcvef'] + maintainers = ['marc_vef', 'ramon_nou'] # set various versions version('latest', branch='master', submodules=True) - version('0.8.0', sha256='106c032d8cdab88173ab116c213201aa5aaad8d7dfc7b5087c94db329e7090e3') - version('0.9.0', sha256='f6f7ec9735417d71d68553b6a4832e2c23f3e406d8d14ffb293855b8aeec4c3a') + version('0.9.0', sha256='f6f7ec9735417d71d68553b6a4832e2c23f3e406d8d14ffb293855b8aeec4c3a', deprecated=True) version('0.9.1', sha256='1772b8a9d4777eca895f88cea6a1b4db2fda62e382ec9f73508e38e9d205d5f7') # apply patches patch('date-tz.patch') - patch('daemon.patch', when='@0.8') # set arguments variant('build_type', default='Release', @@ -35,38 +36,33 @@ to I/O, which reduces interferences and improves performance.""" values=('Debug', 'Release', 'RelWithDebInfo') ) - variant('tests', default=False, description='Build and runs GekkoFS tests.') variant('forwarding', default=False, description='Enables the GekkoFS I/O forwarding mode.') variant('agios', default=False, description='Enables the AGIOS scheduler for the forwarding mode.') variant('guided_distributor', default=False, description='Enables the guided distributor.') variant('prometheus', default=False, description='Enables Prometheus support for statistics.') - variant('parallax', default=False, description='Enables Parallax key-value database.') - variant('rename', default=False, description='Enables experimental rename support.') + variant('parallax', default=False, description='Enables Parallax key-value database.', when='latest') + variant('rename', default=False, description='Enables experimental rename support.', when='latest') variant('dedicated_psm2', default=False, description='Use dedicated _non-system_ opa-psm2 version 11.2.185.') - variant('compile', default='x86', multi=False, values=('x86','powerpc','arm'), description='Architecture to compile syscall intercept.') + variant('compile', default='x86', multi=False, values=('x86', 'powerpc', 'arm'), + description='Architecture to compile syscall intercept.') # general dependencies depends_on('cmake@3.6.0:', type='build') - depends_on('lz4', when='@0.8:') + depends_on('lz4') depends_on('argobots') depends_on('syscall-intercept@arm', when='compile=arm') depends_on('syscall-intercept@powerpc', when='compile=powerpc') depends_on('syscall-intercept@x86', when='compile=x86') depends_on('date cxxstd=14 +shared +tz tzdb=system') depends_on('opa-psm2@11.2.185', when='+dedicated_psm2') - # 0.8.0 specific - depends_on('libfabric@1.8.1', when='@0.8') - depends_on('bzip2', when='@0.8') - depends_on('zstd', when='@0.8') - depends_on('uuid', when='@0.8') - depends_on('bmi', when='@0.8') - depends_on('mercury@2.0.0 +debug +ofi +mpi +sm +shared +boostsys -checksum', when='@0.8') - depends_on('margo', when='@0.8') - depends_on('rocksdb@6.11.4 -shared +static +lz4 +snappy +zlib +rtti', when='@0.8') # 0.9.0 specific depends_on('libfabric@1.13.2', when='@0.9:,latest') depends_on('mercury@2.1.0 -debug +ofi -mpi -bmi +sm +shared +boostsys -checksum', when='@0.9:,latest') depends_on('mochi-margo@0.9.6', when='@0.9:,latest') - depends_on('rocksdb@6.20.3 -shared +static +lz4 -snappy -zlib -zstd -bz2 +rtti', when='@0.9:,latest') + depends_on('rocksdb@6.20.3 -shared +static +lz4 -snappy -zlib -zstd -bz2 +rtti', when='@0.9.0') + # 0.9.1 specific + depends_on('rocksdb@6.26.1 -shared +static +lz4 -snappy -zlib -zstd -bz2 +rtti', when='@0.9.1:,latest') + + # Additional features # Agios I/O forwarding depends_on('agios@1.0', when='@0.8: +agios') depends_on('agios@latest', when='@master +agios') @@ -74,16 +70,20 @@ to I/O, which reduces interferences and improves performance.""" depends_on('prometheus-cpp', when='@0.9:,latest +prometheus') depends_on('parallax', when='@0.9:,latest +parallax') + # known incompatbilities + conflicts('%gcc@11:', when='@:0.9.1') + def cmake_args(self): """Set up GekkoFS CMake arguments""" args = [ - self.define_from_variant('GKFS_BUILD_TESTS', 'tests'), + self.define('CMAKE_INSTALL_LIBDIR', self.prefix.lib), + self.define('GKFS_BUILD_TESTS', self.run_tests), self.define_from_variant('GKFS_ENABLE_FORWARDING', 'forwarding'), self.define_from_variant('GKFS_ENABLE_AGIOS', 'agios'), self.define_from_variant('GKFS_USE_GUIDED_DISTRIBUTION', 'guided_distributor'), self.define_from_variant('GKFS_ENABLE_PROMETHEUS', 'prometheus'), self.define_from_variant('GKFS_USE_PARALLAX', 'parallax'), - self.define_from_variant('RENAME_SUPPORT', 'rename'), + self.define_from_variant('GKFS_RENAME_SUPPORT', 'rename'), ] return args @@ -92,5 +92,5 @@ to I/O, which reduces interferences and improves performance.""" with working_dir(self.build_directory): make('test', parallel=False) - def setup_run_environment(self, env): - env.set('GKFS_PRLD', join_path(self.prefix.lib, 'libgkfs_intercept.so')) + def setup_run_environment(self, env): + env.set('GKFS_CLIENT', join_path(self.prefix.lib, 'libgkfs_intercept.so')) diff --git a/scripts/spack/packages/rocksdb/package.py b/scripts/spack/packages/rocksdb/package.py index d9293d332..78586bbfb 100644 --- a/scripts/spack/packages/rocksdb/package.py +++ b/scripts/spack/packages/rocksdb/package.py @@ -13,8 +13,9 @@ class Rocksdb(MakefilePackage): url = 'https://github.com/facebook/rocksdb/archive/v6.5.3.tar.gz' git = 'https://github.com/facebook/rocksdb.git' - version('master', git=git, branch='master', submodules=True) - version('6.20.3', sha256='c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca') + version('master', git=git, branch='master', submodules=True) + version('6.26.1', sha256='5aeb94677bdd4ead46eb4cefc3dbb5943141fb3ce0ba627cfd8cbabeed6475e7') + version('6.20.3', sha256='c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca') version('6.19.3', sha256='5c19ffefea2bbe4c275d0c60194220865f508f371c64f42e802b4a85f065af5b') version('6.11.4', sha256='6793ef000a933af4a834b59b0cd45d3a03a3aac452a68ae669fb916ddd270532') version('6.7.3', sha256='c4d1397b58e4801b5fd7c3dd9175e6ae84541119cbebb739fe17d998f1829e81') -- GitLab From e11740489a27194397aa7ca7a7d116330df4d21d Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Thu, 9 Mar 2023 20:39:41 +0100 Subject: [PATCH 08/10] Adding Spack documentation to Sphinx and added changelog entry --- CHANGELOG.md | 2 + docs/sphinx/users/building.rst | 87 ++++++++++++++++++++++++++++++++-- scripts/spack/README.md | 2 +- 3 files changed, 87 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1c92536b..f360b69b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). when building to precisely see how a GekkoFS instance has been configured. - Added (parallel) append support for consecutive writes with file descriptor opened with `O_APPEND` ([!164](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/164)). +- Added support for Spack so that it can be used to install + GekkoFS ([!137](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/137)). ### Changed diff --git a/docs/sphinx/users/building.rst b/docs/sphinx/users/building.rst index 259e84d1a..d84800f5c 100644 --- a/docs/sphinx/users/building.rst +++ b/docs/sphinx/users/building.rst @@ -108,9 +108,10 @@ dependencies: - `AGIOS `_ (commit c26a654 or newer) to enable the :code:`GekkoFWD` I/O forwarding mode. -- `PARALLAX` There are two different metadata backends in GekkoFS. The default one uses `rocksdb`, however an alternative based on `PARALLAX` from `FORTH` -is available. To enable it, use the `-DGKFS_ENABLE_PARALLAX:BOOL=ON` option, you can also disable `rocksdb` with `-DGKFS_ENABLE_ROCKSDB:BOOL=OFF`. - Once it is enabled, `--dbbackend` option will be functional. +- :code:`PARALLAX` There are two different metadata backends in GekkoFS. The default one uses :code:`rocksdb`, however +an alternative based on :code:`PARALLAX` from :code:`FORTH` is available. To enable it, use the +:code:`-DGKFS_ENABLE_PARALLAX:BOOL=ON` option, you can also disable :code:`rocksdb` with +:code:`-DGKFS_ENABLE_ROCKSDB:BOOL=OFF`. Once it is enabled, :code:`--dbbackend` option will be functional. .. _step_by_step_installation: @@ -213,3 +214,83 @@ appropriate subdirectories of :code:`GKFS_INSTALL_PATH`: - GekkoFS daemon (server): :code:`${GKFS_INSTALL_PATH}/bin/gkfs_daemon` - GekkoFS client interception library: :code:`${GKFS_INSTALL_PATH}/lib/libgkfs_intercept.so` + +Install GekkoFS via Spack (alternative) +--------------------- + +Spack is a package manager for supercomputers and Linux. It makes it easy to install scientific software for regular +users. Spack is another method to install GekkoFS where Spack handles all the dependencies and setting up the environment. + +Install Spack +========================= + +First, install Spack. You can find the instructions here: https://spack.readthedocs.io/en/latest/getting_started.html + + .. code-block:: console + git clone https://github.com/spack/spack.git + . spack/share/spack/setup-env.sh + +.. attention:: + Note that the second line needs to be executed every time you open a new terminal. It sets up the environment for Spack +and the corresponding environment variables, e.g., $PATH. + +Install GekkoFS with Spack +========================= + +To install GekkoFS with Spack, the GekkoFS repository needs to be added to Spack as it is not part of the official Spack +repository. + + .. code-block:: console + spack repo add gekkofs/scripts/spack + +When added, the GekkoFS package is available. Its installation variants and options can be checked via: + + .. code-block:: console + spack info gekkofs + +Then install GekkoFS with Spack: + + .. code-block:: console + spack install gekkofs + # for installing tests dependencies and running tests + spack install -v --test=root gekkofs + +Finally, GekkoFS is loaded into the currently used environment: + + .. code-block:: console + spack load gekkofs + +This installs the latest release version including its required Git submodules. The installation directory is +:code:`$SPACK_ROOT/opt/spack/linux-///gekkofs-`. The GekkoFS daemon (:code:`gkfs_daemon`) is +located in the :code:`bin` directory and the GekkoFS client (:code:`libgkfs_intercept.so`) is located in the :code:`lib` directory. + +Note that loading the environment adds the GekkoFS daemon to the `$PATH` environment variable. Therefore, the GekkoFS +daemon is started by running :code:`gkfs_daemon`. Loading GekkoFS in Spack further provides the :code:`$GKFS_CLIENT` environment +variable pointing to the interception library. + +Therefore, the following commands can be run to use GekkoFS: + + .. code-block:: console + # Consult `-h` or the Readme for further options + gkfs_daemon -r /tmp/gkfs_rootdir -m /tmp/gkfs_mountdir & + LD_PRELOAD=$GKFS_CLIENT ls -l /tmp/gkfs_mountdir + LD_PRELOAD=$GKFS_CLIENT touch /tmp/gkfs_mountdir/foo + LD_PRELOAD=$GKFS_CLIENT ls -l /tmp/gkfs_mountdir + +When done using GekkoFS, unload it from the environment: + + .. code-block:: console + spack unload gekkofs + +Miscellaneous +========================= + +Use GekkoFS's latest version (master branch) with Spack: + + .. code-block:: console + spack install gekkofs@latest + +Use a specific compiler on your system, e.g., gcc-11.2.0: + + .. code-block:: console + spack install gekkofs@latest%gcc@11.2.0 \ No newline at end of file diff --git a/scripts/spack/README.md b/scripts/spack/README.md index 7f2a581d0..b1f3bce9f 100644 --- a/scripts/spack/README.md +++ b/scripts/spack/README.md @@ -6,7 +6,7 @@ Spack is another method to install GekkoFS where Spack handles all the dependenc ### Install Spack -First, install Spack. You can find the instructions here: https://spack.readthedocs.io/en/latest/getting_started.html +First, install Spack. You can find the instructions [here](https://spack.readthedocs.io/en/latest/getting_started.html) ```bash git clone https://github.com/spack/spack.git -- GitLab From 8321783bc58923369dac261da1a6f1c169f41403 Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Thu, 9 Mar 2023 20:55:12 +0100 Subject: [PATCH 09/10] Added README FAQ --- scripts/spack/README.md | 30 ++++++++++++++- scripts/spack/packages/gekkofs/daemon.patch | 42 --------------------- 2 files changed, 29 insertions(+), 43 deletions(-) delete mode 100644 scripts/spack/packages/gekkofs/daemon.patch diff --git a/scripts/spack/README.md b/scripts/spack/README.md index b1f3bce9f..339a0dce3 100644 --- a/scripts/spack/README.md +++ b/scripts/spack/README.md @@ -86,4 +86,32 @@ Use a specific compiler on your system, e.g., gcc-11.2.0: ```bash spack install gekkofs@latest%gcc@11.2.0 -``` \ No newline at end of file +``` + +#### FAQ + +I cannot run the tests because Python is missing? For Spack and GCC, we rely on the system installed versions. If you +are working on a supercomputer, you may need to load the corresponding Python module first: + +```bash +# GekkoFS tests require at least Python version 3.6. +module load python/3.9.10 +``` + +Everything is failing during the compilation process? See question above, either a GCC is not loaded or it is too old +and does not support C++17 which we require. In any case, when using Spack it is good practice to use the system +compiler if possible: + +```bash +# GekkoFS requires at least GCC version 8 +module load gcc/11.2.0 +``` + +This may not be enough for Spack to recognize it (depending on what time Spack is installed). Therefore, you need to add +the compiler to spack via: + +```bash +spack compiler find +``` + +`spack compiler list` should then list the loaded compiler. \ No newline at end of file diff --git a/scripts/spack/packages/gekkofs/daemon.patch b/scripts/spack/packages/gekkofs/daemon.patch deleted file mode 100644 index 157a92aaa..000000000 --- a/scripts/spack/packages/gekkofs/daemon.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/src/daemon/CMakeLists.txt 2021-07-08 16:40:56.952476529 -0700 -+++ b/src/daemon/CMakeLists.txt 2021-07-08 16:49:09.257352458 -0700 -@@ -66,31 +66,23 @@ - ) - ################### Forwarding daemon ################### - if (GKFS_ENABLE_FORWARDING) -- if (GKFS_ENABLE_AGIOS) -- set(FWD_DAEMON_SRC -- ${DAEMON_SRC} -- scheduler/agios.cpp -+ set(FWD_DAEMON_SRC -+ ${DAEMON_SRC} -+ scheduler/agios.cpp - ) -- set(FWD_DAEMON_HEADERS -- ${DAEMON_HEADERS} -- ../../include/daemon/scheduler/agios.hpp -+ set(FWD_DAEMON_HEADERS -+ ${DAEMON_HEADERS} -+ ../../include/daemon/scheduler/agios.hpp - ) -- add_executable(gkfwd_daemon ${FWD_DAEMON_SRC} ${FWD_DAEMON_HEADERS}) -+ add_executable(gkfwd_daemon ${FWD_DAEMON_SRC} ${FWD_DAEMON_HEADERS}) - -+ if (GKFS_ENABLE_AGIOS) - target_compile_definitions(gkfwd_daemon - PUBLIC - GKFS_ENABLE_FORWARDING - DGKFS_ENABLE_AGIOS - ) - else () -- set(FWD_DAEMON_SRC -- ${DAEMON_SRC} -- ) -- set(FWD_DAEMON_HEADERS -- ${DAEMON_HEADERS} -- ) -- add_executable(gkfwd_daemon ${FWD_DAEMON_SRC} ${FWD_DAEMON_HEADERS}) -- - target_compile_definitions(gkfwd_daemon - PUBLIC - GKFS_ENABLE_FORWARDING -- GitLab From 3f59f7ad255305728cef20afb23f4caae20ae8b7 Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Thu, 9 Mar 2023 21:20:19 +0100 Subject: [PATCH 10/10] Fix Sphinx syntax --- docs/sphinx/users/building.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/sphinx/users/building.rst b/docs/sphinx/users/building.rst index d84800f5c..e0a0beee0 100644 --- a/docs/sphinx/users/building.rst +++ b/docs/sphinx/users/building.rst @@ -227,6 +227,7 @@ Install Spack First, install Spack. You can find the instructions here: https://spack.readthedocs.io/en/latest/getting_started.html .. code-block:: console + git clone https://github.com/spack/spack.git . spack/share/spack/setup-env.sh @@ -241,16 +242,19 @@ To install GekkoFS with Spack, the GekkoFS repository needs to be added to Spack repository. .. code-block:: console + spack repo add gekkofs/scripts/spack When added, the GekkoFS package is available. Its installation variants and options can be checked via: .. code-block:: console + spack info gekkofs Then install GekkoFS with Spack: .. code-block:: console + spack install gekkofs # for installing tests dependencies and running tests spack install -v --test=root gekkofs @@ -258,6 +262,7 @@ Then install GekkoFS with Spack: Finally, GekkoFS is loaded into the currently used environment: .. code-block:: console + spack load gekkofs This installs the latest release version including its required Git submodules. The installation directory is @@ -271,6 +276,7 @@ variable pointing to the interception library. Therefore, the following commands can be run to use GekkoFS: .. code-block:: console + # Consult `-h` or the Readme for further options gkfs_daemon -r /tmp/gkfs_rootdir -m /tmp/gkfs_mountdir & LD_PRELOAD=$GKFS_CLIENT ls -l /tmp/gkfs_mountdir @@ -280,6 +286,7 @@ Therefore, the following commands can be run to use GekkoFS: When done using GekkoFS, unload it from the environment: .. code-block:: console + spack unload gekkofs Miscellaneous @@ -288,9 +295,11 @@ Miscellaneous Use GekkoFS's latest version (master branch) with Spack: .. code-block:: console + spack install gekkofs@latest Use a specific compiler on your system, e.g., gcc-11.2.0: .. code-block:: console + spack install gekkofs@latest%gcc@11.2.0 \ No newline at end of file -- GitLab