Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ci-scripts/release-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export SCALE_CATALOG_SIZES='$SCALE_CATALOG_SIZES'
export SCALE_CPU_REQUESTS_LIMITS=:
export SCALE_DB_STORAGES='$SCALE_DB_STORAGES'
export SCALE_MEMORY_REQUESTS_LIMITS=:
export SCALE_RHDH_REPLICAS=1
export SCALE_RHDH_DB_REPLICAS=1
export SCALE_REPLICAS=1:1
export SCALE_WORKERS=20
export ENABLE_RBAC=true
export SCENARIO=mvp
Expand Down
121 changes: 60 additions & 61 deletions ci-scripts/scalability/collect-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ read -ra rbac_policy_size <<<"${SCALE_RBAC_POLICY_SIZE:-10000}"

read -ra catalog_apis_components <<<"${SCALE_CATALOG_SIZES:-1:1 10000:10000}"

read -ra rhdh_replicas <<<"${SCALE_RHDH_REPLICAS:-5}"

read -ra rhdh_db_replicas <<<"${SCALE_RHDH_DB_REPLICAS:-1}"
read -ra rhdh_replicas <<<"${SCALE_REPLICAS:-1:1}"

read -ra db_storages <<<"${SCALE_DB_STORAGES:-1Gi 2Gi}"

Expand All @@ -51,65 +49,66 @@ echo "Collecting scalability data"
counter=1
rhdh_version=""
for w in "${workers[@]}"; do
for r in "${rhdh_replicas[@]}"; do
for dbr in "${rhdh_db_replicas[@]}"; do
for bu_bg in "${bs_users_groups[@]}"; do
IFS=":" read -ra tokens <<<"${bu_bg}"
bu="${tokens[0]}" # backstage users
[[ "${#tokens[@]}" == 1 ]] && bg="" || bg="${tokens[1]}" # backstage groups
for rbs in "${rbac_policy_size[@]}"; do
for s in "${db_storages[@]}"; do
for au_sr in "${active_users_spawn_rate[@]}"; do
IFS=":" read -ra tokens <<<"${au_sr}"
active_users=${tokens[0]}
output="$ARTIFACT_DIR/scalability_c-${r}r-${dbr}dbr-db_${s}-${bu}bu-${bg}bg-${rbs}rbs-${w}w-${active_users}u-${counter}.csv"
header="CatalogSize${csv_delim}Apis${csv_delim}Components${csv_delim}MaxActiveUsers${csv_delim}AverageRPS${csv_delim}MaxRPS${csv_delim}AverageRT${csv_delim}MaxRT${csv_delim}Failures${csv_delim}FailRate${csv_delim}DBStorageUsed${csv_delim}DBStorageAvailable${csv_delim}DBStorageCapacity"
for cr_cl in "${cpu_requests_limits[@]}"; do
IFS=":" read -ra tokens <<<"${cr_cl}"
cr="${tokens[0]}" # cpu requests
[[ "${#tokens[@]}" == 1 ]] && cl="" || cl="${tokens[1]}" # cpu limits
for mr_ml in "${memory_requests_limits[@]}"; do
IFS=":" read -ra tokens <<<"${mr_ml}"
mr="${tokens[0]}" # memory requests
[[ "${#tokens[@]}" == 1 ]] && ml="" || ml="${tokens[1]}" # memory limits
[[ -f "${output}" ]] || echo "$header" >"$output"
for a_c in "${catalog_apis_components[@]}"; do
IFS=":" read -ra tokens <<<"${a_c}"
a="${tokens[0]}" # apis
[[ "${#tokens[@]}" == 1 ]] && c="" || c="${tokens[1]}" # components
index="${r}r-${dbr}dbr-db_${s}-${bu}bu-${bg}bg-${rbs}rbs-${w}w-${cr}cr-${cl}cl-${mr}mr-${ml}ml-${a}a-${c}c"
iteration="${index}/test/${counter}/${active_users}u"
((counter += 1))
echo "[$iteration] Looking for benchmark.json..."
benchmark_json="$(find "${ARTIFACT_DIR}" -name benchmark.json | grep "$iteration" || true)"
if [ -n "$benchmark_json" ]; then
benchmark_json="$(python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$benchmark_json")"
echo "[$iteration] Gathering data from $benchmark_json"
jq_cmd="\"$((a + c))\" \
+ $csv_delim_quoted + \"${a}\" \
+ $csv_delim_quoted + \"${c}\" \
+ $csv_delim_quoted + (.results.locust_users.max | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_current_rps.mean | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_current_rps.max | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_avg_response_time.mean | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_avg_response_time.max | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_num_failures.max | tostring) \
+ $csv_delim_quoted + (.results.locust_requests_fail_ratio.mean | tostring) \
+ $csv_delim_quoted + (.measurements.cluster.pv_stats.test.\"rhdh-postgresql\".used_bytes.max | tostring) \
+ $csv_delim_quoted + (.measurements.cluster.pv_stats.test.\"rhdh-postgresql\".available_bytes.min | tostring) \
+ $csv_delim_quoted + (.measurements.cluster.pv_stats.test.\"rhdh-postgresql\".capacity_bytes.max | tostring)"
sed -Ee 's/: ([0-9]+\.[0-9]*[X]+[0-9e\+-]*|[0-9]*X+[0-9]*\.[0-9e\+-]*|[0-9]*X+[0-9]*\.[0-9]*X+[0-9e\+-]+)/: "\1"/g' "$benchmark_json" | jq -rc "$jq_cmd" >>"$output"
if [ -z "$rhdh_version" ]; then
rhdh_version=$(jq -r '.metadata.image."konflux.additional-tags" | split(", ") | map(select(test("[0-9]\\.[0-9]-[0-9]+"))) | .[0]' "$benchmark_json" || true)
fi
else
echo "[$iteration] Unable to find benchmark.json"
for _ in $(seq 1 "$(echo "$header" | tr -cd "$csv_delim" | wc -c)"); do
echo -n ";" >>"$output"
done
echo >>"$output"
for r_c in "${rhdh_replicas[@]}"; do
IFS=":" read -ra tokens <<<"${r_c}"
r="${tokens[0]}"
[[ "${#tokens[@]}" == 1 ]] && dbr="" || dbr="${tokens[1]}"
for bu_bg in "${bs_users_groups[@]}"; do
IFS=":" read -ra tokens <<<"${bu_bg}"
bu="${tokens[0]}" # backstage users
[[ "${#tokens[@]}" == 1 ]] && bg="" || bg="${tokens[1]}" # backstage groups
for rbs in "${rbac_policy_size[@]}"; do
for s in "${db_storages[@]}"; do
for au_sr in "${active_users_spawn_rate[@]}"; do
IFS=":" read -ra tokens <<<"${au_sr}"
active_users=${tokens[0]}
output="$ARTIFACT_DIR/scalability_c-${r}r-${dbr}dbr-db_${s}-${bu}bu-${bg}bg-${rbs}rbs-${w}w-${active_users}u-${counter}.csv"
header="CatalogSize${csv_delim}Apis${csv_delim}Components${csv_delim}MaxActiveUsers${csv_delim}AverageRPS${csv_delim}MaxRPS${csv_delim}AverageRT${csv_delim}MaxRT${csv_delim}Failures${csv_delim}FailRate${csv_delim}DBStorageUsed${csv_delim}DBStorageAvailable${csv_delim}DBStorageCapacity"
for cr_cl in "${cpu_requests_limits[@]}"; do
IFS=":" read -ra tokens <<<"${cr_cl}"
cr="${tokens[0]}" # cpu requests
[[ "${#tokens[@]}" == 1 ]] && cl="" || cl="${tokens[1]}" # cpu limits
for mr_ml in "${memory_requests_limits[@]}"; do
IFS=":" read -ra tokens <<<"${mr_ml}"
mr="${tokens[0]}" # memory requests
[[ "${#tokens[@]}" == 1 ]] && ml="" || ml="${tokens[1]}" # memory limits
[[ -f "${output}" ]] || echo "$header" >"$output"
for a_c in "${catalog_apis_components[@]}"; do
IFS=":" read -ra tokens <<<"${a_c}"
a="${tokens[0]}" # apis
[[ "${#tokens[@]}" == 1 ]] && c="" || c="${tokens[1]}" # components
index="${r}r-${dbr}dbr-db_${s}-${bu}bu-${bg}bg-${rbs}rbs-${w}w-${cr}cr-${cl}cl-${mr}mr-${ml}ml-${a}a-${c}c"
iteration="${index}/test/${counter}/${active_users}u"
(( counter += 1 ))
echo "[$iteration] Looking for benchmark.json..."
benchmark_json="$(find "${ARTIFACT_DIR}" -name benchmark.json | grep "$iteration" || true)"
if [ -n "$benchmark_json" ]; then
benchmark_json="$(python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$benchmark_json")"
echo "[$iteration] Gathering data from $benchmark_json"
jq_cmd="\"$((a + c))\" \
+ $csv_delim_quoted + \"${a}\" \
+ $csv_delim_quoted + \"${c}\" \
+ $csv_delim_quoted + (.results.locust_users.max | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_current_rps.mean | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_current_rps.max | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_avg_response_time.mean | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_avg_response_time.max | tostring) \
+ $csv_delim_quoted + (.results.Aggregated.locust_requests_num_failures.max | tostring) \
+ $csv_delim_quoted + (.results.locust_requests_fail_ratio.mean | tostring) \
+ $csv_delim_quoted + (.measurements.cluster.pv_stats.test.\"rhdh-postgresql\".used_bytes.max | tostring) \
+ $csv_delim_quoted + (.measurements.cluster.pv_stats.test.\"rhdh-postgresql\".available_bytes.min | tostring) \
+ $csv_delim_quoted + (.measurements.cluster.pv_stats.test.\"rhdh-postgresql\".capacity_bytes.max | tostring)"
sed -Ee 's/: ([0-9]+\.[0-9]*[X]+[0-9e\+-]*|[0-9]*X+[0-9]*\.[0-9e\+-]*|[0-9]*X+[0-9]*\.[0-9]*X+[0-9e\+-]+)/: "\1"/g' "$benchmark_json" | jq -rc "$jq_cmd" >>"$output"
if [ -z "$rhdh_version" ]; then
rhdh_version=$(jq -r '.metadata.image."konflux.additional-tags" | split(", ") | map(select(test("[0-9]\\.[0-9]-[0-9]+"))) | .[0]' "$benchmark_json" || true)
fi
done
else
echo "[$iteration] Unable to find benchmark.json"
for _ in $(seq 1 "$(echo "$header" | tr -cd "$csv_delim" | wc -c)"); do
echo -n ";" >>"$output"
done
echo >>"$output"
fi
done
done
done
Expand Down
Loading