att-cloudnative-labs / swarmhub

MIT License
2 stars 5 forks source link

Single Locust master with Locust slaves in multiple AWS regions #15

Open rn538e opened 4 years ago

rn538e commented 4 years ago

Is there a way to have the master in one AWS region but slaves in all 4? If not with the current version of swarmhub, is there a place I can make changes in the deployer/swarmhub code to do this?

kmhagan commented 4 years ago

This is not supported with the current version of swarmhub. You would have to make changes to the database schema to support creating a test that has multiple regions for slaves https://github.com/att-cloudnative-labs/swarmhub/blob/master/deployments/db/tables.txt#L95 portal.grid and portal.grid_template would have to be refactored to have a one-to-many relationship to regions and instances for the slaves.

The ansible jobs https://github.com/att-cloudnative-labs/swarmhub/tree/master/services/deployer/ansible would have to be refactored to support having a region tied to each instance it is deploying. Security groups and permissions would need to be altered to open up ports to the other VPCs instances so the slaves can talk to the master.

The frontend would need to be refactored for slave creation to be more dynamic and support adding additional slaves where the input is something like

Region Instance Type Number of Instances
us-west-1 t2.medium 3
us-west-2 t2.medium 2

Where additional rows can be inserted, either by a new one showing up automatically (but empty) or a plus button that adds a new row. https://github.com/att-cloudnative-labs/swarmhub/blob/master/services/swarmhub/frontend/src/components/CreateGrid.vue#L50-L65

And finally the API will have to be refactored to support a list of slaves that contain the region, instance type, and number of instances: https://github.com/att-cloudnative-labs/swarmhub/tree/master/services/swarmhub/src/swarmhub/api