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

Include Java Language Support in Camel K stack #16018

Closed
apupier opened this issue Feb 13, 2020 · 17 comments
Closed

Include Java Language Support in Camel K stack #16018

apupier opened this issue Feb 13, 2020 · 17 comments
Assignees
Labels
area/samples kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system. status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage.

Comments

@apupier
Copy link
Contributor

apupier commented Feb 13, 2020

Is your enhancement related to a problem? Please describe

it is possible to use standalone Java files for Camel K. having the Java Language Server will allow to have a good Java Language support for standalone Java files for Camel K.

Describe the solution you'd like

  • include Java language support 0.55+ in Camel K stack

Describe alternatives you've considered

Additional context

  • version 0.55.1 is required (and now available Update Java extensions to latest che-plugin-registry#376)
  • memory needs to be looked at to have it working on che.openshift.io
    • max available: 3G
    • xml: default: 768Mi --> might be reduced to 256Mi
    • camel-k: default 1G
    • Java: default: 1.5G
  • VS Code Java extension needs to access files downloaded in VS Code Camel K global storage filesystem
  • at activation VS Code Camel K is downloading some dependencies, it will be nice to have them already downloaded in the image
@apupier apupier added the kind/enhancement A feature request - must adhere to the feature request template. label Feb 13, 2020
@apupier apupier self-assigned this Feb 13, 2020
@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 Feb 13, 2020
apupier added a commit to apupier/che-devfile-registry that referenced this issue Feb 13, 2020
@apupier
Copy link
Contributor Author

apupier commented Feb 13, 2020

VS Code Java extension needs to access files downloaded in VS Code Camel K global storage filesystem

seems there is no clean solution available currently to handle that.

  • modify Java AND Camel K meta.yaml file to mount /home/theia/.theia/globalStorage/redhat.vscode-camelk/
    • it implies some Camel K code in Java plugin...
    • we might go for mounting /home/theia/.theia/globalStorage/ and consider that it is generic to all possible VS Code extension integrations?
    • the content will be cleared on each restart of the workspace :-(
  • include Java in Camel K base image (which is already based on Kubernetes one)
    • we are loosing all composability and isolation
  • another one???

second issue: seems the jar dependencies are not downloaded. it is creating the subfolder /home/theia/.theia/globalStorage/redhat.vscode-camelk/ava-dependencies-3.0.0 but it stays empty (seen no error so far, to be investigated)

@tsmaeder tsmaeder added severity/blocker Causes system to crash and be non-recoverable or prevents Che developers from working on Che code. severity/P1 Has a major impact to usage or development of the system. area/languages Issues related to Language extensions or plugins integration. and removed severity/blocker Causes system to crash and be non-recoverable or prevents Che developers from working on Che code. status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Feb 13, 2020
@apupier
Copy link
Contributor Author

apupier commented Feb 13, 2020

I tried to use volumes on both plugins (java and Camel K), the mounted folder is empty in Java container.
To try this case:

metadata:
  name: apache-camel-k-secondtry
projects:
  - name: camel-k-examples
    source:
      location: 'https://github.com/apache/camel-k'
      type: git
      sparseCheckoutDir: examples
components:
  - id: redhat/vscode-xml/latest
    memoryLimit: 150Mi
    type: chePlugin
  - id: redhat/vscode-apache-camel/latest
    type: chePlugin
  - type: chePlugin
    reference: >-
      https://raw.githubusercontent.com/apupier/che-plugin-registry/16018-shareVSCodeGlobalStorage/v3/plugins/redhat/vscode-camelk/0.0.12/meta.yaml
    alias: vscode-camelk
  - type: chePlugin
    reference: >-
      https://raw.githubusercontent.com/apupier/che-plugin-registry/16018-shareVSCodeGlobalStorage/v3/plugins/redhat/java/0.55.1/meta.yaml
apiVersion: 1.0.0

@apupier
Copy link
Contributor Author

apupier commented Feb 17, 2020

depends on #13318

@tsmaeder tsmaeder added the status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage. label Feb 19, 2020
@apupier apupier removed their assignment Apr 14, 2020
apupier added a commit to apupier/che-plugin-registry that referenced this issue May 11, 2020
it is required for VS Code Camel K support of Camel Java standalone
files.

Signed-off-by: Aurélien Pupier <[email protected]>
@apupier apupier self-assigned this May 11, 2020
@apupier
Copy link
Contributor Author

apupier commented May 11, 2020

Given that volumes can now be shared ta plugin levels. This shouldn't be blocked anymore.
Tried with newer Che.
Updated branch for newer available Java and Camel K plugins.

current state:

  • shared volumes seems to work fine (tried to create manually a file in one container, it is visible in the other one
  • the setting provided by VS Code Camel K is wrong, it contains 2 times the /home/theia and i was also expecting it in globalstorage:
{
    "java.project.referencedLibraries": [
        "lib/**/*.jar",
        "/home/theia/home/theia/redhat.vscode-camelk/java-dependencies-3.0.1/*.jar"
    ]
}
  • the VS Code Camel K extension is not able to download the dependencies:
    *
ERROR:Remote plugin in vscode-camelkmtj: promise rejection is not handled in two seconds: Error: spawn mvn ENOENT
ERROR:Remote plugin in vscode-camelkmtj: promise rejection stack trace: Error: spawn mvn ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  • as it is supposed to rely on Maven wrapper, i don't understand why mvn cannot be found. mvn is required
  • maybe not worthy to investigate too much and provide the mvn binary in the sidecar, it will be faster
  • mounting the .m2 migth be a good idea too
  • providing the defautl jar binaries in sidecar image will allow faster first time completion access.

apupier added a commit to apupier/che-plugin-registry that referenced this issue May 13, 2020
apupier added a commit to apupier/che-plugin-registry that referenced this issue May 13, 2020
the VS Code globalstorage implementation in Che is inside this strange
path '/home/theia/home/theia'

Signed-off-by: Aurélien Pupier <[email protected]>
@apupier
Copy link
Contributor Author

apupier commented May 13, 2020

sharing global storage (which is is at a strange /home/theia/home/theia place) in both extensions and providing Maven and Java in VS Code Camel K container does most of the trick:

Screenshot from 2020-05-13 12-04-39

to test, devfile:

metadata:
  name: apache-camel-k-with-sharedvolumes
projects:
  - name: camel-k-examples
    source:
      location: 'https://github.com/apache/camel-k'
      type: git
      sparseCheckoutDir: examples
components:
  - id: redhat/vscode-xml/latest
    memoryLimit: 150Mi
    type: chePlugin
  - id: redhat/vscode-apache-camel/latest
    type: chePlugin
  - type: chePlugin
    reference: >-
      https://raw.githubusercontent.com/apupier/che-plugin-registry/16018-shareVSCodeGlobalStorage-withmavensidecar/v3/plugins/redhat/vscode-camelk/0.0.13/meta.yaml
    alias: vscode-camelk
  - type: chePlugin
    reference: >-
      https://raw.githubusercontent.com/apupier/che-plugin-registry/16018-shareVSCodeGlobalStorage-withmavensidecar/v3/plugins/redhat/java/0.57.0/meta.yaml
apiVersion: 1.0.0

content of the pointed branches:

apiVersion: v2
publisher: redhat
name: vscode-camelk
version: 0.0.13
type: VS Code extension
displayName: Tooling for Apache Camel K
title: Tooling for Apache Camel K
description: Support for Apache Camel K functionality
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
repository: https://github.com/camel-tooling/vscode-camelk
category: Language
firstPublicationDate: '2020-03-24'
spec:
  containers:
  - image: "apupier/che-sidecar-camelk:0.0.13-withmaven"
    name: vscode-camelk
    memoryLimit: "1G"
    volumes:
      - mountPath: "/home/theia/home/theia"
        name: vscodeglobalstorage
  extensions:
  - https://download.jboss.org/jbosstools/vscode/stable/vscode-camelk/vscode-camelk-0.0.13-403.vsix
  - https://download.jboss.org/jbosstools/vscode/3rdparty/vscode-kubernetes-tools/vscode-kubernetes-tools-1.1.0.vsix
  - https://github.com/redhat-developer/vscode-yaml/releases/download/0.7.2/redhat.vscode-yaml-0.7.2.vsix
apiVersion: v2
publisher: redhat
name: java
version: 0.57.0
type: VS Code extension
displayName: Language Support for Java 8
title: Language Support for Java(TM) by Red Hat
description: Java Linting, Intellisense, formatting, refactoring, Maven/Gradle support and more...
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
repository: https://github.com/redhat-developer/vscode-java
category: Language
firstPublicationDate: "2020-02-20"
spec:
  containers:
    - image: "quay.io/eclipse/che-sidecar-java:8-0cfbacb"
      name: vscode-java
      memoryLimit: "1500Mi"
      volumes:
      - mountPath: "/home/theia/.m2"
        name: m2
      - mountPath: "/home/theia/home/theia"
        name: vscodeglobalstorage
  extensions:
    - https://download.jboss.org/jbosstools/vscode/3rdparty/vscode-java-debug/vscode-java-debug-0.24.0.vsix
    - https://download.jboss.org/jbosstools/static/jdt.ls/stable/java-0.57.0-2029.vsix

content of the DockerFile for the sidecar:

FROM quay.io/eclipse/che-sidecar-kubernetes-tooling:1.1.0-24dc4a3

ENV MAVEN_VERSION 3.6.3
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
  && curl -fsSL -o /tmp/apache-maven.tar.gz https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
  && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
  && rm -f /tmp/apache-maven.tar.gz \
  && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
ENV MAVEN_HOME /usr/share/maven

RUN dnf -y update && \
    dnf -y install java-11-openjdk && \
    dnf clean all;

ENV KAMEL_VERSION 1.0.0-RC2
RUN curl -L https://github.com/apache/camel-k/releases/download/${KAMEL_VERSION}/camel-k-client-${KAMEL_VERSION}-linux-64bit.tar.gz | tar -C /usr/local/bin -xz \
    && chmod +x /usr/local/bin/kamel

identified issues/improvements/questions:

  • is it fine to share the global storage in VS Code Java extension? (I think yes but need to be accepted by VS Code Java plugin maintainers)
  • should we change the global storage place to have a more meaningful name than /home/theia/home/theia?
  • several Java errors reported on some examples provided by default:
  • providing the defautl jar binaries in sidecar image will allow faster first time completion access.
  • is there easier way to have mvn and Java in the DockerFile?

@apupier
Copy link
Contributor Author

apupier commented Jul 15, 2020

maybe worth another try activating the "async storage" fetaure #16972

@che-bot
Copy link
Contributor

che-bot commented Jan 20, 2021

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 20, 2021
@apupier
Copy link
Contributor Author

apupier commented Jan 20, 2021

/remove-lifecycle stale

@che-bot che-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 20, 2021
@che-bot
Copy link
Contributor

che-bot commented Jul 19, 2021

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 19, 2021
@apupier
Copy link
Contributor Author

apupier commented Jul 19, 2021

/remove-lifecycle stale

@apupier apupier removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 19, 2021
@che-bot
Copy link
Contributor

che-bot commented Jan 15, 2022

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 15, 2022
@svor
Copy link
Contributor

svor commented Jan 21, 2022

/remove-lifecycle stale

@che-bot che-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 21, 2022
@che-bot
Copy link
Contributor

che-bot commented Jul 20, 2022

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 20, 2022
@svor
Copy link
Contributor

svor commented Jul 20, 2022

/remove-lifecycle stale

@che-bot che-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 20, 2022
@che-bot
Copy link
Contributor

che-bot commented Jan 16, 2023

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 16, 2023
@svor svor removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 16, 2023
@l0rd l0rd added area/samples and removed area/languages Issues related to Language extensions or plugins integration. labels Jan 30, 2023
@che-bot
Copy link
Contributor

che-bot commented Jul 29, 2023

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 29, 2023
@svor svor removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 2, 2023
@che-bot
Copy link
Contributor

che-bot commented Jan 29, 2024

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 29, 2024
@che-bot che-bot closed this as completed Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/samples kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system. status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage.
Projects
None yet
Development

No branches or pull requests

5 participants