-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Kamesh Akella <[email protected]>
- Loading branch information
Showing
7 changed files
with
120 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Setup Go Task | ||
description: Installs Go Task | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: install-task | ||
name: Install Go Task | ||
shell: bash | ||
run: bash -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin/ |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: ROSA Cluster - Run Benchmark | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: shared_cluster | ||
|
||
jobs: | ||
|
||
delete: | ||
name: Run Benchmark | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
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: 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: Setup Go Task | ||
uses: ./.github/actions/task-setup | ||
|
||
- name: Login to OpenShift cluster | ||
run: ./rosa_oc_login.sh | ||
working-directory: provision/aws | ||
|
||
- name: Build with Maven | ||
run: | | ||
./mvnw -B clean install -DskipTests | ||
tar xfvz benchmark/target/keycloak-benchmark-*.tar.gz | ||
mv keycloak-benchmark-* keycloak-benchmark | ||
- name: Install Keycloak | ||
run: task KC_NAMESPACE_PREFIX="" | ||
working-directory: provision/openshift | ||
|
||
- name: Get URLs | ||
run: | | ||
KEYCLOAK_URL=https://$(oc get routes -n keycloak | grep keycloak-service | awk '{ print $2 }') | ||
echo "KEYCLOAK_URL=$KEYCLOAK_URL" >> "$GITHUB_ENV" | ||
- name: Create dataset | ||
run: | | ||
./dataset-import.sh -a create-realms -r 1 -c 1 -u 100 -l ${{ env.KEYCLOAK_URL }}/realms/master/dataset | ||
STATUS_CMD="./dataset-import.sh -a status -l ${{ env.KEYCLOAK_URL }}/realms/master/dataset" | ||
echo -n 'Waiting for dataset to be created: ' | ||
for i in {1..30}; do $STATUS_CMD | grep 'No task in progress' &>/dev/null && break || echo -n '.' && sleep 10; done | ||
echo ' done' | ||
working-directory: dataset | ||
|
||
- name: Run Authorization Code scenario | ||
run: bin/kcb.sh --scenario=keycloak.scenario.authentication.AuthorizationCode --server-url=${{ env.KEYCLOAK_URL }} --realm-name=realm-0 | ||
working-directory: keycloak-benchmark | ||
|
||
- name: Archive Gatling reports | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: gatling-results | ||
path: keycloak-benchmark/results | ||
retention-days: 5 | ||
|
||
- name: Delete Keycloak project | ||
run: oc delete project keycloak |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ -f ./.env ]; then | ||
source ./.env | ||
fi | ||
|
||
CLUSTER_NAME=${CLUSTER_NAME:-$(whoami)} | ||
KEYCLOAK_MASTER_PASSWORD_SECRET_NAME=${KEYCLOAK_MASTER_PASSWORD_SECRET_NAME:-"keycloak-master-password"} | ||
# Force eu-central-1 region for secrets manager so we all work with the same secret | ||
SECRET_MANAGER_REGION="eu-central-1" | ||
|
||
API_URL=$(rosa describe cluster -c shared | grep 'API URL' | awk '{ print $3 }') | ||
ADMIN_PASSWORD=$(aws secretsmanager get-secret-value --region $SECRET_MANAGER_REGION --secret-id $KEYCLOAK_MASTER_PASSWORD_SECRET_NAME --query SecretString --output text --no-cli-pager) | ||
|
||
oc login $API_URL --username cluster-admin --password $ADMIN_PASSWORD --insecure-skip-tls-verify |
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