├── .editorconfig
├── .gitignore
├── Readme.md
├── analysis
└── .gitkeep
├── analyze.r
├── analyzer-app
├── .babelrc
├── README.md
├── config-overrides.js
├── package-lock.json
├── package.json
├── public
│ └── index.html
└── src
│ ├── App.js
│ ├── components
│ ├── Clouds.js
│ ├── Legend.js
│ ├── PluginTable.js
│ ├── Table.js
│ ├── TestBarChart.css
│ ├── TestLineChart.css
│ ├── Tests.js
│ ├── TestsBarChart.js
│ ├── TestsBarChartSet.js
│ ├── TestsLineChart.js
│ └── TestsLineChartSet.js
│ ├── fonts
│ └── Smoolthan
│ │ ├── Smoolthan_Bold-Italic.otf
│ │ ├── Smoolthan_Bold.otf
│ │ ├── Smoolthan_Medium-Italic.otf
│ │ ├── Smoolthan_Medium.otf
│ │ ├── Smoolthan_Regular-Italic.otf
│ │ ├── Smoolthan_Regular.otf
│ │ ├── Smoolthan_Thin-Italic.otf
│ │ └── Smoolthan_Thin.otf
│ ├── helpers.mjs
│ ├── import.mjs
│ ├── index.css
│ └── index.js
├── ansible.cfg.example
├── aws.playbook.yml
├── azure.playbook.yml
├── benchmarks
└── .gitkeep
├── docs
├── analyze.md
├── aws.md
├── azure.md
├── gcp.md
├── htop.md
├── saas.md
├── tests.md
└── variables.md
├── gcp.playbook.yml
├── hosts.yml.example
├── hosts
└── .gitkeep
├── playbook.yml
├── requirements-azure.txt
├── requirements.yml
├── roles
├── apollo-server
│ ├── files
│ │ ├── Dockerfile
│ │ └── src
│ │ │ ├── package-lock.json
│ │ │ └── package.json
│ └── tasks
│ │ ├── install.yml
│ │ ├── main.yml
│ │ └── standup.yml
├── aws
│ └── tasks
│ │ ├── cleanup.yml
│ │ ├── main.yml
│ │ └── standup.yml
├── azure
│ └── tasks
│ │ ├── cleanup.yml
│ │ ├── create_vm.yml
│ │ ├── main.yml
│ │ └── standup.yml
├── gcp
│ └── tasks
│ │ ├── cleanup.yml
│ │ ├── create_instance.yml
│ │ ├── main.yml
│ │ ├── standup.yml
│ │ └── terminate_instance.yml
├── htop
│ └── tasks
│ │ ├── main.yml
│ │ └── redhat.yml
├── kong-dependencies
│ └── tasks
│ │ ├── install.yml
│ │ └── main.yml
├── kong
│ └── tasks
│ │ ├── install.yml
│ │ ├── main.yml
│ │ └── standup.yml
├── load-generator
│ └── tasks
│ │ └── main.yml
├── tyk-dependencies
│ └── tasks
│ │ └── main.yml
├── tyk
│ └── tasks
│ │ ├── install.yml
│ │ ├── main.yml
│ │ ├── standup-federation.yml
│ │ └── standup.yml
└── upstream
│ └── tasks
│ ├── federatation.yml
│ ├── federation-cleanup.yml
│ ├── federation-standup.yml
│ ├── main.yml
│ └── rest.yml
├── saas
├── apps
│ └── .gitkeep
└── hosts.yml.example
├── scripts
└── init.sh
├── templates
├── apollo-server
│ └── index.j2
├── hosts.j2
├── kong
│ └── kong.conf.j2
└── tyk
│ ├── api.j2
│ ├── comments-subgraph.j2
│ ├── posts-subgraph.j2
│ ├── tyk.j2
│ └── users-subgraph.j2
├── tests
├── analyze.sh
├── aws_c5.2xlarge.sh
├── aws_c5.4xlarge.sh
├── aws_c5.large.sh
├── aws_c5.xlarge.sh
├── azure_Standard_F16s_v2.sh
├── azure_Standard_F2s_v2.sh
├── azure_Standard_F4s_v2.sh
├── azure_Standard_F8s_v2.sh
├── gcp_c2d-standard-16.sh
├── gcp_c2d-standard-2.sh
├── gcp_c2d-standard-4.sh
├── gcp_c2d-standard-8.sh
└── saas.sh
└── vars
├── aws.yml.example
├── azure.yml.example
├── gcp.yml.example
├── services.yml.example
└── tests.yml.example
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.{yml,json}]
12 | indent_style = space
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pem
2 | **/.DS_Store
3 | **/*.zip
4 | hosts.yml
5 | ansible.cfg
6 | gcp.json
7 | vars/*.yml
8 | hosts/*.yml
9 | benchmarks/*.txt
10 | analysis/*.png
11 | analysis/*.csv
12 | saas/*hosts.yml
13 | saas/apps/*.json
14 | **/node_modules
15 | analyzer-app/build
16 | analyzer-app/src/benchmarks.json
17 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # Performance Testing Tyk with Ansible
2 |
3 | ## Requirements
4 | 1. [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
5 |
6 | ## Getting Started
7 | 1. Clone repo and navigate to the repo directory.
8 |
9 | 2. Run initalization script to initialize environment `sh scripts/init.sh`.
10 |
11 | 3. Create 5 different servers to conduct the testing:
12 | - Upstream: expose port 8000 (ex. c5.2xlarge)
13 | - Load Generator (ex. c5.2xlarge)
14 | - Tyk: expose port 8080 (ex. c5.2xlarge)
15 | - Kong: expose port 8000 (ex. c5.2xlarge)
16 | - Apollo: expose port 4000 (ex. c5.2xlarge)
17 |
18 | 4. Modify `hosts.yml` file to update ssh variables to your server(s). You can learn more about the hosts file [here](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html).
19 |
20 | 5. Run `sudo ansible-playbook playbook.yml -t install -t standup -t test` to run performance tests. `sudo` is used to allow ansible to create the performance testing results files on your local machine.
21 |
22 | 6. View output of performance tests under `./benchmarks/`.
23 |
24 | 7. Run `ansible-playbook playbook.yml -t cleanup` to cleanup files and turn off services on the machines.
25 |
26 | ## Documentation
27 | Please check the `/docs` folder for more information about the repo.
28 |
29 | - [Tests](/docs/tests.md): Explains the different REST and GraphQL tests available.
30 | - [Analysis](/docs/analyze.md): Explains how to use the `analyze.r` script to generate comparison graphs and csv based on the tests ran.
31 | - [AWS](/docs/aws.md): Explains how to use the `aws.playbook.yml` to standup the resources necessary to run the tests in AWS.
32 | - [GCP](/docs/gcp.md): Explains how to use the `gcp.playbook.yml` to standup the resources necessary to run the tests in GCP.
33 | - [Azure](/docs/azure.md): Explains how to use the `azure.playbook.yml` to standup the resources necessary to run the tests in Azure.
34 | - [Variables](/docs/variables.md): Explains the different variables used in this repo.
35 |
--------------------------------------------------------------------------------
/analysis/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analysis/.gitkeep
--------------------------------------------------------------------------------
/analyze.r:
--------------------------------------------------------------------------------
1 | #!/usr/bin/R
2 |
3 | BASE_DIR <- "./benchmarks/"
4 |
5 | args = commandArgs(trailingOnly=TRUE)
6 |
7 | # RScript ./analyze.r "tyk,kong" "rest,aws" "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" "2,4,8,16" "Machine type" "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" "Tyk vs Kong" "Tyk,Kong"
8 | # RScript ./analyze.r "tyk,kong" "rest,gcp" "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" "2,4,8,16" "Machine type" "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" "Tyk vs Kong" "Tyk,Kong"
9 | compare <- strsplit(args[1], ",")[[1]]
10 | filter <- strsplit(args[2], ",")[[1]]
11 | x <- strsplit(args[3], ",")[[1]]
12 | x_weights <- as.numeric(strsplit(args[4], ",")[[1]])
13 | x_title <- args[5]
14 | x_labels <- strsplit(args[6], ",")[[1]]
15 | title <- args[7]
16 | legend <- strsplit(args[8], ",")[[1]]
17 | is_bar <- if(length(args) >= 9 && args[9] == "bar") TRUE else FALSE
18 | # Create the tests array to help iterate
19 | tests <- c("rps", "p99")
20 | legends <- c("topleft", "topright")
21 | y_labels <- c("RPS", "P99(ms)")
22 |
23 | ###############################################################################
24 | # Preprocess data
25 | ###############################################################################
26 |
27 | # Fetch all files and filter them based on the AND of the filter collection
28 | files <- list.files(BASE_DIR)
29 | for (i in 1:length(filter)) {
30 | files <- files[grep(filter[i], files)]
31 | }
32 |
33 | # Create all_data matrix to house all the filtered files and add the column and
34 | # row names.
35 | all_data <- data.frame(matrix(0, nrow=length(files), ncol=length(tests)))
36 | rownames(all_data) <- files
37 | colnames(all_data) <- tests
38 |
39 | for (filename in files) {
40 | # Open file
41 | coxn <- file(paste(BASE_DIR, filename, sep=""), open="r")
42 | file_lines <- as.list(readLines(coxn))
43 | # Grep the values of rps and p99 and store them in all_data
44 | all_data[filename, 1] <- strsplit(file_lines[grep("Requests/sec:", file_lines)][[1]], '\t')[[1]][2]
45 | all_data[filename, 2] <- strsplit(file_lines[grep("99%", file_lines)][[1]], ' +')[[1]][4]
46 | close(coxn)
47 | }
48 |
49 | # Parse all rps and p99 as numeric data.
50 | all_data$rps <- as.numeric(all_data$rps)
51 | all_data$p99 <- as.numeric(all_data$p99) * 1000
52 |
53 | # Create the shapes and colors of the lines and points we are going to plot.
54 | shapes <- rep(c(15, 16, 17, 18, 20), ceiling(length(compare) / 5))
55 | color <- rep(c("#00D9BA", "#FF6C7D", "#505071", "#D6B218", "#C3C3E5", "#FFBBC5"), ceiling(length(compare) / 6))
56 |
57 | # Filter the data into buckets based on the x values.
58 | data <- list()
59 | for (i in 1:length(x)) {
60 | data[[i]] <- all_data[grep(x[i], files),]
61 | }
62 |
63 | ###############################################################################
64 | # Generate the graphs
65 | ###############################################################################
66 |
67 | # Preprocessing step to determine the means of the data so that we can find the appropriate max for the ylim
68 | y <- list()
69 | for (i in 1:length(tests)) {
70 | y[[i]] <- list()
71 | for (j in 1:length(compare)) {
72 | service <- list()
73 | for (k in 1:length(data)) {
74 | # Iterate access the x variable and taking the mean of the replicas based on the result of the grep of compare
75 | service <- c(service, mean(data[[k]][, tests[i]][grep(compare[j], rownames(data[[k]]))]))
76 | }
77 | y[[i]] <- c(y[[i]], service)
78 | }
79 | }
80 |
81 | for (i in 1:length(tests)) {
82 | # Define image and plit properties
83 | png(paste("./analysis/", filter, "-", paste(compare, collapse="-"), "-", tests[i], "-",paste(filter, collapse="-"), ".png", sep=""), width=8, height=8, units="in", res=100)
84 |
85 | if (! is_bar) {
86 | plot(x_weights, c(1:length(data)), col="white", ylim=c(0, max(unlist(y[[i]]))), main=paste(title, y_labels[i]), ylab=y_labels[i], xaxt="n", xlab=x_title)
87 | axis(1, at=x_weights, labels=x_labels)
88 | }
89 |
90 | service_matrix <- list()
91 | for (j in 1:length(compare)) {
92 | service <- list()
93 | for (k in 1:length(data)) {
94 | # Iterate access the x variable and taking the mean of the replicas based on the result of the grep of compare
95 | service <- c(service, mean(data[[k]][, tests[i]][grep(compare[j], rownames(data[[k]]))]))
96 | }
97 |
98 | service_matrix[[j]] <- service
99 |
100 | # Plot points and lines
101 | if (! is_bar) {
102 | points(x_weights, service, pch=shapes[j], col=color[j], cex=2)
103 | lines(x_weights, service, col=color[j])
104 | }
105 | }
106 | if (is_bar) {
107 | par(mar = c(8, 3, 6, 3))
108 | barplot(t(matrix(unlist(service_matrix), ncol=length(compare), nrow=length(x))), col=color, main=paste(title, y_labels[i]), space=0.2, beside=TRUE)
109 | axis(1, at=1:length(legend) * 1.2 - 0.5, labels=legend, las=2)
110 | } else {
111 | # Add legend
112 | legend(legend=legend, pch=shapes, x=legends[i], col=color, cex=1.5)
113 | }
114 | abline(h=0, lwd=0.2,col=c(rgb(0,0,0,0.25)))
115 | dev.off()
116 | }
117 |
118 | ###############################################################################
119 | # Generate the CSV files
120 | ###############################################################################
121 | # Generate rps and p99 lists to hold the data
122 | rps <- list()
123 | p99 <- list()
124 | for (i in 1:length(compare)) {
125 | rps[[i]] <- numeric()
126 | p99[[i]] <- numeric()
127 | for (j in 1:length(data)) {
128 | rps[[i]][j] <- mean(data[[j]][grep(compare[i], rownames(data[[j]])), ]$rps)
129 | p99[[i]][j] <- mean(data[[j]][grep(compare[i], rownames(data[[j]])), ]$p99)
130 | }
131 | }
132 |
133 | # Generate CSV function
134 | generate_csv <- function(l, type) {
135 | # Turn data into tables and assigning the roles and column names.
136 | l <- as.data.frame(do.call(rbind, l))
137 | colnames(l) <- x
138 | rownames(l) <- compare
139 | l <- round(l, digits = 2)
140 | # Generate CSVs
141 | write.table(l, file=paste("./analysis/average-", type, "-", paste(filter, collapse="-"), paste(compare, collapse="-"), ".csv", sep=""), sep=",", quote=FALSE)
142 | }
143 |
144 | # Invoke generate_csv to generate rps and p99 csv
145 | generate_csv(rps, "rps")
146 | generate_csv(p99, "p99")
147 |
--------------------------------------------------------------------------------
/analyzer-app/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@babel/plugin-proposal-optional-chaining"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/analyzer-app/README.md:
--------------------------------------------------------------------------------
1 | # tyk-performance-analyzer
2 |
3 | React app to analyze performance tests results.
4 |
5 | ## Available Scripts
6 | ### `npm start`
7 | ### `npm run build`
8 |
9 |
--------------------------------------------------------------------------------
/analyzer-app/config-overrides.js:
--------------------------------------------------------------------------------
1 | // Overrides create-react-app webpack configs without ejecting
2 | // https://github.com/timarney/react-app-rewired
3 |
4 | const { useBabelRc, override } = require("customize-cra");
5 | module.exports = override(useBabelRc());
6 |
--------------------------------------------------------------------------------
/analyzer-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tyk-performance-analyzer",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@babel/plugin-proposal-optional-chaining": "^7.18.9",
7 | "@emotion/react": "^11.10.4",
8 | "@emotion/styled": "^11.10.4",
9 | "@mui/material": "^5.10.3",
10 | "customize-cra": "^1.0.0",
11 | "react": "^18.2.0",
12 | "react-app-rewired": "^2.2.1",
13 | "react-dom": "^18.2.0",
14 | "react-scripts": "^2.1.3",
15 | "recharts": "^2.1.13"
16 | },
17 | "scripts": {
18 | "start": "node src/import.mjs & react-app-rewired start",
19 | "build": "node src/import.mjs & react-app-rewired build",
20 | "eject": "react-scripts eject"
21 | },
22 | "eslintConfig": {
23 | "extends": [
24 | "react-app"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/analyzer-app/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tyk Analyzer App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/analyzer-app/src/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import TestsLineChartSet from './components/TestsLineChartSet'
4 | import TestsBarChartSet from './components/TestsBarChartSet'
5 |
6 | import {
7 | KONG,
8 | APOLLO,
9 | } from './helpers'
10 |
11 | import benchmarks from './benchmarks'
12 |
13 | export default class App extends React.Component {
14 | constructor(props) {
15 | super(props)
16 | this.state = {
17 | cloud: 'aws',
18 | test: 'auth',
19 | }
20 | }
21 |
22 | render() {
23 | return (
24 |
25 | {this.props.tyk ? : null}
29 | {this.props.kong ? : null}
34 | {this.props.apollo ? : null}
39 |
40 | )
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/Clouds.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ToggleButton from '@mui/material/ToggleButton'
3 | import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'
4 | import { styled, createTheme, ThemeProvider } from '@mui/material/styles'
5 |
6 | import { colors } from '../helpers'
7 |
8 | const theme = createTheme({
9 | palette: {
10 | primary: {
11 | main: colors[0],
12 | }
13 | },
14 | })
15 |
16 | const StyledToggleButtonGroup = styled(ToggleButtonGroup)(({ theme }) => ({
17 | '&': {
18 | borderRadius: 10,
19 | '.MuiToggleButtonGroup-grouped': {
20 | fontFamily: "'Open Sans', sans-serif",
21 | fontWeight: 'bold',
22 | color: '#A8A8CF',
23 | '&:first-of-type': {
24 | borderRadius: '10px 10px 0 0',
25 | },
26 | '&:last-of-type': {
27 | borderRadius: '0 0 10px 10px',
28 | },
29 | '&.Mui-selected': {
30 | color: '#258C80',
31 | backgroundColor: '#D7F8F3',
32 | borderTop: '1px solid rgba(0, 0, 0, 0.12)',
33 | },
34 | },
35 | },
36 | }))
37 |
38 | export default ({ cloud, setCloud }) => (
39 |
40 |
47 | AWS
48 | GCP
49 | Azure
50 |
51 |
52 | )
53 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/Legend.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import {
4 | colors as c,
5 | capitalize,
6 | } from '../helpers'
7 |
8 | export default ({ values, colors = c }) => (
9 |
39 | )
40 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/PluginTable.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Table from '@mui/material/Table'
3 | import TableBody from '@mui/material/TableBody'
4 | import TableCell, { tableCellClasses } from '@mui/material/TableCell'
5 | import TableContainer from '@mui/material/TableContainer'
6 | import TableHead from '@mui/material/TableHead'
7 | import TableRow from '@mui/material/TableRow'
8 | import Paper from '@mui/material/Paper'
9 | import { styled } from '@mui/material/styles'
10 |
11 | import {
12 | capitalize,
13 | DECIMAL_PLACES,
14 | } from '../helpers'
15 |
16 | const MainStyledTableCell = styled(TableCell)(({ theme }) => ({
17 | [`&.${tableCellClasses.head}`]: {
18 | fontFamily: 'Smoolthan',
19 | fontWeight: 'bold',
20 | backgroundColor: '#2CA597',
21 | color: '#FFFFFF'
22 | },
23 | [`&.${tableCellClasses.body}`]: {
24 | fontSize: 14,
25 | }
26 | }))
27 |
28 | const StyledTableRow = styled(TableRow)(({ theme }) => ({
29 | '&:nth-of-type(odd)': {
30 | backgroundColor: "rgba(168, 168, 207, 0.1)"
31 | },
32 | }));
33 |
34 | export default ({ rps, p99, labels }) => (
35 |
39 |
40 |
41 |
42 |
43 | RPS
44 | P99 (ms)
45 |
46 |
47 |
48 | {Object.keys(rps).sort().map((key, i) => (
49 |
50 |
59 | {capitalize(labels[i])}
60 |
61 |
70 | {rps[key]?.toFixed(DECIMAL_PLACES)}
71 |
72 |
81 | {p99[key]?.toFixed(DECIMAL_PLACES)}
82 |
83 |
84 | ))}
85 |
86 |
87 |
88 | )
89 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/Table.js:
--------------------------------------------------------------------------------
1 | import React, { Fragment } from 'react'
2 | import Table from '@mui/material/Table'
3 | import TableBody from '@mui/material/TableBody'
4 | import TableCell, { tableCellClasses } from '@mui/material/TableCell'
5 | import TableContainer from '@mui/material/TableContainer'
6 | import TableHead from '@mui/material/TableHead'
7 | import TableRow from '@mui/material/TableRow'
8 | import Paper from '@mui/material/Paper'
9 | import { styled } from "@mui/material/styles";
10 |
11 | import {
12 | capitalize,
13 | DECIMAL_PLACES,
14 | } from '../helpers'
15 |
16 | const MainStyledTableCell = styled(TableCell)(({ theme }) => ({
17 | [`&.${tableCellClasses.head}`]: {
18 | fontFamily: 'Smoolthan',
19 | fontWeight: 'bold',
20 | fontSize: '16px',
21 | backgroundColor: '#2CA597',
22 | color: '#FFFFFF'
23 | },
24 | [`&.${tableCellClasses.body}`]: {
25 | fontSize: 14
26 | }
27 | }));
28 |
29 | const StyledTableCell = styled(TableCell)(({ theme }) => ({
30 | [`&.${tableCellClasses.head}`]: {
31 | fontFamily: "'Open Sans', sans-serif",
32 | fontWeight: 'bold',
33 | backgroundColor: '#D7F8F3',
34 | color: '#258C80',
35 | padding: 4
36 | },
37 | [`&.${tableCellClasses.body}`]: {
38 | fontSize: 14
39 | }
40 | }));
41 |
42 | const StyledTableRow = styled(TableRow)(({ theme }) => ({
43 | "&:nth-of-type(odd)": {
44 | backgroundColor: "rgba(168, 168, 207, 0.1)"
45 | },
46 | }));
47 |
48 | export default ({ rps, p99, test, cloud, testSet }) => {
49 | rps = Object.values(rps[cloud][test]).sort((a, b) => a.weight > b.weight ? 1 : -1)
50 | p99 = Object.values(p99[cloud][test]).sort((a, b) => a.weight > b.weight ? 1 : -1)
51 |
52 | return (
53 |
57 |
58 |
59 |
60 |
61 | {Object.values(rps).map(({ machine }) => (
62 |
66 | {machine}
67 |
68 | ))}
69 |
70 |
71 | {[ { name: 'RPS', value: rps }, { name: 'P99', value: p99 } ].map(({ name, value }, i) => (
72 |
73 |
74 |
75 | {name}
76 |
77 |
78 |
79 | {[ 'tyk', testSet ].map((test, i) => (
80 |
81 |
90 | {capitalize(test)}
91 |
92 | {value.map(props => (
93 |
101 | {props[test].toFixed(DECIMAL_PLACES)}
102 |
103 | ))}
104 |
105 | ))}
106 |
107 |
108 | ))}
109 |
110 |
111 | )
112 | }
113 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/TestBarChart.css:
--------------------------------------------------------------------------------
1 | .bar .yAxis .recharts-cartesian-axis-tick-value {
2 | fill: #7A79A1;
3 | }
4 |
5 | .bar .yAxis .recharts-cartesian-axis-tick-value tspan,
6 | .bar .yAxis .recharts-label,
7 | .bar .xAxis .recharts-label {
8 | font-family: 'Open Sans', sans-serif;
9 | }
10 |
11 | .bar .yAxis .recharts-label {
12 | font-weight: bold;
13 | color: #505071;
14 | }
15 |
16 | .bar .xAxis .recharts-label {
17 | fill: #505071;
18 | }
19 |
20 | .bar .notice {
21 | font-family: 'Open Sans', sans-serif;
22 | font-size: 12px;
23 | color: #7A79A1;
24 | }
25 |
26 | .bar .xAxis + .xAxis .recharts-text.recharts-label {
27 | font-family: 'Open Sans', sans-serif;
28 | font-size: 12px;
29 | fill: #7A79A1;
30 | }
31 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/TestLineChart.css:
--------------------------------------------------------------------------------
1 | .line .recharts-cartesian-axis-ticks g:nth-child(3) line,
2 | .line .recharts-cartesian-axis-ticks g:nth-child(5) line,
3 | .line .recharts-cartesian-axis-ticks g:nth-child(6) line,
4 | .line .recharts-cartesian-axis-ticks g:nth-child(7) line {
5 | stroke-width: 1!important;
6 | }
7 |
8 | .line .yAxis .recharts-cartesian-axis-tick-value {
9 | fill: #7A79A1;
10 | }
11 |
12 | .line .yAxis .recharts-cartesian-axis-tick-value tspan,
13 | .line .yAxis .recharts-label,
14 | .line .xAxis .recharts-label {
15 | font-family: 'Open Sans', sans-serif;
16 | }
17 |
18 | .line .yAxis .recharts-label {
19 | font-weight: bold;
20 | color: #505071;
21 | }
22 |
23 | .line .xAxis .recharts-label {
24 | fill: #505071;
25 | }
26 |
27 | .line .recharts-tooltip-wrapper:focus-visible {
28 | outline: none!important;
29 | }
30 |
31 |
32 | .line .recharts-tooltip-wrapper .recharts-default-tooltip {
33 | border: 1px solid #A8A8CF!important;
34 | border-radius: 10px;
35 | }
36 |
37 | .line .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-label {
38 | font-family: Smoolthan;
39 | font-weight: bold;
40 | color: #505071;
41 | padding-bottom: 10px;
42 | text-align: center;
43 | }
44 |
45 | .line .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-item-list {
46 | font-family: 'Open Sans', sans-serif;
47 | font-size: 0.875rem;
48 | }
49 |
50 | .line .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-item-list .recharts-tooltip-item-name {
51 | font-weight: 700;
52 | }
53 |
54 | .line .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-item-list .recharts-tooltip-item-separator {
55 | font-weight: 700;
56 | margin-right: 10px;
57 | }
58 |
59 | .line .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-item-list .recharts-tooltip-item-value {
60 | float: right;
61 | }
62 |
63 | .line .xAxis + .xAxis .recharts-text.recharts-label {
64 | font-family: 'Open Sans', sans-serif;
65 | font-size: 12px;
66 | fill: #7A79A1;
67 | }
68 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/Tests.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ToggleButton from '@mui/material/ToggleButton'
3 | import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'
4 | import { styled, createTheme, ThemeProvider } from '@mui/material/styles'
5 |
6 | import { colors } from '../helpers'
7 |
8 | const theme = createTheme({
9 | palette: {
10 | primary: {
11 | main: colors[2],
12 | }
13 | },
14 | })
15 |
16 | const StyledToggleButtonGroup = styled(ToggleButtonGroup)(({ theme }) => ({
17 | '&': {
18 | borderRadius: 10,
19 | '.MuiToggleButtonGroup-grouped': {
20 | fontFamily: "'Open Sans', sans-serif",
21 | fontWeight: 'bold',
22 | color: '#A8A8CF',
23 | '&:first-of-type': {
24 | borderRadius: '10px 10px 0 0',
25 | },
26 | '&:last-of-type': {
27 | borderRadius: '0 0 10px 10px',
28 | },
29 | '&.Mui-selected': {
30 | color: '#C5425C',
31 | backgroundColor: '#FFE7EA',
32 | borderTop: '1px solid rgba(0, 0, 0, 0.12)',
33 | },
34 | },
35 | },
36 | }))
37 |
38 | export default ({ tests, labels, test, setTest }) => (
39 |
40 |
47 | {Object.entries(tests).map(([key, value]) => (
48 | {labels[key]}
49 | ))}
50 |
51 |
52 | )
53 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/TestsBarChart.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {
3 | BarChart,
4 | Bar,
5 | CartesianGrid,
6 | ResponsiveContainer,
7 | XAxis,
8 | YAxis,
9 | } from 'recharts';
10 |
11 | import {
12 | P99,
13 | colors,
14 | } from '../helpers'
15 |
16 | import './TestBarChart.css'
17 |
18 | export default ({ test, tests, data, range, machine }) => (
19 |
24 |
33 |
39 |
40 |
41 |
45 | {Object.values(tests).sort().map((value, key) => (
46 |
52 | ))}
53 |
57 |
69 |
80 |
86 |
87 |
88 |
89 | )
90 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/TestsBarChartSet.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 | import Container from '@mui/material/Container';
3 |
4 | import Clouds from './Clouds'
5 | import Tests from './Tests'
6 | import TestsBarChart from './TestsBarChart'
7 | import Legend from './Legend'
8 | import PluginTable from './PluginTable'
9 |
10 | import {
11 | clouds,
12 | RPS,
13 | P99,
14 | KONG,
15 | getTests as getPerfTests,
16 | getTestsLabels,
17 | machines,
18 | getMachineWeight,
19 | ranges,
20 | } from '../helpers'
21 |
22 | const TESTS = [ ...getPerfTests(KONG), ...getPerfTests() ],
23 | LABELS = [ ...getTestsLabels(KONG), ...getPerfTests() ].map(l => l.toLowerCase()).sort()
24 |
25 | const getTests = cloud => {
26 | const tests = []
27 |
28 | Object.values(machines).map(value => tests.push(value[clouds.indexOf(cloud)]))
29 |
30 | return tests
31 | }
32 |
33 | const getData = (rps, p99, machine) => {
34 | const data = {}
35 |
36 | data[RPS] = {}
37 | data[P99] = {}
38 |
39 |
40 | Object.keys(rps).forEach(key => {
41 | if (TESTS.includes(key)) {
42 | data[RPS][key] = rps[key][machine]?.tyk
43 | data[P99][key] = p99[key][machine]?.tyk
44 | }
45 | })
46 |
47 | return data
48 | }
49 |
50 | export default ({ defaultTest, rps, p99 }) => {
51 | const [test, setTest] = useState(defaultTest),
52 | [cloud, setCloud] = useState(clouds[0]),
53 | cloud_index=clouds.indexOf(cloud),
54 | machine = machines[test][clouds.indexOf(cloud)],
55 | data = getData(rps[cloud], p99[cloud], machine)
56 |
57 | return (
58 |
59 |
69 |
74 |
setCloud(e.target.value)}
77 | />
78 |
79 | setTest(getMachineWeight(e.target.value))}
84 | />
85 |
86 |
87 |
88 |
95 |
102 |
109 |
110 |
111 |
112 |
116 |
117 | )
118 | }
119 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/TestsLineChart.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {
3 | LineChart,
4 | Line,
5 | CartesianGrid,
6 | ResponsiveContainer,
7 | XAxis,
8 | YAxis,
9 | ReferenceArea,
10 | Tooltip,
11 | } from 'recharts';
12 |
13 | import {
14 | KONG,
15 | P99,
16 | colors,
17 | capitalize,
18 | DECIMAL_PLACES,
19 | machines,
20 | } from '../helpers'
21 |
22 | import './TestLineChart.css'
23 |
24 | const CustomizedTick = ({ payload, verticalAnchor, index, visibleTicksCount, tickFormatter, ...props }) => (
25 |
30 |
38 | {payload.value}
39 |
40 |
41 | )
42 |
43 | const CustomShape = props => (
44 |
45 |
50 |
51 | )
52 |
53 | export default ({ test, data, cloud, testSet }) => (
54 |
59 |
68 |
74 |
75 |
76 |
80 | {Object.entries([ 2, 6, 10, 14 ]).map(([key, value]) => (
81 | }
86 | />
87 | ))}
88 | machines[machine][cloud]}
90 | formatter={(value, name) => [value.toFixed(DECIMAL_PLACES), capitalize(name)]}
91 | separator=":"
92 | cursor={{
93 | stroke: '#A8A8CF',
94 | strokeWidth: 1
95 | }}
96 | />
97 |
105 |
113 |
118 | }
128 | label={{
129 | value: 'CPUs',
130 | offset: -20,
131 | position: 'insideBottom',
132 | }}
133 | />
134 |
145 |
150 |
151 |
152 |
153 | )
154 |
--------------------------------------------------------------------------------
/analyzer-app/src/components/TestsLineChartSet.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 | import Container from '@mui/material/Container';
3 |
4 | import Clouds from './Clouds'
5 | import Tests from './Tests'
6 | import TestsLineChart from './TestsLineChart'
7 | import Legend from './Legend'
8 | import Table from './Table'
9 |
10 | import {
11 | getTests,
12 | getTestsLabels,
13 | clouds,
14 | APOLLO,
15 | RPS,
16 | P99,
17 | colors,
18 | } from '../helpers'
19 |
20 | export default ({ defaultTest, testSet, rps, p99 }) => {
21 | const [test, setTest] = useState(defaultTest),
22 | [cloud, setCloud] = useState(clouds[0])
23 |
24 | return (
25 |
26 |
36 |
41 |
setCloud(e.target.value)}
44 | />
45 |
46 | setTest(e.target.value)}
51 | />
52 |
53 |
54 |
58 |
65 | a.weight > b.weight ? 1 : -1)}
69 | testSet={testSet}
70 | />
71 | a.weight > b.weight ? 1 : -1)}
75 | testSet={testSet}
76 | />
77 |
78 |
79 |
80 |
87 |
88 | )
89 | }
90 |
--------------------------------------------------------------------------------
/analyzer-app/src/fonts/Smoolthan/Smoolthan_Bold-Italic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analyzer-app/src/fonts/Smoolthan/Smoolthan_Bold-Italic.otf
--------------------------------------------------------------------------------
/analyzer-app/src/fonts/Smoolthan/Smoolthan_Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analyzer-app/src/fonts/Smoolthan/Smoolthan_Bold.otf
--------------------------------------------------------------------------------
/analyzer-app/src/fonts/Smoolthan/Smoolthan_Medium-Italic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analyzer-app/src/fonts/Smoolthan/Smoolthan_Medium-Italic.otf
--------------------------------------------------------------------------------
/analyzer-app/src/fonts/Smoolthan/Smoolthan_Medium.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analyzer-app/src/fonts/Smoolthan/Smoolthan_Medium.otf
--------------------------------------------------------------------------------
/analyzer-app/src/fonts/Smoolthan/Smoolthan_Regular-Italic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analyzer-app/src/fonts/Smoolthan/Smoolthan_Regular-Italic.otf
--------------------------------------------------------------------------------
/analyzer-app/src/fonts/Smoolthan/Smoolthan_Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analyzer-app/src/fonts/Smoolthan/Smoolthan_Regular.otf
--------------------------------------------------------------------------------
/analyzer-app/src/fonts/Smoolthan/Smoolthan_Thin-Italic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analyzer-app/src/fonts/Smoolthan/Smoolthan_Thin-Italic.otf
--------------------------------------------------------------------------------
/analyzer-app/src/fonts/Smoolthan/Smoolthan_Thin.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/analyzer-app/src/fonts/Smoolthan/Smoolthan_Thin.otf
--------------------------------------------------------------------------------
/analyzer-app/src/helpers.mjs:
--------------------------------------------------------------------------------
1 | const getTests = vendor => KONG === vendor ? [ 'vanilla','auth','rate-limiting','auth-quota' ] : APOLLO === vendor ? [ 'stitch-0','stitch-1','stitch-2' ] : [ 'all','analytics' ]
2 | const getTestsLabels = vendor => KONG === vendor ? [ 'Vanilla','Auth','Rate-Limiting','Auth & Quota' ] : APOLLO === vendor ? [ 'Query Depth 1','Query Depth 2','Query Depth 3' ] : [ '2 Cores','4 Cores','8 Cores', '16 Cores' ]
3 |
4 | const getTest = name => {
5 | // have to test auth-quota before auth
6 | const tests = [
7 | 'auth-quota','vanilla','auth','rate-limiting',
8 | ...getTests(APOLLO),
9 | ...getTests()
10 | ]
11 |
12 | for (let i = 0; i < tests.length; ++i) {
13 | if (name.includes(tests[i])) return tests[i]
14 | }
15 | }
16 |
17 | const machines = {
18 | 2: [ 'c5.large','c2d-standard-2 ','Standard_F2s_v2' ],
19 | 4: [ 'c5.xlarge','c2d-standard-4','Standard_F4s_v2' ],
20 | 8: [ 'c5.2xlarge','c2d-standard-8','Standard_F8s_v2' ],
21 | 16: [ 'c5.4xlarge','c2d-standard-16','Standard_F16s_v2' ],
22 | }
23 |
24 | const getMachineWeight = machine => {
25 | if (machines[2].includes(machine)) {
26 | return 2
27 | } else if (machines[4].includes(machine)) {
28 | return 4
29 | } else if (machines[8].includes(machine)) {
30 | return 8
31 | } else if (machines[16].includes(machine)) {
32 | return 16
33 | }
34 | }
35 |
36 | const capitalize = word => word[0].toUpperCase() + word.slice(1)
37 |
38 | const clouds = ['aws', 'gcp', 'azure'],
39 | tests = ['rps', 'p99']
40 |
41 | const RPS = 'rps',
42 | P99 = 'p99'
43 |
44 | const KONG = 'kong',
45 | APOLLO = 'apollo'
46 |
47 | const LINE = 'line',
48 | BAR = 'bar'
49 |
50 | const DECIMAL_PLACES = 2
51 |
52 | const colors = [ "#00CDB0", "#505071", "#FF7787", "#DBA72C", "#A8A8CF", "#C5425C" ]
53 |
54 | const ranges = {
55 | 2: [ [0,15000], [0,150] ],
56 | 4: [ [0,25000], [0,15] ],
57 | 8: [ [0,50000], [0,10] ],
58 | 16: [ [0,100000], [0,3] ],
59 | }
60 |
61 | export {
62 | getTest,
63 | getTests,
64 | getTestsLabels,
65 | machines,
66 | getMachineWeight,
67 | clouds,
68 | tests,
69 | RPS,
70 | P99,
71 | KONG,
72 | APOLLO,
73 | LINE,
74 | BAR,
75 | colors,
76 | capitalize,
77 | ranges,
78 | DECIMAL_PLACES,
79 | }
80 |
--------------------------------------------------------------------------------
/analyzer-app/src/import.mjs:
--------------------------------------------------------------------------------
1 | import fs from 'fs'
2 | import {
3 | KONG,
4 | APOLLO,
5 | RPS,
6 | P99,
7 | tests,
8 | clouds,
9 | getMachineWeight,
10 | getTest,
11 | } from './helpers.mjs'
12 |
13 | const DIR = '../benchmarks/'
14 |
15 | const rps_reg = /Requests\/sec:\t(\d+.\d+)/i
16 | const p99_reg = /99% in (\d+.\d+)/i
17 | const name_reg = /bench-([a-zA-Z0-9.\-_]+)-(aws|azure|gcp)-(\d)-(.*)/
18 |
19 | const getVendor = name => name.includes('tyk') ? 'tyk' : name.includes(KONG) ? KONG : APOLLO
20 |
21 | const getRecord = (machine, test) => {
22 | const record = {
23 | machine,
24 | weight: getMachineWeight(machine),
25 | tyk: 0,
26 | }
27 |
28 | if (test.includes('stitch')) record[APOLLO] = 0
29 | else if (['vanilla', 'auth', 'rate-limiting', 'auth-quota'].includes(test)) record[KONG] = 0
30 |
31 | return record
32 | }
33 |
34 | const results = {}
35 |
36 | results[RPS] = {}
37 | results[P99] = {}
38 |
39 | for (let i = 0; i < tests.length; ++i) {
40 | for (let j = 0; j < clouds.length; ++j) {
41 | if (! results[tests[i]][clouds[j]]) results[tests[i]][clouds[j]] = {}
42 | }
43 | }
44 |
45 | fs.readdir(DIR, (err, files) => {
46 | files.forEach(file => {
47 | if (file.includes('.txt')) fs.readFile(DIR + file, "utf8", (err, text) => {
48 | const params = file.match(name_reg),
49 | cloud = params[2],
50 | vendor = getVendor(params[4]),
51 | machine = params[1],
52 | test = getTest(params[4])
53 |
54 | if (! results[RPS][cloud][test]) {
55 | results[RPS][cloud][test] = {}
56 | results[P99][cloud][test] = {}
57 | }
58 |
59 |
60 | if (! results[RPS][cloud][test][machine] ) {
61 | results[RPS][cloud][test][machine] = getRecord(machine, test)
62 | results[P99][cloud][test][machine] = getRecord(machine, test)
63 | }
64 |
65 | results[RPS][cloud][test][machine][vendor] += (parseFloat(text.match(rps_reg)[1]) / 3)
66 | results[P99][cloud][test][machine][vendor] += (parseFloat(text.match(p99_reg)[1] * 1000) / 3)
67 |
68 | fs.writeFileSync('./src/benchmarks.json', JSON.stringify(results))
69 | })
70 | })
71 | })
72 |
--------------------------------------------------------------------------------
/analyzer-app/src/index.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "Smoolthan";
3 | src: local("Smoolthan"), url("./fonts/Smoolthan/Smoolthan_Bold.otf") format("truetype");
4 | font-weight: bold;
5 | }
6 |
--------------------------------------------------------------------------------
/analyzer-app/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App'
4 |
5 | import './fonts/Smoolthan/Smoolthan_Bold.otf'
6 | import './index.css'
7 |
8 | const analyzer = document.getElementById('analyzer'),
9 | className = analyzer.classList.value
10 |
11 | ReactDOM.createRoot(analyzer).render(
12 |
13 |
18 |
19 | )
20 |
--------------------------------------------------------------------------------
/ansible.cfg.example:
--------------------------------------------------------------------------------
1 | [defaults]
2 | timeout = 25
3 | retries = 5
4 | inventory = ./hosts.yml
5 | host_key_checking = False
6 |
7 | [ssh_connection]
8 | pipelining = False
9 |
--------------------------------------------------------------------------------
/aws.playbook.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create EC2 instances
3 | hosts: localhost
4 | gather_facts: false
5 | vars_files:
6 | - ./vars/aws.yml
7 | roles:
8 | - aws
9 | tags:
10 | - standup
11 | - cleanup
12 |
--------------------------------------------------------------------------------
/azure.playbook.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create Azure instances
3 | hosts: localhost
4 | gather_facts: false
5 | vars_files:
6 | - ./vars/azure.yml
7 | roles:
8 | - azure
9 | tags:
10 | - standup
11 | - cleanup
12 |
--------------------------------------------------------------------------------
/benchmarks/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/benchmarks/.gitkeep
--------------------------------------------------------------------------------
/docs/analyze.md:
--------------------------------------------------------------------------------
1 | # Analyze Tool
2 |
3 | Analyze tool will help you visualize the results of your performance tests through auto-generated graphs and csv files.
4 |
5 | ## How to use
6 |
7 | ### Line Graph
8 | `RScript ./analyze.r $compare $filter $x $x_weights $x_title $x_labels $title $legend`
9 |
10 | | Variable | Example | Comments |
11 | |----------| :-----: | -------- |
12 | | compare | `"tyk,kong"` | What your looking to compare. Accepts regex. |
13 | | filter | `"rest,aws"` | Values to filter on. The result is an `AND` of the `,` separated fitler list. Accepts Regex. |
14 | | x | `"c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge"` | The x-axis values to split the data on. Accepts Regex. |
15 | | x_weights | `"2,4,8,16"` | The weights of the x-axis values. Length must match x list length. |
16 | | x_title | `"Cores"` | x-axis title |
17 | | x_labels | `"2,4,8,16"` | The labels of the x-axis values. Length must match x list length. |
18 | | title | `"AWS Tyk vs Kong"` | Title of the auto-generated Graphs. |
19 | | legend | `"Tyk,Kong"` | The labels of the legends. Length must match compare list length. |
20 |
21 | #### Examples
22 | ```
23 | RScript ./analyze.r \
24 | "tyk,kong" \
25 | "rest,aws" \
26 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
27 | "2,4,8,16" \
28 | "Cores" \
29 | "2,4,8,16" \
30 | "AWS Tyk vs Kong" \
31 | "Tyk,Kong"
32 | ```
33 |
34 | ```
35 | RScript ./analyze.r \
36 | "tyk-stitch-0,tyk-federate-0,tyk-stitch-1,tyk-federate-1,tyk-stitch-2,tyk-federate-2" \
37 | "gcp" \
38 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
39 | "2,4,8,16" \
40 | "Cores" \
41 | "2,4,8,16" \
42 | "GCP Stitch vs Federation" \
43 | "Stitch Depth-0,Federate Depth-0,Stitch Depth-1,Federate Depth-1,Stitch Depth-2,Federate Depth-2"
44 | ```
45 |
46 | ```
47 | RScript ./analyze.r \
48 | "tyk-stitch-0,apollo-stitch-0,tyk-stitch-1,apollo-stitch-1,tyk-stitch-2,apollo-stitch-2" \
49 | "azure" \
50 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
51 | "2,4,8,16" \
52 | "Cores" \
53 | "2,4,8,16" \
54 | "Azure Tyk vs Apollo Stitch" \
55 | "Tyk Depth-0,Apollo Depth-0,Tyk Depth-1,Apollo Depth-1,Tyk Depth-2,Apollo Depth-2"
56 | ```
57 |
58 | ```
59 | RScript ./analyze.r \
60 | "tyk-federate-0,apollo-federate-0,tyk-federate-1,apollo-federate-1,tyk-federate-2,apollo-federate-2" \
61 | "aws" \
62 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" "2,4,8,16" \
63 | "Cores" \
64 | "2,4,8,16" \
65 | "AWS Tyk vs Apollo Federation" \
66 | "Tyk Depth-0,Apollo Depth-0,Tyk Depth-1,Apollo Depth-1,Tyk Depth-2,Apollo Depth-2"
67 | ```
68 |
69 | ```
70 | RScript ./analyze.r \
71 | "aws,gcp,azure" \
72 | "rest,tyk" \
73 | "c5.large|e2-standard-2|Standard_F2s_v2,c5.xlarge|c2d-standard-4|Standard_F4s_v2,c5.2xlarge|c2d-standard-8|Standard_F8s_v2,c5.4xlarge|c2d-standard-16|Standard_F16s_v2" \
74 | "2,4,8,16" \
75 | "Cores" \
76 | "2,4,8,16" \
77 | "AWS vs GCP vs Azure REST" \
78 | "AWS,GCP,Azure"
79 | ```
80 |
81 | ```
82 | RScript ./analyze.r \
83 | "aws-[1-5]-tyk,aws-[1-5]-kong,gcp-[1-5]-tyk,gcp-[1-5]-kong,azure-[1-5]-tyk,azure-[1-5]-kong" \
84 | "rest" \
85 | "c5.large|e2-standard-2|Standard_F2s_v2,c5.xlarge|c2d-standard-4|Standard_F4s_v2,c5.2xlarge|c2d-standard-8|Standard_F8s_v2,c5.4xlarge|c2d-standard-16|Standard_F16s_v2" \
86 | "2,4,8,16" \
87 | "Cores" \
88 | "2,4,8,16" \
89 | "Tyk vs Kong on AWS vs GCP vs Azure REST" \
90 | "AWS-Tyk,AWS-Kong,GCP-Tyk,GCP-Kong,Azure-Tyk,Azure-Kong"
91 | ```
92 |
93 | ### Bar Graph
94 | `RScript ./analyze.r $compare $filter $x $x_weights $x_title $x_labels $title $legend`
95 |
96 | #### Examples
97 | ```
98 | RScript ./analyze.r \
99 | "[1-3]-tyk-rest,[1-3]-auth-tyk-rest,[1-3]-analytics-tyk-rest,[1-3]-rate-tyk-rest,[1-3]-auth-quota-tyk-rest,[1-3]-auth-analytics-rate-quota-tyk-rest" \
100 | "aws" \
101 | "c5.4xlarge" \
102 | "16" \
103 | "Cores" \
104 | "16" \
105 | "Tyk Plugin Anlysis - AWS c5.4xlarge" \
106 | "Tyk,Auth,Analytics,Rate Limiting,Auth & Quota,All" \
107 | "bar"
108 | ```
109 |
110 | ```
111 | RScript ./analyze.r \
112 | "[1-3]-tyk-rest,[1-3]-auth-tyk-rest,[1-3]-analytics-tyk-rest,[1-3]-rate-tyk-rest,[1-3]-auth-quota-tyk-rest,[1-3]-auth-analytics-rate-quota-tyk-rest" \
113 | "gcp" \
114 | "c2d-standard-16" \
115 | "16" \
116 | "Cores" \
117 | "16" \
118 | "Tyk Plugin Anlysis - GCP c2d-standard-16" \
119 | "Tyk,Auth,Analytics,Rate Limiting,Auth & Quota,All" \
120 | "bar"
121 | ```
122 |
123 | ```
124 | RScript ./analyze.r \
125 | "[1-3]-tyk-rest,[1-3]-auth-tyk-rest,[1-3]-analytics-tyk-rest,[1-3]-rate-tyk-rest,[1-3]-auth-quota-tyk-rest,[1-3]-auth-analytics-rate-quota-tyk-rest" \
126 | "azure" \
127 | "Standard_F16s_v2" \
128 | "16" \
129 | "Cores" \
130 | "16" \
131 | "Tyk Plugin Anlysis - Azure Standard_F16s_v2" \
132 | "Tyk,Auth,Analytics,Rate Limiting,Auth & Quota,All" \
133 | "bar"
134 | ```
135 |
--------------------------------------------------------------------------------
/docs/aws.md:
--------------------------------------------------------------------------------
1 | ## AWS playbook
2 | AWS playbook allows you to standup and teardown the infrastructure required to run the tests on AWS.
3 |
4 | ### Getting Started
5 | Make sure to add the required AWS information in `vars/aws.yml`. You can find out more information about the following variables in the [variables documentation](/docs/variables.md#aws) page.
6 |
7 | ```
8 | aws_region: us-west-2
9 | aws_key_name: secret
10 | aws_instance_type: c5.large
11 | aws_image: ami-08970fb2e5767e3b8
12 | aws_group: secret-sg
13 | aws_vpc_subnet_id: subnet-vpc_subnet_id
14 | aws_access_key: aws_access_key
15 | aws_secret_key: aws_secret_key
16 | provider:
17 | user: ec2-user
18 | key_file: ./secret.pem
19 | ```
20 |
21 | ### Example
22 | ```
23 | ansible-playbook aws.playbook.yml -t standup -e '{ "aws_instance_type": "c5.large", "test_services": [ "tyk", "kong" ] }'
24 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ] }'
25 | sudo ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "c5.large-aws-1" }'
26 | sudo ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "c5.large-aws-2" }'
27 | sudo ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "c5.large-aws-3" }'
28 | ansible-playbook aws.playbook.yml -t cleanup -e '{ "aws_instance_type": "c5.large", "test_services": [ "tyk", "kong" ] }'
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/azure.md:
--------------------------------------------------------------------------------
1 | ## Azure playbook
2 | Azure playbook allows you to standup and teardown the infrastructure required to run the tests on Azure.
3 |
4 | pip install -r requirements-azure.txt
5 |
6 | ### Getting Started
7 | Make sure to add the required Azure information in `vars/azure.yml`. You can find out more information about the following variables in the [variables documentation](/docs/variables.md#azure) page.
8 |
9 | ```
10 | azure_vm_size: Standard_F2s_v2
11 | azure_location: westus
12 | azure_image:
13 | offer: RHEL
14 | publisher: RedHat
15 | sku: '8_6'
16 | version: '8.6.2022070801'
17 | azure_ssh_public_key: "public_key"
18 | provider:
19 | user: azureuser
20 | key_file: ./secret.pem
21 | ```
22 |
23 | #### Azure CLI
24 | You must login to Azure CLI before using this playbook. You can do so by running the following command:
25 |
26 | ```
27 | az login
28 | ```
29 |
30 | Here are the [official azure docs](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) for installing the Azure CLI.
31 |
32 | #### Ansible Azure libraries
33 | If you run into issues launching ansible you're probably missing the azure ansible libraries you can download these dependencies by running the following command:
34 |
35 | ```
36 | pip install -r requirements-azure.txt
37 | ```
38 |
39 | ### Example
40 | ```
41 | ansible-playbook azure.playbook.yml -t standup -e '{ "azure_vm_size": "Standard_F2s_v2", "test_services": [ "tyk", "kong" ] }'
42 | ansible-playbook playbook.yml -i hosts/Standard_F2s_v2-azure-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ] }'
43 | sudo ansible-playbook playbook.yml -i hosts/Standard_F2s_v2-azure-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "Standard_F2s_v2-azure-1" }'
44 | sudo ansible-playbook playbook.yml -i hosts/Standard_F2s_v2-azure-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "Standard_F2s_v2-azure-2" }'
45 | sudo ansible-playbook playbook.yml -i hosts/Standard_F2s_v2-azure-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "Standard_F2s_v2-azure-3" }'
46 | ansible-playbook azure.playbook.yml -t cleanup -e '{ "azure_vm_size": "Standard_F2s_v2", "test_services": [ "tyk", "kong" ] }'
47 | ```
48 |
49 |
--------------------------------------------------------------------------------
/docs/gcp.md:
--------------------------------------------------------------------------------
1 | ## GCP playbook
2 | GCP playbook allows you to standup and teardown the infrastructure required to run the tests on GCP.
3 |
4 | ### Getting Started
5 | Make sure to add the required GCP information in `vars/gcp.yml`. You can find out more information about the following variables in the [variables documentation](/docs/variables.md#gcp) page.
6 |
7 | ```
8 | gcp_project: project
9 | gcp_region: us-central1
10 | gcp_zone: us-central1-a
11 | gcp_auth_kind: serviceaccount
12 | gcp_service_account_file: ./secret.json
13 | gcp_machine_type: c2d-standard-2
14 | gcp_image: projects/rhel-cloud/global/images/rhel-8-v20220303
15 | provider:
16 | user: user
17 | key_file: ./secret.pem
18 | ```
19 |
20 | ### Example
21 | ```
22 | ansible-playbook gcp.playbook.yml -t standup -e '{ "gcp_machine_type": "c2d-standard-2", "test_services": [ "tyk", "kong" ] }'
23 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ] }'
24 | sudo ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "c2d-standard-2-gcp-1" }'
25 | sudo ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "c2d-standard-2-gcp-2" }'
26 | sudo ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "prefix": "c2d-standard-2-gcp-3" }'
27 | ansible-playbook gcp.playbook.yml -t cleanup -e '{ "gcp_machine_type": "c2d-standard-2", "test_services": [ "tyk", "kong" ] }'
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/htop.md:
--------------------------------------------------------------------------------
1 | ## htop
2 | If you want to install htop on the machine you can do so at any time by running the follow command:
3 |
4 | `ansible-playbook playbook.yml -t htop`
5 |
--------------------------------------------------------------------------------
/docs/saas.md:
--------------------------------------------------------------------------------
1 | ## How to test Tyk Cloud
2 |
3 | 1. Launch ansible-playbook command with `-t saas` tag:
4 |
5 | `sudo ansible-playbook playbook.yml -t install -t standup -t saas -i saas/hosts.yml -e '{ "test_services": [ "tyk" ] }'`
6 |
7 | 2. Import the API definition generated by step one from `saas/apps/api.json` into your Tyk dashboard.
8 |
9 | 3. Run the performance testing command
10 | `sudo ansible-playbook playbook.yml -t test -t saas -i saas/hosts.yml -e '{ "test_services": [ "tyk" ], "query_type": "REST", "api_url": "https://edge-gateway-url/api/" }'`
11 |
12 | 4. Cleanup
13 | `ansible-playbook playbook.yml -t cleanup -t saas -i saas/hosts.yml -e '{ "test_services": [ "tyk" ] }'`
14 |
--------------------------------------------------------------------------------
/docs/tests.md:
--------------------------------------------------------------------------------
1 | ## Tests
2 |
3 | ### query_type
4 | Values: `REST`, `STITCH` or `FEDERATE`
5 |
6 | `REST`: Uses a REST request.
7 |
8 | `STITCH`: Stitches multiple data sources together and presents them as a single GraphQL endpoint.
9 |
10 | `FEDERATE`: Stitches multiple supgrahs and presents them as a supergraph.
11 |
12 | ### query_depth
13 | `query_type`: `STITCH` and `FEDERATE`
14 | Values: `0`, `1` and `2`
15 |
16 | `0`: Runs the following GraphQL query:
17 | ```
18 | query {
19 | user(id: 1) {
20 | username
21 | name
22 | email
23 | }
24 | }
25 | ```
26 |
27 | `1`: Runs the following GraphQL query:
28 |
29 | ```
30 | query {
31 | user(id: 1) {
32 | username
33 | name
34 | email
35 | posts {
36 | title
37 | body
38 | }
39 | }
40 | }
41 | ```
42 |
43 |
44 | `2`: Runs the following GraphQL query:
45 | ```
46 | query {
47 | user(id: 1) {
48 | username
49 | name
50 | email
51 | posts {
52 | title
53 | body
54 | comments {
55 | name
56 | email
57 | body
58 | }
59 | }
60 | }
61 | }
62 | ```
63 |
64 |
--------------------------------------------------------------------------------
/docs/variables.md:
--------------------------------------------------------------------------------
1 | ## Variables
2 | ### Tests
3 | `vars/tests.yml`
4 |
5 | | Variable | Default | Comments |
6 | |----------------------| :---------: | --------- |
7 | | query_type | `REST` | Sets the query type for the performance testing. Can be set to `REST`, `STITCH`, or `FEDERATE` |
8 | | query_depth | `0` | Sets the nested query depth |
9 | | limit_cores | `false` | Allows limiting the number of cores used by the service. Only available for Tyk and Apollo. |
10 | | enable_auth | `False` | Enable authentication in the performance testing. Only available for Tyk and Kong. |
11 | | enable_analytics | `False` | Enable analytics gathering in the performance testing. Only available for Tyk. |
12 | | enable_quota | `False` | Enable quota tracking in the performance testing. Only available for Tyk and Kong. |
13 | | enable_rate_limiting | `False` | Enable rate limiting in the performance testing. Only available for Tyk and Kong. |
14 | | load_test_duration | `10s` | Load test duration. |
15 | | test_services | `[ "tyk", "kong" ]` | List of services you would like to test against. This will influence that number of virtual machines created when using the `AWS`, `GCP`, and `Azure` playbooks. |
16 |
17 | ### Services
18 | `vars/services.yml`
19 |
20 | | Variable | Default | Comments |
21 | | --------- | :---------: | --------- |
22 | | services.upstream.service.port| `8000` | Upstream server listening port |
23 | | services.upstream.subgraphs.users.port | `4001` | Upstream server for users federated service listening port |
24 | | services.upstream.subgraphs.posts.port | `4002` | Upstream server for ports federated service listening port |
25 | | services.upstream.subgraphs.comments.port | `4003` | Upstream server for comments federated service listening port |
26 | | services.tyk.secret | `352d20ee67be67f6340b4c0605b044b7` | API secret |
27 | | services.tyk.service.port | `8080` | Tyk gateway server listening port |
28 | | services.kong.service.port | `8000` | Kong gateway server listening port |
29 | | services.kong.service.ssl_port| `8443` | Kong gateway server SSL listening port |
30 | | services.kong.admin.port | `8001` | Kong gateway admin server listening port |
31 | | services.kong.admin.ssl_port | `8444` | Kong gateway admin server SSL listening port |
32 | | services.apollo.service.port | `4000` | Apollo server listening port |
33 |
34 | ### AWS
35 | `vars/aws.yml`
36 |
37 | | Variable | Default | Comments |
38 | | --------- | :---------: | --------- |
39 | | aws_region| `us-west-2` | AWS region. |
40 | | aws_key_name | `secret` | AWS key name. |
41 | | aws_instance_type | `c5.large` | AWS EC2 instant type that you want to test on. |
42 | | aws_image | `ami-0b28dfc7adc325ef4` | AWS AMI image ID |
43 | | aws_group | `secret-sg` | |
44 | | aws_vpc_subnet_id | `subnet-vpc_subnet_id` | AWS subnet ID |
45 | | aws_access_key | `aws_access_key` | AWS access key |
46 | | aws_secret_key | `aws_secret_key` | AWS secret key |
47 | | provider.user | `ec2-user` | Username for SSH connection to generated instances. |
48 | | provider.key_file | `./secret.pem` | Key file for SSH connection to generated instances. Should be the key file referenced in `aws_key_name`. |
49 |
50 | ### GCP
51 | `vars/gcp.yml`
52 |
53 | | Variable | Default | Comments |
54 | | --------- | :---------: | --------- |
55 | | gcp_project| `project` | GCP project. |
56 | | gcp_region | `us-west1` | GCP region. |
57 | | gcp_zone | `us-west1-a` | GCP zone. |
58 | | gcp_auth_kind | `serviceaccount` | GCP authentication method |
59 | | gcp_service_account_file | `./secret.json | GCP authentication file |
60 | | gcp_machine_type | `e2-standard-2` | GCP compute instant type that you want to test on. |
61 | | gcp_image | `projects/rhel-cloud/global/images/rhel-8-v20220303` | GCP image ID |
62 | | provider.user | `user` | Username for SSH connection to generated instances. |
63 | | provider.key_file | `./secret.pem` | Key file for SSH connection to generated instances. |
64 |
65 | ### Azure
66 | `vars/azure.yml`
67 |
68 | | Variable | Default | Comments |
69 | | --------- | :---------: | --------- |
70 | | azure_vm_size| `Standard_F2s_v2` | Azure VM size. |
71 | | azure_location | `westus` | Azure VM location. |
72 | | azure_image.offer | `UbuntuServer` | Azure image offer. |
73 | | azure_image.publisher | `Canonical` | Azure image publisher. |
74 | | azure_image.sku | `18.04-LTS` | Azure image sku. |
75 | | azure_image.version | `latest` | Azure image version. |
76 | | azure_ssh_public_key | `` | The public key that you will use to SSH into the VMs. |
77 | | provider.user | `user` | Username for SSH connection to generated instances. |
78 | | provider.key_file | `./secret.pem` | Key file for SSH connection to generated instances. |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/gcp.playbook.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create GCP instances
3 | hosts: localhost
4 | gather_facts: false
5 | vars_files:
6 | - ./vars/gcp.yml
7 | roles:
8 | - gcp
9 | tags:
10 | - standup
11 | - cleanup
12 |
--------------------------------------------------------------------------------
/hosts.yml.example:
--------------------------------------------------------------------------------
1 | all:
2 | hosts:
3 | upstream:
4 | ansible_host: host
5 | ansible_user: user
6 | ansible_ssh_private_key_file: ./secret.pem
7 | load-generator:
8 | ansible_host: host
9 | ansible_user: user
10 | ansible_ssh_private_key_file: ./secret.pem
11 | tyk:
12 | ansible_host: host
13 | ansible_user: user
14 | ansible_ssh_private_key_file: ./secret.pem
15 | tyk_dependencies:
16 | ansible_host: host
17 | ansible_user: user
18 | ansible_ssh_private_key_file: ./secret.pem
19 | kong:
20 | ansible_host: host
21 | ansible_user: user
22 | ansible_ssh_private_key_file: ./secret.pem
23 | kong_dependencies:
24 | ansible_host: host
25 | ansible_user: user
26 | ansible_ssh_private_key_file: ./secret.pem
27 | apollo:
28 | ansible_host: host
29 | ansible_user: user
30 | ansible_ssh_private_key_file: ./secret.pem
31 |
--------------------------------------------------------------------------------
/hosts/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/hosts/.gitkeep
--------------------------------------------------------------------------------
/playbook.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Checks if the machines are up and rechable.
3 | - hosts: all
4 | gather_facts: no
5 | any_errors_fatal: true
6 | tasks:
7 | - name: Wait for machines to come up
8 | delegate_to: localhost
9 | wait_for:
10 | port: 22
11 | host: "{{ hostvars[inventory_hostname].ansible_host }}"
12 | search_regex: OpenSSH
13 | tags:
14 | - standup
15 | - install
16 | - test
17 | - cleanup
18 |
19 | # Allows gathering of ansible_facts to discover the internal IPs of the
20 | # servers.
21 | - hosts: all
22 | tasks:
23 | - name: Collect ansible_facts to discover internal IPs
24 | debug:
25 | msg: Discovering internal IP...
26 | tags:
27 | - standup
28 | - install
29 | - test
30 | - cleanup
31 |
32 | # Update packages on all servers.
33 | - hosts: all
34 | gather_facts: false
35 | become: True
36 | tasks:
37 | - name: Update packages
38 | package:
39 | name: "*"
40 | state: latest
41 | update_cache: yes
42 | tags:
43 | - install
44 |
45 | # Install docker on all servers.
46 | - hosts: all
47 | gather_facts: false
48 | become: True
49 | vars:
50 | pip_install_packages:
51 | - name: docker
52 | roles:
53 | - geerlingguy.pip
54 | - geerlingguy.docker
55 | tags:
56 | - install
57 |
58 | # Install htop on all servers (Optional)
59 | - hosts: all
60 | gather_facts: false
61 | become: True
62 | roles:
63 | - htop
64 | tags:
65 | - htop
66 |
67 | # Stand up upstream services.
68 | - hosts: upstream
69 | gather_facts: false
70 | become: True
71 | vars_files:
72 | - ./vars/tests.yml
73 | - ./vars/services.yml
74 | roles:
75 | - upstream
76 | tags:
77 | - standup
78 |
79 | # Benchmark upstream service
80 | - hosts: load-generator
81 | gather_facts: false
82 | become: True
83 | vars_files:
84 | - ./vars/tests.yml
85 | - ./vars/services.yml
86 | tasks:
87 | - name: Include load-generator role
88 | vars:
89 | label: upstream
90 | include_role:
91 | name: load-generator
92 | when: (query_type == 'REST') and ('upstream' in test_services)
93 | tags:
94 | - test
95 |
96 | # Stand up Tyk gateway dependencies
97 | - hosts: tyk_dependencies
98 | gather_facts: false
99 | become: True
100 | tasks:
101 | - name: Include tyk-dependencies role
102 | include_role:
103 | name: tyk-dependencies
104 | when: ('kong' in test_services) and (not ('saas' in ansible_run_tags))
105 | tags:
106 | - install
107 |
108 | # Stand up Tyk gateway
109 | - hosts: "{% if 'saas' in ansible_run_tags %}localhost{% else %}tyk{% endif %}"
110 | gather_facts: false
111 | become: True
112 | vars_files:
113 | - ./vars/tests.yml
114 | - ./vars/services.yml
115 | tasks:
116 | - name: Include tyk role
117 | include_role:
118 | name: tyk
119 | when: ('tyk' in test_services)
120 | tags:
121 | - install
122 | - standup
123 |
124 | # Benchmark Tyk gateway
125 | - hosts: load-generator
126 | gather_facts: false
127 | become: True
128 | vars_files:
129 | - ./vars/tests.yml
130 | - ./vars/services.yml
131 | tasks:
132 | - name: Include load-generator role
133 | vars:
134 | label: "{% if 'saas' in ansible_run_tags %}saas-{% endif %}tyk"
135 | include_role:
136 | name: load-generator
137 | when: ('tyk' in test_services)
138 | tags:
139 | - test
140 |
141 | # Stand up Kong dependencies gateway
142 | - hosts: kong_dependencies
143 | gather_facts: false
144 | become: True
145 | tasks:
146 | - name: Include kong role
147 | include_role:
148 | name: kong-dependencies
149 | when: (query_type == 'REST') and ('kong' in test_services)
150 | tags:
151 | - standup
152 |
153 | # Stand up Kong gateway
154 | - hosts: kong
155 | gather_facts: false
156 | become: True
157 | vars_files:
158 | - ./vars/tests.yml
159 | - ./vars/services.yml
160 | tasks:
161 | - name: Include kong role
162 | include_role:
163 | name: kong
164 | when: (query_type == 'REST') and ('kong' in test_services)
165 | tags:
166 | - standup
167 |
168 | # Benchmark Kong gateway
169 | - hosts: load-generator
170 | gather_facts: false
171 | become: True
172 | vars_files:
173 | - ./vars/tests.yml
174 | - ./vars/services.yml
175 | tasks:
176 | - name: Include load-generator role
177 | vars:
178 | label: kong
179 | include_role:
180 | name: load-generator
181 | when: (query_type == 'REST') and ('kong' in test_services)
182 | tags:
183 | - test
184 |
185 | # Stand up Apollo server
186 | - hosts: apollo
187 | gather_facts: false
188 | become: True
189 | vars_files:
190 | - ./vars/tests.yml
191 | - ./vars/services.yml
192 | tasks:
193 | - name: Include apollo-server role
194 | include_role:
195 | name: apollo-server
196 | when: (query_type != 'REST') and ('apollo' in test_services)
197 | tags:
198 | - install
199 | - standup
200 |
201 | # Benchmark Apollo server
202 | - hosts: load-generator
203 | gather_facts: false
204 | become: True
205 | vars_files:
206 | - ./vars/tests.yml
207 | - ./vars/services.yml
208 | tasks:
209 | - name: Include load-generator role
210 | vars:
211 | label: apollo
212 | include_role:
213 | name: load-generator
214 | when: (query_type != 'REST') and ('apollo' in test_services)
215 | tags:
216 | - test
217 |
218 | # Clean up upstream services
219 | - hosts: upstream
220 | gather_facts: false
221 | become: True
222 | vars_files:
223 | - ./vars/tests.yml
224 | roles:
225 | - upstream
226 | tags:
227 | - cleanup
228 |
229 | # Clean up Tyk gateway services
230 | - hosts: tyk
231 | gather_facts: false
232 | become: True
233 | tasks:
234 | - name: Include tyk role
235 | include_role:
236 | name: tyk
237 | when: ('tyk' in test_services) and (not ('saas' in ansible_run_tags))
238 | tags:
239 | - cleanup
240 |
241 | # Clean up Kong gateway services
242 | - hosts: kong
243 | gather_facts: false
244 | become: True
245 | vars_files:
246 | - ./vars/tests.yml
247 | tasks:
248 | - name: Include kong role
249 | include_role:
250 | name: kong
251 | when: (query_type == 'REST') and ('kong' in test_services)
252 | tags:
253 | - cleanup
254 |
255 | # Clean up Apollo services
256 | - hosts: apollo
257 | gather_facts: false
258 | become: True
259 | vars_files:
260 | - ./vars/tests.yml
261 | tasks:
262 | - name: Include apollo-server role
263 | include_role:
264 | name: apollo-server
265 | when: (query_type != 'REST') and ('apollo' in test_services)
266 | tags:
267 | - cleanup
268 |
--------------------------------------------------------------------------------
/requirements-azure.txt:
--------------------------------------------------------------------------------
1 | packaging
2 | requests[security]
3 | xmltodict
4 | azure-cli-core==2.34.0
5 | azure-common==1.1.11
6 | azure-identity==1.7.0
7 | azure-mgmt-apimanagement==0.2.0
8 | azure-mgmt-authorization==0.51.1
9 | azure-mgmt-batch==5.0.1
10 | azure-mgmt-cdn==3.0.0
11 | azure-mgmt-compute==23.1.0
12 | azure-mgmt-containerinstance==1.4.0
13 | azure-mgmt-containerregistry==2.0.0
14 | azure-mgmt-containerservice==9.1.0
15 | azure-mgmt-datalake-store==0.5.0
16 | azure-mgmt-dns==2.1.0
17 | azure-mgmt-keyvault==1.1.0
18 | azure-mgmt-marketplaceordering==0.1.0
19 | azure-mgmt-monitor==3.0.0
20 | azure-mgmt-managedservices==1.0.0
21 | azure-mgmt-managementgroups==0.2.0
22 | azure-mgmt-network==19.1.0
23 | azure-mgmt-nspkg==2.0.0
24 | azure-mgmt-privatedns==0.1.0
25 | azure-mgmt-redis==5.0.0
26 | azure-mgmt-resource==10.2.0
27 | azure-mgmt-rdbms==1.9.0
28 | azure-mgmt-search==3.0.0
29 | azure-mgmt-servicebus==0.5.3
30 | azure-mgmt-sql==0.10.0
31 | azure-mgmt-storage==19.0.0
32 | azure-mgmt-trafficmanager==0.50.0
33 | azure-mgmt-web==0.41.0
34 | azure-nspkg==2.0.0
35 | azure-storage==0.35.1
36 | msrest==0.6.21
37 | msrestazure==0.6.4
38 | azure-keyvault==1.0.0a1
39 | azure-graphrbac==0.61.1
40 | azure-mgmt-cosmosdb==0.5.2
41 | azure-mgmt-hdinsight==0.1.0
42 | azure-mgmt-devtestlabs==3.0.0
43 | azure-mgmt-loganalytics==1.0.0
44 | azure-mgmt-automation==0.1.1
45 | azure-mgmt-iothub==0.7.0
46 | azure-mgmt-recoveryservices==0.4.0
47 | azure-mgmt-recoveryservicesbackup==0.6.0
48 | azure-mgmt-notificationhubs==2.0.0
49 | azure-mgmt-eventhub==2.0.0
50 | azure.mgmt.datafactory==2.7.0
51 |
--------------------------------------------------------------------------------
/requirements.yml:
--------------------------------------------------------------------------------
1 | roles:
2 | - name: geerlingguy.pip
3 | - name: geerlingguy.docker
4 |
5 | collections:
6 | - name: amazon.aws
7 | - name: google.cloud
8 | - name: azure.azcollection
9 |
--------------------------------------------------------------------------------
/roles/apollo-server/files/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node
2 |
3 | MAINTAINER Zaid Albirawi
4 |
5 | COPY Dockerfile /node/home/apollo-server/Dockerfile
6 | COPY src/* /node/home/apollo-server/src/
7 |
8 | WORKDIR /node/home/apollo-server/src
9 |
10 | RUN npm i
11 |
12 | ENTRYPOINT node index.js
13 |
--------------------------------------------------------------------------------
/roles/apollo-server/files/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "apollo-server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "keywords": [],
7 | "author": "",
8 | "license": "ISC",
9 | "dependencies": {
10 | "@apollo/gateway": "^0.47.0",
11 | "apollo-datasource-rest": "^3.5.0",
12 | "apollo-server": "^3.6.0",
13 | "cluster": "^0.7.7",
14 | "graphql": "^16.2.0",
15 | "os": "^0.1.2",
16 | "process": "^0.11.10"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/roles/apollo-server/tasks/install.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Ensure working directory exists
3 | file:
4 | path: /node/home/apollo-server/src
5 | state: directory
6 |
7 | - name: Copy Dockerfile, and src folder to /node/home/apollo-server
8 | copy:
9 | src: ../files/
10 | dest: /node/home/apollo-server/
11 |
--------------------------------------------------------------------------------
/roles/apollo-server/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Include install task
3 | include_tasks: install.yml
4 | when: ('install' in ansible_run_tags)
5 |
6 | - name: Remove Apollo server container
7 | docker_container:
8 | name: apollo-server
9 | state: absent
10 |
11 | - name: Remove apollo-server container image
12 | docker_image:
13 | name: apollo-server
14 | state: absent
15 |
16 | - name: Include standup task
17 | include_tasks: standup.yml
18 | when: ('standup' in ansible_run_tags)
19 |
--------------------------------------------------------------------------------
/roles/apollo-server/tasks/standup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create index.js
3 | template:
4 | src: apollo-server/index.j2
5 | dest: /node/home/apollo-server/src/index.js
6 |
7 | - name: Build apollo-server container image
8 | docker_image:
9 | name: apollo-server
10 | tag: latest
11 | build:
12 | path: /node/home/apollo-server/
13 | source: build
14 |
15 | - name: Launch Apollo server container
16 | docker_container:
17 | name: apollo-server
18 | state: started
19 | image: apollo-server:latest
20 | ports:
21 | - "{{ services.apollo.service.port }}:{{ services.apollo.service.port }}"
22 |
--------------------------------------------------------------------------------
/roles/aws/tasks/cleanup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Terminate Upstream EC2 instance
3 | ec2_instance:
4 | state: absent
5 | name: "{{ aws_instance_type }}-upstream"
6 | region: "{{ aws_region }}"
7 | instance_type: "{{ aws_instance_type }}"
8 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
9 | aws_access_key: "{{ aws_access_key }}"
10 | aws_secret_key: "{{ aws_secret_key }}"
11 |
12 | - name: Terminate Load Generator EC2 instance
13 | ec2_instance:
14 | state: absent
15 | name: "{{ aws_instance_type }}-load"
16 | region: "{{ aws_region }}"
17 | instance_type: "{{ aws_instance_type }}"
18 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
19 | aws_access_key: "{{ aws_access_key }}"
20 | aws_secret_key: "{{ aws_secret_key }}"
21 |
22 | - name: Terminate Tyk EC2 instance
23 | ec2_instance:
24 | state: absent
25 | name: "{{ aws_instance_type }}-tyk"
26 | region: "{{ aws_region }}"
27 | instance_type: "{{ aws_instance_type }}"
28 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
29 | aws_access_key: "{{ aws_access_key }}"
30 | aws_secret_key: "{{ aws_secret_key }}"
31 | when: ('tyk' in test_services)
32 |
33 | - name: Terminate Tyk Dependencies EC2 instance
34 | ec2_instance:
35 | state: absent
36 | name: "{{ aws_instance_type }}-tyk-dependencies"
37 | region: "{{ aws_region }}"
38 | instance_type: "{{ aws_instance_type }}"
39 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
40 | aws_access_key: "{{ aws_access_key }}"
41 | aws_secret_key: "{{ aws_secret_key }}"
42 | when: ('tyk' in test_services)
43 |
44 | - name: Terminate Kong EC2 instance
45 | ec2_instance:
46 | state: absent
47 | name: "{{ aws_instance_type }}-kong"
48 | region: "{{ aws_region }}"
49 | instance_type: "{{ aws_instance_type }}"
50 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
51 | aws_access_key: "{{ aws_access_key }}"
52 | aws_secret_key: "{{ aws_secret_key }}"
53 | when: ('kong' in test_services)
54 |
55 | - name: Terminate Kong Dependencies EC2 instance
56 | ec2_instance:
57 | state: absent
58 | name: "{{ aws_instance_type }}-kong-dependencies"
59 | region: "{{ aws_region }}"
60 | instance_type: "{{ aws_instance_type }}"
61 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
62 | aws_access_key: "{{ aws_access_key }}"
63 | aws_secret_key: "{{ aws_secret_key }}"
64 | when: ('kong' in test_services)
65 |
66 | - name: Terminate Apollo EC2 instance
67 | ec2_instance:
68 | state: absent
69 | name: "{{ aws_instance_type }}-apollo"
70 | region: "{{ aws_region }}"
71 | instance_type: "{{ aws_instance_type }}"
72 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
73 | aws_access_key: "{{ aws_access_key }}"
74 | aws_secret_key: "{{ aws_secret_key }}"
75 | when: ('apollo' in test_services)
76 |
--------------------------------------------------------------------------------
/roles/aws/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Include standup task
3 | include_tasks: standup.yml
4 | when: ('standup' in ansible_run_tags)
5 |
6 | - name: Include cleanup task
7 | include_tasks: cleanup.yml
8 | when: ('cleanup' in ansible_run_tags)
9 |
--------------------------------------------------------------------------------
/roles/aws/tasks/standup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Provision Upstream EC2 instance
3 | ec2_instance:
4 | name: "{{ aws_instance_type }}-upstream"
5 | instance_type: "{{ aws_instance_type }}"
6 | region: "{{ aws_region }}"
7 | image_id: "{{ aws_image }}"
8 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
9 | security_group: "{{ aws_group }}"
10 | key_name: "{{ aws_key_name }}"
11 | network:
12 | assign_public_ip: yes
13 | aws_access_key: "{{ aws_access_key }}"
14 | aws_secret_key: "{{ aws_secret_key }}"
15 | register: upstream
16 | until: upstream.instances[0].public_dns_name != ""
17 | retries: 10
18 | delay: 5
19 |
20 | - name: Provision Load Generator EC2 instance
21 | ec2_instance:
22 | name: "{{ aws_instance_type }}-load"
23 | instance_type: "{{ aws_instance_type }}"
24 | region: "{{ aws_region }}"
25 | image_id: "{{ aws_image }}"
26 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
27 | security_group: "{{ aws_group }}"
28 | key_name: "{{ aws_key_name }}"
29 | network:
30 | assign_public_ip: yes
31 | aws_access_key: "{{ aws_access_key }}"
32 | aws_secret_key: "{{ aws_secret_key }}"
33 | register: load
34 | until: load.instances[0].public_dns_name != ""
35 | retries: 10
36 | delay: 5
37 |
38 | - name: Provision Tyk Dependencies EC2 instance
39 | ec2_instance:
40 | name: "{{ aws_instance_type }}-tyk-dependencies"
41 | instance_type: "{{ aws_instance_type }}"
42 | region: "{{ aws_region }}"
43 | image_id: "{{ aws_image }}"
44 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
45 | security_group: "{{ aws_group }}"
46 | key_name: "{{ aws_key_name }}"
47 | network:
48 | assign_public_ip: yes
49 | aws_access_key: "{{ aws_access_key }}"
50 | aws_secret_key: "{{ aws_secret_key }}"
51 | register: tyk_dependencies
52 | until: tyk_dependencies.instances[0].public_dns_name != ""
53 | retries: 10
54 | delay: 5
55 | when: ('tyk' in test_services)
56 |
57 | - name: Provision Tyk EC2 instance
58 | ec2_instance:
59 | name: "{{ aws_instance_type }}-tyk"
60 | instance_type: "{{ aws_instance_type }}"
61 | region: "{{ aws_region }}"
62 | image_id: "{{ aws_image }}"
63 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
64 | security_group: "{{ aws_group }}"
65 | key_name: "{{ aws_key_name }}"
66 | network:
67 | assign_public_ip: yes
68 | aws_access_key: "{{ aws_access_key }}"
69 | aws_secret_key: "{{ aws_secret_key }}"
70 | register: tyk
71 | until: tyk.instances[0].public_dns_name != ""
72 | retries: 10
73 | delay: 5
74 | when: ('tyk' in test_services)
75 |
76 | - name: Provision Kong Dependencies EC2 instance
77 | ec2_instance:
78 | name: "{{ aws_instance_type }}-kong-dependencies"
79 | instance_type: "{{ aws_instance_type }}"
80 | region: "{{ aws_region }}"
81 | image_id: "{{ aws_image }}"
82 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
83 | security_group: "{{ aws_group }}"
84 | key_name: "{{ aws_key_name }}"
85 | network:
86 | assign_public_ip: yes
87 | aws_access_key: "{{ aws_access_key }}"
88 | aws_secret_key: "{{ aws_secret_key }}"
89 | register: kong_dependencies
90 | until: kong_dependencies.instances[0].public_dns_name != ""
91 | retries: 10
92 | delay: 5
93 | when: ('kong' in test_services)
94 |
95 | - name: Provision Kong EC2 instance
96 | ec2_instance:
97 | name: "{{ aws_instance_type }}-kong"
98 | instance_type: "{{ aws_instance_type }}"
99 | region: "{{ aws_region }}"
100 | image_id: "{{ aws_image }}"
101 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
102 | security_group: "{{ aws_group }}"
103 | key_name: "{{ aws_key_name }}"
104 | network:
105 | assign_public_ip: yes
106 | aws_access_key: "{{ aws_access_key }}"
107 | aws_secret_key: "{{ aws_secret_key }}"
108 | register: kong
109 | until: kong.instances[0].public_dns_name != ""
110 | retries: 10
111 | delay: 5
112 | when: ('kong' in test_services)
113 |
114 | - name: Provision Apollo EC2 instance
115 | ec2_instance:
116 | name: "{{ aws_instance_type }}-apollo"
117 | instance_type: "{{ aws_instance_type }}"
118 | region: "{{ aws_region }}"
119 | image_id: "{{ aws_image }}"
120 | vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
121 | security_group: "{{ aws_group }}"
122 | key_name: "{{ aws_key_name }}"
123 | network:
124 | assign_public_ip: yes
125 | aws_access_key: "{{ aws_access_key }}"
126 | aws_secret_key: "{{ aws_secret_key }}"
127 | register: apollo
128 | until: apollo.instances[0].public_dns_name != ""
129 | retries: 10
130 | delay: 5
131 | when: ('apollo' in test_services)
132 |
133 | - name: Create {{ aws_instance_type }}-aws-hosts.yml
134 | vars:
135 | hosts:
136 | upstream: "{{ upstream.instances[0].public_dns_name }}"
137 | load: "{{ load.instances[0].public_dns_name }}"
138 | tyk: "{% if 'tyk' in test_services %}{{ tyk.instances[0].public_dns_name }}{% endif %}"
139 | tyk_dependencies: "{% if 'tyk' in test_services %}{{ tyk_dependencies.instances[0].public_dns_name }}{% endif %}"
140 | kong: "{% if 'kong' in test_services %}{{ kong.instances[0].public_dns_name }}{% endif %}"
141 | kong_dependencies: "{% if 'kong' in test_services %}{{ kong_dependencies.instances[0].public_dns_name }}{% endif %}"
142 | apollo: "{% if 'apollo' in test_services %}{{ apollo.instances[0].public_dns_name }}{% endif %}"
143 | template:
144 | src: hosts.j2
145 | dest: ./hosts/{{ aws_instance_type }}-aws-hosts.yml
146 |
--------------------------------------------------------------------------------
/roles/azure/tasks/cleanup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: "Delete {{ azure_vm_size }}-resource-group"
3 | azure_rm_resourcegroup:
4 | name: "{{ azure_vm_size }}-resource-group"
5 | force_delete_nonempty: yes
6 | state: absent
7 |
--------------------------------------------------------------------------------
/roles/azure/tasks/create_vm.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create virtual network interface card for {{ title }}
3 | azure_rm_networkinterface:
4 | resource_group: "{{ azure_vm_size }}-resource-group"
5 | name: "{{ azure_vm_size }}-{{ type }}-network-interface-card"
6 | virtual_network: "{{ azure_vm_size }}-virtual-network"
7 | subnet: "{{ azure_vm_size }}-subnet"
8 | public_ip_name: "{{ azure_vm_size }}-{{ type }}-ip"
9 | security_group: "{{ azure_vm_size }}-network-security-group"
10 |
11 | - name: Create {{ title }} VM
12 | azure_rm_virtualmachine:
13 | resource_group: "{{ azure_vm_size }}-resource-group"
14 | name: "{{ azure_vm_size | replace('_','-') }}-{{ type }}-vm"
15 | vm_size: "{{ azure_vm_size }}"
16 | admin_username: "{{ provider.user }}"
17 | ssh_password_enabled: false
18 | ssh_public_keys:
19 | - path: "/home/{{ provider.user }}/.ssh/authorized_keys"
20 | key_data: "{{ azure_ssh_public_key }}"
21 | network_interfaces: "{{ azure_vm_size }}-{{ type }}-network-interface-card"
22 | image:
23 | offer: "{{ azure_image.offer }}"
24 | publisher: "{{ azure_image.publisher }}"
25 | sku: "{{ azure_image.sku }}"
26 | version: "{{ azure_image.version }}"
27 |
--------------------------------------------------------------------------------
/roles/azure/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Include standup task
3 | include_tasks: standup.yml
4 | when: ('standup' in ansible_run_tags)
5 |
6 | - name: Include cleanup task
7 | include_tasks: cleanup.yml
8 | when: ('cleanup' in ansible_run_tags)
9 |
--------------------------------------------------------------------------------
/roles/azure/tasks/standup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: "Create a resource group {{ azure_vm_size }}-resource-group"
3 | azure_rm_resourcegroup:
4 | name: "{{ azure_vm_size }}-resource-group"
5 | location: "{{ azure_location }}"
6 |
7 | - name: Create a virtual network
8 | azure_rm_virtualnetwork:
9 | resource_group: "{{ azure_vm_size }}-resource-group"
10 | name: "{{ azure_vm_size }}-virtual-network"
11 | address_prefixes_cidr:
12 | - "10.1.0.0/16"
13 |
14 | - name: Create a subnet
15 | azure_rm_subnet:
16 | resource_group: "{{ azure_vm_size }}-resource-group"
17 | virtual_network_name: "{{ azure_vm_size }}-virtual-network"
18 | name: "{{ azure_vm_size }}-subnet"
19 | address_prefix_cidr: "10.1.0.0/24"
20 |
21 | - name: Create a network security group
22 | azure_rm_securitygroup:
23 | resource_group: "{{ azure_vm_size }}-resource-group"
24 | name: "{{ azure_vm_size }}-network-security-group"
25 | rules:
26 | - name: Access
27 | destination_port_range:
28 | - "22"
29 | - "4000-4003"
30 | - "5432"
31 | - "6379"
32 | - "8000-8001"
33 | - "8080"
34 | - "8443-8444"
35 | priority: 1001
36 | direction: Inbound
37 |
38 | - name: Create Upstream public IP address
39 | azure_rm_publicipaddress:
40 | resource_group: "{{ azure_vm_size }}-resource-group"
41 | allocation_method: Static
42 | name: "{{ azure_vm_size }}-upstream-ip"
43 | register: upstream
44 |
45 | - name: Create Load Generator public IP address
46 | azure_rm_publicipaddress:
47 | resource_group: "{{ azure_vm_size }}-resource-group"
48 | allocation_method: Static
49 | name: "{{ azure_vm_size }}-load-ip"
50 | register: load
51 |
52 | - name: Create Tyk Dependencies public IP address
53 | azure_rm_publicipaddress:
54 | resource_group: "{{ azure_vm_size }}-resource-group"
55 | allocation_method: Static
56 | name: "{{ azure_vm_size }}-tyk-dependencies-ip"
57 | register: tyk_dependencies
58 | when: ('tyk' in test_services)
59 |
60 | - name: Create Tyk public IP address
61 | azure_rm_publicipaddress:
62 | resource_group: "{{ azure_vm_size }}-resource-group"
63 | allocation_method: Static
64 | name: "{{ azure_vm_size }}-tyk-ip"
65 | register: tyk
66 | when: ('tyk' in test_services)
67 |
68 | - name: Create Kong Dependencies public IP address
69 | azure_rm_publicipaddress:
70 | resource_group: "{{ azure_vm_size }}-resource-group"
71 | allocation_method: Static
72 | name: "{{ azure_vm_size }}-kong-dependencies-ip"
73 | register: kong_dependencies
74 | when: ('kong' in test_services)
75 |
76 | - name: Create Kong public IP address
77 | azure_rm_publicipaddress:
78 | resource_group: "{{ azure_vm_size }}-resource-group"
79 | allocation_method: Static
80 | name: "{{ azure_vm_size }}-kong-ip"
81 | register: kong
82 | when: ('kong' in test_services)
83 |
84 | - name: Create Apollo public IP address
85 | azure_rm_publicipaddress:
86 | resource_group: "{{ azure_vm_size }}-resource-group"
87 | allocation_method: Static
88 | name: "{{ azure_vm_size }}-apollo-ip"
89 | register: apollo
90 | when: ('apollo' in test_services)
91 |
92 | - name: Include create_vm task to create Upstream vm
93 | include_tasks: create_vm.yml
94 | vars:
95 | title: Upstream
96 | type: upstream
97 |
98 | - name: Include create_vm task to create Load Generator vm
99 | include_tasks: create_vm.yml
100 | vars:
101 | title: Load Generator
102 | type: load
103 |
104 | - name: Include create_vm task to create Tyk Dependencies vm
105 | include_tasks: create_vm.yml
106 | vars:
107 | title: Tyk Dependencies
108 | type: tyk-dependencies
109 | when: ('tyk' in test_services)
110 |
111 | - name: Include create_vm task to create Tyk vm
112 | include_tasks: create_vm.yml
113 | vars:
114 | title: Tyk
115 | type: tyk
116 | when: ('tyk' in test_services)
117 |
118 | - name: Include create_vm task to create Kong Dependencies vm
119 | include_tasks: create_vm.yml
120 | vars:
121 | title: Kong Dependencies
122 | type: kong-dependencies
123 | when: ('kong' in test_services)
124 |
125 | - name: Include create_vm task to create Kong vm
126 | include_tasks: create_vm.yml
127 | vars:
128 | title: Kong
129 | type: kong
130 | when: ('kong' in test_services)
131 |
132 | - name: Include create_vm task to create Apollo vm
133 | include_tasks: create_vm.yml
134 | vars:
135 | title: Apollo
136 | type: apollo
137 | when: ('apollo' in test_services)
138 |
139 | - name: Create {{ azure_vm_size }}-azure-hosts.yml
140 | vars:
141 | hosts:
142 | upstream: "{{ upstream.state.ip_address }}"
143 | load: "{{ load.state.ip_address }}"
144 | tyk: "{% if 'tyk' in test_services %}{{ tyk.state.ip_address }}{% endif %}"
145 | tyk_dependencies: "{% if 'tyk' in test_services %}{{ tyk_dependencies.state.ip_address }}{% endif %}"
146 | kong: "{% if 'kong' in test_services %}{{ kong.state.ip_address }}{% endif %}"
147 | kong_dependencies: "{% if 'kong' in test_services %}{{ kong_dependencies.state.ip_address }}{% endif %}"
148 | apollo: "{% if 'apollo' in test_services %}{{ apollo.state.ip_address }}{% endif %}"
149 | template:
150 | src: hosts.j2
151 | dest: ./hosts/{{ azure_vm_size }}-azure-hosts.yml
152 |
--------------------------------------------------------------------------------
/roles/gcp/tasks/cleanup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Include terminate_instance task to terminate Upstream vm
3 | include_tasks: terminate_instance.yml
4 | vars:
5 | title: Upstream
6 | type: upstream
7 |
8 | - name: Include terminate_instance task to terminate Load Generator vm
9 | include_tasks: terminate_instance.yml
10 | vars:
11 | title: Load Generator
12 | type: load
13 |
14 | - name: Include terminate_instance task to terminate Tyk Dependencies vm
15 | include_tasks: terminate_instance.yml
16 | vars:
17 | title: Tyk Dependencies
18 | type: tyk-dependencies
19 | when: ('tyk' in test_services)
20 |
21 | - name: Include terminate_instance task to terminate Tyk vm
22 | include_tasks: terminate_instance.yml
23 | vars:
24 | title: Tyk
25 | type: tyk
26 | when: ('tyk' in test_services)
27 |
28 | - name: Include terminate_instance task to terminate Kong Dependencies vm
29 | include_tasks: terminate_instance.yml
30 | vars:
31 | title: Kong Dependencies
32 | type: kong-dependencies
33 | when: ('kong' in test_services)
34 |
35 | - name: Include terminate_instance task to terminate Kong vm
36 | include_tasks: terminate_instance.yml
37 | vars:
38 | title: Kong
39 | type: kong
40 | when: ('kong' in test_services)
41 |
42 | - name: Include terminate_instance task to terminate Apollo vm
43 | include_tasks: terminate_instance.yml
44 | vars:
45 | title: Apollo
46 | type: apollo
47 | when: ('apollo' in test_services)
48 |
49 | - name: Terminate GCP firewall instance
50 | gcp_compute_firewall:
51 | state: absent
52 | name: "{{ gcp_machine_type }}-firewall"
53 | project: "{{ gcp_project }}"
54 | auth_kind: "{{ gcp_auth_kind }}"
55 | service_account_file: "{{ gcp_service_account_file }}"
56 |
57 | - name: Terminate GCP network instance
58 | gcp_compute_network:
59 | state: absent
60 | name: "{{ gcp_machine_type }}-network"
61 | project: "{{ gcp_project }}"
62 | auth_kind: "{{ gcp_auth_kind }}"
63 | service_account_file: "{{ gcp_service_account_file }}"
64 |
--------------------------------------------------------------------------------
/roles/gcp/tasks/create_instance.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Provision {{ title }} GCP disk instance
3 | gcp_compute_disk:
4 | name: "{{ gcp_machine_type }}-{{ type }}-disk"
5 | project: "{{ gcp_project }}"
6 | zone: "{{ gcp_zone }}"
7 | auth_kind: "{{ gcp_auth_kind }}"
8 | service_account_file: "{{ gcp_service_account_file }}"
9 | source_image: "{{ gcp_image }}"
10 | size_gb: 20
11 | register: disk
12 |
13 | - name: Provision {{ title }} GCP compute instance
14 | gcp_compute_instance:
15 | name: "{{ gcp_machine_type }}-{{ type }}"
16 | project: "{{ gcp_project }}"
17 | zone: "{{ gcp_zone }}"
18 | auth_kind: "{{ gcp_auth_kind }}"
19 | service_account_file: "{{ gcp_service_account_file }}"
20 | machine_type: "{{ gcp_machine_type }}"
21 | disks:
22 | - auto_delete: True
23 | boot: True
24 | source: "{{ disk }}"
25 | network_interfaces:
26 | - network: "{{ network }}"
27 | access_configs:
28 | - name: External NAT
29 | nat_ip: "{{ address }}"
30 | type: ONE_TO_ONE_NAT
31 |
--------------------------------------------------------------------------------
/roles/gcp/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Include standup task
3 | include_tasks: standup.yml
4 | when: ('standup' in ansible_run_tags)
5 |
6 | - name: Include cleanup task
7 | include_tasks: cleanup.yml
8 | when: ('cleanup' in ansible_run_tags)
9 |
--------------------------------------------------------------------------------
/roles/gcp/tasks/standup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Provision GCP network instance
3 | gcp_compute_network:
4 | name: "{{ gcp_machine_type }}-network"
5 | project: "{{ gcp_project }}"
6 | auth_kind: "{{ gcp_auth_kind }}"
7 | service_account_file: "{{ gcp_service_account_file }}"
8 | auto_create_subnetworks: True
9 | register: network
10 |
11 | - name: Provision GCP firewall instance
12 | gcp_compute_firewall:
13 | name: "{{ gcp_machine_type }}-firewall"
14 | project: "{{ gcp_project }}"
15 | auth_kind: "{{ gcp_auth_kind }}"
16 | service_account_file: "{{ gcp_service_account_file }}"
17 | network: "{{ network }}"
18 | allowed:
19 | - ip_protocol: tcp
20 | ports:
21 | - "22"
22 | - "4000-4003"
23 | - "5432"
24 | - "6379"
25 | - "8000-8001"
26 | - "8080"
27 | - "8443-8444"
28 |
29 | - name: Provision Upstream GCP address instance
30 | gcp_compute_address:
31 | name: "{{ gcp_machine_type }}-upstream-address"
32 | project: "{{ gcp_project }}"
33 | region: "{{ gcp_region }}"
34 | auth_kind: "{{ gcp_auth_kind }}"
35 | service_account_file: "{{ gcp_service_account_file }}"
36 | register: upstream_address
37 |
38 | - name: Provision Load Generator GCP address instance
39 | gcp_compute_address:
40 | name: "{{ gcp_machine_type }}-load-address"
41 | project: "{{ gcp_project }}"
42 | region: "{{ gcp_region }}"
43 | auth_kind: "{{ gcp_auth_kind }}"
44 | service_account_file: "{{ gcp_service_account_file }}"
45 | register: load_address
46 |
47 | - name: Provision Tyk GCP Dependencies address instance
48 | gcp_compute_address:
49 | name: "{{ gcp_machine_type }}-tyk-dependencies-address"
50 | project: "{{ gcp_project }}"
51 | region: "{{ gcp_region }}"
52 | auth_kind: "{{ gcp_auth_kind }}"
53 | service_account_file: "{{ gcp_service_account_file }}"
54 | register: tyk_dependencies_address
55 | when: ('tyk' in test_services)
56 |
57 | - name: Provision Tyk GCP address instance
58 | gcp_compute_address:
59 | name: "{{ gcp_machine_type }}-tyk-address"
60 | project: "{{ gcp_project }}"
61 | region: "{{ gcp_region }}"
62 | auth_kind: "{{ gcp_auth_kind }}"
63 | service_account_file: "{{ gcp_service_account_file }}"
64 | register: tyk_address
65 | when: ('tyk' in test_services)
66 |
67 | - name: Provision Kong Dependencies GCP address instance
68 | gcp_compute_address:
69 | name: "{{ gcp_machine_type }}-kong-dependencies-address"
70 | project: "{{ gcp_project }}"
71 | region: "{{ gcp_region }}"
72 | auth_kind: "{{ gcp_auth_kind }}"
73 | service_account_file: "{{ gcp_service_account_file }}"
74 | register: kong_dependencies_address
75 | when: ('kong' in test_services)
76 |
77 | - name: Provision Kong GCP address instance
78 | gcp_compute_address:
79 | name: "{{ gcp_machine_type }}-kong-address"
80 | project: "{{ gcp_project }}"
81 | region: "{{ gcp_region }}"
82 | auth_kind: "{{ gcp_auth_kind }}"
83 | service_account_file: "{{ gcp_service_account_file }}"
84 | register: kong_address
85 | when: ('kong' in test_services)
86 |
87 | - name: Provision Apollo GCP address instance
88 | gcp_compute_address:
89 | name: "{{ gcp_machine_type }}-apollo-address"
90 | project: "{{ gcp_project }}"
91 | region: "{{ gcp_region }}"
92 | auth_kind: "{{ gcp_auth_kind }}"
93 | service_account_file: "{{ gcp_service_account_file }}"
94 | register: apollo_address
95 | when: ('apollo' in test_services)
96 |
97 | - name: Include create_instance task to create Upstream vm
98 | include_tasks: create_instance.yml
99 | vars:
100 | title: Upstream
101 | type: upstream
102 | address: "{{ upstream_address }}"
103 |
104 | - name: Include create_instance task to create Load Generator vm
105 | include_tasks: create_instance.yml
106 | vars:
107 | title: Load Generator
108 | type: load
109 | address: "{{ load_address }}"
110 |
111 | - name: Include create_instance task to create Tyk Dependencies vm
112 | include_tasks: create_instance.yml
113 | vars:
114 | title: Tyk Dependencies
115 | type: tyk-dependencies
116 | address: "{{ tyk_dependencies_address }}"
117 | when: ('tyk' in test_services)
118 |
119 | - name: Include create_instance task to create Tyk vm
120 | include_tasks: create_instance.yml
121 | vars:
122 | title: Tyk
123 | type: tyk
124 | address: "{{ tyk_address }}"
125 | when: ('tyk' in test_services)
126 |
127 | - name: Include create_instance task to create Kong Dependencies vm
128 | include_tasks: create_instance.yml
129 | vars:
130 | title: Kong
131 | type: kong-dependencies
132 | address: "{{ kong_dependencies_address }}"
133 | when: ('kong' in test_services)
134 |
135 | - name: Include create_instance task to create Kong vm
136 | include_tasks: create_instance.yml
137 | vars:
138 | title: Kong
139 | type: kong
140 | address: "{{ kong_address }}"
141 | when: ('kong' in test_services)
142 |
143 | - name: Include create_instance task to create Apollo vm
144 | include_tasks: create_instance.yml
145 | vars:
146 | title: Apollo
147 | type: apollo
148 | address: "{{ apollo_address }}"
149 | when: ('apollo' in test_services)
150 |
151 | - name: Create {{ gcp_machine_type }}-gcp-hosts.yml
152 | vars:
153 | hosts:
154 | upstream: "{{ upstream_address.address }}"
155 | load: "{{ load_address.address }}"
156 | tyk: "{% if 'tyk' in test_services %}{{ tyk_address.address }}{% endif %}"
157 | tyk_dependencies: "{% if 'tyk' in test_services %}{{ tyk_dependencies_address.address }}{% endif %}"
158 | kong: "{% if 'kong' in test_services %}{{ kong_address.address }}{% endif %}"
159 | kong_dependencies: "{% if 'kong' in test_services %}{{ kong_dependencies_address.address }}{% endif %}"
160 | apollo: "{% if 'apollo' in test_services %}{{ apollo_address.address }}{% endif %}"
161 | template:
162 | src: hosts.j2
163 | dest: ./hosts/{{ gcp_machine_type }}-gcp-hosts.yml
164 |
--------------------------------------------------------------------------------
/roles/gcp/tasks/terminate_instance.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Terminate {{ title }} GCP compute instance
3 | gcp_compute_instance:
4 | state: absent
5 | name: "{{ gcp_machine_type }}-{{ type }}"
6 | project: "{{ gcp_project }}"
7 | zone: "{{ gcp_zone }}"
8 | auth_kind: "{{ gcp_auth_kind }}"
9 | service_account_file: "{{ gcp_service_account_file }}"
10 |
11 | - name: Terminate {{ title }} GCP address instance
12 | gcp_compute_address:
13 | state: absent
14 | name: "{{ gcp_machine_type }}-{{ type }}-address"
15 | project: "{{ gcp_project }}"
16 | region: "{{ gcp_region }}"
17 | auth_kind: "{{ gcp_auth_kind }}"
18 | service_account_file: "{{ gcp_service_account_file }}"
19 |
--------------------------------------------------------------------------------
/roles/htop/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Update system packages
3 | package:
4 | name: "*"
5 | state: latest
6 | update_cache: yes
7 |
8 | - name: Include redhat task
9 | include_tasks: redhat.yml
10 | when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
11 |
12 | - name: Install htop
13 | package:
14 | name: htop
15 | state: present
16 | update_cache: yes
17 |
--------------------------------------------------------------------------------
/roles/htop/tasks/redhat.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Add epel-release GPG key
3 | ansible.builtin.rpm_key:
4 | state: present
5 | key: https://mirror.dst.ca/epel/RPM-GPG-KEY-EPEL-8
6 |
7 | - name: Install epel-release for Red Hat and CentOS
8 | yum:
9 | name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
10 | state: present
11 | update_cache: yes
12 |
--------------------------------------------------------------------------------
/roles/kong-dependencies/tasks/install.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create Tyk network
3 | docker_network:
4 | name: kong
5 |
6 | - name: Launch Redis container
7 | docker_container:
8 | name: redis
9 | state: started
10 | image: redis:4.0-alpine
11 | ports:
12 | - "6379:6379"
13 | networks:
14 | - name: kong
15 |
16 | - name: Launch Postgres container
17 | docker_container:
18 | name: kong-database
19 | state: started
20 | image: postgres:9.6
21 | ports:
22 | - "5432:5432"
23 | env:
24 | POSTGRES_USER: "kong"
25 | POSTGRES_DB: "kong"
26 | POSTGRES_PASSWORD: "kong"
27 | networks:
28 | - name: kong
29 |
30 | - name: Wait for postgres to come up
31 | ansible.builtin.wait_for:
32 | port: 5432
33 | delay: 10
34 |
35 | - name: Bootstrap kong
36 | docker_container:
37 | name: kong-bootstrap
38 | cleanup: yes
39 | state: started
40 | image: kong:latest
41 | entrypoint: kong
42 | command: migrations bootstrap
43 | env:
44 | KONG_DATABASE: "postgres"
45 | KONG_PG_HOST: "kong-database"
46 | KONG_PG_USER: "kong"
47 | KONG_PG_PASSWORD: "kong"
48 | KONG_CASSANDRA_CONTACT_POINTS: "kong-database"
49 | networks:
50 | - name: kong
51 |
--------------------------------------------------------------------------------
/roles/kong-dependencies/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Remove postgres container
3 | docker_container:
4 | name: kong-database
5 | state: absent
6 |
7 | - name: Remove redis container
8 | docker_container:
9 | name: redis
10 | state: absent
11 |
12 | - name: Include install task
13 | include_tasks: install.yml
14 | when: ('install' in ansible_run_tags)
15 |
--------------------------------------------------------------------------------
/roles/kong/tasks/install.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: /etc/kong/ dir exists
3 | file:
4 | path: /etc/kong/
5 | state: directory
6 |
7 | - name: Create kong.conf
8 | template:
9 | src: kong/kong.conf.j2
10 | dest: /etc/kong/kong.conf
11 |
--------------------------------------------------------------------------------
/roles/kong/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Remove Kong gateway container
3 | docker_container:
4 | name: kong
5 | state: absent
6 |
7 | - name: Include install task
8 | include_tasks: install.yml
9 | when: ('install' in ansible_run_tags)
10 |
11 | - name: Include standup task
12 | include_tasks: standup.yml
13 | when: ('standup' in ansible_run_tags)
14 |
--------------------------------------------------------------------------------
/roles/kong/tasks/standup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Launch Kong container
3 | docker_container:
4 | name: kong
5 | state: started
6 | image: kong:latest
7 | ports:
8 | - "{{ services.kong.service.port }}:{{ services.kong.service.port }}"
9 | - "{{ services.kong.service.ssl_port }}:{{ services.kong.service.ssl_port }}"
10 | - "{{ services.kong.admin.port }}:{{ services.kong.admin.port }}"
11 | - "{{ services.kong.admin.ssl_port }}:{{ services.kong.admin.ssl_port }}"
12 | volumes:
13 | - "/etc/kong/:/etc/kong/"
14 | env:
15 | KONG_DATABASE: "postgres"
16 | KONG_PG_HOST: "{{ hostvars.kong_dependencies.ansible_facts.default_ipv4.address }}"
17 | KONG_PG_PASSWORD: "kong"
18 | KONG_ADMIN_LISTEN: "0.0.0.0:{{ services.kong.admin.port }}, 0.0.0.0:{{ services.kong.admin.ssl_port }} ssl"
19 | KONG_CASSANDRA_CONTACT_POINTS: "kong-database"
20 | KONG_PROXY_ACCESS_LOG: "/dev/stdout"
21 | KONG_ADMIN_ACCESS_LOG: "/dev/stdout"
22 | KONG_PROXY_ERROR_LOG: "/dev/stderr"
23 | KONG_ADMIN_ERROR_LOG: "/dev/stderr"
24 | ulimits: "nofile:80000:80000"
25 |
26 | - name: Create Service
27 | uri:
28 | url: http://localhost:{{ services.kong.admin.port }}/services/
29 | method: POST
30 | body_format: form-urlencoded
31 | body:
32 | - [ name, api ]
33 | - [ url, "http://{{ hostvars.upstream.ansible_facts.default_ipv4.address }}:{{ services.upstream.service.port }}" ]
34 | status_code: [ 201, 409 ]
35 |
36 | - name: Create Route
37 | uri:
38 | url: http://localhost:{{ services.kong.admin.port }}/services/api/routes
39 | method: POST
40 | body_format: form-urlencoded
41 | body:
42 | - [ "paths[]", /api ]
43 | status_code: [ 201, 409 ]
44 |
45 | - name: Add Auth to API service
46 | uri:
47 | url: http://localhost:{{ services.kong.admin.port }}/services/api/plugins
48 | method: POST
49 | body_format: form-urlencoded
50 | body:
51 | - [ name, "key-auth" ]
52 | - [ "config.key_names", apikey ]
53 | status_code: [ 201, 409 ]
54 | when: enable_auth
55 |
56 | - name: Create a consumer
57 | uri:
58 | url: http://localhost:{{ services.kong.admin.port }}/consumers/
59 | method: POST
60 | body_format: form-urlencoded
61 | body:
62 | - [ username, user123 ]
63 | status_code: 201
64 | when: enable_auth
65 |
66 | - name: Add Rate Limiting to API service
67 | uri:
68 | url: http://localhost:{{ services.kong.admin.port }}/services/api/plugins
69 | method: POST
70 | body_format: form-urlencoded
71 | body:
72 | - [ name, "rate-limiting" ]
73 | - [ "config.second", 9999999 ]
74 | - [ "config.policy", redis ]
75 | - [ "config.redis_host", "{{ hostvars.kong_dependencies.ansible_facts.default_ipv4.address }}" ]
76 | status_code: [ 201, 409 ]
77 | when: enable_auth or enable_quota or enable_rate_limiting
78 |
--------------------------------------------------------------------------------
/roles/load-generator/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create API key for Tyk
3 | uri:
4 | url: http://{{ hostvars[label].ansible_facts.default_ipv4.address }}:{{ services[label].service.port }}/tyk/keys/create
5 | method: POST
6 | body_format: json
7 | headers:
8 | Content-Type: application/json
9 | x-tyk-authorization: "{{ services.tyk.secret }}"
10 | body: "{ \"access_rights\": { \"1\": { \"allowed_urls\": [], \"api_id\": \"1\", \"api_name\": \"Tyk Test API\", \"limit\": null, \"versions\": [ \"Default\" ] } }, \"allowance\": 100000, \"expires\": 0, \"org_id\": \"default\", \"per\": 1, \"quota_max\": -1, \"quota_remaining\": -1, \"quota_renewal_rate\": -1, \"quota_renews\": 1568655187, \"rate\": 100000, \"throttle_interval\": -1, \"throttle_retry_limit\": -1 }"
11 | register: tyk_key
12 | when: label == 'tyk' and enable_auth
13 |
14 | - name: Create API key for Kong
15 | uri:
16 | url: http://{{ hostvars[label].ansible_facts.default_ipv4.address }}:{{ services.kong.admin.port }}/consumers/user123/key-auth
17 | method: POST
18 | status_code: 201
19 | register: kong_key
20 | when: label == 'kong' and enable_auth
21 |
22 | - name: Launch Load Generator
23 | docker_container:
24 | name: load-generator
25 | state: started
26 | image: rcmorano/docker-hey
27 | detach: no
28 | command: "-z {{ load_test_duration }}{% if label == 'tyk' and enable_auth %} -H \"Authorization: {{ tyk_key.json.key }}\"{% endif %}{% if query_type != 'REST' %} -m POST -H \"Content-Type: application/json\" -d \"{\\\"query\\\":\\\"{{ graphql_query[query_depth] }}\\\",\\\"variables\\\":null}\"{% endif %} {% if label == 'saas-tyk' %}{{ api_url }}{% else %}http://{{ hostvars[label].ansible_facts.default_ipv4.address }}:{{ services[label].service.port }}/{% if (label == 'tyk' or label == 'kong') %}api/{% endif %}{% endif %}{% if query_type == 'REST' %}json/valid{% endif %}{% if label == 'kong' and enable_auth %}?apikey={{ kong_key.json.key }}{% endif %}"
29 | register: output
30 |
31 | - name: Copy result to local
32 | local_action: copy content={{ output.container.Output }} dest="./benchmarks/bench{% if prefix %}-{{ prefix }}{% endif %}{% if limit_cores %}-cores-{{ limit_cores }}{% endif %}-{{ label }}-{{ query_type | lower }}{% if query_type != 'REST' %}-{{ query_depth }}{% endif %}.txt"
33 |
34 | - name: Remove Load Generator container
35 | docker_container:
36 | name: load-generator
37 | state: absent
38 |
--------------------------------------------------------------------------------
/roles/tyk-dependencies/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Launch Redis container
3 | docker_container:
4 | name: redis
5 | state: started
6 | image: redis:4.0-alpine
7 | ports:
8 | - "6379:6379"
9 |
10 |
--------------------------------------------------------------------------------
/roles/tyk/tasks/install.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Ensure working directory exists
3 | file:
4 | path: /opt/tyk-gateway/apps
5 | state: directory
6 |
--------------------------------------------------------------------------------
/roles/tyk/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Remove Tyk Gateway container
3 | docker_container:
4 | name: tyk-gateway
5 | state: absent
6 | when: not ('saas' in ansible_run_tags)
7 |
8 | - name: Include install task
9 | include_tasks: install.yml
10 | when: ('install' in ansible_run_tags) and not ('saas' in ansible_run_tags)
11 |
12 | - name: Include standup task
13 | include_tasks: standup.yml
14 | when: ('standup' in ansible_run_tags)
15 |
--------------------------------------------------------------------------------
/roles/tyk/tasks/standup-federation.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create users-subgraph.json
3 | template:
4 | src: tyk/users-subgraph.j2
5 | dest: "{% if 'saas' in ansible_run_tags %}./saas/apps/users-subgraph.json{% else %}/opt/tyk-gateway/apps/users-subgraph.json{% endif %}"
6 |
7 | - name: Create posts-subgraph.json
8 | template:
9 | src: tyk/posts-subgraph.j2
10 | dest: "{% if 'saas' in ansible_run_tags %}./saas/apps/posts-subgraph.json{% else %}/opt/tyk-gateway/apps/posts-subgraph.json{% endif %}"
11 |
12 | - name: Create comments-subgraph.json
13 | template:
14 | src: tyk/comments-subgraph.j2
15 | dest: "{% if 'saas' in ansible_run_tags %}./saas/apps/comments-subgraph.json{% else %}/opt/tyk-gateway/apps/comments-subgraph.json{% endif %}"
16 |
--------------------------------------------------------------------------------
/roles/tyk/tasks/standup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Create tyk.conf
3 | template:
4 | src: tyk/tyk.j2
5 | dest: /opt/tyk-gateway/tyk.conf
6 | when: not ('saas' in ansible_run_tags)
7 |
8 | - name: Create api.json
9 | template:
10 | src: tyk/api.j2
11 | dest: "{% if 'saas' in ansible_run_tags %}./saas/apps/api{% if prefix %}-{{ prefix }}{% endif %}.json{% else %}/opt/tyk-gateway/apps/api.json{% endif %}"
12 |
13 | - name: Include federation standup task
14 | include_tasks: standup-federation.yml
15 | when: query_type == "FEDERATE"
16 |
17 | - name: Launch Tyk Gateway container
18 | docker_container:
19 | name: tyk-gateway
20 | state: started
21 | image: tykio/tyk-gateway:v4.0.1-rc8
22 | ports:
23 | - "{{ services.tyk.service.port }}:{{ services.tyk.service.port }}"
24 | volumes:
25 | - "/opt/tyk-gateway/tyk.conf:/opt/tyk-gateway/tyk.conf"
26 | - "/opt/tyk-gateway/apps:/opt/tyk-gateway/apps"
27 | ulimits: "nofile:80000:80000"
28 | env:
29 | GOGC: "1600"
30 | GOMAXPROCS: "{% if limit_cores %}{{ limit_cores }}{% endif %}"
31 | when: not ('saas' in ansible_run_tags)
32 |
--------------------------------------------------------------------------------
/roles/upstream/tasks/federatation.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Include federation-standup task
3 | include_tasks: federation-standup.yml
4 | when: ('standup' in ansible_run_tags)
5 |
6 | - name: Include federation-cleanup task
7 | include_tasks: federation-cleanup.yml
8 | when: ('cleanup' in ansible_run_tags)
9 |
--------------------------------------------------------------------------------
/roles/upstream/tasks/federation-cleanup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Remove users container
3 | docker_container:
4 | name: users
5 | state: absent
6 |
7 | - name: Remove posts container
8 | docker_container:
9 | name: posts
10 | state: absent
11 |
12 | - name: Remove comments container
13 | docker_container:
14 | name: comments
15 | state: absent
16 |
--------------------------------------------------------------------------------
/roles/upstream/tasks/federation-standup.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Launch users container
3 | docker_container:
4 | name: users
5 | state: started
6 | image: zalbiraw/go-api-test-service
7 | ports:
8 | - "{{ services.upstream.subgraphs.users.port }}:{{ services.upstream.subgraphs.users.port }}"
9 | env:
10 | GOGC: "3200"
11 | PORT: "{{ services.upstream.subgraphs.users.port }}"
12 | ulimits: "nofile:80000:80000"
13 | entrypoint: ./users/server
14 |
15 | - name: Launch posts container
16 | docker_container:
17 | name: posts
18 | state: started
19 | image: zalbiraw/go-api-test-service
20 | ports:
21 | - "{{ services.upstream.subgraphs.posts.port }}:{{ services.upstream.subgraphs.posts.port }}"
22 | env:
23 | GOGC: "3200"
24 | PORT: "{{ services.upstream.subgraphs.posts.port }}"
25 | ulimits: "nofile:80000:80000"
26 | entrypoint: ./posts/server
27 |
28 | - name: Launch comments container
29 | docker_container:
30 | name: comments
31 | state: started
32 | image: zalbiraw/go-api-test-service
33 | ports:
34 | - "{{ services.upstream.subgraphs.comments.port }}:{{ services.upstream.subgraphs.comments.port }}"
35 | env:
36 | GOGC: "3200"
37 | PORT: "{{ services.upstream.subgraphs.comments.port }}"
38 | ulimits: "nofile:80000:80000"
39 | entrypoint: ./comments/server
40 |
--------------------------------------------------------------------------------
/roles/upstream/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Include rest task
3 | include_tasks: rest.yml
4 | when: query_type != 'FEDERATE'
5 |
6 | - name: Include federatation task
7 | include_tasks: federatation.yml
8 | when: query_type == 'FEDERATE'
9 |
--------------------------------------------------------------------------------
/roles/upstream/tasks/rest.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Launch upstream container
3 | docker_container:
4 | name: upstream
5 | state: started
6 | image: "{% if query_type == 'REST' %}mangomm/go-bench-suite{% elif query_type == 'STITCH' %}mangomm/jsonplaceholder{% endif %}"
7 | ports:
8 | - "{{ services.upstream.service.port }}:8000"
9 | env:
10 | GOGC: "3200"
11 | ulimits: "nofile:80000:80000"
12 | command: "{% if query_type == 'REST' %}./go-bench-suite upstream{% endif %}"
13 | when: ('standup' in ansible_run_tags)
14 |
15 | - name: Remove upstream container
16 | docker_container:
17 | name: upstream
18 | state: absent
19 | when: ('cleanup' in ansible_run_tags)
20 |
--------------------------------------------------------------------------------
/saas/apps/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TykTechnologies/tyk-ansible-performance-testing/d49a060b9abcc56279d57fbb94102e69c46d0c6a/saas/apps/.gitkeep
--------------------------------------------------------------------------------
/saas/hosts.yml.example:
--------------------------------------------------------------------------------
1 | all:
2 | hosts:
3 | upstream:
4 | ansible_host: host
5 | ansible_user: user
6 | ansible_ssh_private_key_file: ./secret.pem
7 | load-generator:
8 | ansible_host: host
9 | ansible_user: user
10 | ansible_ssh_private_key_file: ./secret.pem
11 |
--------------------------------------------------------------------------------
/scripts/init.sh:
--------------------------------------------------------------------------------
1 | cp ansible.cfg.example ansible.cfg
2 | cp hosts.yml.example hosts.yml
3 | cp saas/hosts.yml.example saas/hosts.yml
4 | cp vars/tests.yml.example vars/tests.yml
5 | cp vars/services.yml.example vars/services.yml
6 | cp vars/aws.yml.example vars/aws.yml
7 | cp vars/gcp.yml.example vars/gcp.yml
8 | cp vars/azure.yml.example vars/azure.yml
9 | ansible-galaxy install -r requirements.yml
10 |
--------------------------------------------------------------------------------
/templates/apollo-server/index.j2:
--------------------------------------------------------------------------------
1 | const { ApolloServer, gql } = require('apollo-server')
2 | const { ApolloGateway, IntrospectAndCompose } = require("@apollo/gateway")
3 | const { RESTDataSource } = require('apollo-datasource-rest')
4 | const cluster = require('cluster')
5 | const { cpus } = require('os')
6 | const p = require('process')
7 |
8 | const numCPUs = {% if not limit_cores %}cpus().length{% else %}{{ limit_cores }}{% endif %}
9 |
10 | {% if query_type == 'STITCH' %}
11 | class SocialMediaAPI extends RESTDataSource {
12 | constructor() {
13 | super()
14 | this.baseURL = "http://{{ hostvars.upstream.ansible_facts.default_ipv4.address }}:{{ services.upstream.service.port }}/"
15 | }
16 |
17 | // Fetch user infomation.
18 | async getUser(id) {
19 | return await this.get(`users/${id}`)
20 | }
21 |
22 | // Fetch posts infomation.
23 | async getPosts(id) {
24 | return await this.get(`users/${id}/posts`)
25 | }
26 |
27 | // Fetch comments infomation.
28 | async getComments(id) {
29 | return await this.get(`posts/${id}/comments`)
30 | }
31 | }
32 |
33 | const typeDefs = gql`
34 | type Comment {
35 | id: ID
36 | postId: String
37 | name: String
38 | email: String
39 | body: String
40 | }
41 |
42 | type Post {
43 | id: ID
44 | userId: ID
45 | title: String
46 | body: String
47 | comments: [Comment]
48 | }
49 |
50 | type Query {
51 | user(id: ID!): User
52 | }
53 |
54 | type User {
55 | id: ID
56 | name: String
57 | email: String
58 | username: String
59 | posts: [Post]
60 | }
61 | `
62 |
63 | const resolvers = {
64 | Query: {
65 | user: async (parent, { id }, { dataSources }) =>
66 | dataSources.api.getUser(id),
67 | },
68 | User: {
69 | posts: async (parent, args, { dataSources }) =>
70 | dataSources.api.getPosts(parent.id),
71 | },
72 | Post: {
73 | comments: async (parent, args, { dataSources }) =>
74 | dataSources.api.getComments(parent.id),
75 | }
76 | }
77 |
78 | const server = new ApolloServer({
79 | typeDefs,
80 | resolvers,
81 | dataSources: () => ({
82 | api: new SocialMediaAPI(),
83 | }),
84 | })
85 | {% else %}
86 | const gateway = new ApolloGateway({
87 | supergraphSdl: new IntrospectAndCompose({
88 | subgraphs: [
89 | { name: "users", url: "http://{{ hostvars.upstream.ansible_facts.default_ipv4.address }}:{{ services.upstream.subgraphs.users.port }}/query" },
90 | { name: "posts", url: "http://{{ hostvars.upstream.ansible_facts.default_ipv4.address }}:{{ services.upstream.subgraphs.posts.port }}/query" },
91 | { name: "comments", url: "http://{{ hostvars.upstream.ansible_facts.default_ipv4.address }}:{{ services.upstream.subgraphs.comments.port }}/query" },
92 | ],
93 | }),
94 | })
95 | const server = new ApolloServer({ gateway })
96 | {% endif %}
97 |
98 | if (cluster.isPrimary) {
99 | console.log(`Primary ${process.pid} is running`);
100 |
101 | // Fork workers.
102 | for (let i = 0; i < numCPUs; i++) {
103 | cluster.fork();
104 | }
105 |
106 | cluster.on('exit', (worker, code, signal) => {
107 | console.log(`worker ${worker.process.pid} died`);
108 | });
109 | } else {
110 | // Workers can share any TCP connection
111 | // In this case it is an HTTP server
112 | server
113 | .listen({{ services.apollo.service.port }})
114 | .then(({ url }) => console.log(`Server running at ${url}`))
115 |
116 | console.log(`Worker ${process.pid} started`);
117 | }
118 |
--------------------------------------------------------------------------------
/templates/hosts.j2:
--------------------------------------------------------------------------------
1 | all:
2 | hosts:
3 | upstream:
4 | ansible_host: "{{ hosts.upstream }}"
5 | ansible_user: "{{ provider.user }}"
6 | ansible_ssh_private_key_file: "{{ provider.key_file }}"
7 | load-generator:
8 | ansible_host: "{{ hosts.load }}"
9 | ansible_user: "{{ provider.user }}"
10 | ansible_ssh_private_key_file: "{{ provider.key_file }}"
11 | {% if 'tyk' in test_services %}
12 | tyk:
13 | ansible_host: "{{ hosts.tyk }}"
14 | ansible_user: "{{ provider.user }}"
15 | ansible_ssh_private_key_file: "{{ provider.key_file }}"
16 | tyk_dependencies:
17 | ansible_host: "{{ hosts.tyk_dependencies }}"
18 | ansible_user: "{{ provider.user }}"
19 | ansible_ssh_private_key_file: "{{ provider.key_file }}"
20 | {% endif %}
21 | {% if 'kong' in test_services %}
22 | kong:
23 | ansible_host: "{{ hosts.kong }}"
24 | ansible_user: "{{ provider.user }}"
25 | ansible_ssh_private_key_file: "{{ provider.key_file }}"
26 | kong_dependencies:
27 | ansible_host: "{{ hosts.kong_dependencies }}"
28 | ansible_user: "{{ provider.user }}"
29 | ansible_ssh_private_key_file: "{{ provider.key_file }}"
30 | {% endif %}
31 | {% if 'apollo' in test_services %}
32 | apollo:
33 | ansible_host: "{{ hosts.apollo }}"
34 | ansible_user: "{{ provider.user }}"
35 | ansible_ssh_private_key_file: "{{ provider.key_file }}"
36 | {% endif %}
37 |
--------------------------------------------------------------------------------
/templates/kong/kong.conf.j2:
--------------------------------------------------------------------------------
1 | nginx_worker_processes=auto
2 | nginx_main_worker_rlimit_nofile=auto
3 | nginx_events_worker_connections=auto
4 |
--------------------------------------------------------------------------------
/templates/tyk/api.j2:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Tyk Test API",
3 | "api_id": "1",
4 | "org_id": "default",
5 | "active": true,
6 | "global_rate_limit": {
7 | "rate": 100000,
8 | "per": 1
9 | },
10 | {% if enable_auth %}
11 | "definition": {
12 | "location": "header",
13 | "key": "version"
14 | },
15 | "auth": {
16 | "auth_header_name": "authorization"
17 | },
18 | {% else %}
19 | "auth": {},
20 | "use_keyless": true,
21 | {% endif %}
22 | "version_data": {
23 | "not_versioned": true,
24 | "versions": {
25 | "Default": {
26 | "name": "Default",
27 | "expires": "3000-01-02 15:04",
28 | "use_extended_paths": true,
29 | "extended_paths": {
30 | "ignored": [],
31 | "white_list": [],
32 | "black_list": []
33 | }
34 | }
35 | }
36 | },
37 | {% if 'saas' in ansible_run_tags %}
38 | "tags": [
39 | "edge"
40 | ],
41 | {% endif %}
42 | "proxy": {
43 | "listen_path": "/api/",
44 | "target_url": "{% if query_type == 'REST' %}http://{% if 'saas' in ansible_run_tags %}{{ hostvars.upstream.ansible_host }}{% else %}{{ hostvars.upstream.ansible_facts.default_ipv4.address }}{% endif %}:{{ services.upstream.service.port }}{% endif %}",
45 | "strip_listen_path": true
46 | },
47 | "enable_batch_request_support": true,
48 | "disable_quota": {{ (not(enable_quota | bool)) | lower }},
49 | "disable_rate_limit": {{ (not(enable_rate_limiting | bool)) | lower }},
50 | {% if query_type == 'STITCH' %}
51 | "graphql": {
52 | "schema": "type Comment {\n id: ID\n postId: String\n name: String\n email: String\n body: String\n}\n\ntype Post {\n id: ID\n userId: ID\n title: String\n body: String\n comments: [Comment]\n}\n\ntype Query {\n user(id: ID!): User\n}\n\ntype User {\n id: ID\n name: String\n email: String\n username: String\n posts: [Post]\n}\n",
53 | "enabled": true,
54 | "engine": {
55 | "field_configs": [
56 | {
57 | "type_name": "Query",
58 | "field_name": "user",
59 | "disable_default_mapping": true,
60 | "path": [
61 | ""
62 | ]
63 | },
64 | {
65 | "type_name": "User",
66 | "field_name": "posts",
67 | "disable_default_mapping": true,
68 | "path": [
69 | ""
70 | ]
71 | },
72 | {
73 | "type_name": "Post",
74 | "field_name": "comments",
75 | "disable_default_mapping": true,
76 | "path": [
77 | ""
78 | ]
79 | }
80 | ],
81 | "data_sources": [
82 | {
83 | "kind": "REST",
84 | "name": "users",
85 | "internal": false,
86 | "root_fields": [
87 | {
88 | "type": "Query",
89 | "fields": [
90 | "user"
91 | ]
92 | }
93 | ],
94 | "config": {
95 | "url": "http://{% if 'saas' in ansible_run_tags %}{{ hostvars.upstream.ansible_host }}{% else %}{{ hostvars.upstream.ansible_facts.default_ipv4.address }}{% endif %}:{{ services.upstream.service.port }}/users/{% raw %}{{.arguments.id}}{% endraw %}",
96 | "method": "GET",
97 | "body": "",
98 | "headers": {},
99 | "default_type_name": "User"
100 | }
101 | },
102 | {
103 | "kind": "REST",
104 | "name": "user-posts",
105 | "internal": false,
106 | "root_fields": [
107 | {
108 | "type": "User",
109 | "fields": [
110 | "posts"
111 | ]
112 | }
113 | ],
114 | "config": {
115 | "url": "http://{% if 'saas' in ansible_run_tags %}{{ hostvars.upstream.ansible_host }}{% else %}{{ hostvars.upstream.ansible_facts.default_ipv4.address }}{% endif %}:{{ services.upstream.service.port }}/users/{% raw %}{{.object.id}}{% endraw %}/posts",
116 | "method": "GET",
117 | "body": "",
118 | "headers": {},
119 | "default_type_name": "Post"
120 | }
121 | },
122 | {
123 | "kind": "REST",
124 | "name": "posts-comments",
125 | "internal": false,
126 | "root_fields": [
127 | {
128 | "type": "Post",
129 | "fields": [
130 | "comments"
131 | ]
132 | }
133 | ],
134 | "config": {
135 | "url": "http://{% if 'saas' in ansible_run_tags %}{{ hostvars.upstream.ansible_host }}{% else %}{{ hostvars.upstream.ansible_facts.default_ipv4.address }}{% endif %}:{{ services.upstream.service.port }}/posts/{% raw %}{{.object.id}}{% endraw %}/comments",
136 | "method": "GET",
137 | "body": "",
138 | "headers": {},
139 | "default_type_name": "Comment"
140 | }
141 | }
142 | ]
143 | },
144 | "type_field_configurations": [],
145 | "execution_mode": "executionEngine",
146 | "proxy": {
147 | "auth_headers": {}
148 | },
149 | "subgraph": {
150 | "sdl": ""
151 | },
152 | "supergraph": {
153 | "subgraphs": [],
154 | "merged_sdl": "",
155 | "global_headers": {}
156 | },
157 | "version": "2",
158 | "playground": {
159 | "enabled": false,
160 | "path": ""
161 | },
162 | "last_schema_update": "2021-12-30T16:27:26.291Z"
163 | },
164 | {% elif query_type == 'FEDERATE' %}
165 | "graphql": {
166 | "schema": "type Query {\n user(id: ID!): User!\n users: [User!]!\n comment(id: ID!): Comment!\n comments: [Comment!]!\n post(id: ID!): Post!\n posts: [Post!]!\n}\n\ntype User {\n id: ID!\n name: String!\n username: String!\n email: String!\n address: Address!\n phone: String!\n website: String!\n company: Company!\n posts: [Post]\n}\n\ntype Address {\n street: String!\n suite: String!\n city: String!\n zipcode: String!\n geo: GeoLocation!\n}\n\ntype GeoLocation {\n lat: String!\n lng: String!\n}\n\ntype Company {\n name: String!\n catchPhrase: String!\n bs: String!\n}\n\ntype Comment {\n id: ID!\n postId: ID!\n name: String!\n email: String!\n body: String!\n}\n\ntype Post {\n id: ID!\n userId: ID!\n title: String!\n body: String!\n comments: [Comment]\n}",
167 | "enabled": true,
168 | "engine": {
169 | "field_configs": [],
170 | "data_sources": []
171 | },
172 | "type_field_configurations": [],
173 | "execution_mode": "supergraph",
174 | "proxy": {
175 | "auth_headers": {}
176 | },
177 | "subgraph": {
178 | "sdl": ""
179 | },
180 | "supergraph": {
181 | "updated_at": "2022-02-10T21:03:39.511Z",
182 | "subgraphs": [
183 | {
184 | "api_id": "2",
185 | "name": "users-subgraph",
186 | "url": "tyk://users-subgraph",
187 | "sdl": "extend type Query {\n user(id: ID!): User!\n users: [User!]!\n}\n\ntype User @key(fields: \"id\") {\n id: ID!\n name: String!\n username: String!\n email: String!\n address: Address!\n phone: String!\n website: String!\n company: Company!\n}\n\ntype Address {\n street: String!\n suite: String!\n city: String!\n zipcode: String!\n geo: GeoLocation!\n}\n\ntype GeoLocation {\n lat: String!\n lng: String!\n}\n\ntype Company {\n name: String!\n catchPhrase: String!\n bs: String!\n}\n"
188 | },
189 | {
190 | "api_id": "3",
191 | "name": "comments-subgraph",
192 | "url": "tyk://comments-subgraph",
193 | "sdl": "extend type Query {\n comment(id: ID!): Comment!\n comments: [Comment!]!\n}\n\ntype Comment @key(fields: \"id\") {\n id: ID!\n postId: ID!\n name: String!\n email: String!\n body: String!\n}\n\nextend type Post @key(fields: \"id\") {\n id: ID! @external\n comments: [Comment]\n}\n"
194 | },
195 | {
196 | "api_id": "4",
197 | "name": "posts-subgraph",
198 | "url": "tyk://posts-subgraph",
199 | "sdl": "extend type Query {\n post(id: ID!): Post!\n posts: [Post!]!\n}\n\ntype Post @key(fields: \"id\") {\n id: ID!\n userId: ID!\n title: String!\n body: String!\n}\n\nextend type User @key(fields: \"id\") {\n id: ID! @external\n posts: [Post]\n}\n"
200 | }
201 | ],
202 | "merged_sdl": "type Query {\n user(id: ID!): User!\n users: [User!]!\n comment(id: ID!): Comment!\n comments: [Comment!]!\n post(id: ID!): Post!\n posts: [Post!]!\n}\n\ntype User {\n id: ID!\n name: String!\n username: String!\n email: String!\n address: Address!\n phone: String!\n website: String!\n company: Company!\n posts: [Post]\n}\n\ntype Address {\n street: String!\n suite: String!\n city: String!\n zipcode: String!\n geo: GeoLocation!\n}\n\ntype GeoLocation {\n lat: String!\n lng: String!\n}\n\ntype Company {\n name: String!\n catchPhrase: String!\n bs: String!\n}\n\ntype Comment {\n id: ID!\n postId: ID!\n name: String!\n email: String!\n body: String!\n}\n\ntype Post {\n id: ID!\n userId: ID!\n title: String!\n body: String!\n comments: [Comment]\n}",
203 | "global_headers": {}
204 | },
205 | "version": "2",
206 | "playground": {
207 | "enabled": false,
208 | "path": ""
209 | },
210 | "last_schema_update": "2022-02-10T21:03:39.511Z"
211 | },
212 | {% endif %}
213 | "cache_options": {
214 | "enable_cache": false,
215 | "cache_all_safe_requests": false
216 | }
217 | }
218 |
--------------------------------------------------------------------------------
/templates/tyk/comments-subgraph.j2:
--------------------------------------------------------------------------------
1 | {
2 | "name": "comments-subgraph",
3 | "api_id": "4",
4 | "org_id": "default",
5 | "active": true,
6 | "auth": {},
7 | "use_keyless": true,
8 | "version_data": {
9 | "not_versioned": true,
10 | "versions": {
11 | "Default": {
12 | "name": "Default",
13 | "expires": "3000-01-02 15:04",
14 | "use_extended_paths": true,
15 | "extended_paths": {
16 | "ignored": [],
17 | "white_list": [],
18 | "black_list": []
19 | }
20 | }
21 | }
22 | },
23 | {% if 'saas' in ansible_run_tags %}
24 | "tags": [
25 | "edge"
26 | ],
27 | {% endif %}
28 | "internal": true,
29 | "proxy": {
30 | "target_url": "http://{% if 'saas' in ansible_run_tags %}{{ hostvars.upstream.ansible_host }}{% else %}{{ hostvars.upstream.ansible_facts.default_ipv4.address }}{% endif %}:{{ services.upstream.subgraphs.comments.port }}/query",
31 | "strip_listen_path": true,
32 | "enable_load_balancing": false,
33 | "listen_path": "/comments-subgraph/",
34 | "disable_strip_slash": true
35 | },
36 | "enable_batch_request_support": true,
37 | "disable_quota": true,
38 | "disable_rate_limit": true,
39 | "graphql": {
40 | "schema": "directive @extends on OBJECT | INTERFACE\n\ndirective @external on FIELD_DEFINITION\n\ndirective @key(fields: _FieldSet!) on OBJECT | INTERFACE\n\ndirective @provides(fields: _FieldSet!) on FIELD_DEFINITION\n\ndirective @requires(fields: _FieldSet!) on FIELD_DEFINITION\n\nscalar _Any\n\nunion _Entity = Comment | Post\n\nscalar _FieldSet\n\ntype _Service {\n sdl: String\n}\n\ntype Comment {\n id: ID!\n postId: ID!\n name: String!\n email: String!\n body: String!\n}\n\ntype Entity {\n findCommentByID(id: ID!): Comment!\n findPostByID(id: ID!): Post!\n}\n\ntype Post {\n id: ID!\n comments: [Comment]\n}\n\ntype Query {\n comment(id: ID!): Comment!\n comments: [Comment!]!\n _entities(representations: [_Any!]!): [_Entity]!\n _service: _Service!\n}\n",
41 | "enabled": true,
42 | "engine": {
43 | "field_configs": [],
44 | "data_sources": []
45 | },
46 | "type_field_configurations": [],
47 | "execution_mode": "subgraph",
48 | "proxy": {
49 | "auth_headers": {}
50 | },
51 | "subgraph": {
52 | "sdl": "extend type Query {\n comment(id: ID!): Comment!\n comments: [Comment!]!\n}\n\ntype Comment @key(fields: \"id\") {\n id: ID!\n postId: ID!\n name: String!\n email: String!\n body: String!\n}\n\nextend type Post @key(fields: \"id\") {\n id: ID! @external\n comments: [Comment]\n}\n"
53 | },
54 | "supergraph": {
55 | "subgraphs": [
56 | {
57 | "api_id": "",
58 | "name": "",
59 | "url": "",
60 | "sdl": ""
61 | }
62 | ],
63 | "merged_sdl": "",
64 | "global_headers": {}
65 | },
66 | "version": "2",
67 | "playground": {
68 | "enabled": false,
69 | "path": ""
70 | },
71 | "last_schema_update": "2022-02-10T15:57:14.674Z"
72 | },
73 | "cache_options": {
74 | "enable_cache": false,
75 | "cache_all_safe_requests": false
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/templates/tyk/posts-subgraph.j2:
--------------------------------------------------------------------------------
1 | {
2 | "name": "posts-subgraph",
3 | "api_id": "3",
4 | "org_id": "default",
5 | "active": true,
6 | "auth": {},
7 | "use_keyless": true,
8 | "version_data": {
9 | "not_versioned": true,
10 | "versions": {
11 | "Default": {
12 | "name": "Default",
13 | "expires": "3000-01-02 15:04",
14 | "use_extended_paths": true,
15 | "extended_paths": {
16 | "ignored": [],
17 | "white_list": [],
18 | "black_list": []
19 | }
20 | }
21 | }
22 | },
23 | {% if 'saas' in ansible_run_tags %}
24 | "tags": [
25 | "edge"
26 | ],
27 | {% endif %}
28 | "internal": true,
29 | "proxy": {
30 | "target_url": "http://{% if 'saas' in ansible_run_tags %}{{ hostvars.upstream.ansible_host }}{% else %}{{ hostvars.upstream.ansible_facts.default_ipv4.address }}{% endif %}:{{ services.upstream.subgraphs.posts.port }}/query",
31 | "strip_listen_path": true,
32 | "enable_load_balancing": false,
33 | "listen_path": "/posts-subgraph/",
34 | "disable_strip_slash": true
35 | },
36 | "enable_batch_request_support": true,
37 | "disable_quota": true,
38 | "disable_rate_limit": true,
39 | "graphql": {
40 | "schema": "directive @extends on OBJECT | INTERFACE\n\ndirective @external on FIELD_DEFINITION\n\ndirective @key(fields: _FieldSet!) on OBJECT | INTERFACE\n\ndirective @provides(fields: _FieldSet!) on FIELD_DEFINITION\n\ndirective @requires(fields: _FieldSet!) on FIELD_DEFINITION\n\nscalar _Any\n\nunion _Entity = Post | User\n\nscalar _FieldSet\n\ntype _Service {\n sdl: String\n}\n\ntype Entity {\n findPostByID(id: ID!): Post!\n findUserByID(id: ID!): User!\n}\n\ntype Post {\n id: ID!\n userId: ID!\n title: String!\n body: String!\n}\n\ntype Query {\n post(id: ID!): Post!\n posts: [Post!]!\n _entities(representations: [_Any!]!): [_Entity]!\n _service: _Service!\n}\n\ntype User {\n id: ID!\n posts: [Post]\n}\n",
41 | "enabled": true,
42 | "engine": {
43 | "field_configs": [],
44 | "data_sources": []
45 | },
46 | "type_field_configurations": [],
47 | "execution_mode": "subgraph",
48 | "proxy": {
49 | "auth_headers": {}
50 | },
51 | "subgraph": {
52 | "sdl": "extend type Query {\n post(id: ID!): Post!\n posts: [Post!]!\n}\n\ntype Post @key(fields: \"id\") {\n id: ID!\n userId: ID!\n title: String!\n body: String!\n}\n\nextend type User @key(fields: \"id\") {\n id: ID! @external\n posts: [Post]\n}\n"
53 | },
54 | "supergraph": {
55 | "subgraphs": [
56 | {
57 | "api_id": "",
58 | "name": "",
59 | "url": "",
60 | "sdl": ""
61 | }
62 | ],
63 | "merged_sdl": "",
64 | "global_headers": {}
65 | },
66 | "version": "2",
67 | "playground": {
68 | "enabled": false,
69 | "path": ""
70 | },
71 | "last_schema_update": "2022-02-10T15:57:33.98Z"
72 | },
73 | "cache_options": {
74 | "enable_cache": false,
75 | "cache_all_safe_requests": false
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/templates/tyk/tyk.j2:
--------------------------------------------------------------------------------
1 | {
2 | "listen_port": {{ services.tyk.service.port }},
3 | "secret": "{{ services.tyk.secret }}",
4 | "template_path": "/opt/tyk-gateway/templates",
5 | "tyk_js_path": "/opt/tyk-gateway/js/tyk.js",
6 | "middleware_path": "/opt/tyk-gateway/middleware",
7 | "use_db_app_configs": false,
8 | "app_path": "/opt/tyk-gateway/apps/",
9 | "storage": {
10 | "type": "redis",
11 | "host": "{{ hostvars.tyk_dependencies.ansible_facts.default_ipv4.address }}",
12 | "port": 6379,
13 | "username": "",
14 | "password": "",
15 | "database": 0,
16 | "optimisation_max_idle": 2000,
17 | "optimisation_max_active": 4000
18 | },
19 | "enable_analytics": {{ enable_analytics | lower }},
20 | "analytics_config": {
21 | "type": "csv",
22 | "csv_dir": "/tmp",
23 | "mongo_url": "",
24 | "mongo_db_name": "",
25 | "mongo_collection": "",
26 | "purge_delay": -1,
27 | "ignored_ips": []
28 | },
29 | "health_check": {
30 | "enable_health_checks": false,
31 | "health_check_value_timeouts": 60
32 | },
33 | "optimisations_use_async_session_write": true,
34 | "enable_non_transactional_rate_limiter": true,
35 | "enable_sentinel_rate_limiter": false,
36 | "enable_redis_rolling_limiter": false,
37 | "allow_master_keys": false,
38 | "policies": {
39 | "policy_source": "file",
40 | "policy_record_name": "/opt/tyk-gateway/policies/policies.json"
41 | },
42 | "hash_keys": true,
43 | "close_connections": false,
44 | "http_server_options": {
45 | "enable_websockets": false
46 | },
47 | "allow_insecure_configs": true,
48 | "coprocess_options": {
49 | "enable_coprocess": false,
50 | "coprocess_grpc_server": ""
51 | },
52 | "enable_bundle_downloader": false,
53 | "bundle_base_url": "",
54 | "global_session_lifetime": 100,
55 | "force_global_session_lifetime": false,
56 | "max_idle_connections_per_host": 500
57 | }
58 |
--------------------------------------------------------------------------------
/templates/tyk/users-subgraph.j2:
--------------------------------------------------------------------------------
1 | {
2 | "name": "users-subgraph",
3 | "api_id": "2",
4 | "org_id": "default",
5 | "active": true,
6 | "auth": {},
7 | "use_keyless": true,
8 | "version_data": {
9 | "not_versioned": true,
10 | "versions": {
11 | "Default": {
12 | "name": "Default",
13 | "expires": "3000-01-02 15:04",
14 | "use_extended_paths": true,
15 | "extended_paths": {
16 | "ignored": [],
17 | "white_list": [],
18 | "black_list": []
19 | }
20 | }
21 | }
22 | },
23 | {% if 'saas' in ansible_run_tags %}
24 | "tags": [
25 | "edge"
26 | ],
27 | {% endif %}
28 | "internal": true,
29 | "proxy": {
30 | "target_url": "http://{% if 'saas' in ansible_run_tags %}{{ hostvars.upstream.ansible_host }}{% else %}{{ hostvars.upstream.ansible_facts.default_ipv4.address }}{% endif %}:{{ services.upstream.subgraphs.users.port }}/query",
31 | "strip_listen_path": true,
32 | "enable_load_balancing": false,
33 | "listen_path": "/users-subgraph/",
34 | "disable_strip_slash": true
35 | },
36 | "enable_batch_request_support": true,
37 | "disable_quota": true,
38 | "disable_rate_limit": true,
39 | "graphql": {
40 | "schema": "directive @extends on OBJECT | INTERFACE\n\ndirective @external on FIELD_DEFINITION\n\ndirective @key(fields: _FieldSet!) on OBJECT | INTERFACE\n\ndirective @provides(fields: _FieldSet!) on FIELD_DEFINITION\n\ndirective @requires(fields: _FieldSet!) on FIELD_DEFINITION\n\nscalar _Any\n\nunion _Entity = User\n\nscalar _FieldSet\n\ntype _Service {\n sdl: String\n}\n\ntype Address {\n street: String!\n suite: String!\n city: String!\n zipcode: String!\n geo: GeoLocation!\n}\n\ntype Company {\n name: String!\n catchPhrase: String!\n bs: String!\n}\n\ntype Entity {\n findUserByID(id: ID!): User!\n}\n\ntype GeoLocation {\n lat: String!\n lng: String!\n}\n\ntype Query {\n user(id: ID!): User!\n users: [User!]!\n _entities(representations: [_Any!]!): [_Entity]!\n _service: _Service!\n}\n\ntype User {\n id: ID!\n name: String!\n username: String!\n email: String!\n address: Address!\n phone: String!\n website: String!\n company: Company!\n}\n",
41 | "enabled": true,
42 | "engine": {
43 | "field_configs": [],
44 | "data_sources": []
45 | },
46 | "type_field_configurations": [],
47 | "execution_mode": "subgraph",
48 | "proxy": {
49 | "auth_headers": {}
50 | },
51 | "subgraph": {
52 | "sdl": "extend type Query {\n user(id: ID!): User!\n users: [User!]!\n}\n\ntype User @key(fields: \"id\") {\n id: ID!\n name: String!\n username: String!\n email: String!\n address: Address!\n phone: String!\n website: String!\n company: Company!\n}\n\ntype Address {\n street: String!\n suite: String!\n city: String!\n zipcode: String!\n geo: GeoLocation!\n}\n\ntype GeoLocation {\n lat: String!\n lng: String!\n}\n\ntype Company {\n name: String!\n catchPhrase: String!\n bs: String!\n}\n"
53 | },
54 | "supergraph": {
55 | "subgraphs": [
56 | {
57 | "api_id": "",
58 | "name": "",
59 | "url": "",
60 | "sdl": ""
61 | }
62 | ],
63 | "merged_sdl": "",
64 | "global_headers": {}
65 | },
66 | "version": "2",
67 | "playground": {
68 | "enabled": false,
69 | "path": ""
70 | },
71 | "last_schema_update": "2022-02-10T13:55:39.126Z"
72 | },
73 | "cache_options": {
74 | "enable_cache": false,
75 | "cache_all_safe_requests": false
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/tests/analyze.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | RScript ./analyze.r \
5 | "vanilla-tyk-rest,auth-tyk-rest,analytics-tyk-rest,rate-limiting-tyk-rest,auth-quota-tyk-rest,all-tyk-rest" \
6 | "aws" \
7 | "c5.4xlarge" \
8 | "16" \
9 | "Cores" \
10 | "16" \
11 | "Tyk Plugin Anlysis on AWS c5.4xlarge -" \
12 | "Tyk,Auth,Analytics,Rate Limiting,Auth & Quota,All" \
13 | "bar"
14 |
15 | RScript ./analyze.r \
16 | "vanilla-tyk-rest,auth-tyk-rest,analytics-tyk-rest,rate-limiting-tyk-rest,auth-quota-tyk-rest,all-tyk-rest" \
17 | "gcp" \
18 | "c2d-standard-16" \
19 | "16" \
20 | "Cores" \
21 | "16" \
22 | "Tyk Plugin Anlysis on GCP c2d-standard-16 -" \
23 | "Tyk,Auth,Analytics,Rate Limiting,Auth & Quota,All" \
24 | "bar"
25 |
26 | RScript ./analyze.r \
27 | "vanilla-tyk-rest,auth-tyk-rest,analytics-tyk-rest,rate-limiting-tyk-rest,auth-quota-tyk-rest,all-tyk-rest" \
28 | "azure" \
29 | "Standard_F16s_v2" \
30 | "16" \
31 | "Cores" \
32 | "16" \
33 | "Tyk Plugin Anlysis on Azure Standard_F16s_v2 -" \
34 | "Tyk,Auth,Analytics,Rate Limiting,Auth & Quota,All" \
35 | "bar"
36 |
37 | RScript ./analyze.r \
38 | "all-tyk-rest" \
39 | "aws" \
40 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
41 | "2,4,8,16" \
42 | "Machine type" \
43 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
44 | "Tyk on AWS - Fully Loaded REST -" \
45 | "Tyk"
46 |
47 | RScript ./analyze.r \
48 | "all-tyk-rest" \
49 | "gcp" \
50 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
51 | "2,4,8,16" \
52 | "Machine type" \
53 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
54 | "Tyk on GCP - Fully Loaded REST -" \
55 | "Tyk"
56 |
57 | RScript ./analyze.r \
58 | "all-tyk-rest" \
59 | "azure" \
60 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
61 | "2,4,8,16" \
62 | "Machine type" \
63 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
64 | "Tyk on Azure - Fully Loaded REST -" \
65 | "Tyk"
66 |
67 | RScript ./analyze.r \
68 | "vanilla-tyk,vanilla-kong" \
69 | "rest,aws" \
70 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
71 | "2,4,8,16" \
72 | "Machine type" \
73 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
74 | "Tyk vs Kong on AWS - Vanilla REST -" \
75 | "Tyk,Kong"
76 |
77 | RScript ./analyze.r \
78 | "vanilla-tyk,vanilla-kong" \
79 | "rest,gcp" \
80 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
81 | "2,4,8,16" \
82 | "Machine type" \
83 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
84 | "Tyk vs Kong on GCP - Vanilla REST -" \
85 | "Tyk,Kong"
86 |
87 | RScript ./analyze.r \
88 | "vanilla-tyk,vanilla-kong" \
89 | "rest,azure" \
90 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
91 | "2,4,8,16" \
92 | "Machine type" \
93 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
94 | "Tyk vs Kong on Azure - Vanilla REST -" \
95 | "Tyk,Kong"
96 |
97 | RScript ./analyze.r \
98 | "auth-tyk,auth-kong" \
99 | "rest,aws" \
100 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
101 | "2,4,8,16" \
102 | "Machine type" \
103 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
104 | "Tyk vs Kong on AWS - Auth REST -" \
105 | "Tyk,Kong"
106 |
107 | RScript ./analyze.r \
108 | "auth-tyk,auth-kong" \
109 | "rest,gcp" \
110 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
111 | "2,4,8,16" \
112 | "Machine type" \
113 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
114 | "Tyk vs Kong on GCP - Auth REST -" \
115 | "Tyk,Kong"
116 |
117 | RScript ./analyze.r \
118 | "auth-tyk,auth-kong" \
119 | "rest,azure" \
120 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
121 | "2,4,8,16" \
122 | "Machine type" \
123 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
124 | "Tyk vs Kong on Azure - Auth REST -" \
125 | "Tyk,Kong"
126 |
127 | RScript ./analyze.r \
128 | "rate-limiting-tyk,rate-limiting-kong" \
129 | "rest,aws" \
130 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
131 | "2,4,8,16" \
132 | "Machine type" \
133 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
134 | "Tyk vs Kong on AWS - Rate Limiting REST -" \
135 | "Tyk,Kong"
136 |
137 | RScript ./analyze.r \
138 | "rate-limiting-tyk,rate-limiting-kong" \
139 | "rest,gcp" \
140 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
141 | "2,4,8,16" \
142 | "Machine type" \
143 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
144 | "Tyk vs Kong on GCP - Rate Limiting REST -" \
145 | "Tyk,Kong"
146 |
147 | RScript ./analyze.r \
148 | "rate-limiting-tyk,rate-limiting-kong" \
149 | "rest,azure" \
150 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
151 | "2,4,8,16" \
152 | "Machine type" \
153 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
154 | "Tyk vs Kong on Azure - Rate Limiting REST -" \
155 | "Tyk,Kong"
156 |
157 | RScript ./analyze.r \
158 | "auth-quota-tyk,auth-quota-kong" \
159 | "rest,aws" \
160 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
161 | "2,4,8,16" \
162 | "Machine type" \
163 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
164 | "Tyk vs Kong on AWS - Auth & Quota REST -" \
165 | "Tyk,Kong"
166 |
167 | RScript ./analyze.r \
168 | "auth-quota-tyk,auth-quota-kong" \
169 | "rest,gcp" \
170 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
171 | "2,4,8,16" \
172 | "Machine type" \
173 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
174 | "Tyk vs Kong on GCP - Auth & Quota REST -" \
175 | "Tyk,Kong"
176 |
177 | RScript ./analyze.r \
178 | "auth-quota-tyk,auth-quota-kong" \
179 | "rest,azure" \
180 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
181 | "2,4,8,16" \
182 | "Machine type" \
183 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
184 | "Tyk vs Kong on Azure - Auth & Quota REST -" \
185 | "Tyk,Kong"
186 |
187 | RScript ./analyze.r \
188 | "tyk-stitch-0,tyk-stitch-1,tyk-stitch-2,apollo-stitch-0,apollo-stitch-1,apollo-stitch-2" \
189 | "aws" \
190 | "c5.large,c5.xlarge,c5.2xlarge,c5.4xlarge" \
191 | "2,4,8,16" \
192 | "Cores" \
193 | "2,4,8,16" \
194 | "Tyk vs Apollo on AWS - REST Stitching -" \
195 | "Tyk Depth 0,Tyk Depth 1,Tyk Depth 2,Apollo Depth 0,Apollo Depth 1,Apollo Depth 2"
196 |
197 | RScript ./analyze.r \
198 | "tyk-stitch-0,tyk-stitch-1,tyk-stitch-2,apollo-stitch-0,apollo-stitch-1,apollo-stitch-2" \
199 | "gcp" \
200 | "e2-standard-2,c2d-standard-4,c2d-standard-8,c2d-standard-16" \
201 | "2,4,8,16" \
202 | "Cores" \
203 | "2,4,8,16" \
204 | "Tyk vs Apollo on GCP - REST Stitching -" \
205 | "Tyk Depth 0,Tyk Depth 1,Tyk Depth 2,Apollo Depth 0,Apollo Depth 1,Apollo Depth 2"
206 |
207 | RScript ./analyze.r \
208 | "tyk-stitch-0,tyk-stitch-1,tyk-stitch-2,apollo-stitch-0,apollo-stitch-1,apollo-stitch-2" \
209 | "azure" \
210 | "Standard_F2s_v2,Standard_F4s_v2,Standard_F8s_v2,Standard_F16s_v2" \
211 | "2,4,8,16" \
212 | "Cores" \
213 | "2,4,8,16" \
214 | "Tyk vs Apollo on Azure - REST Stitching -" \
215 | "Tyk Depth 0,Tyk Depth 1,Tyk Depth 2,Apollo Depth 0,Apollo Depth 1,Apollo Depth 2"
216 |
--------------------------------------------------------------------------------
/tests/aws_c5.2xlarge.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | ansible-playbook aws.playbook.yml -t standup -e '{ "aws_instance_type": "c5.2xlarge", "aws_image": "ami-08970fb2e5767e3b8", "test_services": [ "tyk", "kong", "apollo" ] }'
5 |
6 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
7 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-1-vanilla", "load_test_duration": "5m" }'
8 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-2-vanilla", "load_test_duration": "5m" }'
9 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-3-vanilla", "load_test_duration": "5m" }'
10 |
11 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
12 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-1-auth", "load_test_duration": "5m" }'
13 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-2-auth", "load_test_duration": "5m" }'
14 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-3-auth", "load_test_duration": "5m" }'
15 |
16 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false }'
17 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-1-analytics", "load_test_duration": "5m" }'
18 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-2-analytics", "load_test_duration": "5m" }'
19 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-3-analytics", "load_test_duration": "5m" }'
20 |
21 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false }'
22 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-1-auth-quota", "load_test_duration": "5m" }'
23 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-2-auth-quota", "load_test_duration": "5m" }'
24 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.2xlarge-aws-3-auth-quota", "load_test_duration": "5m" }'
25 |
26 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true }'
27 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.2xlarge-aws-1-rate-limiting", "load_test_duration": "5m" }'
28 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.2xlarge-aws-2-rate-limiting", "load_test_duration": "5m" }'
29 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.2xlarge-aws-3-rate-limiting", "load_test_duration": "5m" }'
30 |
31 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true }'
32 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.2xlarge-aws-1-all", "load_test_duration": "5m" }'
33 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.2xlarge-aws-2-all", "load_test_duration": "5m" }'
34 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.2xlarge-aws-3-all", "load_test_duration": "5m" }'
35 |
36 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0 }'
37 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.2xlarge-aws-1", "load_test_duration": "5m" }'
38 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.2xlarge-aws-2", "load_test_duration": "5m" }'
39 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.2xlarge-aws-3", "load_test_duration": "5m" }'
40 |
41 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1 }'
42 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.2xlarge-aws-1", "load_test_duration": "5m" }'
43 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.2xlarge-aws-2", "load_test_duration": "5m" }'
44 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.2xlarge-aws-3", "load_test_duration": "5m" }'
45 |
46 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2 }'
47 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.2xlarge-aws-1", "load_test_duration": "5m" }'
48 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.2xlarge-aws-2", "load_test_duration": "5m" }'
49 | ansible-playbook playbook.yml -i hosts/c5.2xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.2xlarge-aws-3", "load_test_duration": "5m" }'
50 |
51 | ansible-playbook aws.playbook.yml -t cleanup -e '{ "aws_instance_type": "c5.2xlarge", "test_services": [ "tyk", "kong", "apollo" ] }'
52 |
--------------------------------------------------------------------------------
/tests/aws_c5.4xlarge.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | ansible-playbook aws.playbook.yml -t standup -e '{ "aws_instance_type": "c5.4xlarge", "aws_image": "ami-08970fb2e5767e3b8", "test_services": [ "tyk", "kong", "apollo" ] }'
5 |
6 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
7 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-1-vanilla", "load_test_duration": "5m" }'
8 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-2-vanilla", "load_test_duration": "5m" }'
9 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-3-vanilla", "load_test_duration": "5m" }'
10 |
11 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
12 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-1-auth", "load_test_duration": "5m" }'
13 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-2-auth", "load_test_duration": "5m" }'
14 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-3-auth", "load_test_duration": "5m" }'
15 |
16 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false }'
17 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-1-analytics", "load_test_duration": "5m" }'
18 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-2-analytics", "load_test_duration": "5m" }'
19 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-3-analytics", "load_test_duration": "5m" }'
20 |
21 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false }'
22 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-1-auth-quota", "load_test_duration": "5m" }'
23 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-2-auth-quota", "load_test_duration": "5m" }'
24 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.4xlarge-aws-3-auth-quota", "load_test_duration": "5m" }'
25 |
26 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true }'
27 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.4xlarge-aws-1-rate-limiting", "load_test_duration": "5m" }'
28 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.4xlarge-aws-2-rate-limiting", "load_test_duration": "5m" }'
29 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.4xlarge-aws-3-rate-limiting", "load_test_duration": "5m" }'
30 |
31 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true }'
32 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.4xlarge-aws-1-all", "load_test_duration": "5m" }'
33 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.4xlarge-aws-2-all", "load_test_duration": "5m" }'
34 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.4xlarge-aws-3-all", "load_test_duration": "5m" }'
35 |
36 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0 }'
37 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.4xlarge-aws-1", "load_test_duration": "5m" }'
38 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.4xlarge-aws-2", "load_test_duration": "5m" }'
39 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.4xlarge-aws-3", "load_test_duration": "5m" }'
40 |
41 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1 }'
42 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.4xlarge-aws-1", "load_test_duration": "5m" }'
43 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.4xlarge-aws-2", "load_test_duration": "5m" }'
44 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.4xlarge-aws-3", "load_test_duration": "5m" }'
45 |
46 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2 }'
47 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.4xlarge-aws-1", "load_test_duration": "5m" }'
48 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.4xlarge-aws-2", "load_test_duration": "5m" }'
49 | ansible-playbook playbook.yml -i hosts/c5.4xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.4xlarge-aws-3", "load_test_duration": "5m" }'
50 |
51 | ansible-playbook aws.playbook.yml -t cleanup -e '{ "aws_instance_type": "c5.4xlarge", "test_services": [ "tyk", "kong", "apollo" ] }'
52 |
--------------------------------------------------------------------------------
/tests/aws_c5.large.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | ansible-playbook aws.playbook.yml -t standup -e '{ "aws_instance_type": "c5.large", "aws_image": "ami-08970fb2e5767e3b8", "test_services": [ "tyk", "kong", "apollo" ] }'
5 |
6 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
7 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-1-vanilla", "load_test_duration": "5m" }'
8 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-2-vanilla", "load_test_duration": "5m" }'
9 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-3-vanilla", "load_test_duration": "5m" }'
10 |
11 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
12 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-1-auth", "load_test_duration": "5m" }'
13 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-2-auth", "load_test_duration": "5m" }'
14 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-3-auth", "load_test_duration": "5m" }'
15 |
16 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false }'
17 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-1-analytics", "load_test_duration": "5m" }'
18 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-2-analytics", "load_test_duration": "5m" }'
19 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.large-aws-3-analytics", "load_test_duration": "5m" }'
20 |
21 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false }'
22 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.large-aws-1-auth-quota", "load_test_duration": "5m" }'
23 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.large-aws-2-auth-quota", "load_test_duration": "5m" }'
24 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.large-aws-3-auth-quota", "load_test_duration": "5m" }'
25 |
26 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true }'
27 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.large-aws-1-rate-limiting", "load_test_duration": "5m" }'
28 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.large-aws-2-rate-limiting", "load_test_duration": "5m" }'
29 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.large-aws-3-rate-limiting", "load_test_duration": "5m" }'
30 |
31 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true }'
32 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.large-aws-1-all", "load_test_duration": "5m" }'
33 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.large-aws-2-all", "load_test_duration": "5m" }'
34 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.large-aws-3-all", "load_test_duration": "5m" }'
35 |
36 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0 }'
37 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.large-aws-1", "load_test_duration": "5m" }'
38 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.large-aws-2", "load_test_duration": "5m" }'
39 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.large-aws-3", "load_test_duration": "5m" }'
40 |
41 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1 }'
42 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.large-aws-1", "load_test_duration": "5m" }'
43 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.large-aws-2", "load_test_duration": "5m" }'
44 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.large-aws-3", "load_test_duration": "5m" }'
45 |
46 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2 }'
47 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.large-aws-1", "load_test_duration": "5m" }'
48 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.large-aws-2", "load_test_duration": "5m" }'
49 | ansible-playbook playbook.yml -i hosts/c5.large-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.large-aws-3", "load_test_duration": "5m" }'
50 |
51 | ansible-playbook aws.playbook.yml -t cleanup -e '{ "aws_instance_type": "c5.large", "test_services": [ "tyk", "kong", "apollo" ] }'
52 |
--------------------------------------------------------------------------------
/tests/aws_c5.xlarge.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | ansible-playbook aws.playbook.yml -t standup -e '{ "aws_instance_type": "c5.xlarge", "aws_image": "ami-08970fb2e5767e3b8", "test_services": [ "tyk", "kong", "apollo" ] }'
5 |
6 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
7 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-1-vanilla", "load_test_duration": "5m" }'
8 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-2-vanilla", "load_test_duration": "5m" }'
9 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-3-vanilla", "load_test_duration": "5m" }'
10 |
11 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
12 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-1-auth", "load_test_duration": "5m" }'
13 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-2-auth", "load_test_duration": "5m" }'
14 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-3-auth", "load_test_duration": "5m" }'
15 |
16 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false }'
17 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-1-analytics", "load_test_duration": "5m" }'
18 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-2-analytics", "load_test_duration": "5m" }'
19 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-3-analytics", "load_test_duration": "5m" }'
20 |
21 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false }'
22 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-1-auth-quota", "load_test_duration": "5m" }'
23 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-2-auth-quota", "load_test_duration": "5m" }'
24 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c5.xlarge-aws-3-auth-quota", "load_test_duration": "5m" }'
25 |
26 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true }'
27 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.xlarge-aws-1-rate-limiting", "load_test_duration": "5m" }'
28 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.xlarge-aws-2-rate-limiting", "load_test_duration": "5m" }'
29 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c5.xlarge-aws-3-rate-limiting", "load_test_duration": "5m" }'
30 |
31 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true }'
32 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.xlarge-aws-1-all", "load_test_duration": "5m" }'
33 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.xlarge-aws-2-all", "load_test_duration": "5m" }'
34 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c5.xlarge-aws-3-all", "load_test_duration": "5m" }'
35 |
36 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0 }'
37 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.xlarge-aws-1", "load_test_duration": "5m" }'
38 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.xlarge-aws-2", "load_test_duration": "5m" }'
39 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c5.xlarge-aws-3", "load_test_duration": "5m" }'
40 |
41 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1 }'
42 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.xlarge-aws-1", "load_test_duration": "5m" }'
43 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.xlarge-aws-2", "load_test_duration": "5m" }'
44 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c5.xlarge-aws-3", "load_test_duration": "5m" }'
45 |
46 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2 }'
47 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.xlarge-aws-1", "load_test_duration": "5m" }'
48 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.xlarge-aws-2", "load_test_duration": "5m" }'
49 | ansible-playbook playbook.yml -i hosts/c5.xlarge-aws-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c5.xlarge-aws-3", "load_test_duration": "5m" }'
50 |
51 | ansible-playbook aws.playbook.yml -t cleanup -e '{ "aws_instance_type": "c5.xlarge", "test_services": [ "tyk", "kong", "apollo" ] }'
52 |
--------------------------------------------------------------------------------
/tests/gcp_c2d-standard-2.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | ansible-playbook gcp.playbook.yml -t standup -e '{ "gcp_machine_type": "c2d-standard-2", "gcp_image": "projects/rhel-cloud/global/images/rhel-8-v20220303", "test_services": [ "tyk", "kong", "apollo" ] }'
5 |
6 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
7 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-1-vanilla", "load_test_duration": "5m" }'
8 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-2-vanilla", "load_test_duration": "5m" }'
9 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-3-vanilla", "load_test_duration": "5m" }'
10 |
11 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false }'
12 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-1-auth, "load_test_duration": "5m" }'
13 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-2-auth, "load_test_duration": "5m" }'
14 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-3-auth, "load_test_duration": "5m" }'
15 |
16 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false }'
17 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-1-analytics"analytics", "load_test_duration": "5m" }'
18 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-2-analytics"analytics", "load_test_duration": "5m" }'
19 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": false, "enable_analytics": true, "enable_quota": false, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-3-analytics"analytics", "load_test_duration": "5m" }'
20 |
21 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false }'
22 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-1-auth-quota, "load_test_duration": "5m" }'
23 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-2-auth-quota, "load_test_duration": "5m" }'
24 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": true, "enable_analytics": false, "enable_quota": true, "enable_rate_limiting": false, "prefix": "c2d-standard-2-gcp-3-auth-quota, "load_test_duration": "5m" }'
25 |
26 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true }'
27 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c2d-standard-2-gcp-1-rate-limiting, "load_test_duration": "5m" }'
28 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c2d-standard-2-gcp-2-rate-limiting, "load_test_duration": "5m" }'
29 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk", "kong" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": true, "prefix": "c2d-standard-2-gcp-3-rate-limiting, "load_test_duration": "5m" }'
30 |
31 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true }'
32 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c2d-standard-2-gcp-1-all, "load_test_duration": "5m" }'
33 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c2d-standard-2-gcp-2-all, "load_test_duration": "5m" }'
34 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "REST", "test_services": [ "tyk" ], "enable_auth": true, "enable_analytics": true, "enable_quota": true, "enable_rate_limiting": true, "prefix": "c2d-standard-2-gcp-3-all, "load_test_duration": "5m" }'
35 |
36 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0 }'
37 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c2d-standard-2-gcp-1", "load_test_duration": "5m" }'
38 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c2d-standard-2-gcp-2", "load_test_duration": "5m" }'
39 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 0, "prefix": "c2d-standard-2-gcp-3", "load_test_duration": "5m" }'
40 |
41 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1 }'
42 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c2d-standard-2-gcp-1", "load_test_duration": "5m" }'
43 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c2d-standard-2-gcp-2", "load_test_duration": "5m" }'
44 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 1, "prefix": "c2d-standard-2-gcp-3", "load_test_duration": "5m" }'
45 |
46 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t install -t standup -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2 }'
47 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c2d-standard-2-gcp-1", "load_test_duration": "5m" }'
48 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c2d-standard-2-gcp-2", "load_test_duration": "5m" }'
49 | ansible-playbook playbook.yml -i hosts/c2d-standard-2-gcp-hosts.yml -t test -e '{ "query_type": "STITCH", "test_services": [ "tyk", "apollo" ], "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "query_depth": 2, "prefix": "c2d-standard-2-gcp-3", "load_test_duration": "5m" }'
50 |
51 | ansible-playbook gcp.playbook.yml -t cleanup -e '{ "gcp_machine_type": "c2d-standard-2", "test_services": [ "tyk", "kong", "apollo" ] }'
52 |
--------------------------------------------------------------------------------
/tests/saas.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | # Freemium
5 | ansible-playbook playbook.yml -t install -t standup -t saas -i saas/freemium-hosts.yml -e '{ "query_type": "REST", "prefix": "freemium", "test_services": [ "tyk" ] }'
6 | # Freemium Edge Gateway
7 | ansible-playbook playbook.yml -t test -t saas -i saas/freemium-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "freemium-edge-1", "api_url": "https://innocent-gauge-gw.aws-euw1.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
8 | ansible-playbook playbook.yml -t test -t saas -i saas/freemium-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "freemium-edge-2", "api_url": "https://innocent-gauge-gw.aws-euw1.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
9 | ansible-playbook playbook.yml -t test -t saas -i saas/freemium-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "freemium-edge-3", "api_url": "https://innocent-gauge-gw.aws-euw1.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
10 |
11 | # Trial
12 | ansible-playbook playbook.yml -t install -t standup -t saas -i saas/trial-hosts.yml -e '{ "query_type": "REST", "prefix": "trial", "test_services": [ "tyk" ] }'
13 | # Trial Edge Gateway
14 | ansible-playbook playbook.yml -t test -t saas -i saas/trial-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "trial-edge-1", "api_url": "https://accurate-letter-gw.aws-usw2.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
15 | ansible-playbook playbook.yml -t test -t saas -i saas/trial-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "trial-edge-2", "api_url": "https://accurate-letter-gw.aws-usw2.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
16 | ansible-playbook playbook.yml -t test -t saas -i saas/trial-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "trial-edge-3", "api_url": "https://accurate-letter-gw.aws-usw2.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
17 | # Trial Hybrid Gateway
18 | ansible-playbook playbook.yml -t test -t saas -i saas/trial-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "trial-hybrid-1", "api_url": "http://ec2-54-200-9-157.us-west-2.compute.amazonaws.com:8080/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
19 | ansible-playbook playbook.yml -t test -t saas -i saas/trial-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "trial-hybrid-2", "api_url": "http://ec2-54-200-9-157.us-west-2.compute.amazonaws.com:8080/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
20 | ansible-playbook playbook.yml -t test -t saas -i saas/trial-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "trial-hybrid-3", "api_url": "http://ec2-54-200-9-157.us-west-2.compute.amazonaws.com:8080/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
21 |
22 | # Paid
23 | ansible-playbook playbook.yml -t install -t standup -t saas -i saas/paid-hosts.yml -e '{ "query_type": "REST", "prefix": "paid", "test_services": [ "tyk" ] }'
24 | # Paid Edge Gateway
25 | ansible-playbook playbook.yml -t test -t saas -i saas/paid-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "paid-edge-1", "api_url": "https://worthy-pet-gw.aws-euw2.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
26 | ansible-playbook playbook.yml -t test -t saas -i saas/paid-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "paid-edge-2", "api_url": "https://worthy-pet-gw.aws-euw2.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
27 | ansible-playbook playbook.yml -t test -t saas -i saas/paid-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "paid-edge-3", "api_url": "https://worthy-pet-gw.aws-euw2.cloud-ara.tyk.io/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
28 | # Paid Hybrid Gateway
29 | ansible-playbook playbook.yml -t test -t saas -i saas/paid-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "paid-hybrid-1", "api_url": "http://ec2-18-133-180-111.eu-west-2.compute.amazonaws.com:8080/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
30 | ansible-playbook playbook.yml -t test -t saas -i saas/paid-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "paid-hybrid-2", "api_url": "http://ec2-18-133-180-111.eu-west-2.compute.amazonaws.com:8080/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
31 | ansible-playbook playbook.yml -t test -t saas -i saas/paid-hosts.yml -e '{ "query_type": "REST", "enable_auth": false, "enable_analytics": false, "enable_quota": false, "enable_rate_limiting": false, "prefix": "paid-hybrid-3", "api_url": "http://ec2-18-133-180-111.eu-west-2.compute.amazonaws.com:8080/api/", "test_services": [ "tyk" ], , "load_test_duration": "5m" }'
32 |
33 | RScript ./analyze.r \
34 | "freemium-edge,trial-edge,paid-edge" \
35 | "saas" \
36 | "tyk" \
37 | "1" \
38 | "Cores" \
39 | "1" \
40 | "Tyk SAAS Teirs - Edge -" \
41 | "Freemium,Trial,Paid" \
42 | "bar"
43 |
44 | RScript ./analyze.r \
45 | "trial-hybrid,paid-hybrid" \
46 | "saas" \
47 | "tyk" \
48 | "1" \
49 | "Cores" \
50 | "1" \
51 | "Tyk SAAS Teirs - Hybrid" \
52 | "Trial,Paid" \
53 | "bar"
54 |
--------------------------------------------------------------------------------
/vars/aws.yml.example:
--------------------------------------------------------------------------------
1 | aws_region: us-west-2
2 | aws_key_name: secret
3 | aws_instance_type: c5.large
4 | aws_image: ami-08970fb2e5767e3b8
5 | aws_group: secret-sg
6 | aws_vpc_subnet_id: subnet-vpc_subnet_id
7 | aws_access_key: aws_access_key
8 | aws_secret_key: aws_secret_key
9 | provider:
10 | user: ec2-user
11 | key_file: ./secret.pem
12 |
--------------------------------------------------------------------------------
/vars/azure.yml.example:
--------------------------------------------------------------------------------
1 | azure_vm_size: Standard_F2s_v2
2 | azure_location: westus
3 | azure_image:
4 | offer: RHEL
5 | publisher: RedHat
6 | sku: '8_6'
7 | version: '8.6.2022070801'
8 | azure_ssh_public_key: "public_key"
9 | provider:
10 | user: azureuser
11 | key_file: ./secret.pem
12 |
--------------------------------------------------------------------------------
/vars/gcp.yml.example:
--------------------------------------------------------------------------------
1 | gcp_project: project
2 | gcp_region: us-central1
3 | gcp_zone: us-central1-a
4 | gcp_auth_kind: serviceaccount
5 | gcp_service_account_file: ./secret.json
6 | gcp_machine_type: e2-standard-2
7 | gcp_image: projects/rhel-cloud/global/images/rhel-8-v20220303
8 | provider:
9 | user: user
10 | key_file: ./secret.pem
11 |
--------------------------------------------------------------------------------
/vars/services.yml.example:
--------------------------------------------------------------------------------
1 | services:
2 | upstream:
3 | service:
4 | port: 8000
5 | subgraphs:
6 | users:
7 | port: 4001
8 | posts:
9 | port: 4002
10 | comments:
11 | port: 4003
12 | tyk:
13 | secret: 352d20ee67be67f6340b4c0605b044b7
14 | service:
15 | port: 8080
16 | kong:
17 | service:
18 | port: 8000
19 | ssl_port: 8443
20 | admin:
21 | port: 8001
22 | ssl_port: 8444
23 | apollo:
24 | service:
25 | port: 4000
26 |
--------------------------------------------------------------------------------
/vars/tests.yml.example:
--------------------------------------------------------------------------------
1 | # Test query type: enum(REST, STITCH, FEDERATE)
2 | query_type: REST
3 | # Test query depth: enum(0, 1, 2)
4 | # Applicable to the STITCH and FEDERATE query types.
5 | query_depth: 0
6 | # GraphQL queries used to test the stitch and federation services.
7 | graphql_query:
8 | 0: "query { user(id: 1) { username name email }}"
9 | 1: "query { user(id: 1) { username name email posts { title body }}}"
10 | 2: "query { user(id: 1) { username name email posts { title body comments { name email body }}}}"
11 | # Limits the number of cores used by vendor. Set to false to disable
12 | # functionality.
13 | # Applicable to Tyk and Apollo.
14 | limit_cores: False
15 | # Generates an authorization token and uses it to proxy with auth enabled.
16 | # Applicable to Tyk.
17 | enable_auth: False
18 | # Enables analytics gathering for API requests.
19 | # Applicable to Tyk.
20 | enable_analytics: False
21 | # Enables quota checking for API requests.
22 | # Applicable to Tyk.
23 | enable_quota: False
24 | # Enables rate limiting checking for API requests.
25 | # Applicable to Tyk.
26 | enable_rate_limiting: False
27 | # Load test duration.
28 | load_test_duration: 10s
29 | # List of services you would like to run your tests against. Tyk is selected
30 | # by default. Options: [
31 | # kong(REST),
32 | # apollo(STITCH, FEDERATE)
33 | # ]
34 | test_services:
35 | - kong
36 | # Prefix for the generated tests.
37 | prefix: False
38 |
--------------------------------------------------------------------------------