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

[WFCORE-6206] Installation Manager integration #5420

Merged
merged 24 commits into from May 30, 2023

Conversation

yersan
Copy link
Collaborator

@yersan yersan commented Mar 23, 2023

@yersan yersan added Feature This PR adds a new feature to WildFly missing-reqs This PR is missing external requirements before it can be merged labels Mar 23, 2023
@github-actions github-actions bot added the deps-changed Dependencies have been checked, and there are changes highlighted in a comment label Mar 23, 2023
@github-actions
Copy link

github-actions bot commented Mar 23, 2023

Dependency Tree Analyzer Output:

New Dependencies:

  • org.wildfly.core:wildfly-installation-manager:jar:21.0.0.Beta1-SNAPSHOT:compile
  • org.wildfly.installation-manager:installation-manager-api:jar:1.0.1.Final:compile

CC @wildfly/prod

@marekkopecky
Copy link
Contributor

marekkopecky commented Mar 28, 2023

Hi @yersan , thank you for this MR! I'm checking this MR and trying to use https://github.com/wildfly-extras/creaper for calling the installer CLI command. Creaper is using default CommandContext implementation (CommandContext cliContext = new CommandContextFactoryImpl().newCommandContext();) and it seems that CommandContext is not aware of new CLI installer command. I used org.wildfly.core:wildfly-installation-manager dependency for a client, but it seems that installer CLI command is not initialized here: https://github.com/yersan/wildfly-core/blob/WFCORE-6206/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java#L583 then "installer" CLI command is not recognized as CLI command here https://github.com/yersan/wildfly-core/blob/WFCORE-6206/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java#L1722 and then CommandContext try to handle "installer" command as DMR command, which is not possible and client failed here: https://github.com/yersan/wildfly-core/blob/WFCORE-6206/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java#L1766

Do you please have any experiences with this or do you know how to tweak CLI client to be able to use your new installer CLI command? Maybe that I just missed to configure something. Or maybe that CommandContextImpl needs to be updated in this MR?

@wildfly wildfly deleted a comment from wildfly-ci Mar 28, 2023
@wildfly wildfly deleted a comment from wildfly-ci Mar 28, 2023
@wildfly wildfly deleted a comment from wildfly-ci Mar 28, 2023
@wildfly wildfly deleted a comment from wildfly-ci Mar 28, 2023
@wildfly wildfly deleted a comment from wildfly-ci Mar 28, 2023
@yersan
Copy link
Collaborator Author

yersan commented Mar 28, 2023

Requires wildfly/wildfly#16652 (in order to be able to run the full integration tests)

@marekkopecky
Copy link
Contributor

marekkopecky commented Mar 28, 2023

@yersan Thank you for your feedback! But I'm not sure, which mvn dependency from wildfly/wildfly#16652 should I (and customers) use in standalone client in order to get rid of previous issue. Can you please be more specific? Generally other CLI commands initiated here works, but new installer command doesn't.

@yersan
Copy link
Collaborator Author

yersan commented Mar 28, 2023

Hi @marekkopecky , I have no experience with creaper, but the Installation Manager command is loaded as an extra handler via a ServiceLoader. The entry point is here: https://github.com/yersan/wildfly-core/blob/WFCORE-6206/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java#L688.

Its integration is similar to the Patch tool, so if you see the patch tool you should see the Installation Manager as well. However, you have to take into account that the tool is activated only if the management resource is available.
You can check if in your server installation, you can see the following management resource:

[/host=*]/core-service=installer

There are two key points to see the installation manager integrated, one for the integration into the standard management operations and the other to see it available as a high-level command. The latter requires the former.

  1. To see it as a management Operation: At boot time the server has to be able to find an implementation of the installation manager SPI. The code uses a ServiceLoader to find available implementations. The ServiceLoader uses the org.wildfly.installation-manager.api JBoss Modules module to find any available implementation of InstallationManager interface. This implementation is expected to be supplied by a JBoss Modules module named "org.jboss.prospero"

  2. To have the tool available as a CLI Command: It also uses a ServiceLoader facility to load implementations of org.aesh.command.Command. As commented before, the entry point to load the command is here: https://github.com/yersan/wildfly-core/blob/WFCORE-6206/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java#L688. These services are made visible to the CLI module here: https://github.com/yersan/wildfly-core/blob/WFCORE-6206/core-feature-pack/common/src/main/resources/modules/system/layers/base/org/jboss/as/cli/main/module.xml#L67. Then if the command is available, the activator could be hiding it if there is no resource available at [/host=*]/core-service=installation-manager

Let me know if those explanations helps you to discover the issue with creaper, otherwise I can also try your scenario to find the root cause.

@yersan
Copy link
Collaborator Author

yersan commented Mar 28, 2023

Thank you for your feedback! But I'm not sure, which mvn dependency from wildfly/wildfly#16652 should I (and customers) use in standalone client in order to get rid of #5420 (comment). Can you please be more specific? Generally other CLI commands initiated here works, but new installer command doesn't.

We crossed comments, my comment about the requires was unrelated to your question. I hope the previous explanation clarifies your doubts, basically, if the management operations are available, the CLI must find the implementation of org.aesh.command.Command which is supplied by org.wildfly.installation-manager JBoss Modules module, so you need to have the org.wildfly.core:wildfly-installation-manager artifact visible to creaper

@marekkopecky
Copy link
Contributor

marekkopecky commented Mar 28, 2023

@yersan Thank you for your feedback. Generally

  • Creaper is not important here, it just call CommandContext from wf-core
  • Management operations are available (ls /core-service=installer works properly)

To have the tool available as a CLI Command: It also uses a ServiceLoader facility to load implementations of org.aesh.command.Command

The tricky thing is, that installer command is not a CLI command, but Aesh command. I guess that the reason for it is interactive mode there. Anyway, as you said, this is the same like old patch command. The consequences are that CommandContext#buildRequest(command) can't be used, but CommandContext#handle(command) can.

Thank you for your explanation, it directed me to proper solution!

@yersan yersan marked this pull request as ready for review March 30, 2023 08:32
@yersan
Copy link
Collaborator Author

yersan commented Apr 5, 2023

Rebased to fix conflicts

@yersan
Copy link
Collaborator Author

yersan commented Apr 14, 2023

Rebased to get the latest changes

@wildfly wildfly deleted a comment from wildfly-ci Apr 14, 2023
@wildfly wildfly deleted a comment from wildfly-ci Apr 14, 2023
@wildfly wildfly deleted a comment from wildfly-ci Apr 14, 2023
@wildfly wildfly deleted a comment from wildfly-ci Apr 17, 2023
@wildfly wildfly deleted a comment from wildfly-ci Apr 17, 2023
@wildfly wildfly deleted a comment from wildfly-ci Apr 17, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 22, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 23, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 23, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 23, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 23, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 24, 2023
@yersan yersan added the affects_i18n PR affects internationalize text label May 24, 2023
@yersan yersan mentioned this pull request May 25, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 26, 2023
@wildfly wildfly deleted a comment from wildfly-ci May 26, 2023
@darranl darranl removed the missing-reqs This PR is missing external requirements before it can be merged label May 26, 2023
@bstansberry bstansberry merged commit 6a573bd into wildfly:main May 30, 2023
6 of 12 checks passed
@yersan yersan deleted the WFCORE-6206 branch July 4, 2023 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
21.0.0.Beta1 affects_i18n PR affects internationalize text deps-changed Dependencies have been checked, and there are changes highlighted in a comment Feature This PR adds a new feature to WildFly
Projects
None yet
7 participants