Skip to content

feat(scaletest/templates): add support for concurrent scenarios #11753

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
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
add skip create workspaces option
  • Loading branch information
mafredri committed Jan 25, 2024
commit 724e1c5354c8b0c2e2a9c3b9e5c3f99d236c917f
16 changes: 13 additions & 3 deletions scaletest/templates/scaletest-runner/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,18 @@ data "coder_parameter" "num_workspaces" {
}
}

data "coder_parameter" "skip_create_workspaces" {
order = 22
type = "bool"
name = "DEBUG: Skip creating workspaces"
default = false
description = "Skip creating workspaces (for resuming failed scaletests or debugging)"
mutable = true
}


data "coder_parameter" "load_scenarios" {
order = 22
order = 23
name = "Load Scenarios"
type = "list(string)"
description = "The load scenarios to run."
Expand All @@ -252,7 +261,7 @@ data "coder_parameter" "load_scenarios" {
}

data "coder_parameter" "load_scenario_run_concurrently" {
order = 23
order = 24
name = "Run Load Scenarios Concurrently"
type = "bool"
default = false
Expand All @@ -261,7 +270,7 @@ data "coder_parameter" "load_scenario_run_concurrently" {
}

data "coder_parameter" "load_scenario_concurrency_staggering" {
order = 23
order = 25
name = "Load Scenario Concurrency Staggering"
type = "number"
default = 3
Expand Down Expand Up @@ -581,6 +590,7 @@ resource "coder_agent" "main" {
SCALETEST_PARAM_TEMPLATE : data.coder_parameter.workspace_template.value,
SCALETEST_PARAM_REPO_BRANCH : data.coder_parameter.repo_branch.value,
SCALETEST_PARAM_NUM_WORKSPACES : data.coder_parameter.num_workspaces.value,
SCALETEST_PARAM_SKIP_CREATE_WORKSPACES : data.coder_parameter.skip_create_workspaces.value ? "1" : "0",
SCALETEST_PARAM_CREATE_CONCURRENCY : "${data.coder_parameter.create_concurrency.value}",
SCALETEST_PARAM_CLEANUP_STRATEGY : data.coder_parameter.cleanup_strategy.value,
SCALETEST_PARAM_CLEANUP_PREPARE : data.coder_parameter.cleanup_prepare.value ? "1" : "0",
Expand Down
20 changes: 11 additions & 9 deletions scaletest/templates/scaletest-runner/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ log "Running scaletest..."
set_status Running

start_phase "Creating workspaces"
coder exp scaletest create-workspaces \
--count "${SCALETEST_PARAM_NUM_WORKSPACES}" \
--template "${SCALETEST_PARAM_TEMPLATE}" \
--concurrency "${SCALETEST_PARAM_CREATE_CONCURRENCY}" \
--timeout 5h \
--job-timeout 5h \
--no-cleanup \
--output json:"${SCALETEST_RESULTS_DIR}/create-workspaces.json"
show_json "${SCALETEST_RESULTS_DIR}/create-workspaces.json"
if [[ ${SCALETEST_PARAM_SKIP_CREATE_WORKSPACES} == 0 ]]; then
coder exp scaletest create-workspaces \
--count "${SCALETEST_PARAM_NUM_WORKSPACES}" \
--template "${SCALETEST_PARAM_TEMPLATE}" \
--concurrency "${SCALETEST_PARAM_CREATE_CONCURRENCY}" \
--timeout 5h \
--job-timeout 5h \
--no-cleanup \
--output json:"${SCALETEST_RESULTS_DIR}/create-workspaces.json"
show_json "${SCALETEST_RESULTS_DIR}/create-workspaces.json"
fi
end_phase

wait_baseline "${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION}"
Expand Down