Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: autostop workspaces owned by suspended users#13790

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 7 commits intomainfrom8051-stop-workspace
Jul 4, 2024

Conversation

mtojek
Copy link
Member

@mtojekmtojek commentedJul 4, 2024
edited
Loading

Fixed:#8051

This PR modifies autostop rules to stop workspaces owned by suspended users.

@mtojekmtojek self-assigned thisJul 4, 2024
@mtojekmtojek marked this pull request as ready for reviewJuly 4, 2024 12:41
@@ -387,6 +387,10 @@ func isEligibleForAutostop(ws database.Workspace, build database.WorkspaceBuild,
return false
}

if build.Transition == database.WorkspaceTransitionStart && user.Status == database.UserStatusSuspended {
Copy link
Member

Choose a reason for hiding this comment

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

Do we care about any other user statuses?

Copy link
MemberAuthor

@mtojekmtojekJul 4, 2024
edited
Loading

Choose a reason for hiding this comment

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

No, I don't want to mess with others - just suspended.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to mentiondormant but figured it was out of scope;should dormant users be allowed to run workloads?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

IIRC on the first interaction with API the dormant user will be switched to active, so yes.

Copy link
Member

@johnstcnjohnstcnJul 4, 2024
edited
Loading

Choose a reason for hiding this comment

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

By definition... they shouldn't be able to...? Once they log in, they're active.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ok, what is your preference - should I extend the logic to dormant users too?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it could be a follow-up PR since there may be additional considerations.

johnstcn and mtojek reacted with thumbs up emoji
Comment on lines 596 to 600
// When: the autobuild executor ticks after the scheduled time
go func() {
tickCh <- sched.Next(workspace.LatestBuild.CreatedAt)
close(tickCh)
}()
Copy link
Member

Choose a reason for hiding this comment

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

Do we want the executor toimmediately stop workspaces of suspended users, or wait until the workspace has its time to shut down? This is testing the latter.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I assume that the lifecycle executor stops the workspace right after the conditional logic is satisfied? Do you have a specific idea in mind on how we can improve testing?

Copy link
Member

Choose a reason for hiding this comment

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

No matter what time you send down the channel, it should result in the workspace being stopped.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Thanks for more context. I excludedsched from the test.

johnstcn reacted with thumbs up emoji
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

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

LGTM

@mtojekmtojekenabled auto-merge (squash)July 4, 2024 13:28
@mtojekmtojek merged commit7c41f95 intomainJul 4, 2024
28 checks passed
@mtojekmtojek deleted the 8051-stop-workspace branchJuly 4, 2024 13:35
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 4, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mtojekmtojek

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Stop a user's workspaces when their account is suspended
3 participants
@mtojek@dannykopping@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp