Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit 9582ff1

Browse files
authored
Merge pull request #61 from thestormforge/refactor-votingwebapp
Refactor votingwebapp
2 parents df4e429 + 6f52c61 commit 9582ff1

File tree

20 files changed

+17
-140
lines changed

20 files changed

+17
-140
lines changed

voting-webapp/advanced/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

voting-webapp/advanced/add-patches.yaml

Lines changed: 0 additions & 86 deletions
This file was deleted.

voting-webapp/advanced/kustomization.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

webserver/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Webserver optimization
22

3-
StormForge optimize experiment of a web-server using the [voting-webapp example](https://github.com/dockersamples/example-voting-app). We optimize for the `cost` and `latency` using metrics provided by two load test generators:
3+
This examples shows how StormForge optimizes a web-server using the [voting-webapp example](./voting-webapp). We optimize for the `cost` and `latency` using metrics provided by two load test generators:
44
- [Locust](https://locust.io)
55
- [StormForge Performance Testing](https://www.stormforge.io/performance-testing/)
6+
7+
## Prerequisites
8+
9+
You must have a Kubernetes cluster. We recommend using a cluster with 4 nodes, 16 vCPUs (4 on each node) and 32GB of memory (8 on each node). Additionally, you will need a local configured copy of `kubectl`.
10+
11+
Additionally, you will need a local configured copy of `kubectl` and to initialize StormForge Optimize in your cluster. You can download a binary for your platform from the [installation guide](https://docs.stormforge.io/getting-started/install/) and run `stormforge init` (while connected to your cluster).

webserver/locust-metrics/README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
# Locust Metrics Example
22

3+
Locust makes repeated HTTP calls to the voting service of the voting app, thereby simulating user load on the application.
34
This example shows how to optimize the voting app using the metrics built into Locust. This is useful when tuning an application that does not have metrics yet.
45

5-
## Deploy the voting app
6+
Note that the `experiment.yaml` is written to run the optimization in the default namespace.
67

7-
Run
8-
```
9-
kustomize build . | kubectl apply -f -
10-
```
11-
## Create an experiment
8+
## Usage
129

13-
Once the voting app is ready, launch an experiment using:
10+
Run `kustomize build . | kubectl apply -f -` to deploy the voting app in the default namespace.
1411

15-
```
16-
kubectl apply -f experiment.yaml
17-
```
12+
Once the voting app is ready, launch an experiment using `kubectl apply -f experiment.yaml`

webserver/locust-metrics/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

44
resources:
5-
- ../../voting-webapp/application
5+
- ../voting-webapp/application
66

77
generatorOptions:
88
disableNameSuffixHash: true

webserver/sf-perftest-metrics/application/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

44
resources:
5-
- github.com/thestormforge/examples/voting-webapp/application
5+
- ../../voting-webapp/application
66
- ingress.yaml
77

88
patchesStrategicMerge:
Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# Web App Example
22

3-
## Running The Experiment
4-
From `examples/voting-webapp` execute
5-
6-
`kubectl apply -k .`
7-
83
## Introduction
94
A simple distributed application based on the official Docker [voting app](https://github.com/dockersamples/example-voting-app).
105
This application allows users to vote on "cats" vs. "dogs", and serves the results in a simple web page.
@@ -19,17 +14,9 @@ The application architecture is made of 5 components (see diagram below):
1914

2015
![Architecture diagram](architecture.png)
2116

22-
In this example, we demonstrate how to tune a typical application with several components, using [Locust](https://locust.io/). Locust makes repeated HTTP calls to the voting service, thereby simulating user load on the application.
23-
24-
## Prerequisites
25-
26-
You must have a Kubernetes cluster. We recommend using a cluster with 4 nodes, 16 vCPUs (4 on each node) and 32GB of memory (8 on each node). Additionally, you will need a local configured copy of `kubectl`.
27-
28-
Additionally, you will need a local configured copy of `kubectl` and to initialize StormForge Optimize in your cluster. You can download a binary for your platform from the [installation guide](https://docs.stormforge.io/getting-started/install/) and run `stormforge init` (while connected to your cluster).
29-
30-
## Example Resources
17+
## Resources
3118

32-
The resources in this directory aren't going to launch experiments in StormForge Optimize in and off themselves. For that, see [locust-metrics](../webserver/locust-metrics). Nevertheless, here is a short description for each of them.
19+
The resources in this directory aren't going to launch experiments in StormForge Optimize in and off themselves. For that, see [locust-metrics](../locust-metrics). Nevertheless, here is a short description for each of them.
3320

3421
`application/kustomization.yaml`
3522
: The input to Kustomize used to build the Kubernetes object manifests for this sample application.
@@ -56,4 +43,4 @@ The resources in this directory aren't going to launch experiments in StormForge
5643
: This directory contains files required to run the results exporter. The exporter's role is to expose the throughput metric over HTTP (in contrast to the original websocket implementation in the results service) so that it can be collected by the jsonpath metric collector.
5744
`app.py` contains the exporter application, `requirements.txt` are the python library requirements and `Dockerfile` contains the Docker commands to run the exporter container. There is no need to build the image; the folder is only included for reference.
5845

59-
More information can be found on the [docker example voting app](https://github.com/dockersamples/example-voting-app) and [Locust](https://docs.locust.io/en/stable/) docs.
46+
More information can be found on the [docker example voting app](https://github.com/dockersamples/example-voting-app)docs.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)