Skip to content
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

[ws-manager] Introduce stoppedByRequest condition #6218

Merged
merged 2 commits into from
Oct 14, 2021
Merged

Conversation

csweichel
Copy link
Contributor

Description

This PR changes the stopping behaviour of ws-manager so that when StopWorkspace is called we first mark the workspace with a gitpod.io/stoppedByRequest annotation which contains the desired termination grace period. This annotation also backs a new stoppedByRequest annotation on the workspace status. This condition can be used to determine if the workspace was stopped by explicit request, e.g. to signal prebuild cancelation.

Related Issue(s)

Fixes #6213

How to test

  1. Start a workspace
  2. Run gpctl workspaces subscribe --output-template '{{ .Id }} {{ .Phase }} {{ .Conditions }}'
  3. Stop the workspace
  4. Observe the status updates and how the stoppedByRequest annotation is set

image

Release Notes

[ws-manager] Introduce stoppedByRequest annotation marking workspaces explicitly stopped using a `StopWorkspace` call

@roboquat roboquat added release-note team: workspace Issue belongs to the Workspace team labels Oct 14, 2021
@roboquat roboquat requested a review from aledbf October 14, 2021 20:46
@codecov
Copy link

codecov bot commented Oct 14, 2021

Codecov Report

Merging #6218 (4177be7) into main (1854bfa) will increase coverage by 5.40%.
The diff coverage is 55.55%.

❗ Current head 4177be7 differs from pull request most recent head d9ca8fc. Consider uploading reports for the commit d9ca8fc to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6218      +/-   ##
==========================================
+ Coverage   33.96%   39.37%   +5.40%     
==========================================
  Files         130       13     -117     
  Lines       22323     3779   -18544     
==========================================
- Hits         7583     1488    -6095     
+ Misses      14059     2168   -11891     
+ Partials      681      123     -558     
Flag Coverage Δ
components-blobserve-app ?
components-blobserve-lib ?
components-common-go-lib ?
components-content-service-api-go-lib ?
components-content-service-app ?
components-content-service-lib ?
components-ee-agent-smith-app ?
components-ee-agent-smith-lib ?
components-ee-kedge-app ?
components-ee-ws-scheduler-app ?
components-ee-ws-scheduler-lib ?
components-image-builder-api-go-lib ?
components-image-builder-app ?
components-image-builder-bob-app ?
components-image-builder-mk3-app ?
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?
components-openvsx-proxy-app ?
components-registry-facade-app ?
components-registry-facade-lib ?
components-service-waiter-app ?
components-supervisor-app ?
components-workspacekit-app ?
components-ws-daemon-api-go-lib ?
components-ws-daemon-app ?
components-ws-daemon-lib ?
components-ws-daemon-nsinsider-app ?
components-ws-manager-api-go-lib ?
components-ws-manager-app 39.37% <55.55%> (+0.08%) ⬆️
components-ws-manager-bridge-api-go-lib ?
components-ws-proxy-app ?
components-ws-proxy-lib ?
dev-loadgen-app ?
dev-poolkeeper-app ?
installer-app ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/ws-manager/pkg/manager/annotations.go 65.11% <ø> (ø)
components/ws-manager/pkg/manager/manager.go 25.10% <0.00%> (-0.03%) ⬇️
components/ws-manager/pkg/manager/monitor.go 9.01% <53.84%> (+0.75%) ⬆️
components/ws-manager/pkg/manager/status.go 73.50% <100.00%> (+0.13%) ⬆️
components/content-service/pkg/storage/gcloud.go
...nts/content-service/pkg/service/content-service.go
components/ee/agent-smith/pkg/agent/agent.go
components/ee/ws-scheduler/pkg/scaler/time.go
components/openvsx-proxy/pkg/handler.go
...ents/image-builder-mk3/pkg/orchestrator/monitor.go
... and 111 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1854bfa...d9ca8fc. Read the comment docs.

@aledbf
Copy link
Member

aledbf commented Oct 14, 2021

/lgtm
/approve

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: be58609f12e98e4acfd706514fd430a372a1d15e

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf

Associated issue: #6213

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit be7530e into main Oct 14, 2021
@roboquat roboquat deleted the cw/fix-6213 branch October 14, 2021 21:12
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note size/XXL team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new workspace condition "stoppedByRequest"
3 participants