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

Provides dashboard library for VS Code editor #20679

Closed
benoitf opened this issue Oct 21, 2021 · 0 comments · Fixed by eclipse-che/che-dashboard#414
Closed

Provides dashboard library for VS Code editor #20679

benoitf opened this issue Oct 21, 2021 · 0 comments · Fixed by eclipse-che/che-dashboard#414
Assignees
Labels
area/editor/vscode Issues related to the Code OSS editor of Che engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. 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

@benoitf
Copy link
Contributor

benoitf commented Oct 21, 2021

Is your enhancement related to a problem? Please describe

Today, there is ongoing work to have a solution working out of the box using only DevWorkspaceTemplate
devfile/devworkspace-operator#656
devfile/devworkspace-operator#655
devfile/devworkspace-operator#628

But, postStart even being challenging, adding a new component type or attributes may take time

In the meantime, we could provide a dashboard library that will handle that part for now by enhancing DevWorkspaces

Describe the solution you'd like

Library allowing to enhance DevWorkspace / Devfile

As the idea is also to get back to the 'non-enhanced' devWorkspace and 'original Devfile', each contribution made by the library should be annotated.

So we can go back to the original content.

And if we need to change some part of the DevWorkspace, we can filter-in/filter-out these extra information.

All the information like memory, cpu, default image will be described in a "Description/Template" of the editor DevWorkspaceTemplate

Here is an example

Let suppose I have the following devfile

schemaVersion: 2.1.0
metadata:
  name: my-dummy-project
components:
  - name: tools
    container:
      image: quay.io/fbenoit/alpine:jdk11
      memoryLimit: 1Gi

and the following DevWorkspaceTemplate for the editor:

schemaVersion: 2.1.0
metadata:
  name: che-code
commands:
  - id: init-container-command
    apply:
      component: che-code-injector
events:
  preStart:
    - init-container-command
components:
  - name: che-code-injector
    container:
      image: 'quay.io/fbenoit/tmp:1.60.1c'
      command: ["/checode/entrypoint-init-container.sh"]
      volumeMounts:
        - name: checode
          path: /checode-mount
      memoryLimit: 128Mi
      memoryRequest: 32Mi
      cpuLimit: 500m
      cpuRequest: 30m
  - name: che-code-runtime-description
    container:
      image: 'quay.io/fbenoit/alpine:jdk11'
      memoryLimit: 1024Mi
      memoryRequest: 256Mi
      cpuLimit: 500m
      cpuRequest: 30m
      volumeMounts:
        - name: checode
          path: /checode
      endpoints:
        - name: che-code
          attributes:
            type: main
            cookiesAuthEnabled: true
            discoverable: false
            urlRewriteSupported: true
          targetPort: 8080
          exposure: public
          secure: false
          protocol: https
    attributes:
      app.kubernetes.io/component: che-code-runtime
      app.kubernetes.io/part-of: che-code.eclipse.org
  - name: checode
    volume:

so che-code-runtime-description contains the memory, cpu, endpoint, volumes that need to be added on the user DevFile

Here is expected result of the DevWorkspace and editor DevWorkspace template

so, memory is sum up, entrypoint is added

apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspaceTemplate
metadata:
  name: che-code-my-dummy-project
spec:
  commands:
    - id: init-container-command
      apply:
        component: che-code-injector
  events:
    preStart:
      - init-container-command
  components:
    - name: che-code-injector
      container:
        image: quay.io/fbenoit/tmp:1.60.1c
        command:
          - /checode-mount/entrypoint-init-container.sh
        volumeMounts:
          - name: checode
            path: /checode
        memoryLimit: 128Mi
        memoryRequest: 32Mi
        cpuLimit: 500m
        cpuRequest: 30m
    - name: checode
      volume:
        ephemeral: true
---
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspace
metadata:
  name: my-dummy-project
spec:
  started: true
  template:
    components:
      - name: tools
        container:
          image: quay.io/fbenoit/alpine:jdk11
          memoryLimit: 2Gi
          volumeMounts: []
          endpoints:
            - name: che-code
              attributes:
                type: main
                cookiesAuthEnabled: true
                discoverable: false
                urlRewriteSupported: true
                contributed-by: che-code.eclipse.org
              targetPort: 8080
              exposure: public
              secure: false
              protocol: https
          memoryRequest: 256Mi
          cpuLimit: 500m
          cpuRequest: 30m
        attributes:
          che-code.eclipse.org/contribute-endpoint/che-code: 8080
          che-code.eclipse.org/contribute-memoryLimit: true
          che-code.eclipse.org/original-memoryLimit: 1024Mi
          che-code.eclipse.org/contribute-memoryRequest: true
          che-code.eclipse.org/contribute-cpuLimit: true
          che-code.eclipse.org/contribute-cpuRequest: true

so we have extra attributes saying that endpoints, volumes, memory, etc have been added and we can filter/use them to get back to the original DevWorkspace

Describe alternatives you've considered

Use directly DWO enhancement but it'll take more time
It'll be easy to switch to the DWO implementation, we'll just to remove the enhancement library from the dashboard

Additional context

No response

@benoitf benoitf added the kind/enhancement A feature request - must adhere to the feature request template. label Oct 21, 2021
@benoitf benoitf self-assigned this Oct 21, 2021
@benoitf benoitf added the area/editor/vscode Issues related to the Code OSS editor of Che label Oct 21, 2021
@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 21, 2021
@dmytro-ndp dmytro-ndp added severity/P2 Has a minor but important impact to the usage or development of the system. engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Oct 21, 2021
benoitf added a commit to eclipse-che/che-dashboard that referenced this issue Nov 30, 2021
benoitf added a commit to eclipse-che/che-dashboard that referenced this issue Dec 1, 2021
benoitf added a commit to eclipse-che/che-dashboard that referenced this issue Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/vscode Issues related to the Code OSS editor of Che engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants