Giter Club home page Giter Club logo

onsdigital.eq-terraform-load-generator's Introduction

EQ Load Generator

This folder contains the config for the EQ load generator infrastructure. It uses the eq-survey-runner-benchmark repo in order to configure a load test using http://locust.io.

  • Terraform is used to create a network and K8s cluster in GCP (this defaults to a single machine)
  • We then apply some K8 config to the cluster
  • We then download eq-survey-runner-benchmark and run its k8s config.

Prerequisites

  1. Install Terraform Version Manager

  2. Install the Google Cloud SDK

  3. Login to your google cloud console, make sure you are using the correct account and accept any Terms of Service.

  4. Login to the CLI with your Google account gcloud auth login and gcloud auth application-default login

  5. Install kubectl with gcloud components install kubectl

  6. Install Helm with brew install kubernetes-helm and then run helm init --client-only

  7. Install Helm Tiller plugin for tillerless deploys helm plugin install https://github.com/rimusz/helm-tiller

Creating an environment

Development

Either manually create a new project on GCP or use an existing project. Make sure the project name follows the conventions here: https://cloud.google.com/storage/docs/naming

Rename terraform.tfvars.example to terraform.tfvars and fill in the values. (Ask a team member for help).

Create with PROJECT_ID=your-project-id RUNNER_URL=https://your-runner.gcp.dev.eq.ons.digital ./create.sh

Destroy with PROJECT_ID=your-project-id ./destroy.sh. This will destroy all resources except the project itself and the assosciated storage bucket. To permenantly destroy the infrastructure, including the project and storage bucket, delete the project via the GCP UI.

If you want to vary the default parameters Locust uses on start, you can specify them using the LOCUST_OPTS environment variable:

LOCUST_OPTS="-f locustfile.py -c 1000 -r 50 -L WARNING" RUNNER_URL=http://your-runner.gcp.dev.eq.ons.digital PROJECT_ID=your-project-id ./create.sh

Will create an environment running locust with a web interface with 1000 clients and a hatch rate of 50, with a log level of warnings and above.

Terraform state will by default be stored in the eq-terraform-load-generator-tfstate bucket, this bucket can be overridden by setting the TERRAFORM_STATE_BUCKET environment variable

onsdigital.eq-terraform-load-generator's People

Contributors

ajmaddaford avatar iwootten avatar jamesgardiner avatar mebinabraham avatar pricem14pc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.