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

When a devfile is not present Che should include a UDI based dev container in the workspace #21340

Closed
nickboldt opened this issue Apr 19, 2022 · 4 comments
Labels
area/ux Issues related to User Experience Design 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

@nickboldt
Copy link
Contributor

nickboldt commented Apr 19, 2022

Is your enhancement related to a problem? Please describe

Today in #20705 we have the ability to autoload a default v2 devfile when none is present in the git project's repo. Cool beans.

However, if the project needs build tools, like the ones provided by the UDI sidecar, none will be present until the user customize the workspace components.

So... while it's great we can load a project for any git repo, it's of limited usefulness if we can't then compile/run/test/debug the code.

Describe the solution you'd like

OOTB when no devfile is present, the default devfile should include the Che or Dev Spaces UDI image as an available sidecar, so users can open a terminal in that container and at least run build commands (java, javac, mvn, gradle, python, etc.)

As in all things Che, this functionality needs to be whitelabel'd/skinnable/extensible so it can easily be configured to load a DIFFERENT default UDI image.

Describe alternatives you've considered

Document how to write your own devfiles and while generating a default devfile with no build environment, open a README in the workspace saying "so we opened your project, but since you don't define a devfile, we can't know what compilation environments you might want. Here's the boilerplate code to add the UDI sidecar to your generated devfile. Once updated, please save your changes, close the workspace, and reload it from the updated project w/ the devfile in it."

It puts the effort onto the user so the OOTB experience is more manual work, but it saves the effort for the dev team to include the UDI image in the default devfile.

Additional context

Subtasks:

@nickboldt nickboldt added 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. area/ux Issues related to User Experience Design labels Apr 19, 2022
@l0rd
Copy link
Contributor

l0rd commented Apr 20, 2022

Rather than leverage cheFlavor we should introduce a workspaces.defaultComponent property in CheCluster CRD. Che default value should be a component of type container using quay.io/devfile/universal-developer-image as image:

(...)
workspaces:
  (...)
  defaultComponent: |
    name: universal-developer-image
    container:
        image: quay.io/devfile/universal-developer-image:ubi8-latest
        memoryRequest: 256M
        memoryLimit: 1536M
        cpuRequest: 0.1
        cpuLimit: 0.5
(...)

@l0rd l0rd changed the title Default devfile (when none present) should auto-load the Che or Dev Spaces UDI image (based on cheFlavor setting) When a devfile is not present Che should include a UDI based dev container in the workspace Apr 20, 2022
@l0rd
Copy link
Contributor

l0rd commented Apr 20, 2022

Also note that to introduce a defaultComponent there are a couple of preliminary issues to address:

We should support only one way to inject an editor

Currently Theia runs in its own sidecar whereas VS Code is injected in the dev component. The consequence is that in a no-devfile scenario the behavior is different based on the editor:

  • if the editor is Theia: the workspace is started and the dev container is Theia container
  • if the editor is VS Code: the workspace fails to start because no dev container has been specified

Rather than supporting both scenarios we should:

Editors spec should allow to override some hosting container properties

Theia has some pre-requisites (env variables, endpoints, memory, cpu etc...) and VS Code has it's own. We want to let developers to choose their editor but we want to have one unique defaultComponent:

@benoitf
Copy link
Contributor

benoitf commented May 2, 2022

Note that the default component if missing is defined for Che Code editor there: https://github.com/eclipse-che/che-plugin-registry/blob/main/che-editors.yaml#L502-L551

It should be handled by devfile/devworkspace-operator#656

@nickboldt
Copy link
Contributor Author

Closing as this works downstream in 3.3 based on Mario's tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ux Issues related to User Experience Design 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

3 participants