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 XDS support to gRPC extension #29251

Merged
merged 1 commit into from
Jan 10, 2023
Merged

Add XDS support to gRPC extension #29251

merged 1 commit into from
Jan 10, 2023

Conversation

alesj
Copy link
Contributor

@alesj alesj commented Nov 14, 2022

This adds an initial XDS (proxyless) gRPC support (#28298 )

For the server side, one must explicitly enable XDS usage: quarkus.grpc.server.xds.enabled=true
For the client side, you either explicitly enable it - quarkus.grpc.clients.stub.xds.enabled=true, or you set a name resolver to xds (see example below).

New Vert.x gRPC is missing XDS support atm.

A new K8s based test(s) are added, which install Istio (a requirement) into K8s before running the tests.
(Istio == XDS Management server)
Some help will probably be needed for this to properly run on GH_Actions @iocanel @gsmet ^^

An example of XDS gRPC configuration:

# XDS
quarkus.grpc.server.xds.enabled=true
quarkus.grpc.server.port=30051

quarkus.grpc.clients.stub.name-resolver=xds
quarkus.grpc.clients.stub.host=localhost
quarkus.grpc.clients.stub.port=30051

@alesj alesj requested a review from cescoffier November 14, 2022 13:20
@quarkus-bot quarkus-bot bot added area/grpc gRPC area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure labels Nov 14, 2022
@cescoffier
Copy link
Member

@vietj here is the PR we discussed this morning.

@quarkus-bot

This comment has been minimized.

@alesj
Copy link
Contributor Author

alesj commented Nov 15, 2022

As mentioned, I would need some help on the GH_Actions ...
@cescoffier @iocanel ^^

@iocanel
Copy link
Contributor

iocanel commented Nov 15, 2022

As mentioned, I would need some help on the GH_Actions ... @cescoffier @iocanel ^^

I'll try to have a look at it later today!

@iocanel
Copy link
Contributor

iocanel commented Nov 17, 2022

One issue I see is that the istio integration tests run as part of pull request validation build, which should not be the case.
Checked out the pull request and verify that this is the case for local builds too.
What I found confusing is that the same thing happens to the existing kubernetes invoker tests (they run by default).
AFAIR, the intention was that any integration tests that required kubernetes/openshfit/knative etc would have to be explicitly enabled using a profile, but this doesn't seem to be the case. @gsmet: Do I remember correctly? Is there something I miss?

@iocanel
Copy link
Contributor

iocanel commented Nov 17, 2022

WIth a closer look, it seems that the offline-tests (default) will run but are expected to fail.
Not sure why this doesn't work in your case. It's like the invoker.buildResult is ignored for some reason.

Copy link
Member

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

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

The code looks ok, but the CI issue is annoying.
For now we can disable the tests but it would be very good to have a solution.

@cescoffier
Copy link
Member

BTW, we need a bit of doc about this feature.

@alesj
Copy link
Contributor Author

alesj commented Nov 28, 2022

BTW, we need a bit of doc about this feature.

The resources on xDS are pretty limited ...
Where should we put this doc(s)?

@cescoffier
Copy link
Member

I would add a link in grpc.adoc and create a new grpc-xds.adoc.

@iocanel
Copy link
Contributor

iocanel commented Nov 28, 2022

@alesj I had the chance to look at the tests again. I think that missing piece is the the context of invoker.buildResult=fasle. This means that it is expected that the invoker command fails. However, this does not include the verification script. The script must always pass.

So, I think that we just need to exclude the particular test from the offline tests. Simplest way is to just disable them.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

As for CI, I can help but there are multiple problems that need fixing and I'm not always sure what is the intent.

Native tests

All the native tests for gRPC are now failing with issues like:

Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:333)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:288)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedNewInstance(SharedGraphBuilderPhase.java:204)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4501)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4494)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5291)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)
	... 37 more

Istio IT

I see you added a workflow fine to run it on a schedule but I also see the IT is running in the regular JVM run.
Is it supposed to work in the regular JVM run?

What exactly are you trying to achieve here?

FWIW, the existing Kubernetes tests are built to not fail if pointing to a non-available Kubernetes server. @iocanel might be able to help you on this.

Another option would be to disable the test for a normal run and only run it nightly.

Update: I see @iocanel already pushed some information.

@cescoffier
Copy link
Member

@alesj any update about the documentation?

@alesj
Copy link
Contributor Author

alesj commented Dec 5, 2022

So, I think that we just need to exclude the particular test from the offline tests. Simplest way is to just disable them.

@iocanel how do I do that?

@gsmet feedback ...

All the native tests for gRPC are now failing with issues like ... Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing ...

Can this be fixed with some GraalVM "substitute" code ...?

Is it supposed to work in the regular JVM run?

Probably not, as it needs Istio, which it can only get via K8s ...

Another option would be to disable the test for a normal run and only run it nightly.

Sure.
(If you let me know how to do this ...)

any update about the documentation?

@cescoffier wip ... hoping to finish them asap

@quarkus-bot

This comment has been minimized.

@iocanel
Copy link
Contributor

iocanel commented Dec 12, 2022

So, I think that we just need to exclude the particular test from the offline tests. Simplest way is to just disable them.

@iocanel how do I do that?

I would do that using maven profiles along with some property to complely skip these tests when offline.

@gsmet
Copy link
Member

gsmet commented Dec 12, 2022

AFAICS, it's not something preexisting that is failing, it's the new stuff:

2022-12-12T02:30:46.1117701Z [INFO] --- maven-invoker-plugin:3.2.2:run (integration-tests) @ quarkus-integration-test-istio-invoker ---
2022-12-12T02:30:46.1244191Z [INFO] Building: xds-grpc/pom.xml
2022-12-12T02:30:48.6253935Z [INFO] [INFO] Scanning for projects...

I'll have a look at what you're doing exactly later today or tomorrow.

@gsmet
Copy link
Member

gsmet commented Dec 13, 2022

@alesj I pushed two small commits to deal with the CI issues when offline and adjust the issue number to report the status to. I think it should solve that particular CI issue.
I haven't tested the workflow though. I suppose you have tested it in your fork?

@alesj
Copy link
Contributor Author

alesj commented Dec 13, 2022 via email

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@alesj
Copy link
Contributor Author

alesj commented Dec 19, 2022

I haven't tested the workflow though. I suppose you have tested it in your fork?

@gsmet what do you mean by workflow here?
I tested the istio test(s) locally and it worked.
I also used the Quarkus build from this xds1 branch for my demo,
showcasing xDS, and it also worked.

@gsmet I also accidentally overrode your 2 commits,
but I think I got them both back, yet it's again failing with the same "istio" error ...

Any idea what did I miss?

@cescoffier ^^

@alesj
Copy link
Contributor Author

alesj commented Dec 19, 2022

Any idea what did I miss?

Ah, just saw that I missed deleting this line

<skipInvocation>${skipTests}</skipInvocation>

@quarkus-bot

This comment has been minimized.

@alesj alesj force-pushed the xds1 branch 4 times, most recently from 882169d to ca1fcd3 Compare January 5, 2023 14:27
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@cescoffier
Copy link
Member

@alesj can you rebase your PR on the latest main branch?

Add Istio support for XDS gRPC tests
Split xDS support into diff module - due to grpc-netty-shaded native issue
Port gsmet commits.
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 9, 2023

Failing Jobs - Building e27dc93

Status Name Step Failures Logs Raw logs
Devtools Tests - JDK 11 Build Failures Logs Raw logs
Devtools Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
Devtools Tests - JDK 17 Build Failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 17
✔️ JVM Tests - JDK 18
✔️ Maven Tests - JDK 11
Maven Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Devtools Tests - JDK 11 #

- Failing: integration-tests/devtools 

📦 integration-tests/devtools

io.quarkus.devtools.codestarts.quarkus.HibernateOrmCodestartTest.testContent line 23 - More details - Source on GitHub

java.lang.AssertionError: 
[Snapshot is not matching (use -Dsnap to update it automatically): HibernateOrmCodestartTest/testContent/src_main_kotlin_ilove_quark_us_MyKotlinEntity.kt] 
Path:

io.quarkus.devtools.codestarts.quarkus.HibernateOrmPanacheKotlinCodestartTest.testContent line 23 - More details - Source on GitHub

java.lang.AssertionError: 
[Snapshot is not matching (use -Dsnap to update it automatically): HibernateOrmPanacheKotlinCodestartTest/testContent/src_main_kotlin_ilove_quark_us_MyKotlinEntity.kt] 
Path:

⚙️ Devtools Tests - JDK 17 #

- Failing: integration-tests/devtools 

📦 integration-tests/devtools

io.quarkus.devtools.codestarts.quarkus.HibernateOrmCodestartTest.testContent line 23 - More details - Source on GitHub

java.lang.AssertionError: 
[Snapshot is not matching (use -Dsnap to update it automatically): HibernateOrmCodestartTest/testContent/src_main_kotlin_ilove_quark_us_MyKotlinEntity.kt] 
Path:

io.quarkus.devtools.codestarts.quarkus.HibernateOrmPanacheKotlinCodestartTest.testContent line 23 - More details - Source on GitHub

java.lang.AssertionError: 
[Snapshot is not matching (use -Dsnap to update it automatically): HibernateOrmPanacheKotlinCodestartTest/testContent/src_main_kotlin_ilove_quark_us_MyKotlinEntity.kt] 
Path:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/grpc gRPC area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure release/noteworthy-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants