Summary
Implement a pdsh (Parallel Distributed Shell) compatibility mode that allows bssh to be used as a drop-in replacement for pdsh. Users should be able to use pdsh command syntax and have it automatically mapped to bssh's superior functionality.
This is a meta-issue. See linked sub-issues below for individual implementation tasks.
Background
pdsh is a widely-used parallel shell utility in HPC environments. Adding compatibility mode would allow users to migrate from pdsh to bssh without changing their existing scripts and workflows.
Activation Methods (Proposed)
- Binary name detection: If
argv[0] is "pdsh", automatically enable compatibility mode
- Environment variable:
BSSH_PDSH_COMPAT=1
- Command-line flag:
bssh --pdsh-compat or bssh pdsh subcommand
Option Conflict Analysis
Critical Conflicts (same short flag, different meaning)
| Option |
pdsh meaning |
bssh meaning |
Resolution |
-f |
fanout (max concurrent, default 32) |
--filter (host filter pattern) |
In pdsh mode: map to --parallel |
-t |
connection timeout (seconds) |
--tty (force TTY allocation) |
In pdsh mode: new --connect-timeout |
-A |
all nodes (genders database) |
--use-agent (SSH agent) |
In pdsh mode: target all configured hosts |
-q |
display options/nodelist then exit |
--quiet (suppress output) |
In pdsh mode: dry-run/list mode |
-S |
return largest exit code |
--sudo-password |
In pdsh mode: map to new --any-failure |
-L |
list loaded modules |
--local-forward |
In pdsh mode: show info |
-R |
rcmd module selection |
--remote-forward |
In pdsh mode: ignore (ssh only) |
-C |
SLURM features filter |
--cluster |
Similar concept, may work |
-F |
genders file path |
--ssh-config |
Different file format |
Compatible Options
| Option |
Both pdsh and bssh meaning |
-l |
Login user name |
pdsh Options Not in bssh (need implementation)
| Option |
pdsh meaning |
Proposed bssh implementation |
-w |
Host targets |
Map to -H |
-x |
Exclude hosts |
New --exclude option |
-u |
Command timeout |
Map to --timeout |
-N |
Disable hostname prefix |
New --no-prefix option |
-b |
Batch mode (single Ctrl+C kills) |
New --batch option |
-k |
Fail fast on error |
New --fail-fast option |
-d |
Debug/timing statistics |
Map to -vvv |
-g |
Target by group/attributes |
Map to -C (cluster) |
Implementation Phases
Note: Phases are ordered by dependency - new bssh options must exist before the pdsh compatibility layer can map to them.
Phase 1: New Options for Feature Parity
Add new options to bssh that pdsh compatibility mode will map to:
Phase 2: Core Infrastructure
Build the pdsh compatibility layer:
Phase 3: Hostlist Expression Support
Phase 4: Installation & Documentation
Sub-Issues
Phase 1: New Options for Feature Parity
Phase 2: Core Infrastructure
Phase 3: Hostlist Expression Support
Phase 4: Installation & Documentation
Impact on Existing Behavior
- No impact: Default bssh behavior remains unchanged
- Opt-in only: Compatibility mode requires explicit activation
- Backward compatible: All existing bssh commands continue to work
Example Usage (after implementation)
# pdsh-style commands work when running as pdsh or with compat mode
pdsh -w node[01-10] -f 20 "uptime" # Using pdsh symlink
bssh --pdsh-compat -w node[01-10] -f 20 "uptime" # Using flag
BSSH_PDSH_COMPAT=1 bssh -w node[01-10] "uptime" # Using env var
# Equivalent bssh native command
bssh -H "node01,node02,...,node10" --parallel 20 "uptime"
References
Summary
Implement a pdsh (Parallel Distributed Shell) compatibility mode that allows bssh to be used as a drop-in replacement for pdsh. Users should be able to use pdsh command syntax and have it automatically mapped to bssh's superior functionality.
Background
pdsh is a widely-used parallel shell utility in HPC environments. Adding compatibility mode would allow users to migrate from pdsh to bssh without changing their existing scripts and workflows.
Activation Methods (Proposed)
argv[0]is "pdsh", automatically enable compatibility modeBSSH_PDSH_COMPAT=1bssh --pdsh-compatorbssh pdshsubcommandOption Conflict Analysis
Critical Conflicts (same short flag, different meaning)
-f--filter(host filter pattern)--parallel-t--tty(force TTY allocation)--connect-timeout-A--use-agent(SSH agent)-q--quiet(suppress output)-S--sudo-password--any-failure-L--local-forward-R--remote-forward-C--cluster-F--ssh-configCompatible Options
-lpdsh Options Not in bssh (need implementation)
-w-H-x--excludeoption-u--timeout-N--no-prefixoption-b--batchoption-k--fail-fastoption-d-vvv-g-C(cluster)Implementation Phases
Phase 1: New Options for Feature Parity
Add new options to bssh that pdsh compatibility mode will map to:
--excludeoption for host exclusion--no-prefixoption to disable hostname prefix in output--batchoption for single Ctrl+C termination--fail-fastoption to stop on first failure--connect-timeoutoption (separate from command timeout)Phase 2: Core Infrastructure
Build the pdsh compatibility layer:
main.rs(argv[0]check)BSSH_PDSH_COMPATenvironment variable supportsrc/cli/pdsh.rswith pdsh-compatible CLI parserPhase 3: Hostlist Expression Support
host[01-05]->host01,host02,...,host05host[1-5] -x host[2-3]^filenamesyntaxPhase 4: Installation & Documentation
pdsh -> bssh)Sub-Issues
Phase 1: New Options for Feature Parity
--excludeoption for host exclusion--no-prefixoption to disable hostname prefix--batchoption for batch mode--fail-fastoption for fail-fast execution--connect-timeoutoption for connection timeoutPhase 2: Core Infrastructure
Phase 3: Hostlist Expression Support
Phase 4: Installation & Documentation
Impact on Existing Behavior
Example Usage (after implementation)
References