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

Why does che override the container entrypoint in a devfile on Red Hat Dev Spaces #22182

Closed
Charleeboyle opened this issue Apr 27, 2023 · 6 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@Charleeboyle
Copy link

Charleeboyle commented Apr 27, 2023

Summary

I am trying to migrate from RedHat Code Ready Workspaces (CRW) to Red Hat Dev Spaces. Our existing devfile for CRW does not work in Dev Spaces because Che is contributing many different fields to the devfile upon creation of the workspace.

The following attributes are added to the devfile:

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

The part causing the most confusion is this entrypoint command which is added to the container component of the devfile:

command:
        - /checode/entrypoint-volume.sh

From reading the devfile.io documentation, the command field modifies the entrypoint command of the container created from the image, and if not specified, the entrypoint from the provided image is used.

We provide a custom image for this container component, therefore when Che adds these fields into the devfile, the container does not start as intended. When this entrypoint command is removed from the devfile after the workspace is created, by editing the devfile, our container will start as intended, but then the workspace does not open.

What is the purpose of these Che contributions ? I notice that these are added to the "Empty Workspace" sample also.

Relevant information

The devfile we want to use:

schemaVersion: 2.1.0
metadata:
  name: sample-workspace
projects:
  - name: sample
    git:
      checkoutFrom:
        revision: main
      remotes:
        origin: < git repo containing our project source >
components:
    - name: ui
      container:
        image: < web application image which is hosted on the 9080 port>
        memoryLimit: 4927M
        mountSources: true
        endpoints:
          - name: ui
            targetPort: 9080
            exposure: public
            protocol: http

We are aiming for a workspace which opens our project source, and runs the specified image in a container ui, exposing it on the defined endpoint.

Our image entrypoint is being overridden when the workspace is created

command:
        - /checode/entrypoint-volume.sh

Do we need two container components in our devfile? One which will host the workspace, and one which will run our custom image?

@Charleeboyle Charleeboyle added the kind/question Questions that haven't been identified as being feature requests or bugs. label Apr 27, 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 Apr 27, 2023
@Charleeboyle Charleeboyle changed the title Why does che override the container entrypoint in devfile Why does che override the container entrypoint in a devfile on Red Hat Dev Spaces Apr 27, 2023
@RomanNikitenko
Copy link
Member

RomanNikitenko commented Apr 27, 2023

Hello, @Charleeboyle
About
image

I have no info about version you are using, but recently the corresponding part was reworked: https://github.com/eclipse-che/che-plugin-registry/pull/1566/files

So, it should be possible to start IDE on the post-start event, the entrypoint should not be overridden.

@Charleeboyle
Copy link
Author

Charleeboyle commented Apr 27, 2023

Hi @RomanNikitenko thanks for the speedy response.

Currently we are using the devspacesoperator.v3.5.0 as part of the registry.redhat.io/redhat/redhat-operator-index:v4.12 catalog source.

I wonder if our version does not include those changes in the PR

@RomanNikitenko
Copy link
Member

The changes will be available within 3.6 version

@amisevsk amisevsk removed the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Apr 28, 2023
@Charleeboyle
Copy link
Author

Is there a timeline for the 3.6 release ?

@RomanNikitenko
Copy link
Member

May 17 is date of the 3.6 release if I'm not mistaken.
The new version should be available here when the release is done.

@Charleeboyle
Copy link
Author

This issue was resolved in version 3.6. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

No branches or pull requests

4 participants