Test JMX Operations #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test EC2 connection | |
on: | |
workflow_dispatch: | |
inputs: | |
clusterName: | |
description: 'Name of the cluster' | |
type: string | |
default: 'gh-keycloak' | |
region: | |
description: 'Name of the region where EC2 instances should be installed' | |
type: string | |
default: 'eu-west-1' | |
concurrency: cluster_${{ github.event.inputs.clusterName || format('gh-{0}', github.repository_owner) }} | |
env: | |
PROJECT_PREFIX: runner- # same as default | |
PROJECT: runner-keycloak | |
jobs: | |
run: | |
name: Run Benchmark | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup ROSA CLI | |
uses: ./.github/actions/rosa-cli-setup | |
with: | |
aws-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-default-region: ${{ vars.AWS_DEFAULT_REGION }} | |
rosa-token: ${{ secrets.ROSA_TOKEN }} | |
- name: Login to OpenShift cluster | |
uses: ./.github/actions/oc-keycloak-login | |
with: | |
clusterName: ${{ inputs.clusterName || format('gh-{0}', github.repository_owner) }} | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: Cache Maven Wrapper | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.mvn/wrapper/maven-wrapper.jar | |
key: ${{ runner.os }}-maven-wrapper-${{ hashFiles('**/maven-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-maven-wrapper- | |
- name: Build with Maven | |
run: | | |
./mvnw -B clean package -DskipTests -pl benchmark | |
tar xfvz benchmark/target/keycloak-benchmark-*.tar.gz | |
mv keycloak-benchmark-* keycloak-benchmark | |
- name: Create AWS EC2 instances | |
uses: ./.github/actions/ec2-create-instances | |
with: | |
region: ${{ inputs.region }} | |
- name: Get URLs | |
uses: ./.github/actions/get-keycloak-url | |
with: | |
project: ${{ env.PROJECT }} | |
- name: Testing memory for creating sessions | |
id: kcb-authorization-code-1 | |
run: | | |
./benchmark.sh ${{ inputs.region }} \ | |
--scenario=keycloak.scenario.authentication.AuthorizationCode \ | |
--server-url=${{ env.KEYCLOAK_URL }} \ | |
--realm-name=realm-0 \ | |
--users-per-sec=${{ inputs.numberOfUsersPerSecond }} \ | |
--ramp-up=20 \ | |
--logout-percentage=0 \ | |
--measurement=600 \ | |
--users-per-realm=100 \ | |
--log-http-on-failure | |
working-directory: ansible | |
# - name: Testing CPU usage for user logins | |
# id: kcb-authorization-code-2 | |
# run: | | |
# ./benchmark.sh ${{ inputs.region }} \ | |
# --scenario=keycloak.scenario.authentication.AuthorizationCode \ | |
# --server-url=${{ env.KEYCLOAK_URL }} \ | |
# --realm-name=realm-0 \ | |
# --users-per-sec=${{ inputs.numberOfUsersPerSecond }} \ | |
# --ramp-up=20 \ | |
# --logout-percentage=100 \ | |
# --measurement=600 \ | |
# --users-per-realm=100 \ | |
# --log-http-on-failure | |
# working-directory: ansible | |
# - name: Testing CPU usage for client credential grants | |
# id: kcb-client-secret | |
# run: | | |
# ./benchmark.sh ${{ inputs.region }} \ | |
# --scenario=keycloak.scenario.authentication.ClientSecret \ | |
# --server-url=${{ env.KEYCLOAK_URL }} \ | |
# --realm-name=realm-0 \ | |
# --users-per-sec=${{ inputs.numberOfClientsPerSecond }} \ | |
# --ramp-up=20 \ | |
# --measurement=600 \ | |
# --users-per-realm=100000 \ | |
# --log-http-on-failure | |
# working-directory: ansible | |
- name: Archive Gatling reports | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gatling-results | |
path: keycloak-benchmark/results | |
retention-days: 5 | |
- name: Archive Summary - Testing memory for creating sessions | |
uses: actions/upload-artifact@v3 | |
with: | |
name: summary | |
path: ${{ steps.kcb-authorization-code-1.outputs.kcb_result }} | |
retention-days: 5 | |
# - name: Archive Summary - Testing CPU usage for user logins | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: summary | |
# path: ${{ steps.kcb-authorization-code-2.outputs.kcb_result }} | |
# retention-days: 5 | |
# - name: Archive Summary - Testing CPU usage for client credential grants | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: summary | |
# path: ${{ steps.kcb-client-secret.outputs.kcb_result }} | |
# retention-days: 5 | |
- name: Stop and Delete EC2 instances | |
uses: ./.github/actions/ec2-delete-instances | |
with: | |
region: ${{ inputs.region }} | |
archive: | |
name: Commit results to Git repository | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: | |
- run | |
steps: | |
- name: Checkout repository for results | |
uses: actions/checkout@v3 | |
with: | |
ref: 'result-data' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: summary | |
- name: Commit result-summary | |
shell: bash | |
env: | |
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
DATE_FOLDER=scalability/$(date +"%Y/%m/%d") | |
mkdir -p ${DATE_FOLDER} | |
mv *.json ${DATE_FOLDER} | |
git add . | |
git commit -m "generated" | |
git push | |
- name: Trigger data aggregation | |
if: github.repository == 'keycloak/keycloak-benchmark' | |
env: | |
GH_TOKEN: ${{ github.token }} | |
# manually trigger the run, as a push with a standard GitHub action token doesn't trigger any workflow run on GitHub | |
run: gh workflow run -R keycloak/keycloak-benchmark aggregate-results.yaml --ref result-data |