forked from keycloak/keycloak-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rosa Scaling Benchmark: JSON Update with environment data (keycloak#637…
…) (keycloak#679) Signed-off-by: Anna Manukyan <amanukya@redhat.com> Co-authored-by: Anna Manukyan <amanukya@redhat.com>
- Loading branch information
1 parent
6781194
commit 62c8cd7
Showing
9 changed files
with
265 additions
and
24 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,33 @@ | ||
name: Prepare Horreum Report | ||
description: Prepares JSON report before further processing, i.e. creates the JSON with the env data which gets from the configmap. | ||
|
||
inputs: | ||
project: | ||
description: 'The project namespace.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: prepare-report-file | ||
name: Create and Prepare Report File | ||
shell: bash | ||
# language=bash | ||
run: | | ||
output_file_prefix="result-" | ||
cur_date=$(date) | ||
cur_date_iso=$(date -d "$cur_date" --iso-8601=seconds) | ||
cur_date_iso_compressed=$(date -d "$cur_date" '+%Y%m%d-%H%M%S') | ||
uuid=$(uuidgen) | ||
OUTPUT_FILE_NAME="${output_file_prefix}${cur_date_iso_compressed}-${uuid}.json" | ||
echo "HORREUM_OUTPUT_FILE_NAME=$OUTPUT_FILE_NAME" >> $GITHUB_ENV | ||
jq -n --arg current_date "${cur_date_iso}" --arg id "${uuid}" \ | ||
'{"$schema": "urn:keycloak-benchmark:0.1", "uuid": ($id), "name": "ROSA Scalability Benchmark Run Results", | ||
"start_dttm": ($current_date)}' > ${OUTPUT_FILE_NAME} | ||
#Reading configmap with environment data | ||
configJson=$(oc get configmap env-config -n ${{ env.PROJECT }} -o "jsonpath={ .data['environment_data\.json']}'" | rev | cut -d\' -f2- | rev | jq) | ||
jq '. + {"context":{}}' ${OUTPUT_FILE_NAME} > tmp.json && \ | ||
mv tmp.json ${OUTPUT_FILE_NAME} | ||
#Putting environment parameters into JSON | ||
jq --argjson configJson "${configJson}" '.context = ($configJson)' ${OUTPUT_FILE_NAME} > tmp.json && \ | ||
mv tmp.json ${OUTPUT_FILE_NAME} |
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
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,83 @@ | ||
name: Multi-AZ Clusters - Undeploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
clusterPrefix: | ||
description: 'The prefix to be used when cleaning the clusters' | ||
type: string | ||
region: | ||
description: 'The AWS region to create both clusters in. Defaults to "vars.AWS_DEFAULT_REGION" if omitted.' | ||
type: string | ||
skipAuroraDeletion: | ||
description: 'Skip Aurora database deletion.' | ||
type: boolean | ||
default: false | ||
|
||
env: | ||
CLUSTER_PREFIX: ${{ inputs.clusterPrefix || format('gh-{0}', github.repository_owner) }} | ||
REGION: ${{ github.event.inputs.region || vars.AWS_DEFAULT_REGION }} | ||
|
||
jobs: | ||
clear-keycloak-and-infinispan-deployment-with-aurora: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- 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: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
cache: maven | ||
|
||
- name: Login to OpenShift cluster | ||
uses: ./.github/actions/oc-keycloak-login | ||
with: | ||
clusterName: ${{ inputs.clusterPrefix }}-a | ||
|
||
- name: Get Keycloak Domain | ||
uses: ./.github/actions/get-keycloak-url | ||
with: | ||
project: runner-keycloak | ||
|
||
- name: Undeploy infinispan and keycloak | ||
working-directory: provision/rosa-cross-dc | ||
run: | | ||
task undeploy | ||
env: | ||
ROSA_CLUSTER_NAME_1: ${{ env.CLUSTER_PREFIX }}-a | ||
ROSA_CLUSTER_NAME_2: ${{ env.CLUSTER_PREFIX }}-b | ||
|
||
- name: Undeploy aurora database | ||
if: ${{ !inputs.skipAuroraDeletion }} | ||
working-directory: provision/rosa-cross-dc | ||
run: | | ||
task delete-aurora | ||
env: | ||
AURORA_CLUSTER: ${{ env.CLUSTER_PREFIX }} | ||
AURORA_REGION: ${{ env.REGION }} | ||
ROSA_CLUSTER_NAME_1: ${{ env.CLUSTER_PREFIX }}-a | ||
ROSA_CLUSTER_NAME_2: ${{ env.CLUSTER_PREFIX }}-b | ||
|
||
- name: Set SUBDOMAIN env variable for route53 processing | ||
run: | | ||
echo "SUBDOMAIN=$(echo $KEYCLOAK_URL | grep -oP '(?<=client.).*?(?=.keycloak-benchmark.com)')" >> $GITHUB_ENV | ||
- name: Delete Route53 Records | ||
run: | | ||
./provision/aws/route53/route53_delete.sh | ||
env: | ||
SUBDOMAIN: ${{ env.SUBDOMAIN }} |
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
Oops, something went wrong.