Skip to content

Config helper - #236

Open
rountree wants to merge 1 commit into
llnl:develfrom
rountree:config_helper
Open

rountree wants to merge 1 commit into
llnl:develfrom
rountree:config_helper

Conversation

@rountree

Copy link
Copy Markdown
Collaborator

Separate binary that creates/validates Spindle config files. Work in progress.

@rountree

Copy link
Copy Markdown
Collaborator Author

spindle-config-helper is built using the same config_mgr.cc as Spindle and will pull in and parse runtime parameters from the same sources, including the command line.

The design philosophy is to validate those runtime parameters, issue warnings and validation where needed, and then dump all parameters and their current values to stdout. The user can redirect the output to their spindle.conf file.

Here's a snapshot of current functionality:

# Security configuration:
#   Current mode: munge
#     Munge authentication enabled
#
#   Munge availability:
#     Munge is available and working (recommended security option)
#
# Spindle filesystem recommendations:
#   Local: /dev/shm (tmpfs, 250GB), /tmp (tmpfs, 428GB)
#
#   commpaths analysis:
#     WARNING: /bad_commpath -> /bad_commpath
#       Path does not exist (will be created by Spindle)
#       Parent directory (/) is not writable
#     OK: /tmp/commpath -> /tmp/commpath (tmpfs, 428GB)
#
#   cachepaths analysis:
#     WARNING: /bad_cachepath -> /bad_cachepath
#       Path does not exist (will be created by Spindle)
#       Parent directory (/) is not writable
#     OK: /tmp/commpath/cachepath -> /tmp/commpath/cachepath (tmpfs, 428GB)
#
#   pythonprefix analysis:
#     WARNING: /usr/lib/python -> /usr/lib/python
#       Path does not exist
#     WARNING: /usr/lib64/python -> /usr/lib64/python
#       Path does not exist
#
#   localprefix analysis:
#     WARNING: /var/ -> /var
#       Cannot determine filesystem type
#     OK: /tmp/ -> /tmp (tmpfs, 428GB)
#     OK: /proc/ -> /proc
#     OK: /dev/ -> /dev
#     OK: /sys/ -> /sys
#
port = 21940
numports = 250
commpaths = /bad_commpath:/tmp/commpath
cachepaths = /bad_cachepath:/tmp/commpath/cachepath
pythonprefix = /usr/lib/python:/usr/lib64/python
localprefix = /var/:/tmp/:/proc/:/dev/:/sys/
strip = yes
relocaout = yes
reloclibs = yes
relocpython = yes
relocexec = yes
followfork = yes
stopreloc = no
level = default
pushpull = push
network = cobo
security = munge
launcher = serial
numa = no
audittype = audit
shmcachesize = 0
debug = no
noclean = no
disablelogging = yes
nohide = no
persist = no
msgcachebuffer = 0
msgcachetimeout = 0
cleanupproc = no
execexcludes = gcc:g++:cc:CC:clang:clang++:hipcc:amdclang:amdclang++:craycc:crayCC:ld:ld.lld:mpicc:mpic++:mpicxx:make:gmake:cmake
enablersh = no
patchldso = yes
crashdedup = no
calctls = yes
crashaltstack = no

@rountree

Copy link
Copy Markdown
Collaborator Author

Current snapshot.

$ ./spindle-config-helper -h
Usage: ./spindle-config-helper [OPTIONS] [-- SPINDLE_OPTIONS]

Generate and validate Spindle configuration files for HPC environments.

DESCRIPTION:
  spindle-config-helper analyzes the local system and generates appropriate
  spindle.conf files. It detects local vs. remote filesystems, discovers
  Python installations, validates paths, and tests SSH connectivity.

OPTIONS:
  -h, --help              Display this help message and exit
  -V, --version           Display version information and exit
  -o, --output=FILE       Write output to FILE instead of stdout
  --overwrite             Allow overwriting existing output file
  -c, --check[=FILE]      Validate existing config FILE (optional)
  -a, --all               Generate complete config with all options
  --usage                 Display Spindle's usage summary

MODES:
  Default mode (no options):
    - Analyzes filesystem mounts (local vs. remote)
    - Checks $TMPDIR availability and recommends paths
    - Tests SSH connectivity to verify compute node access
    - Discovers Python installations via 'which python/python3'
    - Generates localprefix from top-level directories
    - Outputs minimal spindle.conf with 4 path variables:
      * commpaths:     Local directories for inter-process communication
      * cachepaths:    Local directories for file caching
      * pythonprefix:  Python installation directories
      * localprefix:   Directories excluded from caching
    - Includes warnings and recommendations as comments

  Check mode (-c [FILE]):
    - FILE is optional: validates and outputs options from:
      * Config file (if FILE provided)
      * Command-line options after --
    - Command-line options override config file values
    - Validates option names and values
    - Use cases:
      * -c FILE           : Validate file
      * -c -- --opt=val   : Validate single option
      * -c FILE -- --opt  : Validate file + override

  All mode (-a):
    - Enumerates all Spindle configuration options
    - Comments out options with default values (prefix '#')
    - Uncomments options specified after --
    - Useful for discovering available options

ENVIRONMENT:
  $TMPDIR                 Preferred directory for commpaths/cachepaths
                          Falls back to /tmp if not set

SPINDLE_OPTIONS:
  Any valid Spindle option can be passed after --
  Use './spindle-config-helper -- --usage' to see all available options
  Common options:
    --commpaths=PATHS     Colon-separated list of comm directories
    --cachepaths=PATHS    Colon-separated list of cache directories
    --level=LEVEL         Aggressiveness: high, medium, low, off
    --security=MODE       Security: none, munge, keyfile
    --launcher=TYPE       Launcher: serial, slurm, flux, etc.

EXAMPLES:
  # Generate new config to stdout
  ./spindle-config-helper

  # Generate config for review before saving
  ./spindle-config-helper | less

  # Save config to file
  ./spindle-config-helper -o ~/.spindle/spindle.conf

  # Generate with custom paths
  ./spindle-config-helper -- --commpaths=/dev/shm --cachepaths=/tmp

  # Check existing config for warnings
  ./spindle-config-helper -c ~/.spindle/spindle.conf | grep WARNING

  # Update config with new security setting
  ./spindle-config-helper -c ~/.spindle/spindle.conf -o ~/.spindle/spindle.conf \
    --overwrite -- --security=munge

  # Generate complete config with all options
  ./spindle-config-helper -a -o spindle.conf.full

  # See all available Spindle options
  ./spindle-config-helper -- --usage

EXIT STATUS:
  0   Success
  1   Error (invalid arguments, file I/O error, etc.)

SEE ALSO:
  spindle(1), spindle-config-helper(1)

VERSION:
  spindle-config-helper 0.13

Utility for generating spindle.conf files with reasonable values
for commpaths, cachepaths, python-prefix, and local-prefix.

Builds using config_mgr.[cc|h].  The binary spindle-config-helper
will be put in the same directory as the spindle binary.

Co-authored with Claude Code.

Details:
	man share/man/man1/spindle-config-helper.1
	./bin/spindle-config-helper -h

This branch was previously deployed

1 inactive deployment
Spindle CI — 5329f87a Deployed Nov 13, 2026 by rountree via Testsuite (Serial, Ubuntu, arm64) #310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant