konveyor / kantra

A CLI that unifies analysis and transformation capabilities of Konveyor
Apache License 2.0
6 stars 21 forks source link

[Feature] Support for Analyzing Multiple Inputs Applications Together #180

Open kthatipally opened 3 months ago

kthatipally commented 3 months ago

Kantra currently can't analyze input multiple applications at once. Adding this feature would let users analyze several projects together, using the same settings and producing combined reports similar to how Windup supports analyzing multiple applications simultaneously. This change would save time, ensure consistency, and give better insights.

konveyor-ci-bot[bot] commented 3 months ago

This issue is currently awaiting triage. If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance. The triage/accepted label can be added by org members.

aufi commented 3 months ago

Let's clarify the CLI arguments for multiple applications analysis, assuming this is not Hub-related, but pure kantra CLI solution. Windup looks to use --input option [1] that could be file or a directory, is it the right way to allow use multiple --input as an array or applications?

[1] https://access.redhat.com/documentation/en-us/red_hat_jboss_migration_toolkit/2.4/html-single/windup_user_guide/index#command-line-arguments

brunoborges commented 2 months ago

@aufi I think that the main benefit here for having multiple apps, is so that we have a static report generated with multiple apps as part of the assessment.

This is particularly useful for microservices, or even larger systems deployed as a handful of deployable units, all part of the same "business application". This will give the end user a single report with all the analysis in a single report.

Now, whether --input can receive a list of inputs (e.g., --input my app.jar,myotherappsource/,someotherapp.jar) or requiring one --input for each input (e.g. --input myapp.jar --input otherapp.jar --input sourcefolder/), I think that's up to the engineering team to decide. Both options are scriptable.

aufi commented 2 weeks ago

PR was merged, docs/usage: https://github.com/konveyor/kantra?tab=readme-ov-file#analyze-multiple-applications

aufi commented 2 weeks ago

Related paragraph from kantra readme:

Analyze multiple applications

By design, kantra supports single application analysis per kantra command execution. However, it is possible use --bulk option for executing multiple kantra analyze commands with different applications to get an output directory and static-report populated with all applications analysis reports.

Example:

kantra analyze --bulk --input=<path/to/source/A> --output=<path/to/output/ABC>
kantra analyze --bulk --input=<path/to/source/B> --output=<path/to/output/ABC>
kantra analyze --bulk --input=<path/to/source/C> --output=<path/to/output/ABC>
rromannissen commented 2 weeks ago

@aufi I don't understand how that example relates to what @brunoborges was asking for. Could you elaborate further how would that work if I want to analyze applications A, B and C and get the reports for the three of them merged together?

brunoborges commented 2 weeks ago

I think the implementation is almost there.

But instead of calling kantra three times with the --bulk parameter, the --input parameter should allow multiple inputs, either by comma separated list, or by adding multiple --input

aufi commented 2 weeks ago

Thank you for comment Ramon and Bruno, adding some description what lead us to focus on little different way to getting static report including multiple applications analyses. If the proposed --bulk option would not satisfy you use-case, let's discuss it.

Initialy requested command like below would introduce issues with different input applications technologies, output directory structure incompatible with single application analysis, unexpectable running time before returning the report and our aim move such use-cases primary to use Hub-based Konveyor installation.

kantra analyze --input A --input B --input C --output=<path/to/output/ABC>
# or
kantra analyze --input A,B,C --output=<path/to/output/ABC>

The --bulk option allows to run applications analysis (single application per kantra call), but put results of multiple application analyses into a single static report (when pointing to the same output directory and it doesn't make assumptions about applications technologies/languages, sources, targets, etc.

It is true that there was also nearly working PR with initialy requested functionality (currently broken by multiprovider changes and replaced by the multiple inputs with --bulk option), but it could be refreshed and completed.

This discussion probably should involve also @pranavgaikwad and @shawn-hurley (when they're available).

aufi commented 2 weeks ago

Example of currently proposed solution: A user have apps A, B and C in a directory path/to/source and wants analyze them with kantra.

In order to run analysis and get single static report covering all 3 applications A, B, C, commands below should be executed (kantra analyze with --bulk option to the same output directory)

kantra analyze --bulk --input=<path/to/source/A> --output=<path/to/output/ABC>
kantra analyze --bulk --input=<path/to/source/B> --output=<path/to/output/ABC>
kantra analyze --bulk --input=<path/to/source/C> --output=<path/to/output/ABC>
aufi commented 2 weeks ago

I should have mentioned one more option we agreed at some point with dev-colleagues and that was not use multiple input fields (or list of applications), but add --input-bin-dir option to analyze all applications within the directory. (implentation not finished yet)

Example command:

# E.g. have applications A.war, B.war, C.ear in directory ./apps and want analyze them to get single static report covering all 3 applications
kantra analyze --input-bin-dir=./apps --output=<path/to/output>
aufi commented 1 week ago

Let me summarize current state. There is merged&built upstream solution/workaround combining multiple application analyses into single static report with --bulk option.

To fulfil request from this RFE, we might discuss if real multiple --input options and/or --input-bin-dir options support will be implemented too. Let's talk about it on regular bi-weekly call.