osrf / uctf

Unmanned Capture the Flag (U-CTF) project.
Apache License 2.0
24 stars 10 forks source link

Create deployment script for multiple payload machines #85

Closed gerkey closed 7 years ago

gerkey commented 7 years ago

Assuming that you're on the VPN, rsync a locally available tactics repo to all payload machines, set env vars as necessary and then spawn vehicles. We might want to make the spawning step available in the cloudsim UI in addition to or instead of via a script.

The script would take the set of vehicle IDs to be spawned. It'll decide how to parcel out the work over the available payload machines then write that configuration onto each one.

Also offer spawn script that will ssh into each payload and spawn the earlier configured vehicles.

gerkey commented 7 years ago

@tfoote and I made a plan today to develop two scripts, one to deploy and the other to spawn.

Deployment

deploy_blue --hosts <num_hosts> -i </path/to/key.pem> </path/to/my/local/working/copy>
deploy_gold --hosts <num_hosts> -i </path/to/key.pem> </path/to/my/local/working/copy>

where:

The script will ssh/rsync the local working copy to a known location on each of the indicated machines, then exit.

Spawning

rspawn_blue --hosts <num_hosts> -i </path/to/key.pem> <vehicle_ids...>
rspawn_gold --hosts <num_hosts> -i </path/to/key.pem> <vehicle_ids...>

where:

The script will spread the load of the requested vehicles across the available machines, sshing to each one and running the appropriate local spawn_blue or spawn_gold command. The script will hold all the SSH connections open and keep running until given Ctrl-C by the user, at which point it will tear everything down, including the remote processes.

tfoote commented 7 years ago

First work here: 8057d25dbdf1d0c05155d52580973aa8df2e2cbe

tfoote commented 7 years ago

sasc_deploy is working now for payloads. Only a single entry point for all payloads.