Skip to content

Commit

Permalink
docs: Document Configure options
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisklein committed Feb 27, 2024
1 parent 22e79aa commit da5a732
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,37 @@ or newer. The plug-ins are compiled against the header file `<slurm/spank.h>`.
Fedora distributes this file in the `slurm-devel` RPM package [^DoUiD]. CMake is
available via the `cmake` package.

Choose a `<build-dir>` to configure and build the plugin:
```sh
cmake -S . -B build # configure the project and choose a build dir
cmake --build build # build the Singularity SPANK plug-in
sudo cmake --install build # install the binary and configuration files
# on older CMake: sudo cmake --build build --target install
cmake -S <source-dir> -B <build-dir> # configure
cmake --build <build-dir> # build the Singularity SPANK plug-in
```

You may customize the configure phase further via the following CMake options:

CMake option | Default | Description
---------------------------------|-------------------------------------------------------|-------------------------------------------------------------------------------------
`--install-prefix <install-dir>` | `/usr` | Equivalent to `-DCMAKE_INSTALL_PREFIX=<install-dir>`
`-DINSTALL_PLUGSTACK_CONF=ON` | `OFF` | Whether to install a plugin config file
`-DSLURM_SYSCONFDIR=...` | `/etc/slurm` | Slurm sysconfdir
`-DSLURM_PLUGSTACK_CONF_D=...` | `${SLURM_SYSCONFDIR}/plugstack.conf.d` | Slurm plugstack conf dir
`-DPLUGIN_DEFAULT_ARG=...` | `""` | Plugin default= arg`
`-DPLUGIN_BIND_ARG=...` | `${SLURM_SYSCONFDIR},/var/spool/slurm,/var/run/munge` | Plugin bind= arg
`-DPLUGIN_EXTRA_ARGS=...` | `""` | Plugin args= arg
`-DSLURM_INCLUDE_DIR=...` | Detected by CMake, typically `/usr/include` | Slurm include dir passed to compiler via `-I` so `#include <slurm/spank.h>` resolves
`-DCMAKE_INSTALL_LIBEXECDIR=...` | `libexec` on RHEL-based systems | FHS "internal binaries" directory

## Install

```sh
[sudo] cmake --install <build-dir>
```

By default the plug-in `singularity-exec.so` is installed to `/usr/lib64/slurm`.
`sudo` is needed to install to system directories like `/usr`.

By default, installation directories are chosen to be FSH-compliant [^sSrfT] as
implemented by the CMake "GNUInstallDirs" module [^dsfDS].

Restart `slurmd` in order to load the plug-in after installation.

## Configuration

Expand Down Expand Up @@ -76,6 +97,9 @@ Option | Description

Passing `-DINSTALL_PLUGSTACK_CONF=ON` to the CMake configure command will automate the above configuration.

Restart `slurmd` in order to load the plug-in after installation and configuration.


## Usage

The plugin adds following command-line options to `salloc`, `srun` and `sbatch`:
Expand Down Expand Up @@ -209,6 +233,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
[^DoUiD]: Fedora Slurm RPM Package
<https://src.fedoraproject.org/rpms/slurm>

[^sSrfT]: Filesystem Hierarchy Standard
<https://refspecs.linuxfoundation.org/fhs.shtml>

[^dsfDS]: CMake "GNUInstallDirs" module
<https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html>

[99]: singularity-exec.conf.in
[98]: slurm-singularity-wrapper.sh
[97]: containers.sh
Expand Down

0 comments on commit da5a732

Please sign in to comment.