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

Add Java Web devfiles #18

Merged
merged 10 commits into from
Jul 16, 2019
Merged

Conversation

sleshchenko
Copy link
Member

@sleshchenko sleshchenko commented Jun 19, 2019

What does this PR do?

This PR adds the following samples devfiles:

stack sample
✔️ java-spring-web https://github.com/che-samples/web-java-spring.git
✔️ java-vertx https://github.com/vert-x3/vertx-examples
✔️ java-mysql https://github.com/che-samples/web-java-spring-petclinic

Notes:

  • initially java-postgresql was requested but we do not have (and did not find easily) Java + PostgreSQL sample, and was decided to replace it with stack that we used to have JAVA + MYSQL
  • Initially, sample from https://github.com/vert-x3/vertx-examples was requested but Devfile do not support keepDirectory feature and it was decided to use our old https://github.com/che-samples/web-java-vertx. Also, note that verx container is not provided but an application is run via Spring Boot in jdk container. I tried to use it but that sample has some compatibility issues. It can be improved later and I'll create an issue for that.

What issues does this PR fix or reference?

eclipse-che/che#13529

@sleshchenko sleshchenko self-assigned this Jun 19, 2019
@sleshchenko sleshchenko changed the title Add java-web-spring devfile Add Java Web devfiles Jun 20, 2019
@sleshchenko sleshchenko marked this pull request as ready for review June 20, 2019 13:51
@sleshchenko sleshchenko requested a review from l0rd June 20, 2019 13:52
@sleshchenko
Copy link
Member Author

@l0rd Please take a look on left notes in PR description and let me know if you're with the decision that I've made for Verx devfile.

@sleshchenko sleshchenko requested a review from slemeur June 20, 2019 13:52
@l0rd
Copy link
Contributor

l0rd commented Jun 20, 2019

@sleshchenko what do you mean with compatibility issue?

@sleshchenko
Copy link
Member Author

Vetx cannot find spring related classes in classpath even when I specified -fat.jar to be used for classpath.

@sleshchenko
Copy link
Member Author

@l0rd ^

@l0rd
Copy link
Contributor

l0rd commented Jun 25, 2019

As discussed yesterday we want to improve those stacks (eventually in a separate PR):

  • Java MySQL: Use the official spring petclinic sample (without tomcat)
  • Vertx: use a git submodule in our sample for something like the vert.x Simple REST microservice

Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
@l0rd
Copy link
Contributor

l0rd commented Jul 3, 2019

cc @ibuziuk

@l0rd l0rd requested a review from ibuziuk July 3, 2019 14:38
and clean up the devfile a bit.

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
discoverable: "true"
public: "false"
mountSources: false
commands:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say command to run server in debug mode is missed.

SPRING_DATASOURCE_URL=jdbc:mysql://db/petclinic SPRING_DATASOURCE_USERNAME=petclinic SPRING_DATASOURCE_PASSWORD=password java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044 -jar target/*.jar  --spring.profile.active=mysql

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. It's a nice way to improve this and other java stacks, I'm going to merge as is and create a separate issue to improve it. I think except Debug it also needs command to stop the application, because probably user starts his app, sees that something is wrong, stops app and rerun it in debug mode.

Copy link
Contributor

@tolusha tolusha left a comment

Choose a reason for hiding this comment

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

See my comments.

@tolusha
Copy link
Contributor

tolusha commented Jul 10, 2019

Since @sleshchenko is on PTO I can recreate a PR with my changes.
@l0rd wdyt?

@sparkoo
Copy link
Member

sparkoo commented Jul 10, 2019

This looks like clone is broken. According to doc (https://redhat-developer.github.io/devfile/devfile#projects), when no clonePath defined, project name should be used as clone folder. However, here project is cloned to spring-petclinic, which is wrong. Looks like it's related to eclipse-che/che#13796, see eclipse-che/che#13796 (comment) comment. Some path is not set properly in Theia.

@sparkoo
Copy link
Member

sparkoo commented Jul 10, 2019

also when I set the clonePath to java-web-spring/, project is cloned to java-web-spring/spring-petclinic. If I set it to java-web-spring, it has no effect. So this doesn't solve the issue here.

Copy link
Member

@sparkoo sparkoo left a comment

Choose a reason for hiding this comment

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

After fix of eclipse-che/che#13796, all these Java samples works for me. I would just rename them and rewrite descriptions a bit. My suggestions in commens in the code.

devfiles/java-mysql/meta.yaml Outdated Show resolved Hide resolved
devfiles/java-mysql/meta.yaml Outdated Show resolved Hide resolved
devfiles/java-web-spring/meta.yaml Outdated Show resolved Hide resolved
devfiles/java-web-spring/meta.yaml Outdated Show resolved Hide resolved
devfiles/java-web-vertx/meta.yaml Outdated Show resolved Hide resolved
devfiles/java-web-vertx/meta.yaml Outdated Show resolved Hide resolved
Signed-off-by: Michal Vala <mvala@redhat.com>
@sparkoo
Copy link
Member

sparkoo commented Jul 15, 2019

@tolusha can you please re-review?

sparkoo and others added 2 commits July 15, 2019 14:02
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
@sleshchenko sleshchenko merged commit 93bcd2e into eclipse-che:master Jul 16, 2019
@sleshchenko sleshchenko deleted the moreJavaDevfiles branch July 16, 2019 08:43
nickboldt pushed a commit to nickboldt/che-devfile-registry that referenced this pull request Aug 9, 2019
This commits contains devfile for:
* Java Spring Boot
* Java with Spring Boot and MySQL
* Java Vert.x

Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
monaka added a commit that referenced this pull request Feb 1, 2020
Ohrimenko1988 added a commit that referenced this pull request May 21, 2020
Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>
Ohrimenko1988 added a commit that referenced this pull request Jun 1, 2020
Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>
sparkoo pushed a commit to sparkoo/che-devfile-registry that referenced this pull request Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants