DDS's SSH plug-in is capable to deploy DDS agents on any resource machine available for password-less access (public key, ssh agent, etc.).
In order to define resources for the SSH plug-in we use a comma-separated values (CSV) configuration file, in cases if you want to deploy agents on several computing nodes.
The ssh plug-in can also spawn agents on the local machine only. In this case you don't need a configuration file - just use dds-submit -n X, where X is a desired number of agents to spawn.
As for the configuration file. Fields are normally separated by commas. If you want to put a comma in a field, you need to decorate it with quotes around. Also 3 escape sequences are supported.
DDS's SSH plug-in configuration fields:
- An id (must be any unique string).
This id string is used just to distinguish different DDS workers in the plug-in. - A host name with or without a login, in a form:
login@host.fqdn - Additional SSH params (could be empty).
- A remote working directory.
- A number of agents to spawn.
An example of the SSH plug-in configuration file:
r1, anar@lxg0527.gsi.de, -p24, /tmp/test, 10
# this is a comment
r2, user@lxi001.gsi.de,,/home/user/dds,10
125, user2@host, , /tmp/test,The SSH plug-in supports embedding custom bash scripts directly in the configuration file. These scripts are executed on each worker node before DDS agent startup, allowing you to set up custom environments, load modules, or perform initialization tasks.
Use @bash_begin@ and @bash_end@ tags to delimit your bash script:
@bash_begin@
# Your custom bash commands here
export MY_VAR=value
module load gcc/9.3.0
@bash_end@
# Regular SSH configuration entries follow
r1, user@host1.example.com, -p22, /tmp/dds, 4
r2, user@host2.example.com, , /tmp/dds, 4@bash_begin@
# Load required environment modules
module purge
module load gcc/9.3.0
module load openmpi/4.0.3
module load python/3.8.5
# Set custom environment variables
export MY_APP_CONFIG="/shared/config"
export DATA_ROOT="/shared/data"
export OMP_NUM_THREADS=4
# Source site-specific setup
if [ -f "/etc/site-setup.sh" ]; then
source /etc/site-setup.sh
fi
echo "Custom environment loaded for DDS worker"
@bash_end@
wn1, user@compute01.example.com, -p22, /home/user/dds_work, 8
wn2, user@compute02.example.com, -p22, /home/user/dds_work, 8
wn3, user@compute03.example.com, -p22, /home/user/dds_work, 8- The inline script is executed once per worker node during agent initialization
- The script applies to all agents spawned from the configuration file
- Comments are allowed within the
@bash_begin@/@bash_end@block - Comments outside the bash block start with
#as usual - The closing
@bash_end@tag must be present or a syntax error will occur - If you don't need an inline script, you can omit the tags entirely or use empty tags:
@bash_begin@
@bash_end@
wn, localhost, , ~/tmp/dds_wn_test, 6Instead of inline scripts in the configuration file, you can also use the --env-config flag with dds-submit:
dds-submit -r ssh -c ssh_config.cfg --env-config /path/to/env_script.shThis method is useful when you want to:
- Reuse the same environment script across different configurations
- Keep configuration files simple and separate from environment setup
- Manage environment scripts in version control separately
Call using a given configuration file:
dds-submit -r ssh -c your-ssh-Resource-definition-config-fileCall using a local system only to spawn 10 DDS agents on it:
dds-submit -r ssh -n 10