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

Containerless Kantra Distribution for Java Analysis #196

Merged
merged 4 commits into from
Aug 26, 2024

Conversation

eemcmullan
Copy link
Contributor

Closes #188

@eemcmullan eemcmullan changed the title Containerless Kantra for Java Analysis Containerless Kantra Distribution for Java Analysis Aug 12, 2024
Signed-off-by: Emily McMullan <emcmulla@redhat.com>
Copy link
Contributor

@pranavgaikwad pranavgaikwad left a comment

Choose a reason for hiding this comment

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

I like the idea overall. I am requesting that we include all pre-requisites for the user to be able to run this on their machines. Also, can we talk about Builtin provider too?

enhancements/containerless-kantra/README.md Outdated Show resolved Hide resolved

Users will be expected to have or install several tools onto their machines, such as OpenJDK and Maven. We will produce and ship our [rulesets](https://github.com/konveyor/rulesets/), JDTLS, and the [Java Bundle](https://github.com/konveyor/java-analyzer-bundle).

The user will be instructed to set these packaged binaries and rules in a known location, such as `$HOME/.kantra/`. Alternatively, an install script can set these.
Copy link
Contributor

Choose a reason for hiding this comment

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

By setting, do you mean keeping those binaries there? Can we use standard system paths as well as environment variables for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

For JDT.LS and java analyzer bundle, for unistall purposes it would be nice I think if this was all in .kantra/<folders> for ease of use, Maven, OpenJDK should be system paths and we use the correct env vars ($M2_ and $JAVA_) IMO

Copy link
Member

Choose a reason for hiding this comment

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

Are we going to allow these to be in the system path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Install script to add .kantra/<folders>/... to path? Or users add it manually? And set those as env vars in kantra? And +1 for using expected env vars for Maven and OpenJDK. @djzager Are you instead thinking of using the binaries from the abs path?

Copy link
Member

Choose a reason for hiding this comment

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

What I meant was that, if a user installs the binary at /usr/local/bin then it should be accessible via Kantra right?

I suppose that what I am suggesting is that we may install stuff at ${XDG_CONFIG_HOME}/.kantra/... but we should encourage the users to set their PATH to include that directory so kantra the CLI is free to just execute them (and not go looking for them or expecting environment variables).


### Technical Implmentation

A new analyze subcommand can be introduced for kantra to recognize when to start the containerized version of analysis versus the non-containerized option. This could look like `kantra analyze-java-only <options>`. Another option for starting the analyze subcommand without running containers would be to detect existing packaged requirements at the expected location discussed in the [requirements](#requirements). However, in this case, we would want to provide an option to disable this behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea of having an explicit / separate subcommand for this. Keeps things clean for us and users. Think we should discuss more about semantics, analyze-java-only sounds restrictive. Maybe fine right now, but unsure if similar requirement will arise for other providers.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is "restricte" in that you can't use any other providers (besides builtin which you called out we need to add :) good catch!)

Copy link
Member

Choose a reason for hiding this comment

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

I wish I could come up with a decent analyze-no-container name that could be more generic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I am still not sure of this subcommand name, so I'm open to any other suggestions.

Copy link
Member

Choose a reason for hiding this comment

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

The best I could come up with kantra analyze-bin --provider=java, gives us ability to expand to other providers.

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 a +1 on @djzager's flag to add more, or the one in the enhancement

enhancements/containerless-kantra/README.md Show resolved Hide resolved
Copy link
Member

@djzager djzager left a comment

Choose a reason for hiding this comment

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

I think this genuinely improves on what I've heard previously discussed. I do somewhat wonder what prevents us from creating a new command altogether (separate go module) and whether that may give us some more flexibility even if in the same repository.

enhancements/containerless-kantra/README.md Outdated Show resolved Hide resolved
enhancements/containerless-kantra/README.md Show resolved Hide resolved

Users will be expected to have or install several tools onto their machines, such as OpenJDK and Maven. We will produce and ship our [rulesets](https://github.com/konveyor/rulesets/), JDTLS, and the [Java Bundle](https://github.com/konveyor/java-analyzer-bundle).

The user will be instructed to set these packaged binaries and rules in a known location, such as `$HOME/.kantra/`. Alternatively, an install script can set these.
Copy link
Member

Choose a reason for hiding this comment

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

Are we going to allow these to be in the system path?


### Technical Implmentation

A new analyze subcommand can be introduced for kantra to recognize when to start the containerized version of analysis versus the non-containerized option. This could look like `kantra analyze-java-only <options>`. Another option for starting the analyze subcommand without running containers would be to detect existing packaged requirements at the expected location discussed in the [requirements](#requirements). However, in this case, we would want to provide an option to disable this behavior.
Copy link
Member

Choose a reason for hiding this comment

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

I wish I could come up with a decent analyze-no-container name that could be more generic.

@eemcmullan
Copy link
Contributor Author

"I think this genuinely improves on what I've heard previously discussed. I do somewhat wonder what prevents us from creating a new command altogether (separate go module) and whether that may give us some more flexibility even if in the same repository."
@djzager This is an interesting idea. It would make it more light-weight as well if we do not have to build the entirety of kantra for this distribution. I'd be curious to know what others think @pranavgaikwad @shawn-hurley

Signed-off-by: Emily McMullan <emcmulla@redhat.com>
@dymurray dymurray added this to the v0.6.0 milestone Aug 20, 2024
Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

Understanding why a new InternalProviderClient and not just importaing from external is the only open question in my book

Otherwise this LGTM

enhancements/containerless-kantra/README.md Show resolved Hide resolved

### Technical Implmentation

A new analyze subcommand can be introduced for kantra to recognize when to start the containerized version of analysis versus the non-containerized option. This could look like `kantra analyze-java-only <options>`. Another option for starting the analyze subcommand without running containers would be to detect existing packaged requirements at the expected location discussed in the [requirements](#requirements). However, in this case, we would want to provide an option to disable this behavior.
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 a +1 on @djzager's flag to add more, or the one in the enhancement

enhancements/containerless-kantra/README.md Show resolved Hide resolved
Copy link
Member

@djzager djzager left a comment

Choose a reason for hiding this comment

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

This looks good to me. The only two (non-blocking) comments I have are:

  1. To consider documenting that we will start shipping binaries as the release artifacts for kantra (and any other necessary component) as part of this work.
  2. Consider kantra analyze-bin --provider=java as a way to satisfy the requirements with room to grow in the future.

Signed-off-by: Emily McMullan <emcmulla@redhat.com>
Copy link
Member

@djzager djzager left a comment

Choose a reason for hiding this comment

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

ACK

Signed-off-by: Emily McMullan <emcmulla@redhat.com>
@eemcmullan eemcmullan merged commit 2380ae9 into konveyor:master Aug 26, 2024
3 checks passed
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.

Containerless distributions of the Kantra CLI - Java
5 participants