-
Notifications
You must be signed in to change notification settings - Fork 268
Remove configuration hosts.<hostname>.quantity field #2067
Copy link
Copy link
Closed
Labels
Type: EnhancementNew functionality or improved designNew functionality or improved design
Description
Shadow supports a hosts.<hostname>.quantity field to make it easier to start multiple hosts that run the same processes. For example, we use it in our curl example to start three clients:
hosts:
# a host with the hostname 'server'
server:
network_node_id: 0
processes:
- path: /usr/bin/python3
args: -m http.server 80
start_time: 3s
# three hosts with hostnames 'client1', 'client2', and 'client3'
client:
network_node_id: 0
quantity: 3
processes:
- path: /usr/bin/curl
args: -s server
start_time: 5sI think we should consider removing this option, and instead recommend using yaml anchors instead. The previous example can be replaced by:
hosts:
server:
network_node_id: 0
processes:
- path: /usr/bin/python3
args: -m http.server 80
start_time: 3s
client1: &client_host
network_node_id: 0
processes:
- path: /usr/bin/curl
args: -s server
start_time: 5s
client2: *client_host
client3: *client_hostThere is also a hosts.<hostname>.processes[*].quantity field we may also want to consider removing.
This syntax is already supported in shadow today.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: EnhancementNew functionality or improved designNew functionality or improved design