Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add API/SDK support for autostop extension #1778

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 11 commits into from
May 26, 2022
Merged

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented May 26, 2022

  • Adds deadline column to workspace_builds, associated DB/API plumbing
  • database: Upon inserting a row into workspace_builds, deadline will be initially be zero.
  • autobuild: Executor will now check the Deadline field of the workspace_build for the purpose of autostop logic.
  • coderd: Adds a new route /api/v2/workspaces/:workspace/extend which will allow updating the deadline of the currently active workspace build. The new deadline must be after the existing deadline, and not the zero time.
  • provisionerd: update workspace_build.deadline upon successful workspace build completion (equal to now plus workspace TTL, if it exists)

Closes #1462

@johnstcn johnstcn requested a review from a team May 26, 2022 12:55
@johnstcn johnstcn requested a review from a team as a code owner May 26, 2022 12:55
@johnstcn johnstcn self-assigned this May 26, 2022
@johnstcn johnstcn requested a review from greyscaled May 26, 2022 12:55
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

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

So what will be the behavior when the user changes the TTL on a running workspace? Will you add functionality to the CLI so we also update the TTL to be closer to the new TTL?

@johnstcn
Copy link
Member Author

johnstcn commented May 26, 2022

So what will be the behavior when the user changes the TTL on a running workspace? Will you add functionality to the CLI so we also update the TTL to be closer to the new TTL?

Good idea!

EDIT: Opened separate issue as this has a lot of if's and but's #1783

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

Minor comments

@johnstcn johnstcn force-pushed the cj/autostop-extend-api branch from ded669b to 03ec987 Compare May 26, 2022 16:48
@johnstcn johnstcn merged commit 8f0a5a8 into main May 26, 2022
@johnstcn johnstcn deleted the cj/autostop-extend-api branch May 26, 2022 17:08
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
* Adds deadline column to workspace_builds, associated DB/API plumbing
* database: Upon inserting a row into workspace_builds, deadline will 
  initially be zero.
* autobuild: Executor now checks the Deadline field of the workspace_build
  for the purpose of autostop logic.
* coderd: Adds a new route /api/v2/workspaces/:workspace/extend which allows
  updating the deadline of the currently active workspace build. The new
  deadline must be after the existing deadline, and not the zero time.
* provisionerd: updates workspace_build.deadline upon successful workspace 
  build completion (equal to now plus workspace TTL, if it exists).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API/SDK auto-stop extension
4 participants