Story #9581
Updated by Brett Smith over 8 years ago
h3. Use case Administrators want additional control over how Arvados containers are dispatched to SLURM. Some options they might commonly want to specify are @--account@, @--clusters@, or @--partition@. crunch-dispatch-slurm should provide a simple mechanism for administrators to set arbitrary additional arguments to sbatch. h3. Implementation Add a command line flag, "-config path/to/config.json" (see source:services/keep-balance/main.go for an example). crunch-dispatch-slurm reads configuration entries from this JSON file. If no @-config@ switch is given, it tries to read configuration from @/etc/arvados/crunch-dispatch-slurm/config.json@. If that file does not exist, crunch-dispatch-slurm continues running with default configuration. example) Convert existing command line flags to config file entries. <pre> type Config struct { SbatchArguments []string PollPeriod time.Duration CrunchRunCommand string } </pre> Append the configured SbatchArguments to the existing arguments passed to exec.Command(). h3. Tests Just unit tests for sbatchFunc. * Handles nil SbatchArguments correctly * Handles non-nil SbatchArguments correctly