Open framar89 opened 2 years ago
Hello @framar89 it was a test repository
if you've DevWorkspace engine enabled you just need to provide the editor key to open with CheCode
http://your-che-server#https://github.com/your/repository?che-editor=che-incubator/che-code/insiders
Thank you a lot. I'm trying to use a custom IDE but unfortunately the documentation provides examples with version 1 and they don't work with Eclipse Che 7.42.0-SNAPSHOT (the default IDE is always loaded). So I looked for an example to start with and this repo seemed to me the simplest one. So now I try to follow your suggestion and let you know. Do you know where I can find documentation for using custom IDE with devfile v2 and compatible with the current version?
you may look at https://che.eclipseprojects.io/2021/12/20/@florent.benoit-authoring-a-url-to-start-a-workspace.html or https://che.eclipseprojects.io/2021/10/12/@mario.loriedo-devfile-v2-and-the-devworkspace-operator-p1.html
Let me know if you've some issues
What about having a custom IDE? I can define my custom IDE (using devfile v2) in .che/che-editor.yaml and then refer to it with http://your-che-server#https://github.com/your/repository?che-editor=my-custom-ide Is this correct?
if there is a custom .che/che-editor.yaml then no need to add ?che-editor parameter
I created a simple repo with a custom IDE (in .che/che-editor.yaml I defined a devfile with one component that is just a web server that exposes some info: https://hub.docker.com/r/nginxdemos/hello): https://github.com/framar89/testvistaide I created a new workspace importing from git (https://github.com/framar89/testvistaide) but I obtain the following error: Container theia-ide has state CrashLoopBackOff Probably there is something wrong in the che-editor.yaml, is there a way to understand what is wrong?
@framar89 do not use 'che-theia' values in your .che-editor.yaml as it'll try to enhance devfile automatically and it won't work in your case
Thank you, I was able to change the che-editor.yaml and set the fake IDE image (nginxdemos/nginx-hello) The workspace pod is now running and from the details I see that the container related to the custom IDE (nginxdemos/nginx-hello) is running. Unfortunately now I have another error creating a new workspace importing from git (https://github.com/framar89/testvistaide): Getting workspace detail data failed. Failed to fetch the workspace demo-custom-ide4, reason: Could not retrieve mainUrl for the running workspace
so, in DevWorkspace, we need to expose one "main" endpoint among all the endpoints
For example when using Dashboard to open a workspace, it will redirect user to one endpoint, the main one
so, add
attributes:
type: main
to your vista endpoint in the che-editor.yaml
Unfortunately it won't fix the issue. I still get "Could not retrieve mainUrl for the running workspace"
I changed the che-editor.yaml with the following:
inline:
schemaVersion: 2.1.0
metadata:
name: test-custom-ide12
components:
- name: vista-ide
container:
image: "crccheck/hello-world"
mountSources: true
endpoints:
- name: vista
targetPort: 80
exposure: public
protocol: http
attributes:
type: main
attributes:
ports:
- exposedPort: 80
and now in the console log I see that it is stuck in "waiting for editor". The container is actually started so I don't know what is missing.
Now it works! Thank you for your suggestions
ah cool , thanks for keeping me updated
About the link you provided (https://che.eclipseprojects.io/2021/12/20/@florent.benoit-authoring-a-url-to-start-a-workspace.html), is it possible to specify a custom query string argument like
https://che-host#
no, it's not possible to add new environment variables though queries (only inside the devfile)
ok, and what about define the environment variable (with a default value) inside the devfile and override the value in some way in the URL? I did some tests with the redhat env and I saw that the link to create a workspace is something like: https://workspaces.openshift.com/f?url=https://endpoint/devfile-registry/devfiles/05_python/devfile.yaml&override.attributes.persistVolumes=false
Is the &override.attributes.persistVolumes=false something inspiring to do what I'd like?
If I create a new workspace importing from git (this repo) I get the following error in applying the dev file: Failed to create a workspace. Failed to create a new workspace from the devfile, reason: Unable to resolve che-code plugins: Not able to find che-code-description component in DevWorkspace and its templates
I am using minikube under windows 10 (hyperv) and the Eclipse Che 7.42.0-SNAPSHOT