Skip to content

chore(scaletest/templates/scaletest-runner): fix dashboard command invocation, autoscale provisioners #10177

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
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions scaletest/templates/scaletest-runner/scripts/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ coder exp scaletest cleanup \
tee "${SCALETEST_RESULTS_DIR}/cleanup-${event}.txt"
end_phase

if [[ $event != prepare ]]; then
start_phase "Scaling down provisioners..."
maybedryrun "$DRY_RUN" kubectl scale deployment/coder-provisioner --replicas 1
maybedryrun "$DRY_RUN" kubectl rollout status deployment/coder-provisioner
fi

if [[ $event = manual ]]; then
echo 'Press any key to continue...'
read -s -r -n 1
Expand Down
2 changes: 2 additions & 0 deletions scaletest/templates/scaletest-runner/scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,12 @@ fetch_coder_full() {
exit 1
fi
log "Fetching full Coder binary from ${pod}"
# We need --retries due to https://github.com/kubernetes/kubernetes/issues/60140 :(
maybedryrun "${DRY_RUN}" kubectl \
--namespace "${namespace}" \
cp \
--container coder \
--retries 3 \
"${pod}:/opt/coder" "${SCALETEST_CODER_BINARY}"
maybedryrun "${DRY_RUN}" chmod +x "${SCALETEST_CODER_BINARY}"
log "Full Coder binary downloaded to ${SCALETEST_CODER_BINARY}"
Expand Down
6 changes: 6 additions & 0 deletions scaletest/templates/scaletest-runner/scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ log "Cleaning up from previous runs (if applicable)..."
"${SCRIPTS_DIR}/cleanup.sh" "prepare"

log "Preparation complete!"

log "Scaling up provisioners to ${SCALETEST_PARAM_CREATE_CONCURRENCY}..."
maybedryrun "$DRY_RUN" kubectl scale deployment/coder-provisioner \
--replicas "${SCALETEST_PARAM_CREATE_CONCURRENCY}"
Copy link
Member

Choose a reason for hiding this comment

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

This is dope! 😍

Copy link
Member Author

Choose a reason for hiding this comment

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

actually I may need to handle concurrency=0 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we can just enforce a non-zero value for create concurrency in the template

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, if SCALETEST_PARAM_CREATE_CONCURRENCY is 0, I'm defaulting to 10 provisioners.

log "Waiting for provisioners to scale up..."
maybedryrun "$DRY_RUN" kubectl rollout status deployment/coder-provisioner
1 change: 0 additions & 1 deletion scaletest/templates/scaletest-runner/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
;;
"Dashboard Traffic")
coder exp scaletest dashboard \
--count "${SCALETEST_PARAM_NUM_WORKSPACES}" \
--timeout "${SCALETEST_PARAM_LOAD_SCENARIO_DASHBOARD_TRAFFIC_DURATION}m" \
--job-timeout "${SCALETEST_PARAM_LOAD_SCENARIO_DASHBOARD_TRAFFIC_DURATION}m30s" \
--output json:"${SCALETEST_RESULTS_DIR}/traffic-dashboard.json" \
Expand Down