Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MB-10464 Add reasons for why local docker setup isn't supported anymore #89

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,32 +72,4 @@ load_test_prime_workflow: clean ## Run load testing on the Prime API
open http://localhost:8089
locust -f locustfiles/prime_workflow.py --host local

.PHONY: local_docker_build
local_docker_build: clean ## Build a Docker container to run load testing locally
docker-compose -f docker-compose.local.yaml build locust

.PHONY: local_docker_up
local_docker_up: ## Run load testing on the Prime API in local using a Docker container
open http://localhost:8089
LOCUSTFILES=$(PRIME_LOCUSTFILES) docker-compose -f docker-compose.local.yaml up locust

.PHONY: local_docker_down
local_docker_down: ## Shutdown any active local docker containers with docker-compose
docker-compose -f docker-compose.local.yaml down locust

.PHONY: local_docker_office_up
local_docker_office_up: ## Run load testing on the GHC API in local using a Docker container
open http://localhost:8089
LOCUSTFILES=$(OFFICE_LOCUSTFILES) docker-compose -f docker-compose.local.yaml up locust

.PHONY: local_docker_report
local_docker_report: ## Run load testing automatically against a local server and generate reports
export DOCKER_CSV_PREFIX="${DOCKER_CSV_DIR}/$(shell date +'%Y-%m-%d-%H%M%S')"; LOCUSTFILES=$(PRIME_LOCUSTFILES) docker-compose -f docker-compose.local.yaml up --build prime-reporting
docker cp mmlt_prime_reporting:/app/static/reports static/local/

.PHONY: exp_load_test
exp_load_test: ## Run load testing against the MilMove Experimental Deployment
export DOCKER_CSV_PREFIX="${DOCKER_CSV_DIR}/$(shell date +'%Y-%m-%d-%H%M%S')"; docker-compose up --build prime-exp-reporting
docker cp mmlt_prime_exp_reporting:/app/static/reports static/

default: help
60 changes: 15 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ the [LICENSE.txt](./LICENSE.txt) file in this repository.
* [Setup: Nix](#setup-nix)
* [Installing Python Dependencies and Pre-commit Hooks](#installing-python-dependencies-and-pre-commit-hooks)
* [Unsupported Setup](#unsupported-setup)
* [Alternative Setup: Docker](#alternative-setup-docker)
* [Troubleshooting](#troubleshooting)
* [Testing](#testing)
* [Running Load Tests](#running-load-tests)
* [Setting up the local environment](#setting-up-the-local-environment)
* [Setting up Tests in AWS](#setting-up-tests-in-aws)
* [Running preset tests](#running-preset-tests)
* [Running custom tests](#running-custom-tests)
* [Running Tests for Reporting](#running-tests-for-reporting)
* [Adding Load Tests](#adding-load-tests)
* [Starting from scratch](#starting-from-scratch)
* [Creating TaskSets](#creating-tasksets)
Expand All @@ -58,7 +56,7 @@ the [LICENSE.txt](./LICENSE.txt) file in this repository.
* [Metrics](#metrics)
* [References](#references)

<!-- Added by: felipe, at: Wed Nov 17 15:44:25 PST 2021 -->
<!-- Added by: felipe, at: Mon Dec 6 13:16:19 PST 2021 -->

<!--te-->
<!-- markdownlint-restore -->
Expand Down Expand Up @@ -177,33 +175,25 @@ level of this repo and reload your shell.

### Unsupported Setup

This is a setup that existed previously but will no longer be kept up to date or supported. It will possibly be removed
entirely at a future date.
Maintaining many ways to set up locally can be time-consuming, which is why we removed the `asdf` and docker setups.

#### Alternative Setup: Docker
The `asdf` end set-up was similar to the `pyenv` setup, but required many commands to have tweaks to work the same as
the `pyenv` commands which made them harder to maintain.

It is also possible to run load tests from within a Docker container, eliminating the need to set up a valid python
environment. This requires Docker and `docker-compose` to be installed on your machine. Get them here:
As for docker, we had a few reasons for dropping support:

* [Get Docker](https://docs.docker.com/get-docker/)
* [Install Docker Compose](https://docs.docker.com/compose/install/) - version `1.27` or later
* Locust is a tool that needs to reach the target host and running it from inside docker makes it harder to reach a
server that is managed outside of docker.
* Docker adds yet another layer for possible issues. We've experienced some problems in the past with docker network
problems that were masked as locust errors. Errors like this are a pain to debug.
* Our current setup using `direnv` and `pipenv` is fairly quick to set up using either `nix` or the `make install_tools`
command, decreasing the "quick setup" case for using docker.

To get your load testing Docker container up and running for the local environment, use the following commands:
Setups were removed in the following PRs:

* `docker-compose -f docker-compose.local.yaml build`
* `docker-compose -f docker-compose.local.yaml up`

And when you are done with testing:

* `docker-compose -f docker-compose.local.yaml build`

You can also use the Makefile equivalents of these commands:

* `make local_docker_build`
* `make local_docker_up`
* `make local_docker_down`

As long as your local MilMove server is up and running, you are ready to run your tests!
* [PR #74](https://github.com/transcom/milmove_load_testing/pull/74)
* [PR #78](https://github.com/transcom/milmove_load_testing/pull/78)
* [PR #89](https://github.com/transcom/milmove_load_testing/pull/89)

### Troubleshooting

Expand Down Expand Up @@ -324,26 +314,6 @@ locust -f locustfiles/prime.py --host local
For more information on running custom tests, refer to
the [wiki](https://github.com/transcom/milmove_load_testing/wiki/Running-Load-Tests-Against-MyMove)

### Running Tests for Reporting

*NOTE*: THESE COMMAND ARE DEPRECATED AND NOT WORKING AS OF 2021-11-17

There are a couple of preset tests that have been set up to generate reports for later analysis. These commands are:

```shell
make local_docker_report
```

and:

```shell
make exp_load_test
```

**`make exp_load_test` should only be used on a scheduled basis with InfraSec's supervision.**

Both of these commands require a `docker-compose` version of `1.27` or greater to work.

## Adding Load Tests

### Starting from scratch
Expand Down
29 changes: 0 additions & 29 deletions docker-compose.local.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions docker-compose.yaml

This file was deleted.

60 changes: 0 additions & 60 deletions local_locust.py

This file was deleted.