Skip to content

feat(scaletest): add greedy agent test to runner #10559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
minor tweaks
  • Loading branch information
mafredri committed Dec 1, 2023
commit 1278cbe65640f49217c528ef9c66aa705f890544
2 changes: 1 addition & 1 deletion scaletest/templates/scaletest-runner/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ data "coder_parameter" "num_workspaces" {

validation {
min = 0
max = 1000
max = 2000
}
}

Expand Down
23 changes: 19 additions & 4 deletions scaletest/templates/scaletest-runner/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ end_phase

wait_baseline "${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION}"

non_greedy_agent_traffic_args=()
if [[ ${SCALETEST_PARAM_GREEDY_AGENT} != 1 ]]; then
greedy_agent() { :; }
else
echo "WARNING: Greedy agent enabled, this may cause the load tests to fail." >&2
non_greedy_agent_traffic_args=(
# Let the greedy agent traffic command be scraped.
# --scaletest-prometheus-address 0.0.0.0:21113
# --trace=false
)

coder exp scaletest create-workspaces \
--count 1 \
Expand Down Expand Up @@ -59,14 +65,21 @@ else
set +e
coder exp scaletest workspace-traffic \
--template "${SCALETEST_PARAM_GREEDY_AGENT_TEMPLATE}" \
--bytes-per-tick $((1024 * 1024 * 25)) \
--tick-interval 40ms \
--timeout "$((delay))s" \
--job-timeout "$((delay))s" \
--output json:"${SCALETEST_RESULTS_DIR}/traffic-${type}-greedy-agent.json" \
--bytes-per-tick $((1024 * 1024 * 25)) \
--tick-interval 40ms \
--scaletest-prometheus-address 0.0.0.0:21113 \
--trace=false \
"${args[@]}"
status=${?}
show_json "${SCALETEST_RESULTS_DIR}/traffic-${type}-greedy-agent.json"

export GRAFANA_ADD_TAGS=
if [[ ${status} != 0 ]]; then
GRAFANA_ADD_TAGS=error
fi
annotate_grafana_end greedy_agent "${scenario}: Greedy agent"

return ${status}
Expand All @@ -89,7 +102,8 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
--tick-interval "${SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_TICK_INTERVAL}ms" \
--timeout "${SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_DURATION}m" \
--job-timeout "${SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_DURATION}m30s" \
--output json:"${SCALETEST_RESULTS_DIR}/traffic-ssh.json"
--output json:"${SCALETEST_RESULTS_DIR}/traffic-ssh.json" \
"${non_greedy_agent_traffic_args[@]}"
status=$?
wait
status2=$?
Expand All @@ -106,7 +120,8 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
--tick-interval "${SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_TICK_INTERVAL}ms" \
--timeout "${SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_DURATION}m" \
--job-timeout "${SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_DURATION}m30s" \
--output json:"${SCALETEST_RESULTS_DIR}/traffic-web-terminal.json"
--output json:"${SCALETEST_RESULTS_DIR}/traffic-web-terminal.json" \
"${non_greedy_agent_traffic_args[@]}"
status=$?
wait
status2=$?
Expand Down
2 changes: 2 additions & 0 deletions scaletest/templates/scaletest-runner/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ base64 -d <<<"${SCRIPTS_ZIP}" >/tmp/scripts.zip
rm -rf "${SCRIPTS_DIR}" || true
mkdir -p "${SCRIPTS_DIR}"
unzip -o /tmp/scripts.zip -d "${SCRIPTS_DIR}"
# Chmod to work around https://github.com/coder/coder/issues/10034
chmod +x "${SCRIPTS_DIR}"/*.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice finding!

rm /tmp/scripts.zip

echo "Cloning coder/coder repo..."
Expand Down