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

DevWorkspace Template does not contain editor-runtime-description component #21971

Closed
RomanNikitenko opened this issue Jan 31, 2023 · 3 comments
Labels
area/devworkspace-operator kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach

Comments

@RomanNikitenko
Copy link
Member

RomanNikitenko commented Jan 31, 2023

Describe the bug

There is a possibility to describe a component related to an editor, like che-code-runtime-description. But the component is absent in the DevWorkspace template. It looks like it filtered out by the dashboard.
It leads to unexpected behaviour/errors at a workspace starting for some use cases. For example, user defines a command which is bound to the component. At starting the workspace there is an error that the container component with name che-code-runtime-description not found.

Che version

7.60@latest

Steps to reproduce

Start a workspace using this link.

Expected behavior

che-code-runtime-description component should be present in the DevWorkspace Template.

Screenshots

image

Additional context

I tested it on the dogfooding instance.

@RomanNikitenko RomanNikitenko added the kind/bug Outline of a bug - must adhere to the bug report template. label Jan 31, 2023
@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 Jan 31, 2023
@RomanNikitenko
Copy link
Member Author

RomanNikitenko commented Jan 31, 2023

It might be helpful: #21879 (comment)

@AObuchow AObuchow added status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach severity/P1 Has a major impact to usage or development of the system. area/devworkspace-operator and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Jan 31, 2023
@AObuchow
Copy link

For some reason, in my testing, the workspace was able to start up, but with some weird behaviour:

  • The DevWorkspace is missing the che-code-runtime-description component
  • When opening an editor, the following error message pops up (even if you refresh the page):
    image

Here is the DevFile:

schemaVersion: 2.1.0
metadata:
  name: quarkus-api-example-demo-jl9v
  namespace: aobuchow-che-1cac83
attributes:
  controller.devfile.io/devworkspace-config:
    name: devworkspace-config
    namespace: dogfooding
  controller.devfile.io/scc: container-build
  controller.devfile.io/storage-type: ephemeral
projects:
  - git:
      remotes:
        origin: 'https://github.com/l0rd/quarkus-api-example.git'
    name: quarkus-api-example
components:
  - attributes:
      che-code.eclipse.org/contribute-cpuLimit: true
      che-code.eclipse.org/contribute-cpuRequest: true
      che-code.eclipse.org/contribute-endpoint/che-code: 3100
      che-code.eclipse.org/contribute-endpoint/code-redirect-1: 13131
      che-code.eclipse.org/contribute-endpoint/code-redirect-2: 13132
      che-code.eclipse.org/contribute-endpoint/code-redirect-3: 13133
      che-code.eclipse.org/contribute-entry-point: true
      che-code.eclipse.org/contribute-memoryLimit: true
      che-code.eclipse.org/contribute-memoryRequest: true
      che-code.eclipse.org/contribute-volume-mount/checode: /checode
      che-code.eclipse.org/contributed-container: tools
      che-code.eclipse.org/original-cpuLimit: 1500m
      che-code.eclipse.org/original-memoryLimit: 6G
    container:
      command:
        - /checode/entrypoint-volume.sh
      cpuLimit: 2000m
      cpuRequest: 30m
      endpoints:
        - exposure: none
          name: debug
          protocol: tcp
          targetPort: 5005
        - exposure: none
          name: test
          protocol: tcp
          targetPort: 1593
        - exposure: public
          name: list-all-food
          path: /food
          protocol: http
          targetPort: 8080
        - attributes:
            contributed-by: che-code.eclipse.org
            cookiesAuthEnabled: true
            discoverable: false
            type: main
            urlRewriteSupported: true
          exposure: public
          name: che-code
          path: '?tkn=eclipse-che'
          protocol: https
          secure: false
          targetPort: 3100
        - attributes:
            contributed-by: che-code.eclipse.org
            discoverable: false
            urlRewriteSupported: false
          exposure: public
          name: code-redirect-1
          protocol: http
          targetPort: 13131
        - attributes:
            contributed-by: che-code.eclipse.org
            discoverable: false
            urlRewriteSupported: false
          exposure: public
          name: code-redirect-2
          protocol: http
          targetPort: 13132
        - attributes:
            contributed-by: che-code.eclipse.org
            discoverable: false
            urlRewriteSupported: false
          exposure: public
          name: code-redirect-3
          protocol: http
          targetPort: 13133
      env:
        - name: QUARKUS_HTTP_HOST
          value: 0.0.0.0
        - name: CHE_DASHBOARD_URL
          value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com'
        - name: CHE_PLUGIN_REGISTRY_URL
          value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/plugin-registry/v3'
        - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
          value: 'http://plugin-registry.dogfooding.svc:8080/v3'
        - name: OPENVSX_REGISTRY_URL
          value: 'https://open-vsx.org'
      image: 'quay.io/devfile/universal-developer-image:ubi8-latest'
      memoryLimit: 7.07G
      memoryRequest: 256Mi
      mountSources: true
      sourceMapping: /projects
      volumeMounts:
        - name: checode
          path: /checode
    name: tools
  - container:
      args:
        - '-f'
        - /dev/null
      command:
        - tail
      env:
        - name: CHE_DASHBOARD_URL
          value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com'
        - name: CHE_PLUGIN_REGISTRY_URL
          value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/plugin-registry/v3'
        - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
          value: 'http://plugin-registry.dogfooding.svc:8080/v3'
        - name: OPENVSX_REGISTRY_URL
          value: 'https://open-vsx.org'
      image: registry.access.redhat.com/ubi8/ubi-minimal
      memoryLimit: 64M
      mountSources: true
      sourceMapping: /projects
    name: ubi-minimal
  - container:
      env:
        - name: POSTGRESQL_USER
          value: user
        - name: POSTGRESQL_PASSWORD
          value: password
        - name: POSTGRESQL_DATABASE
          value: food_db
        - name: PGDATA
          value: /tmp/pgdata
        - name: CHE_DASHBOARD_URL
          value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com'
        - name: CHE_PLUGIN_REGISTRY_URL
          value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/plugin-registry/v3'
        - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
          value: 'http://plugin-registry.dogfooding.svc:8080/v3'
        - name: OPENVSX_REGISTRY_URL
          value: 'https://open-vsx.org'
      image: 'quay.io/centos7/postgresql-13-centos7@sha256:994f5c622e2913bda1c4a7fa3b0c7e7f75e7caa3ac66ff1ed70ccfe65c40dd75'
      sourceMapping: /projects
    name: postgresql
commands:
  - exec:
      commandLine: ./mvnw clean package -DskipTests=true -Dquarkus.profile=staging
      component: tools
      group:
        isDefault: true
        kind: build
      label: Package
      workingDir: '${PROJECT_SOURCE}'
    id: package
  - exec:
      commandLine: ./mvnw test
      component: tools
      group:
        kind: test
      label: Run tests
      workingDir: '${PROJECT_SOURCE}'
    id: runtests
  - exec:
      commandLine: ./mvnw package -Dnative -Dmaven.test.skip -Dquarkus.native.native-image-xmx=3G  -Dquarkus.profile=staging
      component: tools
      group:
        kind: build
      label: Package Native
      workingDir: '${PROJECT_SOURCE}'
    id: packagenative
  - exec:
      commandLine: |
        IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/quarkus-api-example
        podman build -f src/main/docker/Dockerfile.jvm -t "${IMAGE}" .
      component: tools
      group:
        kind: build
      label: Build Image
      workingDir: '${PROJECT_SOURCE}'
    id: buildimage
  - exec:
      commandLine: |
        # Requires `oc policy add-role-to-user registry-editor <user_name>`
        IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/quarkus-api-example
        podman login --tls-verify=false -u $(oc whoami) -p $(oc whoami -t) image-registry.openshift-image-registry.svc:5000
        podman push --tls-verify=false "${IMAGE}"
      component: tools
      group:
        kind: build
      label: Push Image
      workingDir: '${PROJECT_SOURCE}'
    id: pushimage
  - exec:
      commandLine: './mvnw compile quarkus:dev'
      component: tools
      group:
        isDefault: true
        kind: run
      label: Start Development mode (Hot reload + debug)
      workingDir: '${PROJECT_SOURCE}'
    id: startdev
  - exec:
      commandLine: ./quarkus-api-example-1.0.0-SNAPSHOT-runner
      component: ubi-minimal
      group:
        kind: run
      label: Start Native
      workingDir: '${PROJECT_SOURCE}/target'
    id: startnative

Here is the DevWorkspace:

apiVersion: workspace.devfile.io/v1alpha2
metadata:
  annotations:
    che.eclipse.org/che-editor: che-incubator/che-code/insiders
    che.eclipse.org/devfile-source: |
      scm:
        repo: 'https://github.com/l0rd/quarkus-api-example.git'
        fileName: devfile.yaml
      factory:
        params: 'url=https://github.com/l0rd/quarkus-api-example'
    che.eclipse.org/last-updated-timestamp: '2023-01-31T16:39:54.159Z'
    controller.devfile.io/started-at: '1675183206290'
    controller.devfile.io/timing.components.created: '1675183194254'
    controller.devfile.io/timing.components.duration: 45 ms
    controller.devfile.io/timing.components.ready: '1675183194299'
    controller.devfile.io/timing.deployment.created: '1675183194976'
    controller.devfile.io/timing.deployment.duration: 7072 ms
    controller.devfile.io/timing.deployment.ready: '1675183202048'
    controller.devfile.io/timing.duration: 12004 ms
    controller.devfile.io/timing.healthchecks.duration: 4210 ms
    controller.devfile.io/timing.ready: '1675183206258'
    controller.devfile.io/timing.routing.created: '1675183194501'
    controller.devfile.io/timing.routing.duration: 315 ms
    controller.devfile.io/timing.routing.ready: '1675183194816'
    controller.devfile.io/timing.started: '1675183194254'
  creationTimestamp: '2023-01-31T16:39:50Z'
  finalizers:
    - rbac.controller.devfile.io
  generation: 4
  labels:
    controller.devfile.io/creator: edfb6fae-d79d-4910-b1f6-0be5d2ce51e4
  managedFields:
  (...)
  name: quarkus-api-example-demo-jl9v
  namespace: aobuchow-che-1cac83
  resourceVersion: '1148007924'
  uid: c208b070-0e71-479a-9659-217915bc1af7
kind: DevWorkspace
spec:
  contributions:
    - kubernetes:
        name: che-code-workspacec208b0700e71479a
        namespace: aobuchow-che-1cac83
      name: che-code-workspacec208b0700e71479a
  routingClass: che
  started: true
  template:
    attributes:
      controller.devfile.io/devworkspace-config:
        name: devworkspace-config
        namespace: dogfooding
      controller.devfile.io/scc: container-build
      controller.devfile.io/storage-type: ephemeral
      dw.metadata.annotations:
        che.eclipse.org/che-editor: che-incubator/che-code/insiders
        che.eclipse.org/devfile-source: |
          scm:
            repo: 'https://github.com/l0rd/quarkus-api-example.git'
            fileName: devfile.yaml
          factory:
            params: 'url=https://github.com/l0rd/quarkus-api-example'
        che.eclipse.org/last-updated-timestamp: '2023-01-31T16:39:50.396Z'
    projects:
      - git:
          remotes:
            origin: 'https://github.com/l0rd/quarkus-api-example.git'
        name: quarkus-api-example
    components:
      - attributes:
          che-code.eclipse.org/contribute-cpuLimit: true
          che-code.eclipse.org/contribute-cpuRequest: true
          che-code.eclipse.org/contribute-endpoint/che-code: 3100
          che-code.eclipse.org/contribute-endpoint/code-redirect-1: 13131
          che-code.eclipse.org/contribute-endpoint/code-redirect-2: 13132
          che-code.eclipse.org/contribute-endpoint/code-redirect-3: 13133
          che-code.eclipse.org/contribute-entry-point: true
          che-code.eclipse.org/contribute-memoryLimit: true
          che-code.eclipse.org/contribute-memoryRequest: true
          che-code.eclipse.org/contribute-volume-mount/checode: /checode
          che-code.eclipse.org/contributed-container: tools
          che-code.eclipse.org/original-cpuLimit: 1500m
          che-code.eclipse.org/original-memoryLimit: 6G
        container:
          command:
            - /checode/entrypoint-volume.sh
          cpuLimit: 2000m
          cpuRequest: 30m
          endpoints:
            - exposure: none
              name: debug
              protocol: tcp
              targetPort: 5005
            - exposure: none
              name: test
              protocol: tcp
              targetPort: 1593
            - exposure: public
              name: list-all-food
              path: /food
              protocol: http
              targetPort: 8080
            - attributes:
                contributed-by: che-code.eclipse.org
                cookiesAuthEnabled: true
                discoverable: false
                type: main
                urlRewriteSupported: true
              exposure: public
              name: che-code
              path: '?tkn=eclipse-che'
              protocol: https
              secure: false
              targetPort: 3100
            - attributes:
                contributed-by: che-code.eclipse.org
                discoverable: false
                urlRewriteSupported: false
              exposure: public
              name: code-redirect-1
              protocol: http
              targetPort: 13131
            - attributes:
                contributed-by: che-code.eclipse.org
                discoverable: false
                urlRewriteSupported: false
              exposure: public
              name: code-redirect-2
              protocol: http
              targetPort: 13132
            - attributes:
                contributed-by: che-code.eclipse.org
                discoverable: false
                urlRewriteSupported: false
              exposure: public
              name: code-redirect-3
              protocol: http
              targetPort: 13133
          env:
            - name: QUARKUS_HTTP_HOST
              value: 0.0.0.0
            - name: CHE_DASHBOARD_URL
              value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com'
            - name: CHE_PLUGIN_REGISTRY_URL
              value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/plugin-registry/v3'
            - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
              value: 'http://plugin-registry.dogfooding.svc:8080/v3'
            - name: OPENVSX_REGISTRY_URL
              value: 'https://open-vsx.org'
          image: 'quay.io/devfile/universal-developer-image:ubi8-latest'
          memoryLimit: 7.07G
          memoryRequest: 256Mi
          mountSources: true
          sourceMapping: /projects
          volumeMounts:
            - name: checode
              path: /checode
        name: tools
      - container:
          args:
            - '-f'
            - /dev/null
          command:
            - tail
          env:
            - name: CHE_DASHBOARD_URL
              value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com'
            - name: CHE_PLUGIN_REGISTRY_URL
              value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/plugin-registry/v3'
            - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
              value: 'http://plugin-registry.dogfooding.svc:8080/v3'
            - name: OPENVSX_REGISTRY_URL
              value: 'https://open-vsx.org'
          image: registry.access.redhat.com/ubi8/ubi-minimal
          memoryLimit: 64M
          mountSources: true
          sourceMapping: /projects
        name: ubi-minimal
      - container:
          env:
            - name: POSTGRESQL_USER
              value: user
            - name: POSTGRESQL_PASSWORD
              value: password
            - name: POSTGRESQL_DATABASE
              value: food_db
            - name: PGDATA
              value: /tmp/pgdata
            - name: CHE_DASHBOARD_URL
              value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com'
            - name: CHE_PLUGIN_REGISTRY_URL
              value: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/plugin-registry/v3'
            - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
              value: 'http://plugin-registry.dogfooding.svc:8080/v3'
            - name: OPENVSX_REGISTRY_URL
              value: 'https://open-vsx.org'
          image: 'quay.io/centos7/postgresql-13-centos7@sha256:994f5c622e2913bda1c4a7fa3b0c7e7f75e7caa3ac66ff1ed70ccfe65c40dd75'
          sourceMapping: /projects
        name: postgresql
    commands:
      - exec:
          commandLine: ./mvnw clean package -DskipTests=true -Dquarkus.profile=staging
          component: tools
          group:
            isDefault: true
            kind: build
          label: Package
          workingDir: '${PROJECT_SOURCE}'
        id: package
      - exec:
          commandLine: ./mvnw test
          component: tools
          group:
            kind: test
          label: Run tests
          workingDir: '${PROJECT_SOURCE}'
        id: runtests
      - exec:
          commandLine: ./mvnw package -Dnative -Dmaven.test.skip -Dquarkus.native.native-image-xmx=3G  -Dquarkus.profile=staging
          component: tools
          group:
            kind: build
          label: Package Native
          workingDir: '${PROJECT_SOURCE}'
        id: packagenative
      - exec:
          commandLine: |
            IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/quarkus-api-example
            podman build -f src/main/docker/Dockerfile.jvm -t "${IMAGE}" .
          component: tools
          group:
            kind: build
          label: Build Image
          workingDir: '${PROJECT_SOURCE}'
        id: buildimage
      - exec:
          commandLine: |
            # Requires `oc policy add-role-to-user registry-editor <user_name>`
            IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/quarkus-api-example
            podman login --tls-verify=false -u $(oc whoami) -p $(oc whoami -t) image-registry.openshift-image-registry.svc:5000
            podman push --tls-verify=false "${IMAGE}"
          component: tools
          group:
            kind: build
          label: Push Image
          workingDir: '${PROJECT_SOURCE}'
        id: pushimage
      - exec:
          commandLine: './mvnw compile quarkus:dev'
          component: tools
          group:
            isDefault: true
            kind: run
          label: Start Development mode (Hot reload + debug)
          workingDir: '${PROJECT_SOURCE}'
        id: startdev
      - exec:
          commandLine: ./quarkus-api-example-1.0.0-SNAPSHOT-runner
          component: ubi-minimal
          group:
            kind: run
          label: Start Native
          workingDir: '${PROJECT_SOURCE}/target'
        id: startnative
status:
  conditions:
    - lastTransitionTime: '2023-01-31T16:39:54Z'
      message: DevWorkspace is starting
      status: 'True'
      type: Started
    - lastTransitionTime: '2023-01-31T16:39:54Z'
      message: Resolved plugins and parents from DevWorkspace
      status: 'True'
      type: DevWorkspaceResolved
    - lastTransitionTime: '2023-01-31T16:39:54Z'
      message: Storage ready
      status: 'True'
      type: StorageReady
    - lastTransitionTime: '2023-01-31T16:39:54Z'
      message: Networking ready
      status: 'True'
      type: RoutingReady
    - lastTransitionTime: '2023-01-31T16:39:55Z'
      message: DevWorkspace serviceaccount ready
      status: 'True'
      type: ServiceAccountReady
    - lastTransitionTime: '2023-01-31T16:39:55Z'
      message: DevWorkspace secrets ready
      status: 'True'
      type: PullSecretsReady
    - lastTransitionTime: '2023-01-31T16:40:03Z'
      message: DevWorkspace deployment ready
      status: 'True'
      type: DeploymentReady
    - lastTransitionTime: '2023-01-31T16:40:06Z'
      status: 'True'
      type: Ready
  devworkspaceId: workspacec208b0700e71479a
  mainUrl: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/workspacec208b0700e71479a/tools/3100/?tkn=eclipse-che'
  message: 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/workspacec208b0700e71479a/tools/3100/?tkn=eclipse-che'
  phase: Running

I'm not sure, but I think the dashboard isin't processing the link correctly? i.e it doesn't seem to be applying the che-editor= URL parameter? My issue seems to be a separate issue however, and a seperate issue should be created (unless I'm making a mistake somewhere).

In regard to the information provided in #21879 (comment):
I did some debugging in DWO and the issue seems to be that, as a result of merging container contributions, the internal DevWorkspace used by DWO does not have the che-code-runtime-description component - it gets merged into the dev component (since the dev component is first container component, resulting in it getting selected as a container contribution target).

I'm not sure yet, but this seems to be a bug in DWO's container contribution mechanism: events that are tied to a component that is a container contribution should be re-associated to the container contribution target.

@amisevsk WDYT? Can I make a DWO bug for this?

@RomanNikitenko
Copy link
Member Author

Related issue: devfile/devworkspace-operator#1029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devworkspace-operator kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach
Projects
None yet
Development

No branches or pull requests

3 participants