che icon indicating copy to clipboard operation
che copied to clipboard

Full support for Devfile 2.x spec

Open sleshchenko opened this issue 5 years ago • 13 comments

Is your enhancement related to a problem? Please describe.

Currently, devworkspace controller supports only limited of devfile 2.x format. This is epic to track which parts needs to be implemented.

schemaVersion: 2.0.0
metadata:
  name: nodejs-stack
projects:
  - name: project    
    git:
      remotes:                                                           # The only one remote is supported on Che Theia side
        origin: "https://github.com/che-samples/web-nodejs-sample.git"
components:
  - name: editor
    plugin:
      id: eclipse/che-theia/7.1.0
  - name: terminal
    plugin:
      id: eclipse/che-machine-exec-plugin/7.1.0
  - name: typescript-plugin
    plugin:
      id: che-incubator/typescript/1.30.2                                 # patching of plugins configuration are not supported yet
      components:
        - name: "??"
          container:
            memoryLimit: 512Mi
  - name: nodejs
    container:
      image: quay.io/eclipse/che-nodejs10-ubi:nightly
      memoryLimit: 512Mi
      endpoints:
        - name: nodejs
          protocol: http
          targetPort: 3000
      mountSources: true
  - name: cleanup-job
    kubernetes:
      inlined: |
        apiVersion: batch/v1
        kind: Job
        metadata:
          name: pi
        spec:
          template:
            spec:
              containers:
              - name: job
                image: someimage
                command: ["some",  "command", "with", "parameters"]
              restartPolicy: Never
          backoffLimit: 4
  - name: postgres
    kubernetes:                                               # kubernete component is not supported yet
      inlined: |
        kind: Deployment
        metadata:
          name: pi
        spec:
          template:
            spec:
              containers:
              - name: job
                image: someimage
                command: ["some",  "command", "with", "parameters"]
              restartPolicy: Never
          backoffLimit: 4
volumes:                                                    ## volumes are not implemented on that level
  - name: ...
commands:
  - id: download dependencies
    exec:
      component: nodejs
      commandLine: npm install
      workingDir: ${PROJECTS_ROOT}/project/app
      group:
        kind: build                                              # groups are not supported yet
commands:
  - id: cleanup-job
    apply:
      component: cleanup-job 
events:
  postStop:
    - cleanup-job
  preStop: ...
  preStart: ...
  postStart: ...

This issue is not well-described yet. More details will be provided soon.

Devfile 2.0 Feature Supported Issue
~~Plugin mechanism~~ removed from the spec https://github.com/devfile/api/pull/333
Parent devfiles https://github.com/devfile/devworkspace-operator/pull/346
Allow volumes to be shared across components https://github.com/devfile/devworkspace-operator/pull/237
kubernetes component
projects
starterProjects
Components sourceMapping
Specify size of volume for component https://github.com/devfile/devworkspace-operator/pull/827
Environment variables for a specific command
Commands group (application lifecycle)
Out of main pod containers
Stacks/Devfile matching rules not in the spec yet
Devfile metadata: add a link to an external website
Add lifecycle bindings to bind commands to specific events pre-start only https://github.com/devfile/devworkspace-operator/issues/629
Containers endpoints (routes/ingresses)
New type of command to apply a component
Run exec commands as specified user
hotReloadCapable
image component https://github.com/eclipse/che/issues/21187
outer loop components of type image and kubernetes https://github.com/eclipse/che/issues/21186

sleshchenko avatar Sep 16 '20 09:09 sleshchenko

We should separate the compatibility requirements into two categories: there are parts of the devfile that impact how objects are created on the cluster (e.g. out of pod containers, etc.) and parts that are data to be passed to other components (e.g. commands, projects). For many of the elements listed above, all the devworkspace controller can do is pass data to Theia in a way that Theia will understand.

amisevsk avatar Sep 17 '20 16:09 amisevsk

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

che-bot avatar Oct 12 '21 12:10 che-bot

Closing. We will implement missing parts of the spec when there is a real request.

l0rd avatar Oct 26 '21 22:10 l0rd

@l0rd can you define what "real request" is?

vaidotasp avatar Jul 27 '22 09:07 vaidotasp

@vaidotasp I think it makes sense to re-open this issue so that we can track what's supported and what's not.

I am not sure why I closed it but we are continuously working on supporting the v2 spec (and we have implemented a big part of it already). And we want to prioritize the features that are required in users/customers scenarios (i.e. "real request") rather than guessing what will be useful and what not (for example I would be careful to implement postStop events today as I am not aware of any scenario that would require that).

I have updated the description with what is supported today. We should probably clean it up because there are new fields (i.e. image components) that have been added in the meantime. @amisevsk @AObuchow please have a look.

l0rd avatar Jul 27 '22 12:07 l0rd

/remove-lifecycle stale

l0rd avatar Aug 03 '22 07:08 l0rd

Support for setting annotations on services and endpoints should probably be added to the list.

Also, support for Specifying size of volume component wasn't solved by https://github.com/devfile/devworkspace-operator/pull/827. Instead, Compute required size for per-workspace PVC when all volumes have sizes specified would be a more relevant issue.

AObuchow avatar Nov 21 '22 18:11 AObuchow

@amisevsk correct me if I am wrong, but it seems like the projects and sourceMapping features are supported and can be updated in the table.

Additionally, kubernetes components will be supported once https://github.com/devfile/devworkspace-operator/pull/961 is merged.

AObuchow avatar Nov 23 '22 21:11 AObuchow

components.volume.size is now supported in DWO when using the per-workspace storage strategy. See https://github.com/devfile/devworkspace-operator/pull/1020

AObuchow avatar Jan 18 '23 14:01 AObuchow

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

che-bot avatar Jul 17 '23 01:07 che-bot

/remove-lifecycle stale

l0rd avatar Jul 17 '23 19:07 l0rd

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

che-bot avatar Jan 13 '24 01:01 che-bot

/remove-lifecycle stale

amisevsk avatar Jan 15 '24 15:01 amisevsk