|
20 | 20 | RUN_STG_BW, |
21 | 21 | RUN_STG_IOPS, |
22 | 22 | RUN_STG_META, |
| 23 | + SYNC, |
23 | 24 | SYSTEMS |
24 | 25 | ) |
25 | 26 | from bobber.lib.analysis import parse_results |
26 | 27 | from bobber.lib.system.file_handler import create_directory |
| 28 | +from bobber.lib.system.shell import copy_keys |
27 | 29 | from bobber.lib.tests import run_tests |
28 | 30 | from typing import NoReturn |
29 | 31 |
|
@@ -227,6 +229,21 @@ def parse_args(version: str) -> Namespace: |
227 | 229 | 'binary') |
228 | 230 | load.add_argument('filename', help='Filename of local *.tar file of ' |
229 | 231 | 'the image to load') |
| 232 | + |
| 233 | + # Options specific to synchronizing SSH keys in containers |
| 234 | + sync = commands.add_parser(SYNC, help='Create SSH keys and add them to all' |
| 235 | + ' Bobber containers in a cluster. Requires the ' |
| 236 | + 'container to be running on all nodes using ' |
| 237 | + '"bobber cast".') |
| 238 | + sync.add_argument('--hosts', help='A comma-separated list of hostnames or ' |
| 239 | + 'IP address of the nodes to add SSH keys to. Required ' |
| 240 | + 'for multi-node tests. If left empty, it is assumed ' |
| 241 | + 'that keys should only be copied to the container on ' |
| 242 | + 'the local node.', type=str, default='') |
| 243 | + sync.add_argument('--user', help='Optionally specify a user to use to ' |
| 244 | + 'login to remote hosts to copy keys to containers. If ' |
| 245 | + 'left blank, will use the currently logged-in user.', |
| 246 | + type=str, default='') |
230 | 247 | return parser.parse_args() |
231 | 248 |
|
232 | 249 |
|
@@ -360,6 +377,8 @@ def execute_command(args: Namespace, version: str) -> NoReturn: |
360 | 377 | bobber.lib.docker.cast(args.storage_path, args.ignore_gpu, version) |
361 | 378 | elif args.command == LOAD: |
362 | 379 | bobber.lib.docker.load(args.filename) |
| 380 | + elif args.command == SYNC: |
| 381 | + copy_keys(args.hosts, args.user) |
363 | 382 | else: |
364 | 383 | # Update the version to be used in filenames |
365 | 384 | version_underscore = version.replace('.', '_') |
|
0 commit comments