Skip to content

feat(scaletest): add scaletest-runner template #9662

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 36 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
51b5054
feat(scaletest): add scaletest-runner template
mafredri Sep 13, 2023
9a579fb
add setup/scaletest-sa.yaml
mafredri Sep 13, 2023
cde4388
fix typo
mafredri Sep 13, 2023
cd20cb8
shfmt
mafredri Sep 13, 2023
12ecd71
fix typo
mafredri Sep 13, 2023
55d6fd8
fix shellcheck
mafredri Sep 13, 2023
b251af9
fmt
mafredri Sep 13, 2023
1b1b401
improve precondition
mafredri Sep 13, 2023
fa0de66
turn namespace into param
mafredri Sep 14, 2023
77d575c
turn some params to non-ephemeral
mafredri Sep 14, 2023
abab20f
expose concurrency knobs as parameters
mafredri Sep 14, 2023
dac2ff8
refactor phase, create lib
mafredri Sep 14, 2023
059988e
refactor to use state dir in run dir
mafredri Sep 14, 2023
6352ce1
move permission check higher up
mafredri Sep 14, 2023
67e54a6
fixup! turn namespace into param
mafredri Sep 14, 2023
8f6950a
fixup! turn namespace into param
mafredri Sep 14, 2023
964778e
add cleanup strategy and make minor tweaks
mafredri Sep 14, 2023
57fd74e
move prepare/install step to Dockerfile
mafredri Sep 14, 2023
4c22a73
fix
mafredri Sep 14, 2023
35ac68f
add todo for cleanup
mafredri Sep 14, 2023
7cffd30
store timestamps for all status messages
mafredri Sep 14, 2023
5cb0e9b
make fmt/shfmt
mafredri Sep 14, 2023
e037b6b
fix unbound var
mafredri Sep 14, 2023
f336a0a
clean up previous runs if needed
mafredri Sep 14, 2023
047c784
clean up results json files
mafredri Sep 14, 2023
18875f4
add previous phase
mafredri Sep 14, 2023
0507591
fix
mafredri Sep 14, 2023
d83f480
grep -c <3
mafredri Sep 14, 2023
179f5b4
ns
mafredri Sep 14, 2023
5f5d3b1
add compression of old archives
mafredri Sep 14, 2023
c9205ce
s/echo/log/
mafredri Sep 14, 2023
f7b8c00
increase zstd compression level
mafredri Sep 15, 2023
4688f59
make sleep a dry-run op
mafredri Sep 15, 2023
3f4008c
make compression a dry-run op
mafredri Sep 15, 2023
0fce513
show dry-run in status
mafredri Sep 15, 2023
94b49e9
make shellcheck happy
mafredri Sep 15, 2023
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
expose concurrency knobs as parameters
  • Loading branch information
mafredri committed Sep 14, 2023
commit abab20f541e193089db3aa44db8225e10f6835c8
60 changes: 56 additions & 4 deletions scaletest/templates/scaletest-runner/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,56 @@ data "coder_parameter" "dry_run" {
ephemeral = true
}

data "coder_parameter" "create_concurrency" {
order = 10
type = "number"
name = "Create concurrency"
default = 10
description = "The number of workspaces to create concurrently."
mutable = true

# Setting zero = unlimited, but perhaps not a good idea,
# we can raise this limit instead.
validation {
min = 1
max = 100
}
}

data "coder_parameter" "job_concurrency" {
order = 11
type = "number"
name = "Scaletest job concurrency"
default = 10
description = "The number of concurrent jobs (e.g. when producing workspace traffic)."
mutable = true

# Setting zero = unlimited, but perhaps not a good idea,
# we can raise this limit instead.
validation {
min = 1
max = 100
}
}

data "coder_parameter" "cleanup_concurrency" {
order = 12
type = "number"
name = "Cleanup concurrency"
default = 10
description = "The number of concurrent cleanup jobs."
mutable = true

# Setting zero = unlimited, but perhaps not a good idea,
# we can raise this limit instead.
validation {
min = 1
max = 100
}
}

data "coder_parameter" "workspace_template" {
order = 3
order = 20
name = "workspace_template"
display_name = "Workspace Template"
description = "The template used for workspace creation."
Expand Down Expand Up @@ -106,7 +154,7 @@ data "coder_parameter" "workspace_template" {
}

data "coder_parameter" "num_workspaces" {
order = 10
order = 21
type = "number"
name = "Number of workspaces to create"
default = 100
Expand Down Expand Up @@ -142,16 +190,20 @@ resource "coder_agent" "main" {
CODER_CONFIG_DIR : "/home/coder/.config/coderv2",
CODER_USER_TOKEN : data.coder_workspace.me.owner_session_token,
CODER_URL : data.coder_workspace.me.access_url,

# Global scaletest envs that may affect each `coder exp scaletest` invocation.
CODER_SCALETEST_PROMETHEUS_ADDRESS : "0.0.0.0:21112",
CODER_SCALETEST_PROMETHEUS_WAIT : "60s",
CODER_SCALETEST_CONCURRENCY : "${data.coder_parameter.job_concurrency.value}",
CODER_SCALETEST_CLEANUP_CONCURRENCY : "${data.coder_parameter.cleanup_concurrency.value}",

# Local envs passed as arguments to `coder exp scaletest` invocations.
SCALETEST_RUN_ID : local.scaletest_run_id,
SCALETEST_RUN_DIR : local.scaletest_run_dir,
SCALETEST_TEMPLATE : data.coder_parameter.workspace_template.value,
SCALETEST_SKIP_CLEANUP : "1",
SCALETEST_NUM_WORKSPACES : data.coder_parameter.num_workspaces.value,
SCALETEST_CREATE_CONCURRENCY : "10",
SCALETEST_CLEANUP_CONCURRENCY : "10",
SCALETEST_CREATE_CONCURRENCY : "${data.coder_parameter.create_concurrency.value}",

SCRIPTS_ZIP : filebase64(data.archive_file.scripts_zip.output_path),
SCRIPTS_DIR : "/tmp/scripts",
Expand Down
5 changes: 1 addition & 4 deletions scaletest/templates/scaletest-runner/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ touch /tmp/.scaletest_phase_creating_workspaces

coder exp scaletest create-workspaces \
--count "${SCALETEST_NUM_WORKSPACES}" \
--template="${SCALETEST_TEMPLATE}" \
--template "${SCALETEST_TEMPLATE}" \
--concurrency "${SCALETEST_CREATE_CONCURRENCY}" \
--job-timeout 15m \
--no-cleanup \
Expand All @@ -44,7 +44,6 @@ coder exp scaletest workspace-traffic \
--ssh \
--bytes-per-tick 10240 \
--tick-interval 1s \
--concurrency 0 \
--timeout 5m \
--output json:"${SCALETEST_RUN_DIR}/result-ssh.json"
show_json "${SCALETEST_RUN_DIR}/result-ssh.json"
Expand All @@ -56,7 +55,6 @@ touch /tmp/.scaletest_phase_rpty
coder exp scaletest workspace-traffic \
--bytes-per-tick 10240 \
--tick-interval 1s \
--concurrency 0 \
--timeout 5m \
--output json:"${SCALETEST_RUN_DIR}/result-rpty.json"
show_json "${SCALETEST_RUN_DIR}/result-rpty.json"
Expand All @@ -67,7 +65,6 @@ wait_baseline 5
touch /tmp/.scaletest_phase_dashboard
coder exp scaletest dashboard \
--count "${SCALETEST_NUM_WORKSPACES}" \
--concurrency 0 \
--job-timeout 5m \
--output json:"${SCALETEST_RUN_DIR}/result-dashboard.json"
show_json "${SCALETEST_RUN_DIR}/result-dashboard.json"
Expand Down