Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 4.33 KB

INFRASTRUCTURE.md

File metadata and controls

45 lines (33 loc) · 4.33 KB

Servo EC2Win Driver Infrastructure

EC2Win Components

For the sake of simplicity, the servo-ec2win driver was designed to adjust already running EC2 Autoscaling groups; it does not automate their orchestration, but expects it to have been set up before hand. This list documents the components you must create and configure to make use of the driver ```

  • Launch Data - Instance configuration template that an Auto Scaling group uses to launch EC2 instances. There are two types; you will only need one of them:

    • Launch Config - No versioning supported. During adjust, new launch config with incremented version number appended to name will be generated with non-adjustment values copied from the previous config
    • Launch Template - Supports versioning, driver generates new version of template during adjust
      • UserData Script - Note Regardless of Launch Data type, it must include a UserData script to download the file hosted at s3_path on s3_bucket and execute it. See user_data_dotnet.example
  • Autoscaling Group(s) - An Auto Scaling group contains a collection of Amazon EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management

    • Note the asg setting of config.yaml must be set to a comma seperated list of one or more Autoscaling group names whose instances are to be adjusted
    • Note If using an application load balancer, you would attach the Target Group to this autoscaling group
    • Note At least one EC2 instance must be running among the ASGs specified or the driver will fail

Optional

  • Reference Autoscaling Group(s) - used to specify production ASGs that are not adjusted. The driver will return a list of the instance IDs within these Reference groups along with the list of the adjusted Groups' instance IDs to the backend to help facilitate measurement

  • servo-ec2s3 S3 Bucket - Location for the driver to store the adjust.ps1 script which the windows EC2 Instances download and run on creation

    • Note you are required to set s3_bucket and s3_path settings of config.yaml to this bucket and file path eg.
      s3_bucket: example-bucket.com
      s3_path: servo-ec2win/adjust.ps1
      
      
  • servo-ec2s3 Describe Endpoint - Json web endpoint describing the current value of adjusted settings. When specified, the driver will use this endpoint as a readiness check for the EC2 hosts as well as to validate the efficacy of the adjustment. If not specified, an additional wait will be used instead which is configured by the setting batch_cooldown in config.yaml

    • Note when included, describe_port and describe_endpoint must have values reflecting the path to this endpoint. This url http://[EC2_IP]:8080/describe.json would be reflected by the following config settings
    describe_port: 8080
    describe_endpoint: 'describe.json'
    
    • See describe_site.ps1.example for a simple setup of such an endpoint. This example is invoked by the UserData script (user_data_dotnet.example)
    • Note describe_endpoint_dotnet.ps1.example is an example script that would generate a json file to be hosted by the site above. This script was generated by the encode_describe() method of the dotnet encoder and is also executed by the User Data script in this example (user_data_dotnet.example)

Additional infrastructure

  • Amazon Application ELB (Elastic Load Balancer) - responsible for routing apache benchmark requests to the EC2 Instances due to their public IP addresses being ephemeral and subject to change upon adjustment

  • Amazon Target Group - Your load balancer routes requests to the targets in a target group using the target group settings that you specify, and performs health checks on the targets using the health check settings that you specify

    • Note Target type must be set to Instance
    • Note ASG is not set during target group creation. Once created, go into ASG settings and attach the target group there
  • Servo Amazon EC2 Instance, docker installed - this host executes the containerized driver code (see servo-ec2win-cloudwatch-ab/Dockerfile) which references the config.yaml to run the utilities and api calls involved in measurement and adjustment. It must also be able to route to your target application in cases where apache benchmark is used