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

As a developer, I want to be notified when autoscaler kicks in during the workspaces startup #22598

Closed
ibuziuk opened this issue Oct 11, 2023 · 11 comments · Fixed by eclipse-che/che-dashboard#1211
Assignees
Labels
area/dashboard area/devworkspace-operator area/doc Issues related to documentation kind/enhancement A feature request - must adhere to the feature request template. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@ibuziuk
Copy link
Member

ibuziuk commented Oct 11, 2023

Is your enhancement related to a problem? Please describe

Currently in order to have the machine auto scaler support admin needs to create DWOC object on the cluster:

apiVersion: controller.devfile.io/v1alpha1
config:
  workspace:
    ignoredUnrecoverableEvents:
      - FailedScheduling
    progressTimeout: 600s

Basically, it means that FailedScheduling events would be ignored during the workspace startup + that workspace startup time would be longer (depending on infra it takes around 10 mins for a new node to be provisioned)

Describe the solution you'd like

Ideally, DWO should detect when autoscaler kicks in and update DWOC accordingly, on the workspace startup screen the notification banner should be shown informing user that workspace startup would take longer due to a new node being provisioned:

Screenshot 2023-10-11 at 14 51 13

Describe alternatives you've considered

Properly document DWOC config for autoscaler support

Additional context

Initial implementation of the Machine Autoscaler support - https://issues.redhat.com/browse/CRW-4072

@ibuziuk ibuziuk added the kind/enhancement A feature request - must adhere to the feature request template. label Oct 11, 2023
@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 Oct 11, 2023
@ibuziuk ibuziuk changed the title As a developer I want to be notified when autoscelaer kick in during the workspaces startup As a developer I want to be notified when autoscaler kicks in during the workspaces startup Oct 11, 2023
@ibuziuk ibuziuk changed the title As a developer I want to be notified when autoscaler kicks in during the workspaces startup As a developer, I want to be notified when autoscaler kicks in during the workspaces startup Oct 11, 2023
@amisevsk amisevsk added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Oct 13, 2023
@amisevsk
Copy link
Contributor

A potentially easier alternative that we also discussed is enabling an option on the CheCluster that can be used to more easily configure the operators for working with auto-scaling.

This could be done more quickly, in case detecting the "in-autoscale" state is tricky.

@cgruver
Copy link

cgruver commented Nov 1, 2023

@ibuziuk I tried creating a DWOC as you mentioned above. It does not appear to work.

DWOC:

apiVersion: controller.devfile.io/v1alpha1
kind: DevWorkspaceOperatorConfig
metadata:
  name: scaling-workspace-config
  namespace: openshift-devspaces
config:
  workspace:
    ignoredUnrecoverableEvents:
      - FailedScheduling
    progressTimeout: 600s

devfile snippet:

schemaVersion: 2.2.0
attributes:
  controller.devfile.io/storage-type: per-workspace
  controller.devfile.io/devworkspace-config: {"name": "scaling-workspace-config", "namespace": "openshift-devspaces"}
metadata:
  name: che-workspace
components:
- name: dev-tools
  container: 
    image: quay.io/cgruver0/che/che-dev-image:latest
    etc...

The resulting DevWorkspace object inherits the attributes as expected, but still fails to start immediately rather than waiting for node scaling.

kind: DevWorkspace
spec:
  contributions:
    - kubernetes:
        name: che-code-che-workspace
      name: editor
  routingClass: che
  started: true
  template:
    attributes:
      controller.devfile.io/devworkspace-config:
        name: devworkspace-config
        namespace: openshift-devspaces
      controller.devfile.io/scc: container-build
      controller.devfile.io/storage-type: per-workspace
    projects:
      - git:
          remotes:
            origin: https://github.com/cgruver/my-che-workspace.git
        name: my-che-workspace
        etc...

Error:

Error creating DevWorkspace deployment: Detected unrecoverable event FailedScheduling: 0/9 nodes are available: 2 Insufficient memory, 3 Insufficient cpu, 3 node(s) had untolerated taint {node-role.kubernetes.io/infra: }, 3 node(s) had untolerated taint {node-role.kubernetes.io/master: }. preemption: 0/9 nodes are available: 3 No preemption victims found for incoming pod, 6 Preemption is not helpful for scheduling...

@amisevsk
Copy link
Contributor

amisevsk commented Nov 1, 2023

@cgruver Che (and Dev Spaces) have their own custom DevWorkspaceOperatorConfigs that are used in place of the one you created:

      # In your DevWorkspace object
      controller.devfile.io/devworkspace-config:
        name: devworkspace-config
        namespace: openshift-devspaces

You could try to edit that DWOC, or, alternatively, configure the DevWorkspace Operator itself by creating your dwoc in DWO's install namespace (openshift-operators) with name devworkspace-operator-config. As far as I know, Che will ignore/overwrite any controller.devfile.io/devworkspace-config attribute in a devfile when converting it into a DevWorkspace.

@cgruver
Copy link

cgruver commented Nov 2, 2023

I think adding this as a parameter in the CheCluster CRD is a great idea.

@monaka
Copy link
Member

monaka commented Feb 23, 2024

ping?

I created a PoC. Is it acceptable?
monami-ya/che-operator@2681812

@tolusha
Copy link
Contributor

tolusha commented Feb 28, 2024

@monaka
Yes, It works for me

@monaka
Copy link
Member

monaka commented Feb 29, 2024

@tolusha Thanks for your check.
I suppose that some additional docs are required. I'll set them up within a couple of weeks.

@monaka
Copy link
Member

monaka commented Aug 4, 2024

I suppose this can be closed as eclipse-che/che-operator#1864 was merged. @ibuziuk

@ibuziuk
Copy link
Member Author

ibuziuk commented Aug 21, 2024

@monaka thanks, but I do not think we can close this issue since there is no update on the user dashboard with appropriate notification.
@dkwon17 @mkuznyetsov @AObuchow @svor it would be nice to prioritize this issue for the next sprint.

@vinokurig
Copy link
Contributor

@ibuziuk @dkwon17 I have tried to set up cluster autoscaler but unfortunately I did not manage to cause new node provision. However I noticed that scaling up a machine set causes a new node provision. It means that we can intercept the Created Machine ... event from the openshift-machine-api namespace events and that would mean that a new node, binded to the new machine, will be provisioned soon.
So the plan is to add an event listener to the dashboard side and catch the Created Machine ... event and show a notification about workspace start delay. Any objections, concerns?

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 1, 2024

@vinokurig yes, I think it is a good idea to use Created Machine event as a marker for auto scaler.

@vinokurig vinokurig moved this from 🚧 In Progress to 📅 Planned in Eclipse Che Team A Backlog Oct 1, 2024
@vinokurig vinokurig moved this from 📅 Planned to 🚧 In Progress in Eclipse Che Team A Backlog Oct 2, 2024
@ibuziuk ibuziuk moved this from 🚧 In Progress to Ready for Review in Eclipse Che Team A Backlog Oct 9, 2024
@vinokurig vinokurig moved this from Ready for Review to ✅ Done in Eclipse Che Team A Backlog Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard area/devworkspace-operator area/doc Issues related to documentation kind/enhancement A feature request - must adhere to the feature request template. severity/P2 Has a minor but important impact to the usage or development of the system.
Development

Successfully merging a pull request may close this issue.

8 participants