ODCR implementation
Related tasks
Context
The Cave Circuit runs will make use of AWS's On-Demand Capacity Reservation (ODCR) to ensure that there are enough machines available to launch all simulations.
There is an AWS EC2 API endpoint that allows checking the number of remaining machines in the ODCR.
AWS folks have suggested that we use this endpoint to check machine availability, instead of doing a dry-run before going ahead and actually requesting the machines.
This task requires that Ec2Client.launchInstances is modified to have different modes of operation: dry-run and ODCR. dry-run is the current implementation, and ODCR uses the EC2 SDK's (EC2API) DescribeCapacityReservations method to get the number of instances reserved and compare with a maximum known value.
Change
This MR adds a new env var to check if there are enough available instances using ODCR when launching a simulation.
Other information
Usage example:
- IGN_EC2_AVAILABILITY_ZONES: us-east-1c,us-east-1d
- IGN_EC2_MACHINES_LIMIT: "30"
- IGN_EC2_ODCR: cr-0e6edeb6d2be23519,cr-0d500efed85570da6
- IGN_EC2_SUBNETS: subnet-00a9f3acf0ce3785a,subnet-0614ac8a450d5d1d1