-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add maximum lifetime constraint for a workspace #8307
Conversation
7e0d329
to
a33db32
Compare
a33db32
to
3edc6f6
Compare
Codecov Report
@@ Coverage Diff @@
## main #8307 +/- ##
==========================================
- Coverage 31.10% 28.15% -2.95%
==========================================
Files 39 44 +5
Lines 5913 5689 -224
==========================================
- Hits 1839 1602 -237
- Misses 3934 3970 +36
+ Partials 140 117 -23
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
/hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look good to me, but added hold so that @csweichel can weigh in as well.
as far as UX goes, when workspace will timeout, do we show to user the reason for this anywhere? Or is it just will show up as stopped? as it might be confusing for those few who have workspaces running longer than 36 hours.
(if we don't have anything right now, @princerachit can you create a new issue for webapp team?)
@sagor999 The reason for workspace timeout is not displayed. We can have this information but impact wise I am not so sure if it will be useful given that very few users actually run workspace for 36 hours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a bunch of nits, this looks spot on.
Re showing feedback when a workspace times out: we currently show that the workspace timed out, but not why it did that: https://github.com/gitpod-io/gitpod/blob/main/components/dashboard/src/start/StartWorkspace.tsx#L526-L527
@@ -82,6 +82,7 @@ data: | |||
"headlessWorkspace": "60m", | |||
"initialization": "30m", | |||
"regularWorkspace": "30m", | |||
"maxLifetime": "2160m", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"maxLifetime": "2160m", | |
"maxLifetime": "36h", |
@@ -41,6 +41,7 @@ | |||
"headlessWorkspace": "60m", | |||
"initialization": "30m", | |||
"regularWorkspace": "30m", | |||
"maxLifetime": "2160m", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"maxLifetime": "2160m", | |
"maxLifetime": "36h", |
@@ -87,6 +87,7 @@ func forIntegrationTestGetManager(t *testing.T) *Manager { | |||
Initialization: util.Duration(30 * time.Minute), | |||
TotalStartup: util.Duration(45 * time.Minute), | |||
RegularWorkspace: util.Duration(60 * time.Minute), | |||
MaxLifetime: util.Duration(2160 * time.Minute), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MaxLifetime: util.Duration(2160 * time.Minute), | |
MaxLifetime: util.Duration(36 * time.Hour), |
timeout := m.Config.Timeouts.MaxLifetime | ||
activity := activityMaxLifetime | ||
if msg, err := decide(start, timeout, activity); msg != "" { | ||
return msg, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can be simplified (we don't need the variable assignment here because there's no variance in the decision)
timeout := m.Config.Timeouts.MaxLifetime | |
activity := activityMaxLifetime | |
if msg, err := decide(start, timeout, activity); msg != "" { | |
return msg, err | |
} | |
if msg, err := decide(start, m.Config.Timeouts.MaxLifetime, activityMaxLifetime); msg != "" { | |
return msg, err | |
} |
@@ -56,6 +56,7 @@ func forTestingOnlyManagerConfig() config.Configuration { | |||
Initialization: util.Duration(30 * time.Minute), | |||
TotalStartup: util.Duration(45 * time.Minute), | |||
RegularWorkspace: util.Duration(60 * time.Minute), | |||
MaxLifetime: util.Duration(2160 * time.Minute), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MaxLifetime: util.Duration(2160 * time.Minute), | |
MaxLifetime: util.Duration(36 * time.Hour), |
3edc6f6
to
58dc389
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/un-hold |
/unhold |
Description
Add maximum lifetime constraint for a workspace. Timeout the workspace if it breaches the limit. The default value is
36 hours
or2160m
Related Issue(s)
Fixes #7318
How to test
ws-manager
configmap and update themaxLifetime
value to something short e.g.3m00s
status: {"repo": {"branch": "master", "latestCommit": "e81cb46b130e72e96096a91523ed76d00d3263d5", "uncommitedFiles": ["README.md"], "totalUntrackedFiles": 0, "totalUncommitedFiles": 1, "totalUnpushedCommits": 0}, "phase": "stopped", "nodeIp": "10.132.0.41", "message": "", "podName": "ws-10d2368f-69ea-4b10-a7a7-7c6e59c37d6c", "timeout": "60m", "nodeName": "gke-core-dev-workspace-4-adb83b08-505z", "conditions": {"failed": "", "timeout": "workspace timed out after maximum lifetime (00h03m) took longer than 00h03m", "deployed": false, "pullingImages": false, "stoppedByRequest": false, "headlessTaskFailed": ""}, "ownerToken": "RYhpErXpCr6U2MJvkFpUSxWp6ZmqGAXO", "exposedPorts": []}
Release Notes
Documentation