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

Editor devfiles should use controller.devfile.io/container-contribution: true attribute on injectable components #21739

Closed
amisevsk opened this issue Sep 29, 2022 · 3 comments
Assignees
Labels
area/editors area/plugin-registry kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system.

Comments

@amisevsk
Copy link
Contributor

Is your enhancement related to a problem? Please describe

DevWorkspace Operator PR devfile/devworkspace-operator#844 added support for two new attributes on components:

  • controller.devfile.io/container-contribution: true defines a container component as a "container contribution"
  • controller.devfile.io/merge-contribution: true defines a container as a target for merging a "container contribution"

When a component has the container-contribution: true attribute and another component has the merge-contribution: true attribute, the DevWorkspace Operator merges the former into the latter, overriding fields except for image. This is intended to support the current process of injecting the Theia or CheCode editors into an existing Devfile component, which is currently done by modifying the devfile contents when converting to a DevWorkspace. This has the issue that it's hard to get the original Devfile back from the converted form, as fields have been updated.

When merging is not possible, the original image for the merged component is used and that component is started as normal.

Describe the solution you'd like

The plugins listed in the Devfile registry should be updated to use the controller.devfile.io/container-contribution: true attribute on components intended to be "injected" into a devfile component.

  • For the CheCode editor (che-incubator/che-code/insiders), this is simple -- it is sufficient to just add the attribute to the che-code-runtime-description component
     components:
       - name: che-code-runtime-description
         attributes:
           app.kubernetes.io/component: che-code-runtime
           app.kubernetes.io/part-of: che-code.eclipse.org
    +      controller.devfile.io/container-contribution: true
         container:
           image: quay.io/devfile/universal-developer-image@sha256:53cec58dd190dd1e06100478ae879d7c28abd8fc883d5fdf5be3eb6e943fe5e7
           command:
             - /checode/entrypoint-volume.sh
  • For the Theia editor, the required additions are done by the dashboard directly and are not present in the devfile. If we want to define the additions required by the Theia editor when it is being injected into a container, one approach is to define a "dummy" component that is expected to be injected
    @@ -9,6 +9,26 @@
       preStart:
         - init-container-command
     components:
    +  - name: theia-ide-contributions
    +    attributes:
    +      controller.devfile.io/container-contribution: true
    +    container:
    +      args:
    +        - sh
    +        - '-c'
    +        - '${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}'
    +      env:
    +        - name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE
    +          value: /remote-endpoint/plugin-remote-endpoint
    +        - name: THEIA_PLUGINS
    +          value: local-dir:///plugins/sidecars/tools
    +      memoryLimit: 512Mi
    +      volumeMounts:
    +        - name: plugins
    +          path: /plugins
    +        - name: remote-endpoint
    +          path: /remote-endpoint
    +      image: quay.io/devfile/universal-developer-image@sha256:53cec58dd190dd1e06100478ae879d7c28abd8fc883d5fdf5be3eb6e943fe5e7
       - name: theia-ide
         container:
           image: quay.io/eclipse/che-theia:next
    when used with an appropriate merge target, this results in a DevWorkspace that matches what is produced by the dashboard when using the Theia IDE

Describe alternatives you've considered

It may make sense to only implement this for CheCode, as it's a lot simpler.

Additional context

This issue is part of #21736

@amisevsk amisevsk added kind/enhancement A feature request - must adhere to the feature request template. area/devfile-registry area/editors labels Sep 29, 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 Sep 29, 2022
@amisevsk amisevsk added severity/P1 Has a major impact to 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 Sep 30, 2022
@ibuziuk ibuziuk mentioned this issue Nov 22, 2022
68 tasks
@svor svor self-assigned this Nov 28, 2022
@l0rd
Copy link
Contributor

l0rd commented Nov 28, 2022

If that can be useful I have provided VS Code, IntelliJ and Theia samples.

@svor
Copy link
Contributor

svor commented Nov 29, 2022

@l0rd I can't find controller.devfile.io/container-contribution: true attribute in IntelliJ devfile provided above. Is it something I've missed?

@l0rd
Copy link
Contributor

l0rd commented Nov 29, 2022

@svor that's because currently IntelliJ runs in its own container and doesn't "contribute" anything to the tooling container. There is no IntelliJ handler. And changing current behavior (i.e. running IntelliJ in the tooling container) is a distinct issue.

@svor svor closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editors area/plugin-registry kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants