Skip to content

Commit

Permalink
WIP: chore(RHIDP-3671): Run passive user groups scalability (RBAC pol…
Browse files Browse the repository at this point in the history
…icy size)

Signed-off-by: Pavel Macík <[email protected]>
  • Loading branch information
pmacik committed Oct 7, 2024
1 parent 3645991 commit 1fa0250
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
3 changes: 3 additions & 0 deletions ci-scripts/collect-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ try_gather_file "${TMP_DIR}/benchmark-scenario"
try_gather_file "${TMP_DIR}/create_group.log"
try_gather_file "${TMP_DIR}/create_user.log"
try_gather_file "${TMP_DIR}/get_token.log"
try_gather_file "${TMP_DIR}/get_rhdh_token.log"
try_gather_file "${TMP_DIR}/get_api_count.log"
try_gather_file "${TMP_DIR}/get_component_count.log"
try_gather_file load-test.log
try_gather_file postgresql.log

Expand Down
8 changes: 4 additions & 4 deletions ci-scripts/rhdh-setup/create_resource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ clone_and_upload() {
ACCESS_TOKEN=$(get_token "rhdh")
curl -k "$(backstage_url)/api/catalog/locations" --cookie "$COOKIE" --cookie-jar "$COOKIE" -X POST -H 'Accept-Encoding: gzip, deflate, br' -H 'Authorization: Bearer '"$ACCESS_TOKEN" -H 'Content-Type: application/json' --data-raw '{"type":"url","target":"'"${upload_url}"'"}'

timeout=600
timeout=1800
timeout_timestamp=$(date -d "$timeout seconds" "+%s")
last_count=-1
while true; do
Expand All @@ -126,8 +126,8 @@ clone_and_upload() {
exit 1
else
ACCESS_TOKEN=$(get_token "rhdh")
if [[ 'component-*.yaml' == "${1}" ]]; then b_count=$(curl -s -k "$(backstage_url)/api/catalog/entity-facets?facet=kind" --cookie "$COOKIE" --cookie-jar "$COOKIE" -H 'Content-Type: application/json' -H 'Authorization: Bearer '"$ACCESS_TOKEN" | jq -r '.facets.kind[] | select(.value == "Component")| .count'); fi
if [[ 'api-*.yaml' == "${1}" ]]; then b_count=$(curl -s -k "$(backstage_url)/api/catalog/entity-facets?facet=kind" --cookie "$COOKIE" --cookie-jar "$COOKIE" -H 'Content-Type: application/json' -H 'Authorization: Bearer '"$ACCESS_TOKEN" | jq -r '.facets.kind[] | select(.value == "API")| .count'); fi
if [[ 'component-*.yaml' == "${1}" ]]; then b_count=$(curl -s -k "$(backstage_url)/api/catalog/entity-facets?facet=kind" --cookie "$COOKIE" --cookie-jar "$COOKIE" -H 'Content-Type: application/json' -H 'Authorization: Bearer '"$ACCESS_TOKEN" | tee -a "$TMP_DIR/get_component_count.log" | jq -r '.facets.kind[] | select(.value == "Component")| .count'); fi
if [[ 'api-*.yaml' == "${1}" ]]; then b_count=$(curl -s -k "$(backstage_url)/api/catalog/entity-facets?facet=kind" --cookie "$COOKIE" --cookie-jar "$COOKIE" -H 'Content-Type: application/json' -H 'Authorization: Bearer '"$ACCESS_TOKEN" | tee -a "$TMP_DIR/get_api_count.log" | jq -r '.facets.kind[] | select(.value == "API")| .count'); fi
if [[ "$last_count" != "$b_count" ]] && [[ $last_count -ge 0 ]]; then # reset the timeout if current count changes
log_info "The current count changed, resetting entity waiting timeout to $timeout seconds"
timeout_timestamp=$(date -d "$timeout seconds" "+%s")
Expand Down Expand Up @@ -308,7 +308,7 @@ rhdh_token() {
--data-urlencode "code=$code" \
--data-urlencode "session_state=$session_state" \
--data-urlencode "state=$state" \
"$CODE_URL" | jq -r ".backstageIdentity" | jq -r ".expires_in_timestamp = $(date -d '30 minutes' +%s)")
"$CODE_URL" | tee -a "$TMP_DIR/get_rhdh_token.log" | jq -r ".backstageIdentity" | jq -r ".expires_in_timestamp = $(date -d '30 minutes' +%s)")
echo "$ACCESS_TOKEN"
}

Expand Down
25 changes: 17 additions & 8 deletions test.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
# To override system environment variables, uncomment the variables down bellow. It will be sourced by the ci-scripts.

## Scenario
# export SCENARIO=baseline-test
export SCENARIO=mvp
# export HOST=http://localhost
# export USERS=100
# export WORKERS=5
# export DURATION=1m
export DURATION=10m
# export SPAWN_RATE=20
# export WAIT_FOR_SEARCH_INDEX=false
export WAIT_FOR_SEARCH_INDEX=false

## RHDH database population
# export PRE_LOAD_DB=true
export PRE_LOAD_DB=true
# export BACKSTAGE_USER_COUNT=1
# export GROUP_COUNT=1
# export API_COUNT=1
# export COMPONENT_COUNT=1
# export KEYCLOAK_USER_PASS=changeme
# export AUTH_PROVIDER=keycloak
# export POPULATION_CONCURRENCY=10
export KEYCLOAK_USER_PASS=V1RKb2FHSnRaR3hpVjFWTENnPT0K
export AUTH_PROVIDER=keycloak
export POPULATION_CONCURRENCY=10
# export COMPONENT_SHARD_SIZE=500

## RHDH installed via Helm
Expand Down Expand Up @@ -54,5 +54,14 @@
## Extras
# export LOCUST_EXTRA_CMD=--debug=true
# export ARTIFACT_DIR=.artifacts
# export ENABLE_RBAC=false
export ENABLE_RBAC=true
# export ENABLE_PROFILING=false

export SCALE_WORKERS=1
export SCALE_ACTIVE_USERS_SPAWN_RATES="1:1"
export SCALE_BS_USERS_GROUPS="1:1 1:1000 1:2000 1:3000 1:4000 1:5000"
export SCALE_CATALOG_SIZES="2500:2500"
export SCALE_REPLICAS="1"
export SCALE_DB_STORAGES="10Gi"
export SCALE_CPU_REQUESTS_LIMITS=":"
export SCALE_MEMORY_REQUESTS_LIMITS=":"

0 comments on commit 1fa0250

Please sign in to comment.