-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to define a custom IDE in a devfile #21634
Comments
Hello @Deel96, Just choose a stable version from the dropdown menu. Or follow this direct link https://www.eclipse.org/che/docs/stable/end-user-guide/selecting-a-workspace-ide/
I hope that helps you. |
Hi @azatsarynnyy, Using a che-editor.yaml file seems like the easiest way to get started:
reference: https://someaccessibleUrl/referenced-che-editor.yaml # mandatory
override: # optional
containers:
- name: theia-ide
memoryLimit: 1280Mi It's not clear to me if the reference Url should point to the vanilla che-editor.yaml file or to my own like specified later in the documentation:https://www.eclipse.org/che/docs/stable/end-user-guide/specifying-an-in-browser-ide-for-a-git-repository-by-using-che-editor.yaml/#using-an-embedded-editor-ddefinition-for-your-ide_che I tried to create a project which has the corresponding files: For simplicity I also have the referenced yaml file in the repo which i include via raw.github.com If I open the repo via QuickAdd in Che the github repo opens with vanilla theia-che. |
@Deel96 Just provide your images in: |
@azatsarynnyy If I use my che-editor file without reference (everything in the che-editor.yaml file) the workspace still opens with che-theia. At least that's the devfile I can see in eclipse che after the quick add apiVersion: 1.0.0
metadata:
name: editor295x
projects:
- name: editor
source:
location: 'https://github.com/Deel96/editor.git'
type: github
components:
- id: redhat/vscode-xml/latest
type: chePlugin
- id: redhat/vscode-yaml/latest
type: chePlugin
apiVersion: 1.0.0
metadata:
name: editor-testingndju
projects:
- name: editor-testing
source:
location: 'https://github.com/Deel96/editor-testing.git'
type: github
|
you can keep it the same as it's in your example here https://github.com/Deel96/editor/blob/d66ef4655c015432ae25df348e8da110254250e8/.che/che-editor.yaml#L31 @Deel96 I've just noticed the version of your Devfile is I wonder what Che version you use? Because all the examples I provided and the docs are related to the Devfile v.2 |
You're right, I changed it to version 2. Until now I used the codereadyworkspace because I had problems setting che up locally. With a local deployment with version 7.52 on OpenShift Local. I noticed that che doesn't find the devfile. Checking other repos suggests that the yamlfile has to be in the root directory with the name "devfile.yaml". But I guess the devfile is for everything dispite the IDE. But I also noticed that the che-editor.yaml seems not to be taken into account at all. Is there a workaround to force another IDE to be used? I guess the bug also is present on other platforms like minikube? |
@Deel96 The |
Selecting an ide via url with the editor_key works for me. Example: Doing so I get following error:
This also happens if I just do Seems like a devfile has to be present in the root folder anyway? |
@Deel96 if So in this editor Devfile https://github.com/Deel96/editor/blob/main/.che/che-editor.yaml
|
@azatsarynnyy Since When using my custom che-editor.yaml file I get now the following error about my theia-ide (my custom ide):
used URL : I get the same error if I try to use the for example che-idea:
editorkey = che-theia/latest
|
@Deel96 can you check the workspace pod's events? There should be more details on the exact problem. On my local cluster, I usually pre-download the large images "by hand". E.g.:
|
@azatsarynnyy Prefetching "worked". I now get a 404 after the workspace started, but that's probably because of my ide image. |
in Che-Theia, it's specified by the |
For documentation in case someone in the future reads this: For simplicity I have my client and server part inside one container. |
I'm using the OpenShift Console. It is also possible with
Theia uses the URL fragment for providing the folder to open. The "dynamic" URL shouldn't be a problem, as I understand it. The frontend knows what backend URL to request based on the URL of the frontend page itself. This code from upstream Theia may help https://github.com/eclipse-theia/theia/blob/master/packages/core/src/browser/endpoint.ts |
5m39s Normal BackOff pod/workspaced8273c46efad4604-587495468c-f9p6t Back-off pulling image "docker.io/browork/ide:latest" Gave the same informations but prepulling the images fixed it (see above). Regarding the issue with the "localhost" URL. I think the cause lays somewhere else. I published the same image on an "alternative solution for workspaces", where everything works as expected. In my dockerfile I create the user "theia", which starts the serverside components. RUN useradd -ms /bin/bash theia
....
USER theia
...
build.sh
....
CMD yarn start Below you can see what gets printed out from the theia terminal integrated in the frontend: $ whoami
theia
$ groups
theia
$ groups root
root : root
$ groups theia
theia : theia
$ groups $USER
theia
$ id -Gn
theia
$ id -Gn $USER
theia
$ echo $USER
$ id -u $USER
1000 This is what I get on the eclipse-che instance (same image as above): $ whoami
whoami: cannot find name for user ID 1234
$ groups
root groups: cannot find name for group ID 1234
1234
$ groups root
root : root
$ groups theia
theia : theia
$ groups $USER
root groups: cannot find name for group ID 1234
1234
$ id -Gn
root id: cannot find name for group ID 1234
1234
$ id -Gn $USER
root id: cannot find name for group ID 1234
1234
$ echo $USER
$ id -u $USER
1234 First I thought it has something to do with the che-machine-exec container, but there is a uid of 12345 specified. Inside the logs of the "theia-ide" container inside the user1-che pod I see many errors because of missing permissions for folder creations. My question now is: how can I change the user from 1234 to another one? |
I'm not sure I can help with that one. Maybe, building a custom image... |
The image I use is a custom image. Changing the ownership of the files inside the dockerfile to uid 1234 didn't helped. For more context on the other solution: I have a helm chart where I have to provide the userid. When I match it to the id I get from creating the "theia" user (id 1000) it works as expected. I also noticed that the container is started with uid 1234 from kubernetes/minikube. If I start the container inside minikube manually ( |
Okay I found the problem. 512 MB for the container I took from vanilla che-theia was not enough for my custom ide since it also contains language servers. Sadly no errors pointed me this way. Best Regards |
@Deel96 I'm glad you were able to figure out the root cause of the problem.
I agree that's a problem. That's why Che-Theia and Che-Code editors include the Resource Monitor plug-in that displays the info about the cluster resources consumption. We also have some plans for improvements to that plug-in: #20809, #21624.
Feel free to ask the questions you have in the issues, mattermost channel, or on the community calls. |
@ashumilova I am a bit confused of the combination of the devfile and the che-editor file. With the che-editor file I'm able to use a custom IDE. From my editor repo which has no devfile. On startup I also get the message that no devfile could be found so the default configuration is used: My question now is where do I specify for example a tools container with nodejs which should run an internally and publicly exposed api. Notice that the following link is on my editor-testing repo with the same content, just added with a devfile. So I guess I have to add this also to the che-editor file? But on workspace restart che manages to start the workspace with the right ide. Adding the nodejs/redhat universal image to the che-editor.yaml works as expected. IDE on First sidecar/container of the devfile which is exposed will be exposed here: With that it is possible to get access to the sidecar containers without haven the port extension (which would TLDR: To specify a workspace I either use devfile.yaml or in che-editor.yaml (via .che or via url). But if I specify both the devfile wins? |
@Deel96 I'm not sure I understand your question correctly, but I'll try to answer ) A project Devfile is stored in the |
Hi @azatsarynnyy My question at the end is basicly if it's possible to combine a devfile.yaml and a che-editor.yaml file. I thought that I would need a devfile.yaml for the workspace and che-editor.yaml file for the ide. Is my impression wrong or do you either use che-editor or devfile.yaml? |
@Deel96 recently, I've noticed there's a problem that |
@azatsarynnyy @Deel96 thanks for your great answers and discuss!but l also have a lot questions: |
@davidxwwang |
Is there a current documentation for running a custom IDE?
I only found an old version:
https://www.eclipse.org/che/docs/che-7/end-user-guide/support-for-theia-based-ides/
I created an own devfile like mentioned in the docs with a reference URL. The editor auto insertes a pastebin url, which looks pretty empty:
https://pastebin.com/raw/kYprWiNB
So I used the file from the docs an hosted my own file on pastebin. https://pastebin.com/raw/4YdE6DiT
When starting the workspace I get the error
Workspace emfcloud failed to start. Failed to start the workspace emfcloud, reason: Internal Server Error occurred, error time
Starting in verbose mode gives me the same. The dockerimage of the ide works locally without problems.
Possible reasons I found:
I tried docker.io, registry.hub.docker.com but always get the error above, maybe the issues lays somewhere else?
At the moment I have a docker hub image from: https://hub.docker.com/repository/docker/browork/ide linked as registry.hub.docker.com/browork/ide
If I remove my changes
reference: 'https://pastebin.com/raw/QFYWXJc0'
the workspace starts without a problem.
If just use the 2 lines as a devfile I get the error above.
I'm testing this at the moment on Codeready Workspaces, but the issue above should be independent from it.
My devfile file:
The text was updated successfully, but these errors were encountered: