Skip to content

Commit

Permalink
feat: release of infinitemonkeys helm chart (#2610)
Browse files Browse the repository at this point in the history
* rerelease of infinitemonkeys helm chart, adding readme, minor refactor removing nested docker install from Dockerfile

* removing unneeded dependencies, updating vars and readme

* introducing jvm limits for monkey-server pods

* use JAVA_OPTS, Java 8 style flags

* add delay-pool argument to the controller

* decreasing waits between monkey startups, adding java-opts readme section, fixing indentation

* adding action for monkey image push to quay

* starting pods in parallel, adding ENV vars with expected app timeout settings to monkey-controller

* debugging new quay push action

* debugging new quay push action

* debugging new quay push action

* debugging new quay push action

* changes to monkey-dashboard

* disabling image build for PR branch

* updating readme on cluster resource use

---------

Co-authored-by: Mathias Staab <[email protected]>
  • Loading branch information
jschumacher-wire and mastaab authored Mar 18, 2024
1 parent 4aeb41c commit 06a032e
Show file tree
Hide file tree
Showing 14 changed files with 2,413 additions and 10 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/quay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: quay.io infinitemonkeys image build & push

on:
push:
branches: ['develop']
paths: ['monkeys/**']

jobs:
quay_publish:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: quay.io
username: wire+kalium_github_actions
password: ${{ secrets.QUAY_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./monkeys/docker/Dockerfile
platforms: linux/amd64
tags: quay.io/wire/infinitemonkeys
push: true

10 changes: 0 additions & 10 deletions monkeys/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,5 @@ RUN tar -xf /kalium/monkeys/build/distributions/monkeys.tar

FROM wirebot/cryptobox:1.4.0

# install docker cli
RUN install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
chmod a+r /etc/apt/keyrings/docker.asc && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update && apt-get install -y docker-ce-cli

RUN mkdir /opt/app
COPY --from=jdk-build /monkeys /opt/app
23 changes: 23 additions & 0 deletions monkeys/helm/infinitemonkeys/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions monkeys/helm/infinitemonkeys/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2

name: infinitemonkeys
type: application
version: 0.1.0

52 changes: 52 additions & 0 deletions monkeys/helm/infinitemonkeys/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# infinitemonkeys - load testing tool for Wire

This Helm chart provides:

- A group of StatefulSets deploying one monkeyController and N monkeyServers
- Integration Prometheus-Operator via PodMonitors and a Grafana Dashboard

## Architecture

The Controller will instruct the Servers what to do, via files/config.json.
The config schema can be [viewed here](https://github.com/wireapp/kalium/blob/develop/monkeys/schema.json).
Currently, config options for a single backend are exposed via values.yaml, but it is possible
to add several backends and let the Servers send messages between them. In that case, it's recommended to edit
the config.json file directly prior (re)deployment.


## Scaling

The application is capable scaling to 100s of monkeys, given sufficient cluster resources. We've determined
that as of now (2024-03), one Controller can handle about 350 monkeys before running into concurrency issues.

In order to support a deployment with 350 monkeys (plus Owner plus Controller), the cluster should have a total of at least:

* 192 GiB RAM
* 40 (v)CPU

Equivalent to about 500 MiB RAM and per monkey and 10 monkeys per vCPU. During tests it's been determined that
a minimum of six nodes with 32G RAM and 8 vCPU each are sufficient, with about 87% total cluster RAM usage.
Depending on the specific actions which the monkeys are supposed to perform, more compute power might be needed down the line.


## Log output

The Servers echo all logging to stdout. The Controller writes to a local log within it's pod in `/wire/cryptobox/monkeys.log`.


## JVM Optimizations

JVM options are exposed as a config block in `values.yaml`, in order to reduce memory footprint of the monkey servers.
At this point, the amount of RAM needed by each monkey is down about 50% compared to non-optimized defaults.


## Limitations

The total number of all users as defined via `monkeyController.userCount` (or directly in config.json backend sections) needs
to be matched by `monkeyServer.replicaCount`, as N+1, since there's always one additional team owner monkey.


## References

1. - [Infinite Monkeys documentation](https://wearezeta.atlassian.net/wiki/spaces/ENGINEERIN/pages/878182477/Infinite+Monkeys+IM)
2. - [JVM tuning in K8s](https://www.padok.fr/en/blog/jvm-oom)
Loading

0 comments on commit 06a032e

Please sign in to comment.