Resolve "Support Spack and others"

Usage information

Download Spack and setup environment:

git clone -c feature.manyFiles=true https://github.com/spack/spack.git
. spack/share/spack/setup-env.sh

Add GekkoFS Spack repository to Spack:

spack repo add gekkofs/scripts/spack

Check that Spack can find GekkoFS:

spack info gekkofs

Install GekkoFS (and run optional tests). Check spack info gekkofs for available option and versions:

spack install gekkofs
# for installing tests dependencies and running tests
spack install -v --test=root gekkofs +tests

Load GekkoFS into environment:

spack load gekkofs

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.

TODO

  • Base Spack functionality, versions, and configuration support
  • Documentation
  • Advanced functionality, more detailed configuration support, e.g., Parallax and Prometheus
  • More easy way to get path to client library
  • Add GekkoFS client wrapper for LD_PRELOAD
  • Add final version to main Spack repository if possible. (Not possible right now as it not clear how 3rd party libraries should be treated.

Closes #58 (closed)

Edited by Marc Vef

Merge request reports

Loading
+93 −3
Changes for docs/sphinx/users/building.rst: 93 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -108,9 +108,10 @@ dependencies:
- `AGIOS <https://github.com/francielizanon/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,92 @@ 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-<arch>/<compiler>/<version>/gekkofs-<version>`. 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
+20 −0
Changes for scripts/spack/packages/agios/package.py: 20 added lines, 0 removed lines.
Original line number Diff line number Diff line
# 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')
+36 −0
Changes for scripts/spack/packages/bmi/package.py: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line
# 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
+11 −0
Changes for scripts/spack/packages/gekkofs/date-tz.patch: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
--- 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)
+96 −0
Changes for scripts/spack/packages/gekkofs/package.py: 96 added lines, 0 removed lines.
Original line number Diff line number Diff line
# 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 *


# 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 = ['marc_vef', 'ramon_nou']
    # set various versions
    version('latest', branch='master', submodules=True)
    version('0.9.0', sha256='f6f7ec9735417d71d68553b6a4832e2c23f3e406d8d14ffb293855b8aeec4c3a', deprecated=True)
    version('0.9.1', sha256='1772b8a9d4777eca895f88cea6a1b4db2fda62e382ec9f73508e38e9d205d5f7')
    # apply patches
    patch('date-tz.patch')
    # set arguments
    variant('build_type',
            default='Release',
            description='CMake build type',
            values=('Debug', 'Release', 'RelWithDebInfo')
            )

    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.', 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.')
    # general dependencies
    depends_on('cmake@3.6.0:', type='build')
    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.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.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')
    # Prometheus CPP
    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('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('GKFS_RENAME_SUPPORT', 'rename'),
        ]
        return args

    def check(self):
        """Run tests"""
        with working_dir(self.build_directory):
            make('test', parallel=False)

    def setup_run_environment(self, env):
        env.set('GKFS_CLIENT', join_path(self.prefix.lib, 'libgkfs_intercept.so'))
Loading
Loading