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

Allow admins to change workspaces inactivity and run timeout #21390

Closed
l0rd opened this issue May 11, 2022 · 16 comments
Closed

Allow admins to change workspaces inactivity and run timeout #21390

l0rd opened this issue May 11, 2022 · 16 comments
Assignees
Labels
area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator area/editor/theia Issues related to the che-theia IDE of Che area/machine-exec kind/enhancement A feature request - must adhere to the feature request template.

Comments

@l0rd
Copy link
Contributor

l0rd commented May 11, 2022

Is your enhancement related to a problem? Please describe

Before switching to the DevWorkspace engine, it was possible to specify workspaces timeout through Che server properties CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT and CHE_LIMITS_WORKSPACE_RUN_TIMEOUT.

Currently Che-Theia based workspaces are idled after 15 minutes of inactivity. This is specified in the editor definition and it's not configurable by the user or by an admin (if not by patching the editor definition in the plugin registry or by publishing and using an alternative editor definition).

Note that VS Code and JetBrains IDE based workspaces are never idled and that we want to use a universal idling mechanism (there is a separate issue for that).

Describe the solution you'd like

CheCluster CRD should have:

  • devEnvironments.secondsOfInactivityBeforeIdling
  • devEnvironments.secondsOfRunBeforeIdling

That should be propagated as environment variables to the workspace containers:

  • SECONDS_OF_DW_INACTIVITY_BEFORE_IDLING
  • SECONDS_OF_DW_RUN_BEFORE_IDLING

Machine exec should parse those variables, if they exist, when setting the timeout.

Machine exec should support SECONDS_OF_DW_RUN_BEFORE_IDLING

Theia definition should not specify the --idle-timeout parameter for machine exec.

The defaults should be 30 minutes for secondsOfInactivityBeforeIdling and SECONDS_OF_DW_INACTIVITY_BEFORE_IDLING and -1 for secondsOfRunBeforeIdling and SECONDS_OF_DW_RUN_BEFORE_IDLING

Additional context

#21322

Release notes text

Administrators can specify the timeout for inactivity and running workspaces with the CheCluster spec.devEnvironmentfieldssecondsOfInactivityBeforeIdlingandsecondsOfRunBeforeIdling` respectively. The default values are 30 minutes and -1 (no timeout) respectively.

@l0rd l0rd added the kind/enhancement A feature request - must adhere to the feature request template. label May 11, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label May 11, 2022
@l0rd l0rd added area/machine-exec area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator area/editor/theia Issues related to the che-theia IDE of Che and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels May 11, 2022
@pdfruth
Copy link

pdfruth commented Jun 23, 2022

I ran across this enhancement request while searching for any known method of customizing the workspace idle timeout.
It is super annoying to have to restart a workspace after only 15 minutes of idle.

I have searched, and found another suggested workaround here.
But, that workaround does not seem to work in my environment (Red Hat OpenShift Dev Spaces Operator V3.0 on Red Hat OpenShift Container Platform V4.10.18)

Questions:

  • Is there any news on when this enhancement will be implemented?
  • Is there any workaround to customize or disable the idle timeout in the meantime?

@amisevsk
Copy link
Contributor

I'm not clear on why it's done in this way. The DevWorkspace Operator provides the environment variable DEVWORKSPACE_IDLE_TIMEOUT to DevWorkspaces as a suggested idle timeout (which can be configured from the DevWorkspace configuration CR). If the e.g. machine-exec command was

          command:
            - /go/bin/che-machine-exec
            - '--url'
            - '127.0.0.1:3333'
            - '--idle-timeout'
            - '$DEVWORKSPACE_IDLE_TIMEOUT'

then the workspace would automatically take into account the configured value in DWO.

@l0rd
Copy link
Contributor Author

l0rd commented Jun 23, 2022

Note that here we are talking about Theia, the default editor included in Che workspaces. If instead we specify to use VS Code, IntelliJ or PyCharm instead of Theia, those won't be idled at all (and this can be problematic too). So, @pdfruth, if you prefer no-idling you can refer to this blog post draft to use a different editor.

@pdfruth
Copy link

pdfruth commented Jun 24, 2022

@l0rd
I don't think you've linked to a blog post draft. The link leads to a Git issue comment.
Can you link to the blog post draft, please?

@l0rd
Copy link
Contributor Author

l0rd commented Jun 25, 2022

@pdfruth sorry, I have updated the comment above with the right link.

@pdfruth
Copy link

pdfruth commented Jun 28, 2022

@l0rd Thank you for the updated link to the blog post draft.
I have attempted to follow the instructions by adding .che folder containing a che-editor.yaml file to an existing Git repo.
However, upon creating a new Openshift Dev Spaces workspace, I still see the Theia editor (as seen in this screen-shot)
The Git repo containing my simple Python app is here.
Can you see what I might have done wrong?

2022-06-28_6-30-18

@l0rd
Copy link
Contributor Author

l0rd commented Jun 28, 2022

@pdfruth: you need a devfile c.f. https://github.com/pdfruth/voting-app-py-ds/pull/1, thanks for spotting that, I will update the document to mention that.

@olexii4 I have reproduced that upstream too: .che/che-editor.yaml is ignored if there is no devfile.

@pdfruth
Copy link

pdfruth commented Jun 30, 2022

Thank You @l0rd. I can confirm that the addition of a devfile has enabled the che-code editor to load. And there is no idle timeout!!

@pdfruth
Copy link

pdfruth commented Jul 11, 2022

Hi @l0rd
As you mentioned earlier;

... if you prefer no-idling you can refer to this blog post draft to use a different editor.

I have been able to get the che-code editor working in conjunction with the Red Hat OpenShift Dev Spaces V3.0 operator on an OCP cluster on x86 architecture.
I would like to do the same on an OCP cluster on the s390x architecture. But I do not see container images at https://quay.io/repository/che-incubator/che-code?tab=tags.
Questions:

  • Is there a place to find che-code images for s390x architecture?
  • The blog article indicates the intent to make the VSCode editor = default, with 3Q22 timing. Is the intent to make it default on all supported architectures where the Red Hat OpenShift Dev Spaces operator is supported today? And is 3Q22 still valid?
  • If there is not s390x images available today, is there instructions somewhere for building from source?

@l0rd
Copy link
Contributor Author

l0rd commented Jul 11, 2022

@pdfruth @azatsarynnyy I don't think we have any s390 build yet and I am not sure if we have a plan to build it for 3Q22 (cc @azatsarynnyy @RomanNikitenko @nickboldt). To build it yourself you can have a look at the PR check GitHub action.

@l0rd
Copy link
Contributor Author

l0rd commented Jul 12, 2022

I have updated the description with CheCluster devEnvironments section instead of workspaces and I have added a note about the default values for the CheCluster fields and the env variables.

@RomanNikitenko
Copy link
Member

RomanNikitenko commented Jul 20, 2022

@pdfruth

If there is not s390x images available today, is there instructions somewhere for building from source?

I think for s390x platform you should add the corresponding target, please see here, building images - here

Using those changes I had a successful build for ppc64 platform, but I didn't test it for s390x platform...

@l0rd
Copy link
Contributor Author

l0rd commented Jul 21, 2022

@dkwon17 can we close this issue (asking to figure out if we can include it in 7.51 release notes).

@dkwon17
Copy link
Contributor

dkwon17 commented Jul 21, 2022

@l0rd , yes this can be closed and included in the 7.51 release notes

@dkwon17 dkwon17 closed this as completed Jul 21, 2022
@nickboldt
Copy link
Contributor

@pdfruth @azatsarynnyy I don't think we have any s390 build yet and I am not sure if we have a plan to build it for 3Q22 (cc @azatsarynnyy @RomanNikitenko @nickboldt). To build it yourself you can have a look at the PR check GitHub action.

For S390x support, or to contrubute to the effort, see https://issues.redhat.com/browse/CRW-3171

@RomanNikitenko
Copy link
Member

RomanNikitenko commented Jul 23, 2022

Tested on s390x platform - yes - there are some problems on yarn install step:

image

@pdfruth
FYI
These changes should fix the problem

Screenshot 2022-07-23 at 13 18 48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator area/editor/theia Issues related to the che-theia IDE of Che area/machine-exec kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

No branches or pull requests

7 participants