Skip to content

Commit c67e609

Browse files
jentingroboquat
authored andcommitted
loadgen: support custom workspace timeout
Signed-off-by: JenTing Hsiao <[email protected]>
1 parent 0a476c5 commit c67e609

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

dev/loadgen/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ In order to configure the benchmark, you can use the configuration file
4141
| successRate | Percentage of started workspaces that should enter running state to count as a successful run |
4242
| environment | Global environment variables that will be set for all repositories |
4343
| workspaceClass | The workspace class to use for workspaces. This setting can be overriden for individual repositories |
44+
| workspaceTimeout | The workspace timeout value |
4445
| repoAuth | The authentication for a repository. This setting can be overriden for individual repositories |
4546
| repoAuth.authUser | The user that should be used for authentication |
4647
| repoAuth.authPassword | The password that should be used for authentication |

dev/loadgen/cmd/benchmark.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var benchmarkCommand = &cobra.Command{
7575
Username: "foobar",
7676
},
7777
FeatureFlags: scenario.FeatureFlags,
78-
Timeout: "5m",
78+
Timeout: scenario.WorkspaceTimeout,
7979
WorkspaceImage: "will-be-overriden",
8080
Envvars: scenario.Environment,
8181
Class: scenario.WorkspaceClass,
@@ -191,16 +191,17 @@ func init() {
191191
}
192192

193193
type BenchmarkScenario struct {
194-
Workspaces int `json:"workspaces"`
195-
IDEImage string `json:"ideImage"`
196-
Repos []loadgen.WorkspaceCfg `json:"repos"`
197-
Environment []*api.EnvironmentVariable `json:"environment"`
198-
RunningTimeout string `json:"waitForRunning"`
199-
StoppingTimeout string `json:"waitForStopping"`
200-
SuccessRate float32 `json:"successRate"`
201-
WorkspaceClass string `json:"workspaceClass"`
202-
FeatureFlags []api.WorkspaceFeatureFlag `json:"featureFlags"`
203-
RepositoryAuth *loadgen.RepositoryAuth `json:"repoAuth,omitempty"`
194+
Workspaces int `json:"workspaces"`
195+
IDEImage string `json:"ideImage"`
196+
Repos []loadgen.WorkspaceCfg `json:"repos"`
197+
Environment []*api.EnvironmentVariable `json:"environment"`
198+
RunningTimeout string `json:"waitForRunning"`
199+
StoppingTimeout string `json:"waitForStopping"`
200+
SuccessRate float32 `json:"successRate"`
201+
WorkspaceClass string `json:"workspaceClass"`
202+
FeatureFlags []api.WorkspaceFeatureFlag `json:"featureFlags"`
203+
RepositoryAuth *loadgen.RepositoryAuth `json:"repoAuth,omitempty"`
204+
WorkspaceTimeout string `json:"workspaceTimeout,omitempty"`
204205
}
205206

206207
func handleWorkspaceDeletion(timeout string, executor loadgen.Executor, canceled bool) error {

dev/loadgen/configs/prod-benchmark-pvc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ environment:
1010
- name: "THEIA_SUPERVISOR_TOKENS"
1111
value: '[{"token":"foobar","host":"gitpod-staging.com","scope":["function:getWorkspace","function:getLoggedInUser","function:getPortAuthenticationToken","function:getWorkspaceOwner","function:getWorkspaceUsers","function:isWorkspaceOwner","function:controlAdmission","function:setWorkspaceTimeout","function:getWorkspaceTimeout","function:sendHeartBeat","function:getOpenPorts","function:openPort","function:closePort","function:generateNewGitpodToken","function:takeSnapshot","function:stopWorkspace","resource:workspace::fa498dcc-0a84-448f-9666-79f297ad821a::get/update","resource:workspaceInstance::e0a17083-6a78-441a-9b97-ef90d6aff463::get/update/delete","resource:snapshot::*::create/get","resource:gitpodToken::*::create","resource:userStorage::*::create/get/update"],"expiryDate":"2020-12-01T07:55:12.501Z","reuse":2}]'
1212
workspaceClass: "g1-standard-pvc"
13+
workspaceTimeout: 1h
1314
featureFlags:
1415
# https://github.com/gitpod-io/gitpod/blob/e437e1868072dfad1d195031a4709a254bd60dc8/components/ws-manager-api/core.proto#L596
1516
# from core.proto: PERSISTENT_VOLUME_CLAIM = 7;

dev/loadgen/configs/prod-benchmark.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ environment:
1010
- name: "THEIA_SUPERVISOR_TOKENS"
1111
value: '[{"token":"foobar","host":"gitpod-staging.com","scope":["function:getWorkspace","function:getLoggedInUser","function:getPortAuthenticationToken","function:getWorkspaceOwner","function:getWorkspaceUsers","function:isWorkspaceOwner","function:controlAdmission","function:setWorkspaceTimeout","function:getWorkspaceTimeout","function:sendHeartBeat","function:getOpenPorts","function:openPort","function:closePort","function:generateNewGitpodToken","function:takeSnapshot","function:stopWorkspace","resource:workspace::fa498dcc-0a84-448f-9666-79f297ad821a::get/update","resource:workspaceInstance::e0a17083-6a78-441a-9b97-ef90d6aff463::get/update/delete","resource:snapshot::*::create/get","resource:gitpodToken::*::create","resource:userStorage::*::create/get/update"],"expiryDate":"2020-12-01T07:55:12.501Z","reuse":2}]'
1212
workspaceClass: "g1-standard"
13+
workspaceTimeout: 1h
1314
repos:
1415
- cloneURL: https://github.com/Furisto/workspace-stress
1516
cloneTarget: main

dev/loadgen/configs/workspace-preview-benchmark-pvc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ environment:
77
- name: "THEIA_SUPERVISOR_TOKENS"
88
value: '[{"token":"foobar","host":"gitpod-staging.com","scope":["function:getWorkspace","function:getLoggedInUser","function:getPortAuthenticationToken","function:getWorkspaceOwner","function:getWorkspaceUsers","function:isWorkspaceOwner","function:controlAdmission","function:setWorkspaceTimeout","function:getWorkspaceTimeout","function:sendHeartBeat","function:getOpenPorts","function:openPort","function:closePort","function:generateNewGitpodToken","function:takeSnapshot","function:stopWorkspace","resource:workspace::fa498dcc-0a84-448f-9666-79f297ad821a::get/update","resource:workspaceInstance::e0a17083-6a78-441a-9b97-ef90d6aff463::get/update/delete","resource:snapshot::*::create/get","resource:gitpodToken::*::create","resource:userStorage::*::create/get/update"],"expiryDate":"2020-12-01T07:55:12.501Z","reuse":2}]'
99
workspaceClass: ""
10+
workspaceTimeout: 1h
1011
featureFlags:
1112
# https://github.com/gitpod-io/gitpod/blob/e437e1868072dfad1d195031a4709a254bd60dc8/components/ws-manager-api/core.proto#L596
1213
# from core.proto: PERSISTENT_VOLUME_CLAIM = 7;

dev/loadgen/configs/workspace-preview-benchmark.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ environment:
77
- name: "THEIA_SUPERVISOR_TOKENS"
88
value: '[{"token":"foobar","host":"gitpod-staging.com","scope":["function:getWorkspace","function:getLoggedInUser","function:getPortAuthenticationToken","function:getWorkspaceOwner","function:getWorkspaceUsers","function:isWorkspaceOwner","function:controlAdmission","function:setWorkspaceTimeout","function:getWorkspaceTimeout","function:sendHeartBeat","function:getOpenPorts","function:openPort","function:closePort","function:generateNewGitpodToken","function:takeSnapshot","function:stopWorkspace","resource:workspace::fa498dcc-0a84-448f-9666-79f297ad821a::get/update","resource:workspaceInstance::e0a17083-6a78-441a-9b97-ef90d6aff463::get/update/delete","resource:snapshot::*::create/get","resource:gitpodToken::*::create","resource:userStorage::*::create/get/update"],"expiryDate":"2020-12-01T07:55:12.501Z","reuse":2}]'
99
workspaceClass: ""
10+
workspaceTimeout: 1h
1011
repos:
1112
- cloneURL: https://github.com/Furisto/workspace-stress
1213
cloneTarget: main

0 commit comments

Comments
 (0)