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-19954] Add the vertx extension/subsystem from wildfly-vertx-feature-pack to WildFly Preview Feature Pack #665

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

gaol
Copy link
Contributor

@gaol gaol commented Nov 20, 2024

Fixes #662

@github-actions github-actions bot added the stability-level/preview "Preview" stability level label Nov 20, 2024
@gaol
Copy link
Contributor Author

gaol commented Nov 20, 2024

@kabir @jasondlee @fl4via may I ask you to review ? thanks :)

N/A

== Implementation Plan
The {wildfly_vertx_feature_pack_with_link} repository is hosted under wildfly-extras github organization. It contains the source codes for all subsystem functionalities, unit tests and integration tests, including the tests on the vertx subsystem management model operations.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the goal of this effort to move the sources from the external FP into the WF source tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the source code will stay in the external FP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a consideration of moving it to WildFly codebase in the future when it becomes mature enough and has a higher stability level.

There is no Vertx instance set up by default, users need to do it explicitly like:
[source,shell]
----
/subsystem=vertx/vertx=vertx:add()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jasondlee @kabir Do you see any options that we need to stay using the default ones ?

I am not sure if the following options should be updated by users or not:

  • disableTCCL - defaults to false, so a context will be associated to the TCCL when it was created.
  • useDaemonThread - defaults to false, so all Vertx threads are not daemons.

Also do you see some system properties that we need to set before constructing the Vertx instance in microprofile-opentelemetry and microprofile-reactive-messaging subsystem ?

One example I see coming from opentelemetry subsystem[1]:

        // We need to disable vertx's DNS resolver as it causes failures under k8s
        if (System.getProperty(VERTX_DISABLE_DNS_RESOLVER) == null) {
            System.setProperty(VERTX_DISABLE_DNS_RESOLVER, "true");
        }

[1] https://github.com/wildfly/wildfly/blob/34.0.0.Final/observability/opentelemetry/src/main/java/org/wildfly/extension/opentelemetry/OpenTelemetrySubsystemRegistrar.java#L184

Copy link
Contributor

Choose a reason for hiding this comment

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

At least for reactive messaging I'm not setting any properties in WildFly. I don't know if any are set internally in SmallRye RM. I guess not since when running in Quarkus they use the Vert.X instance provided by Quarkus

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if the following options should be updated by users or not:

Those sound like properties that I'm not sure we'd want users managing inside an application server, but I could be wrong.

One example I see coming from opentelemetry subsystem[1]:

That's kind of an ugly hack that we had to put in because vertx did not (and may still not. I haven't looked) provide an API to set. I don't know if setting that property in opentelemetry will affect the vertx instance from the FP. I'd be surprised if it's set in time, given the module system lifecycle, etc., so we might either need to make that a configurable option, or just add that to the FP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we should keep the 2 options(disableTCCL, useDaemonThread) untouched by users, and open only when there are explicit demands to configure them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because vertx did not (and may still not. I haven't looked) provide an API to set ...
so we might either need to make that a configurable option, or just add that to the FP.

I don't see any API either to set, so probably be good to add that to the FP as well before a Vertx instance is constructed so that it takes effect.

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

Choose a reason for hiding this comment

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

I vote for keeping those options untouched for now. We can always add later


The demand comes from https://github.com/smallrye/smallrye-reactive-messaging/discussions/2725[a discussion in smallrye-reactive-messaging] to ask the capability to configure the vertx options used in the microprofile-reactive-messaging subsystem, and there is a {wildfly_vertx_feature_pack_with_link} ready to fulfill, integrate it to WildFly should satisfy the requirement.

The goal of the {wildfly_vertx_feature_pack_with_link} is to be the central place to provide the Vertx instance within WildFly server for other subsystems which may need it, example subsystems are https://github.com/wildfly/wildfly/tree/main/microprofile/telemetry-smallrye[microprofile-telemetry] and https://github.com/wildfly/wildfly/tree/main/microprofile/reactive-messaging-smallrye[microprofile-reactive-messaging].
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth pointing out that these currently create their own vertx instances (and I think it is actually worse, since at least RM will create one per deployment). Advice from the VertX team is to have only one shared instance

|===
^| Field Name ^| Data Type ^| Source Class ^| Resource Attribute Name ^| Note

| hostsPath | String | {address_resolver_options_with_link} | hosts-path | the path to the alternate hosts configuration file
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the contents of this file?

For domain mode, it might be problematic to have things in external files. It might be better to make this part of the management model, and have the subsystem create some kind of temp file which then is passed in to vertx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The content is something like what is inside /etc/hosts in Linux. The hostsValue is the alternative which contains the content in String. So maybe we can just support hostsValue.

@gaol gaol force-pushed the issues_662_vertx_feature_pack branch from 60f5ca6 to 381c0df Compare November 22, 2024 04:52
@github-actions github-actions bot added stability-level/preview "Preview" stability level and removed stability-level/preview "Preview" stability level labels Nov 22, 2024
@gaol
Copy link
Contributor Author

gaol commented Nov 22, 2024

Thank you for the feedback, main updates were done:

  • Mention that we will consider moving the code to WildFly code base in the future
  • Make disableTCCL and useDaemonThread not configurable via vertx subsystem (users still can do via system property though)
  • Add the setting of vertx.disableDnsResolver system property in the vertx subsystem
  • Make the default value of fileCacheDir to ${jboss.server.temp.dir}/vertx-cache
  • Do not configure hostsPath, use only the alternative hostsValue for the AddressResolverOptions
  • Remove the function of configuring the VertxOptions from a JSON file, as it may lead to some options that are not listed above get configured which may be confusing.

promoted-by:
---

= Integrate wildfly-vertx-feature-pack to WildFly Preview
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a small comment about terminology here, WildFly Preview is itself a feature pack - is this proposal more about adding the Vert.x subsystem / extension to the WildFly Preview Feature Pack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is. I thought WildFly Preview is a different distribution, so Adding the vertx subsystem / extension to the WildFly Preview Feature Pack would be more accurate, will update it. :)

@gaol gaol force-pushed the issues_662_vertx_feature_pack branch from 381c0df to 4a43c58 Compare December 3, 2024 13:25
@github-actions github-actions bot added stability-level/preview "Preview" stability level and removed stability-level/preview "Preview" stability level labels Dec 3, 2024
@gaol gaol changed the title [WFLY-19954] Add the wildfly-vertx-feature-pack to WildFly Preview [WFLY-19954] Add the vertx extension/subsystem from wildfly-vertx-feature-pack to WildFly Preview Feature Pack Dec 3, 2024
Copy link
Contributor

@kabir kabir left a comment

Choose a reason for hiding this comment

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

Some small suggestions but apart from that I think it looks good.
Mention/pong me when fixed since somehow I don’t get any notifications in this repository


The demand comes from https://github.com/smallrye/smallrye-reactive-messaging/discussions/2725[a discussion in smallrye-reactive-messaging] to ask the capability to configure the vertx options used in the microprofile-reactive-messaging subsystem, and there is a {wildfly_vertx_feature_pack_with_link} ready to fulfill, integrate it to WildFly should satisfy the requirement.

The goal of the {wildfly_vertx_feature_pack_with_link} is to be the central place to provide the Vertx instance within WildFly server for other subsystems which may need it, example subsystems are https://github.com/wildfly/wildfly/tree/main/microprofile/telemetry-smallrye[microprofile-telemetry] and https://github.com/wildfly/wildfly/tree/main/microprofile/reactive-messaging-smallrye[microprofile-reactive-messaging]. Currently, they create their own vertx instances(microprofile-reactive-messaging creates one per deployment). Advice from the VertX team is to have only one shared instance for everything.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be a space before "(microprofile-reactive-messaging creates one per deployment)"

* [ ] QE

=== Affected Projects or Components
* https://github.com/wildfly/wildfly
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it could be good to add the feature pack repository here?

@gaol gaol force-pushed the issues_662_vertx_feature_pack branch from 4a43c58 to 4113ccc Compare December 5, 2024 01:25
@github-actions github-actions bot added stability-level/preview "Preview" stability level and removed stability-level/preview "Preview" stability level labels Dec 5, 2024
@gaol
Copy link
Contributor Author

gaol commented Dec 5, 2024

Thank you @fl4via and @kabir for the reviews and feedback, I updated accordingly. :)

| classPathResolvingEnabled | boolean | {filesystem_options_with_link} | classpath-resolving-enabled | whether classpath resolving is enabled
| fileCachingEnabled | boolean | {filesystem_options_with_link} | file-cache-enabled | whether file caching is enabled for class path resolving
| fileCacheDir | String | {filesystem_options_with_link} | file-cache-dir | file cache directory, defaults to `${jboss.server.temp.dir}/vertx-cache`
| addressResolverOptions | AddressResolverOptions | {vertx_options_with_link} | address-resolver-option | reference to the AddressResolverOptions name
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think should block integration at 'preview' stability, but for 'community' we should consider changing all these attributes to follow the WildFly style.

s/eventLoopSize/event-loop-size

etc

AFAIK there are no deviations from this style in subsystem's that ship in WildFly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, good point. But I agree on changing for the next version

| searchDomains | List<String> | {address_resolver_options_with_link} | search-domains | the list of search domains
| ndots | int | {address_resolver_options_with_link} | n-dots | the ndots value
| rotateServers | boolean | {address_resolver_options_with_link} | rotate-servers | if the dns server selection uses round-robin
| roundRobinInetAddress | boolean | {address_resolver_options_with_link} | round-robin-inet-address | if the inet address selection uses round-robin
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above re the attribute names in a 'community' stability variant:

s/hostsValue/hosts-value

@darranl darranl merged commit f093382 into wildfly:main Dec 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stability-level/preview "Preview" stability level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the vertx extension/subsystem from wildfly-vertx-feature-pack to WildFly Preview Feature Pack
6 participants