benoitf / exvscd

0 stars 1 forks source link

Example no more working #1

Open framar89 opened 2 years ago

framar89 commented 2 years ago

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

image

I am using minikube under windows 10 (hyperv) and the Eclipse Che 7.42.0-SNAPSHOT

benoitf commented 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

framar89 commented 2 years ago

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?

benoitf commented 2 years ago

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

framar89 commented 2 years ago

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?

benoitf commented 2 years ago

if there is a custom .che/che-editor.yaml then no need to add ?che-editor parameter

framar89 commented 2 years ago

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?

benoitf commented 2 years ago

@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

framar89 commented 2 years ago

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

benoitf commented 2 years ago

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

framar89 commented 2 years ago

Unfortunately it won't fix the issue. I still get "Could not retrieve mainUrl for the running workspace"

framar89 commented 2 years ago

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.

framar89 commented 2 years ago

Now it works! Thank you for your suggestions

benoitf commented 2 years ago

ah cool , thanks for keeping me updated

framar89 commented 2 years ago

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#?my-custom-environment-variable=value that is automatically mapped as environment variable of the IDE container?

benoitf commented 2 years ago

no, it's not possible to add new environment variables though queries (only inside the devfile)

framar89 commented 2 years ago

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?