Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

add lombok demo devfile #316

Closed
wants to merge 5 commits into from
Closed

Conversation

gattytto
Copy link
Contributor

Signed-off-by: Esteban Mañaricua [email protected]

Signed-off-by: Esteban Mañaricua <[email protected]>
Signed-off-by: Esteban Mañaricua <[email protected]>
@ericwill ericwill requested a review from sunix December 10, 2020 17:28
Signed-off-by: Esteban Mañaricua <[email protected]>
Signed-off-by: Esteban Mañaricua <[email protected]>
@sunix
Copy link
Contributor

sunix commented Dec 14, 2020

@gattytto I am giving a try right now

@sunix
Copy link
Contributor

sunix commented Dec 14, 2020

@gattytto so it is missing the plugin cool2k/vscode-lombok/latest in the plugin registry right ?

@sunix
Copy link
Contributor

sunix commented Dec 14, 2020

I guess this one: eclipse-che/che-plugin-registry#761

@gattytto
Copy link
Contributor Author

gattytto commented Dec 14, 2020

yes @sunix you can test it using this one, just edit pom.xml to use java11 instead of java8:

apiVersion: 1.0.0
metadata:
  name: Lombok
projects:
  - name: iot-core
    source:
      location: 'https://github.com/chuucks/LOMBOK-PROJECT-EXAMPLE'
      type: git
      branch: master
components:
  - id: redhat/java8/latest
    type: chePlugin
    volumes:
      - containerPath: /tmp/vscode-unpacked
        name: lombok-java-unpacked
    preferences:
      java.jdt.ls.vmargs: -javaagent:/tmp/vscode-unpacked/lombok.jar
  - type: chePlugin
    reference: >-
      https://raw.githubusercontent.com/gattytto/cheplugins/master/lombok/1.0.1/meta.yaml
    volumes:
      - containerPath: /tmp/vscode-unpacked
        name: lombok-java-unpacked
    alias: lombok
  - id: eclipse/che-theia/next
    type: cheEditor
  - type: dockerimage
    command:
      - sh
      - -c
    args:
      - until [ -d /tmp/vscode-unpacked/*lombok* ]; do sleep 1; done; cp $(find /tmp |grep lombok |grep jar) /tmp/vscode-unpacked/; sleep infinity
    alias: maven
    image: quay.io/eclipse/che-java8-maven:nightly
    env:
      - name: MAVEN_CONFIG
        value: >-
          -javaagent:/tmp/vscode-unpacked/lombok.jar -XX:MaxRAMPercentage=50.0
          -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
          -Duser.home=/home/user
      - name: JAVA_OPTS
        value: >-
          -XX:MaxRAMPercentage=50.0 -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: JAVA_TOOL_OPTIONS
        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
    memoryLimit: 512Mi
    mountSources: true
    volumes:
      - name: m2
        containerPath: /home/user/.m2
      - name: lombok-java-unpacked
        containerPath: /tmp/vscode-unpacked
    endpoints:
      - name: 8080/tcp
        port: 8080

projects:
- name: lombok-demo
source:
location: 'https://github.com/che-samples/lombok-demo.git'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This git repo is empty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id: cool2k/vscode-lombok/latest
volumes:
- containerPath: /tmp/vscode-unpacked
name: lombok-java-unpacked
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gattytto This looks tricky for the enduser to figure out what he needs to do to have the plugin working.
Why not making it in the same sidecar with Java extension like we do for Quarkus?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other option we could try: add the volume vscode-unpack to all the java based plugin.
and add

 preferences:
      java.jdt.ls.vmargs: -javaagent:/tmp/vscode-unpacked/lombok.jar

to the lombok meta.yaml (not sure it is possible)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunix
Copy link
Contributor

sunix commented Dec 16, 2020

For a nice demo (to be included in the Get Started sample), I would add a VSCode Didact tutorial like this one:

https://www.baeldung.com/intro-to-project-lombok

- sh
- -c
args:
- until [ -d /tmp/vscode-unpacked/*lombok* ]; do sleep 1; done; cp $(find /tmp |grep lombok |grep jar) /tmp/vscode-unpacked/; sleep infinity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that works but i don't think this is the right approach. It should be done by the Che plugin (entrypoint maybe ?)

@gattytto
Copy link
Contributor Author

gattytto commented Dec 16, 2020

@sunix maybe we can have a feature in plugins meta.yaml like "globalVolume" or "volumeForAll" to set up a folder that will be mounted in all CLI and sidecar containers (including theia's) to have files copied there. With that and settings from meta.yaml and a command in the meta.yaml that is run in the sidecar, we could have all this sorted out invisibly to the user.

I don't know about the current status of meta.yaml but it's easy to be able to just override the init command from the yaml and not having to put it in the sidecar .sh/Dockerfile.

command:
      - sh
      - -c
    args:
      - until [ -d /tmp/vscode-unpacked/*lombok* ]; do sleep 1; done; cp $(find /tmp |grep lombok |grep jar) /tmp/vscode-unpacked/; sleep infinity

@ericwill
Copy link
Contributor

I think this PR is stale now as we have added Lombok without the plugin. Let's close this PR and try again with the new approach.

@ericwill ericwill closed this Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants