Che: How to add custom editor image to Che?

Created on 2 May 2020  路  3Comments  路  Source: eclipse/che

I have been trying to use the vs-code-bazel extension in my Che workspace, which requires the Buildifier and Bazel runtime executables to be installed:

https://github.com/bazelbuild/vscode-bazel

So I created a new docker image based on: 'quay.io/eclipse/che-java11-maven:7.10.0' and use that as a chePlugin dev container.

However, after I installed the bazel extension it was actually, I suspect, the Theia-IDE container that needs to have the bazel executables installed! So in my workspace, the maven container was working fine, I could execute the bazel runtime, but none of the bazel extension features work.

The hosted-instance-log showed this:

Extension-Host:With stack trace: Error: Command failed: /usr/bin/buildifier --format=json --mode=check --type=build --lint=warn
/bin/sh: /usr/bin/buildifier: not found

Then I realised that the executables are used in another container. I am guessing that's the Theia IDE one, but not 100% sure.

So then I thought I could try to create a new image based on 'quay.io/eclipse/che-theia:7.11.0' and added the bazel installation on the Dockerfile. I have the image available but I don't know where to upload it in order for me to switch to this editor in Che!!

I did try and see if I can add it to the Stacks but there isn't a "Add Stack" button anywhere. I thought I could add it to the devfile using

components

  • type: cheEditor

but it doesn't like the "image" tag...

Could anyone help please?

Thank you!

kinquestion

Most helpful comment

@InterestedInTechAndCake

To use own docker image for editor I made the following:

- type: cheEditor
  alias: theia-editor
  reference: https://raw.githubusercontent.com/RomanNikitenko/che-plugin-registry/master/v3/plugins/eclipse/che-theia/next/meta.yaml
  memoryLimit: 2Gi

It works for me!

All 3 comments

@InterestedInTechAndCake

To use own docker image for editor I made the following:

- type: cheEditor
  alias: theia-editor
  reference: https://raw.githubusercontent.com/RomanNikitenko/che-plugin-registry/master/v3/plugins/eclipse/che-theia/next/meta.yaml
  memoryLimit: 2Gi

It works for me!

@InterestedInTechAndCake is that the extension is running in a separate container with your image ?
Could you share your devfile

@RomanNikitenko Thank you very much!! That worked like a charm :-)

@benoitf The extension (presumably you meant the vscode-bazel) runs inside the che-plugin-registry, I didn't run it as a sidecar or separate container. This is the devfile:

apiVersion: 1.0.0
metadata:
name: wksp-xxxx
components:

  • id: redhat/java11/latest
    type: chePlugin
  • mountSources: true
    memoryLimit: 2048Mi
    type: dockerimage
    volumes:

    • name: m2

      containerPath: /home/user/.m2

      alias: maven

      image: 'quay.io/eclipse/che-java11-maven:7.11.0'

      env:

    • value: ''

      name: MAVEN_CONFIG

    • value: >-

      -XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10

      -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4

      -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true

      -Xms20m -Djava.security.egd=file:/dev/./urandom -Duser.home=/home/user

      name: MAVEN_OPTS

    • value: >-

      -XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10

      -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4

      -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true

      -Xms20m -Djava.security.egd=file:/dev/./urandom

      name: JAVA_OPTS

    • value: >-

      -XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10

      -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4

      -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true

      -Xms20m -Djava.security.egd=file:/dev/./urandom

      name: JAVA_TOOL_OPTIONS

  • id: ms-vscode/bazel/latest
    type: chePlugin
Was this page helpful?
0 / 5 - 0 ratings

Related issues

redeagle84 picture redeagle84  路  3Comments

JamesDrummond picture JamesDrummond  路  3Comments

AndrienkoAleksandr picture AndrienkoAleksandr  路  3Comments

apupier picture apupier  路  3Comments

Ohrimenko1988 picture Ohrimenko1988  路  3Comments