Skip to content

multicluster creation performance test #64

multicluster creation performance test

multicluster creation performance test #64

Workflow file for this run

name: Test - E2E - Performance # e2e tests running against a k8s cluster
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- closed
env:
PERF_DATA_FILE: perf-data.json
E2E_UTILS: ./hack/e2e/perf/scripts/utils.sh
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
# build-operator:
# uses: ./.github/workflows/build-operator.yaml
# name: Build Operator Image
# secrets: inherit
perf-test-minikube:
# needs:
# - build-operator
name: Run Performance Tests on Minikube
runs-on: ubuntu-latest
strategy:
matrix:
git_branch:
- main
- PR
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ matrix.git_branch == 'main' && 'main' || github.head_ref }}
- name: Checkout .github from PR
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
path: .github
- name: Checkout hack from PR
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
path: hack
- name: List contents of the hack directory
run: ls -R hack/
# Identify comment to be updated
- name: Find comment for Performance Overview
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: Performance Overview
direction: last
# Create/Update comment with action deployment status
- name: Create or Update Comment with Performance Overview
id: notification
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Operator Performance Overview
:gear: Running performance tests on Minikube
edit-mode: replace
- name: install yq
run: sudo snap install yq
- name: Download Helm Values Artifact
uses: actions/download-artifact@v3
with:
name: helm-values
- name: Start Minikube
run: minikube start --addons default-storageclass,storage-provisioner --driver=docker
- name: Install Uffizzi Cluster Operator
id: prev
run: |
helm dep update ./chart
helm upgrade --install --wait pr-${{ github.event.pull_request.number }} \
./chart -f helm-values.yaml
- name: Create PERF_DATA_FILE
run: |
# Ensure the file exists and initialize it as an empty array if not
if [ ! -f "$PERF_DATA_FILE" ]; then
echo '[]' > "$PERF_DATA_FILE"
fi
- name: Time taken to create UffizziClusters with different numbers of workers
run: |
for n_workers in $(seq 1 5 30); do
yq -i '.concurrent = "$n_workers"' helm-values.yaml
n_simultaneous_clusters=3
# time taken to create n clusters simultaneously
time=$(bash hack/e2e/perf/01-multicluster.sh $n_simultaneous_clusters)
bash $E2E_UTILS update_json_with_workers_and_time $n_workers $time $PERF_DATA_FILE
done
# - name: dummy data
# shell: bash
# run: |
# if [[ "${{ github.ref_name }}" == "main" ]]; then
# factor=2
# else
# factor=1
# fi
# echo '[
# {"workers": 1, "time": '$((10 * factor))'},
# {"workers": 2, "time": '$((20 * factor))'},
# {"workers": 3, "time": '$((30 * factor))'},
# {"workers": 4, "time": '$((40 * factor))'},
# {"workers": 5, "time": '$((50 * factor))'},
# {"workers": 6, "time": '$((60 * factor))'},
# {"workers": 7, "time": '$((70 * factor))'},
# {"workers": 8, "time": '$((80 * factor))'},
# {"workers": 9, "time": '$((90 * factor))'},
# {"workers": 10, "time": '$((100 * factor))'},
# {"workers": 11, "time": '$((110 * factor))'},
# {"workers": 12, "time": '$((120 * factor))'},
# {"workers": 13, "time": '$((130 * factor))'},
# {"workers": 14, "time": '$((140 * factor))'},
# {"workers": 15, "time": '$((150 * factor))'},
# {"workers": 16, "time": '$((160 * factor))'},
# {"workers": 17, "time": '$((170 * factor))'},
# {"workers": 18, "time": '$((180 * factor))'},
# {"workers": 19, "time": '$((190 * factor))'},
# {"workers": 20, "time": '$((200 * factor))'},
# {"workers": 21, "time": '$((210 * factor))'},
# {"workers": 22, "time": '$((220 * factor))'},
# {"workers": 23, "time": '$((230 * factor))'},
# {"workers": 24, "time": '$((240 * factor))'},
# {"workers": 25, "time": '$((250 * factor))'},
# {"workers": 26, "time": '$((260 * factor))'},
# {"workers": 27, "time": '$((270 * factor))'},
# {"workers": 28, "time": '$((280 * factor))'},
# {"workers": 29, "time": '$((290 * factor))'},
# {"workers": 30, "time": '$((300 * factor))'}
# ]' > $PERF_DATA_FILE
- name: Rename and update PERF_DATA_FILE
run: |
NEW_NAME="${PERF_DATA_FILE%.json}-${{ matrix.git_branch }}.json"
mv $PERF_DATA_FILE $NEW_NAME
echo "PERF_DATA_FILE=$NEW_NAME" >> $GITHUB_ENV
- name: Upload PERF_DATA_FILE artifact
uses: actions/upload-artifact@v2
with:
name: perf-data-${{ matrix.git_branch }}
path: ${{ env.PERF_DATA_FILE }}
performance-overview:
name: Collate performance data and post overview
needs:
- perf-test-minikube
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Identify comment to be updated
- name: Find comment for Performance Overview
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: Performance Overview
direction: last
- name: Download perf data - PR
uses: actions/download-artifact@v2
with:
name: perf-data-PR
- name: Download perf data - main
uses: actions/download-artifact@v2
with:
name: perf-data-main
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install matplotlib
- name: Create Graph
run: python hack/e2e/perf/viz/generate_graph.py
- name: Upload the simultaneous cluster creation test image to Imgur
id: upload_image
uses: devicons/[email protected]
with:
path: ./simul_graph.png
client_id: ${{ secrets.IMGUR_CLIENT_ID }}
- name: Update Comment with Performance Overview
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Operator Performance Overview
### Simultaneous cluster creation
Creating simultaneously to check if operator is able to manage the load of creating multiple clusters
at once. Creating multiple clusters simultaneously, in operator deployments; of varying number of concurrent
workers help us understand how the operator manages high load in restricted environments as well.
![Graph](${{ fromJSON(steps.upload_image.outputs.imgur_urls)[0] }})
edit-mode: replace