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

Bug 1839233: send activity tick to keep the cloud shell terminal alive #5546

Merged
merged 3 commits into from
May 26, 2020

Conversation

christianvogt
Copy link
Contributor

@christianvogt christianvogt commented May 22, 2020

Fixes:
https://issues.redhat.com/browse/ODC-3926
Also removed dockerimage from the workspace resource as per devfile/devworkspace-operator#82

Analysis / Root cause:
Cloudshell pod never scales to zero. Therefore indefinitely consuming resources per user per terminal.

Solution Description:
A new endpoint is created in the backend at /api/$namespace/$workspaceName/terminal/activity/tick
We notify this endpoint every minute while there is activity in the console.
The controller will keep the pod alive so long as there has been a tick within a certain time frame (TBD and set on the controller).

Also using the new endpoint to check if the terminal is available before enabling the masthead button.

Unit test coverage report:

image

Test setup:
Requires #5332
When using local bridge. Need to do the following: https://gist.github.com/amisevsk/de48e5e2664857fcd53f0f9550a92082
https://gist.github.com/amisevsk/788ade83b172259f1130691a8c4a1a25

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label May 22, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2020
@christianvogt christianvogt changed the title send activity tick to keep the cloud shell terminal alive Bug 1839233: send activity tick to keep the cloud shell terminal alive May 22, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. label May 22, 2020
@openshift-ci-robot
Copy link
Contributor

@christianvogt: This pull request references Bugzilla bug 1839233, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1839233: send activity tick to keep the cloud shell terminal alive

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 22, 2020
@openshift-ci-robot
Copy link
Contributor

@christianvogt: This pull request references Bugzilla bug 1839233, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1839233: send activity tick to keep the cloud shell terminal alive

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

}
});
} else {
setTerminalAvailable(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Need a check for mounted here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rohitkrai03 this doesn't require a check because it's not executed asynchronously.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right.

@christianvogt
Copy link
Contributor Author

/retest

@openshift-ci-robot
Copy link
Contributor

@christianvogt: This pull request references Bugzilla bug 1839233, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1839233: send activity tick to keep the cloud shell terminal alive

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@christianvogt
Copy link
Contributor Author

/retest

@rohitkrai03
Copy link
Contributor

/assign

@rohitkrai03
Copy link
Contributor

@christianvogt Once the workspace pod scales down to zero, the workspace phase changes to Stopped and the next time user tries to access the terminal it never calls initTerminal and goes into infinite loading state.

Peek 2020-05-27 01-08

Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

/lgtm

Verified locally. Works fine except for the comment about stopped workspaces above. Seems like that fix is coming in #5554. So approving this one.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 26, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, rohitkrai03

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

@openshift-merge-robot openshift-merge-robot merged commit 96cbc18 into openshift:master May 26, 2020
@openshift-ci-robot
Copy link
Contributor

@christianvogt: All pull requests linked via external trackers have merged: openshift/console#5546. Bugzilla bug 1839233 has been moved to the MODIFIED state.

In response to this:

Bug 1839233: send activity tick to keep the cloud shell terminal alive

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.5 milestone May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants