Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ load/__pycache__
fast/bluegreen.zip
**/__pycache__*
fast/test/locust.log
fast/test/viparray.py
6 changes: 6 additions & 0 deletions fast/test/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bigip1=i11000s-1.cpt.gtp.f5net.com
user=admin
password=admin
ipprefix=10.210.
ipthird="101 102 103"
ipfourth=10..234
55 changes: 55 additions & 0 deletions fast/test/AS3-BLUEGREEN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Using Locust to step through a Blue-Green Scenario

## Basic Setup
There's some [pre-work](COMMON-SETUP.md)

## Setup information for each of the VIPs
Within the ```vips.py``` file, edit the VIPS_INFO array, adding a record for each VIP. The fields are *virtual address*, *AS3 Tenant Name*, and *AS3 Application Name*.

```python
VIP_INFO = [
("192.0.2.10","Test","App"),
("192.0.2.11","Test2","App")
]
```

## Start a Locust Instance
at a command line, define the following environment variables
```bash
# IP or FQDN of BIG-IP
export BIGIP_ADDRESS="https://bigip.example.com"
# username with which to authenticate on the BIG-IP
export BIGIP_USER="admin"
# password for BIGI_USER
export BIGIP_PASS="supersecretpassword"
# number of seconds between steps in the blue-green workflow
export BLUEGREEN_STEP_WAIT="300"
export BLUEGREEN_STEP_WAIT_MIN="60"
```

in the same command line session run the following command to start locust.
```shell
docker run --env BIGIP_USER=$BIGIP_USER --env BIGIP_PASS=$BIGIP_PASS --env BLUEGREEN_STEP_WAIT=$BLUEGREEN_STEP_WAIT -p 8089:8089 -v $PWD:/mnt/locust locustio/locust -f /mnt/locust/as3-bluegreen-test.py --host $BIGIP_ADDRESS
```

The [Docker site](https://docs.docker.com/) and others have more elaborate information on the various command line parameters. The options used here are:
- Environment variables are set within the docker container to be used by Locust
```shell
--env BIGIP_USER=$BIGIP_USER --env BIGIP_PASS=$BIGIP_PASS
```
- A port from within the container is exposed outside the container to provide access to the Locust UI
```shell
-p 8089:8089
```
- The current working directory is exposed as a volume within the container to provide access to the ```fast-as3-bluegree-test.py``` test tasks file
```shell
-v $PWD:/mnt/locust
```

## Run the test
- open ```http://hostname:8089```
![locust ui](locust-1st-step.png)
- set the number of users to spawn and the spawn rate
![locust ui](locust-2nd-step.png)
- watch the process
![locust ui](locust-3rd-step.png)
56 changes: 56 additions & 0 deletions fast/test/AS3-BUFFERED-BLUEGREEN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Using Locust to step through a Blue-Green Scenario

## FIRST
Build a BIG-IP and maybe a jumphost

## Basic Setup
There's some [pre-work](COMMON-SETUP.md)

## Setup information for each of the VIPs
Within the ```vips.py``` file, edit the VIPS_INFO array, adding a record for each VIP. The fields are *virtual address*, *AS3 Tenant Name*, and *AS3 Application Name*.

```python
VIP_INFO = [
("192.0.2.10","Test","App"),
("192.0.2.11","Test2","App")
]
```
## Start an AS3BUFFER container
Which can be found [here](https://github.com/mjmenger/as3buffer), using mmenger/as3buffer:0.1.0 (<-- there's going to be breaking change in 0.2.0). And, don't forget to prime the pump as described in the as3buffer README.

## Start a Locust Instance
at a command line, define the following environment variables
```bash
# IP or FQDN of BIG-IP
export BUFFER_ADDRESS="http://jumphost:8080"
# number of seconds between steps in the blue-green workflow
export BLUEGREEN_STEP_WAIT="300"
export BLUEGREEN_STEP_WAIT_MIN="60"
```

in the same command line session run the following command to start locust.
```shell
docker run --env BIGIP_USER=$JENKINS_ADMIN_ID --env BIGIP_PASS=$JENKINS_ADMIN_PASSWORD --env BIGIP_MGMT_URI=$BIGIP_MGMT_URI --env BLUEGREEN_STEP_WAIT_MIN=$BLUEGREEN_STEP_WAIT_MIN --env BLUEGREEN_STEP_WAIT=$BLUEGREEN_STEP_WAIT -p 8089:8089 -v $PWD:/mnt/locust locustio/locust -f /mnt/locust/jenkins-as3-bluegreen-test.py --host $BUFFER_ADDRESS
```

The [Docker site](https://docs.docker.com/) and others have more elaborate information on the various command line parameters. The options used here are:
- Environment variables are set within the docker container to be used by Locust
```shell
--env BIGIP_USER=$BIGIP_USER --env BIGIP_PASS=$BIGIP_PASS
```
- A port from within the container is exposed outside the container to provide access to the Locust UI
```shell
-p 8089:8089
```
- The current working directory is exposed as a volume within the container to provide access to the ```fast-as3-bluegree-test.py``` test tasks file
```shell
-v $PWD:/mnt/locust
```

## Run the test
- open ```http://hostname:8089```
![locust ui](locust-1st-step.png)
- set the number of users to spawn and the spawn rate
![locust ui](locust-2nd-step.png)
- watch the process
![locust ui](locust-3rd-step.png)
30 changes: 30 additions & 0 deletions fast/test/COMMON-SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Install AS3 on the target BIG-IPs
- Follow [these directions](https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/installation.html#installation) to install AS3

## Enable BurstHandling for AS3
- Follow [these directions](https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/burst-handling.html?highlight=burst)
- Or, execute this curl command
```
curl --header "Content-Type: application/json" -X POST -u admin:adminpassword -k https://bigipaddress/mgmt/shared/appsvcs/settings -d '{ "burstHandlingEnabled": true }'
```
- Or, if you have the VS Code [Rest Client extension](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) installed, use the following


```
###
# @name setbursthandling
#
POST https://bigip/mgmt/shared/appsvcs/settings
Authorization: Basic {{$dotenv user}} {{$dotenv password}}
Content-Type: application/json

{
"burstHandlingEnabled": true
}
```

## Enable AS3 Best Practices memory configuration
TBD look [here](https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/best-practices.html)

## Install Docker
If you don't already have Docker installed, [install Docker](https://docs.docker.com/get-docker/)
71 changes: 71 additions & 0 deletions fast/test/FAST-BLUEGREEN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Using Locust to step through a Blue-Green Scenario

## Basic Setup
There's some [pre-work](COMMON-SETUP.md)

## Install FAST on the target BIG-IPs
- Follow [these directions](https://clouddocs.f5.com/products/extensions/f5-appsvcs-templates/latest/userguide/install-uninstall.html) to install F5 Applications Services Templates (FAST)

## Install the BlueGreen FAST Template
- create a zip file of the [`bluegreen.yml`](../bluegreen.yml) file:

```bash
$ zip -r bluegreen.zip bluegreen.yaml
```
- Log into the target BIG-IP
- Navigate to iApps -> Application Services -> Applications LX
- Click on ```F5 Application Services Templates```
- Click on the ```Templates``` tab
- Click on ```Add Template Set```
- Follow the subsequent steps using the ```bluegreen.zip``` file created above

## Setup information for each of the VIPs
Within the ```vips.py``` file, edit the VIPS_INFO array, adding a record for each VIP. The fields are *virtual address*, *AS3 Tenant Name*, and *AS3 Application Name*.

```python
VIP_INFO = [
("192.0.2.10","Test","App"),
("192.0.2.11","Test2","App")
]
```

## Start a Locust Instance
at a command line, define the following environment variables
```bash
# IP or FQDN of BIG-IP
export BIGIP_ADDRESS="https://bigip.example.com"
# username with which to authenticate on the BIG-IP
export BIGIP_USER="admin"
# password for BIGI_USER
export BIGIP_PASS="supersecretpassword"
# number of seconds between steps in the blue-green workflow
export BLUEGREEN_STEP_WAIT="300"
export BLUEGREEN_STEP_WAIT_MIN="60"
```

in the same command line session run the following command to start locust.
```shell
docker run --env BIGIP_USER=$BIGIP_USER --env BIGIP_PASS=$BIGIP_PASS --env BLUEGREEN_STEP_WAIT=$BLUEGREEN_STEP_WAIT -p 8089:8089 -v $PWD:/mnt/locust locustio/locust -f /mnt/locust/fast-as3-bluegreen-test.py --host $BIGIP_ADDRESS
```

The [Docker site](https://docs.docker.com/) and others have more elaborate information on the various command line parameters. The options used here are:
- Environment variables are set within the docker container to be used by Locust
```shell
--env BIGIP_USER=$BIGIP_USER --env BIGIP_PASS=$BIGIP_PASS
```
- A port from within the container is exposed outside the container to provide access to the Locust UI
```shell
-p 8089:8089
```
- The current working directory is exposed as a volume within the container to provide access to the ```fast-as3-bluegree-test.py``` test tasks file
```shell
-v $PWD:/mnt/locust
```

## Run the test
- open ```http://hostname:8089```
![locust ui](locust-1st-step.png)
- set the number of users to spawn and the spawn rate
![locust ui](locust-2nd-step.png)
- watch the process
![locust ui](locust-3rd-step.png)
88 changes: 4 additions & 84 deletions fast/test/README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,6 @@
# Using Locust to step through a Blue-Green Scenario

## Install AS3 and FAST on the target BIG-IPs
- Follow [these directions](https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/installation.html#installation) to install AS3
- Follow [these directions](https://clouddocs.f5.com/products/extensions/f5-appsvcs-templates/latest/userguide/install-uninstall.html) to install F5 Applications Services Templates (FAST)

## Enable BurstHandling for AS3
- Follow [these directions](https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/burst-handling.html?highlight=burst)
- Or, if you have the VS Code [Rest Client extension](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) installed, use the following
```
###
# @name setbursthandling
POST https://{{$dotenv bigip}}/mgmt/shared/appsvcs/settings
Authorization: Basic {{$dotenv user}} {{$dotenv password}}
Content-Type: application/json

{
"burstHandlingEnabled": true
}
```

## Install the BlueGreen FAST Template
- create a zip file of the [`bluegreen.yml`](../bluegreen.yml) file:

```bash
$ zip -r bluegreen.zip bluegreen.yaml
```
- Log into the target BIG-IP
- Navigate to iApps -> Application Services -> Applications LX
- Click on ```F5 Application Services Templates```
- Click on the ```Templates``` tab
- Click on ```Add Template Set```
- Follow the subsequent steps using the ```bluegreen.zip``` file created above

## Install Docker
If you don't already have Docker installed, [install Docker](https://docs.docker.com/get-docker/)

## Setup information for each of the VIPs
Within the ```vips.py``` file, edit the VIPS_INFO array, adding a record for each VIP. The fields are *virtual address*, *AS3 Tenant Name*, and *AS3 Application Name*.

```python
VIP_INFO = [
("192.0.2.10","Test","App"),
("192.0.2.11","Test2","App")
]
```

## Start a Locust Instance
at a command line, define the following environment variables
```bash
# IP or FQDN of BIG-IP
export BIGIP_ADDRESS="https://bigip.example.com"
# username with which to authenticate on the BIG-IP
export BIGIP_USER="admin"
# password for BIGI_USER
export BIGIP_PASS="supersecretpassword"
# number of seconds between steps in the blue-green workflow
export BLUEGREEN_STEP_WAIT="60"
```

in the same command line session run the following command to start locust.
```shell
docker run --env BIGIP_USER=$BIGIP_USER --env BIGIP_PASS=$BIGIP_PASS --env BLUEGREEN_STEP_WAIT=$BLUEGREEN_STEP_WAIT -p 8089:8089 -v $PWD:/mnt/locust locustio/locust -f /mnt/locust/fast-as3-bluegreen-test.py --host $BIGIP_ADDRESS
```

The [Docker site](https://docs.docker.com/) and others have more elaborate information on the various command line parameters. The options used here are:
- Environment variables are set within the docker container to be used by Locust
```shell
--env BIGIP_USER=$BIGIP_USER --env BIGIP_PASS=$BIGIP_PASS
```
- A port from within the container is exposed outside the container to provide access to the Locust UI
```shell
-p 8089:8089
```
- The current working directory is exposed as a volume within the container to provide access to the ```fast-as3-bluegree-test.py``` test tasks file
```shell
-v $PWD:/mnt/locust
```

## Run the test
- open ```http://hostname:8089```
![locust ui](locust-1st-step.png)
- set the number of users to spawn and the spawn rate
![locust ui](locust-2nd-step.png)
- watch the process
![locust ui](locust-3rd-step.png)
There are three variants for implementing blue-green scenarios
- [Using the FAST extension](FAST-BLUEGREEN.md)
- [Using AS3 directly](AS3-BLUEGREEN.md)
- [Using AS3 with an external buffer](AS3-BUFFERED-BLUEGREEN.md)
Loading