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

WFLY-18383 Quickstart for MicroProfile LRA #778

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

xstefank
Copy link
Member

microprofile-lra/pom.xml Outdated Show resolved Hide resolved
link:https://github.com/eclipse/microprofile-lra[MicroProfile LRA specification] aims to provide an API that the
applications utilize to cooperate actions in
distributed
transactions based on the saga pattern. The user applications enlist within the LRA whicquickstart_microprofile-openapi_ci.ymlh in turn notifies all enlisted

Choose a reason for hiding this comment

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

within the LRA whicquickstart_microprofile-openapi_ci.ymlh

Suggested change
transactions based on the saga pattern. The user applications enlist within the LRA whicquickstart_microprofile-openapi_ci.ymlh in turn notifies all enlisted
transactions based on the saga pattern. The user applications enlist within the LRA which in turn notifies all enlisted

----
+

[[solution]]

Choose a reason for hiding this comment

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

It looks now a little bit odd:
image

Copy link
Contributor

Choose a reason for hiding this comment

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

that is probably due to the line 121 +

include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+1]

// Restore the {productName} Standalone Server Configuration
include::../shared-doc/restore-standalone-server-configuration.adoc[leveloffset=+1]

Choose a reason for hiding this comment

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

I think we need to include restore-standalone-server-configuration-manual.adoc in order to make the second link (see the screenshot) clickable as well.
image

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct, @xstefank please also add the following include, after that one:

// Restore the {productName} Standalone Server Configuration Manually
include::../shared-doc/restore-standalone-server-configuration-manual.adoc[leveloffset=+1]

----
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
----
Copy link

@zhantemirov zhantemirov Nov 28, 2023

Choose a reason for hiding this comment

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

There are no instructions regarding

<version.server>30.0.0.Final</version.server>
<version.bom.ee>${version.server}</version.bom.ee>
<version.bom.microprofile>${version.server}</version.bom.microprofile>
<version.plugin.wildfly>4.2.0.Final</version.plugin.wildfly>
<version.plugin.wildfly-jar>10.0.0.Final</version.plugin.wildfly-jar>
<version.cloud.fp>5.0.0.Final</version.cloud.fp>

Copy link
Contributor

@emmartins emmartins Nov 28, 2023

Choose a reason for hiding this comment

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

Agree.
PS: This is why I dislike "create from scratch" on readmes, those always have a hard time catching up with sources.

Copy link
Member Author

Choose a reason for hiding this comment

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

Less work for us, more investigations for the user/customer. I still think it's worth having step by step instructions.

Copy link
Member Author

Choose a reason for hiding this comment

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

For this we could also say copy the pom.xml from the QS but since the QS is not independent of the parent properties this is not possible.


NOTE: The `@Complete` and `@Compensate` methods don't need to be JAX-RS methods. See the specification for details.

Now we are already able to start our first LRA. You can deploy the application to the {productName} as demonstrated in

Choose a reason for hiding this comment

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

Unfortunately, we are not able. There is missing ParticipantResult.java code in the Readme

@@ -25,6 +25,11 @@ ifdef::reactive-messaging[]
<layer>cloud-server</layer>
<layer>h2-default-datasource</layer>
<layer>microprofile-reactive-messaging-kafka</layer>
endif::[]
ifdef::microprofile-lra[]
<layer>jaxrs-server</layer>

Choose a reason for hiding this comment

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

Redundant jaxrs-server layer:
image

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I would prefer to have here an abstract <layers>...<layers/>, which suits all and needs no maintenance. @zhantemirov @xstefank WDYT?

Choose a reason for hiding this comment

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

If it doesn't increase the server build time significantly, I'm OK with that change

Copy link
Contributor

Choose a reason for hiding this comment

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

I was actually referring to the docs only, replace the layers config in the XML snippet with what I proposed above. This would be done on all asciidocs having the plugins config showing up layers XML, for both wildfly and wildfly-jar.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no easy way to override this. Unfortunately for LRA and RM we need to have different layers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@emmartins emmartins Dec 4, 2023

Choose a reason for hiding this comment

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

In short, you can revert this and no worries with the layers config on READMEs, that should be gone soon.
Same for the changes for shared-doc/build-the-quickstart-for-openshift.adoc

<!-- The versions for the BOMs, Packs and Plugins -->
<version.bom.ee>${version.server}</version.bom.ee>
<version.bom.microprofile>${version.server}</version.bom.microprofile>
<version.pack.cloud>5.0.0.Final</version.pack.cloud>

Choose a reason for hiding this comment

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

Please rename it to <version.cloud.fp>5.0.0.Final</version.cloud.fp> in order to match https://github.com/wildfly/quickstart/blob/main/shared-doc/build-the-quickstart-for-openshift.adoc

Copy link
Contributor

@emmartins emmartins Nov 28, 2023

Choose a reason for hiding this comment

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

It should be instead fixed in the build-the-quickstart-for-openshift.adoc , this is the new common property name used since the enhancements

Copy link

@zhantemirov zhantemirov Nov 28, 2023

Choose a reason for hiding this comment

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

@emmartins should be then the <version>${version.wildfly.maven.plugin}</version> property dropped from the example openshift profile? It won't build once I copy it to my "create-from-scratch" project since we don't have this property defined.

Copy link
Contributor

@emmartins emmartins Nov 28, 2023

Choose a reason for hiding this comment

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

Yes, that element is not needed since we do pluginManagement of the version. I guess that we need pluginmanagement documented too... Either that or get ridden of the create from scratch part, which imho provides little value, specially considering soon we will have a guide for developing apps from scratch.

@zhantemirov
Copy link

@xstefank please consider adding some clauses to https://raw.githubusercontent.com/wildfly/quickstart/main/shared-doc/build-the-quickstart-for-openshift.adoc - the Readme instructions use wrong layers:

<layers>
    <layer>cloud-server</layer>
</layers>

instead of:

<layers>
     <layer>jaxrs-server</layer>
     <layer>microprofile-lra-coordinator</layer>
     <layer>microprofile-lra-participant</layer>
</layers>


== Conclusion

MicroProfile LRA provides a simple API for the distributed transactions based on the saga pattern. To use it

Choose a reason for hiding this comment

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

Suggested change
MicroProfile LRA provides a simple API for the distributed transactions based on the saga pattern. To use it
MicroProfile LRA provides a simple API for the distributed transactions based on the saga pattern. To use it on


MicroProfile LRA provides a simple API for the distributed transactions based on the saga pattern. To use it
{productName} we need to enable the appropriate extensions and subsystems for the LRA Coordinator (a service that
manages LRAs) and the LRA participant (client API). The LRAs are controlled trough annotations provided by the

Choose a reason for hiding this comment

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

Suggested change
manages LRAs) and the LRA participant (client API). The LRAs are controlled trough annotations provided by the
manages LRAs) and the LRA participant (client API). The LRAs are controlled through annotations provided by the

@@ -0,0 +1,6 @@
build:

Choose a reason for hiding this comment

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

Please rename this file to helm.yaml

@zhantemirov
Copy link

@xstefank while creating whole MP-lRA QS from the scratch, I ran into an issue while trying to build the openshift profile (I have all necessary Java classes and pom.xml changes):

mvn clean package -Popenshift
...
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:4.2.0.Final:package (default) on project microprofile-lra: No deployment found with name ROOT.war -> [Help 1]

The profile configuration should be equal to this, but I didn't succeed to make it work. Could you please have a look?

@zhantemirov
Copy link

@xstefank please have a look at OpenShift testing section:

  1. @emmartins I assume we must define empty {extra-openshift-test-arguments}, right? Because now it's unresolved in the Readme instructions.
  2. mvn verify -Pintegration-testing -Dserver.host=https://$(oc get route microprofile-lra --template='{{ .spec.host }}') ends up with failures:
[ERROR] Failures: 
[ERROR]   BasicRuntimeIT.testHTTPEndpointIsAvailable:48 expected:<200> but was:<500>
[ERROR]   MicroProfileLRAIT.testLRAExecutionFailure:95 expected:<[RESTEASY004655: Unable to invoke request: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]> but was:<[http://localhost:8080/lra-coordinator/lra-coordinator/0_ffff0a8204a0_-70b53f8e_65660971_5b]>
[ERROR]   MicroProfileLRAIT.testLRAExecutionSuccess:50 expected:<200> but was:<500>

The https://$(oc get route microprofile-lra --template='{{ .spec.host }}') resolves correctly, the tests are failing even when I'm passing a valid https URL of OpenShift deployment. I also have an imported OpenShift cluster SSL certificate, so this shouldn't be a cause of the issue.

@xstefank
Copy link
Member Author

@zhantemirov

1/ mvn clean package -Popenshift builds without issue. I don't know what could cause the error message you posted.

2/ I also verified on OpenShift sandbox mvn verify -Pintegration-testing -Dserver.host=https://$(oc get route microprofile-lra --template='{{ .spec.host }}') and it works all tests passing.

@xstefank xstefank force-pushed the lra-qs branch 2 times, most recently from 85c1755 to 8e3214c Compare November 29, 2023 12:16
@zhantemirov
Copy link

@xstefank

  • yes, I confirm that 2/ is now OK, there was some local issue - I tried it on an OpenShift sandbox and it works.

  • Ad 1/: it's still an issue when a user starts building app from a scratch (there is a missing WFLY parent dependency). @emmartins is it a valid use case when the user tries to add openshift profile content from Readme Building and running the quickstart application with OpenShift section to a newly created app's pom.xml (after all steps from Creating the Maven Project and so on) and run mvn clean package -Popenshift ? The instructions don't tell explicitly to use the completed example.

  • @emmartins I assume we must define empty {extra-openshift-test-arguments}, right? Because now it's unresolved in the Readme instructions.

  • we still need to adjust build-the-quickstart-for-openshift.adoc like it was said. @emmartins will that be adjusted in some follow-up PR?

Apart from that, it LGTM

@xstefank
Copy link
Member Author

xstefank commented Nov 30, 2023

1/ with the latest changes the version are there https://github.com/wildfly/quickstart/pull/778/files#diff-9473084512ad678e1593a36499d53db5eb7e5725ac6760364e4a139c1e67283aR188-R189 and https://github.com/wildfly/quickstart/pull/778/files#diff-a707e14145c2d812182a60503710696acb76495b0953320ad7add3834c865e78R38. So what's missing?

Add build-the-quickstart-for-openshift.adoc I can remove ${version.wildfly.maven.plugin} but I would leave this to @emmartins and follow up.

Overall, once you will have a guide to set up project, we should adjust all MP quickstart to include that and just change what they need so we can still keep instructions but leave out the project set up.

@zhantemirov
Copy link

@xstefank 1/ can you please send a screenshot, my browsers don't display me the lines you're trying to show. And it seems like you pasted the same link.

I mean when you're writing an app from a scratch and trying to copy-paste the openshift profile from Readme instructions (not from existing QS pom.xml), the mvn clean package -Popenshift fails with an error due to the fact that the pom.xml of newly created app misses WFLY parent definition. But as I said previously, I'm not sure whether it's a valid use case - trying to copy-paste openshift profile from Readme section, not from existing QS pom.xml. I'll wait for @emmartins reply.

@xstefank
Copy link
Member Author

xstefank commented Dec 1, 2023

@zhantemirov thanks, fixed the links. When you click the link, you need to manually open bigger number of changes files like README here, so just click load diff and you will be taken to the correct line.

@zhantemirov
Copy link

LGTM in terms of QS itself. Thank you, @xstefank

@emmartins please note that we still need to resolve things related to OpenShift instructions in some follow-up PRs, you can find my findings at my previous comments.

@emmartins
Copy link
Contributor

  1. I have fixed the openshift testing command at 673125a , please update+rebase this PR with main branch if you want to see the change
  2. Wrt the common/shared XML snippets of the maven plugins, I plan to rework and make those abstract on a separated JIRA https://issues.redhat.com/browse/WFLY-18819
  3. any README.adoc "local" XML snippet wrt "creating from scratch" should work after copy pasting, I see no point with having incomplete or inaccurate "create from scratch" instructions

@emmartins
Copy link
Contributor

@xstefank I now merged the changes to make the plugin XML snippets abstract to layers #796 , can you please rebase so we have a final look to see if all Sultan concerns are gone? Wrt the conflicts please note that you no longer need to change those common/shared doc sections.

@xstefank
Copy link
Member Author

xstefank commented Dec 6, 2023

@emmartins @zhantemirov rebased, please take a look

INFO [org.wildfly.quickstarts.microprofile.lra.LRAParticipant2] (default task-5) Compensating action for Participant 2 (http://localhost:8080/lra-coordinator/lra-coordinator/recoveryhttp%3A%2F%2Flocalhost%3A8080%2Flra-coordinator%2Flra-coordinator%2F0_ffff0aca949a_-4998614b_64e74427_38b/0_ffff0aca949a_-4998614b_64e74427_38f) in LRA http://localhost:8080/lra-coordinator/lra-coordinator/0_ffff0aca949a_-4998614b_64e74427_38b.
----

//Bootable JAR
Copy link
Contributor

Choose a reason for hiding this comment

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

@xstefank @zhantemirov this is optional but I believe a good change wrt user experience and our priorities... I think we should move this bootable jar section include, and the one after wrt to openshift, to https://github.com/wildfly/quickstart/pull/778/files#diff-9473084512ad678e1593a36499d53db5eb7e5725ac6760364e4a139c1e67283aR157 , ie to include those before the create-from-scratch instructions start. This change will put the bootable-jar and openshift at same level as baremetal, right now it kind of gives baremetal the spotlight, which is undesirable considering our priorities.

@xstefank
Copy link
Member Author

xstefank commented Dec 6, 2023

@emmartins @zhantemirov pushed the reordering

@emmartins emmartins merged commit 0ec2ef5 into wildfly:main Dec 6, 2023
20 checks passed
@emmartins
Copy link
Contributor

thank you :-)

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.

3 participants