Skip to content

NIFI-6703: Add Stateless NiFi to CLI#3795

Closed
SamHjelmfelt wants to merge 8 commits intoapache:masterfrom
SamHjelmfelt:statelesscli
Closed

NIFI-6703: Add Stateless NiFi to CLI#3795
SamHjelmfelt wants to merge 8 commits intoapache:masterfrom
SamHjelmfelt:statelesscli

Conversation

@SamHjelmfelt
Copy link
Contributor

Thank you for submitting a contribution to Apache NiFi.

Please provide a short description of the PR here:

Description of PR

https://issues.apache.org/jira/browse/NIFI-6703
Users should be able to easily run Stateless NiFi flows from the CLI without docker.

Added stateless bootstrap and nar to nifi-assembly and removed nifi-stateless/nifi-stateless-assembly. nifi-docker/dockermaven-stateless was updated to accommodate this change.

Added a new top level action (stateless) to nifi.sh which runs the "org.apache.nifi.stateless.NiFiStateless" bootstrap class with the provided arguments after extracting nars. Note that this is intentionally synchronous to allow for many stateless flows on the same machine.

Moved nifi-stateless into nifi-framework to resolve jar conflicts between traditional and stateless runtimes.

Updated stateless-nifi/README.md

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • [ X ] Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • [ X ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • [ X ] Has your PR been rebased against the latest commit within the target branch (typically master)?

  • [ X ] Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not squash or use --force when pushing to allow for clean monitoring of changes.

For code changes:

  • [ X ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • [ X ] Have you verified that the full build is successful on both JDK 8 and JDK 11?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

@SamHjelmfelt

This comment has been minimized.

@SamHjelmfelt
Copy link
Contributor Author

rebase

@mcgilman
Copy link
Contributor

Will review...

@mcgilman
Copy link
Contributor

Thanks for the PR @SamHjelmfelt! And thanks for the subsequent commit. This approach feels better and is inline with our existing approach with NiFi. Two additional comments.

  1. When I build, the dockermaven-stateless fails because it seems to be running before nifi-assembly. Looking at the maven build order, it seems as though the order in the pom is a last resort. Something appears to be allowing the docker builds to run before the nifi-assembly. I think we should try to prevent this. I successfully did so by adding a dependency to nifi-docker (so all docker projects can benefit) on nifi-assembly.
<dependencies>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-assembly</artifactId>
        <classifier>bin</classifier>
        <version>1.10.0-SNAPSHOT</version>
        <type>zip</type>
    </dependency>
</dependencies>

In order for this to work, I had to attach the resulting artifacts in the maven-assembly-plugin configuration of nifi-assembly. I am not sure if this is the best solution to this issue.

This is arguably a separate concern that we could file a JIRA for addressing in the future.

  1. Once I got the build to execute in the right order, the dockermaven-stateless build seems to fail with:

[INFO] --- exec-maven-plugin:1.6.0:exec (Docker integration tests) @ dockermaven-stateless ---
[ERROR] Command execution failed.
java.io.IOException: Cannot run program "/Users/mgilman/Development/apache/nifi/nifi-docker/dockermaven-stateless/integration-test.sh"

This file appears to have been removed in this PR. Did you intend to also remove it from the pom?

@mcgilman
Copy link
Contributor

mcgilman commented Oct 17, 2019

I've created [1] to address (1) above in a subsequent effort.

[1] https://issues.apache.org/jira/browse/NIFI-6784

@mcgilman
Copy link
Contributor

@SamHjelmfelt Can you please create follow JIRAs for the following:

  1. Please add some support for configuring logging. Whe I am running your PR I am seeing lots of DEBUG output that I would like to disable. It's not clear/obvious how I can do that.

  2. Please consider leveraging the extracted NARs in the same path that NiFi uses. Would definitely be open to updating where NiFi extracts NARs if it makes this easier for Stateless NiFi as well. Just seems unnecessary to extract the exact same NARs in an adjacent directory that NiFi uses.

@mcgilman
Copy link
Contributor

I'm a +1 once the subsequent JIRAs are files and the documentation issues mentioned above are resolved.

@SamHjelmfelt
Copy link
Contributor Author

@bbende
Copy link
Contributor

bbende commented Oct 17, 2019

+1 from me, was able to run the examples using local execution, docker with cat'd json, and docker with file json... will merge shortly

@asfgit asfgit closed this in ea1beca Oct 17, 2019
patricker pushed a commit to patricker/nifi that referenced this pull request Jan 22, 2020
NIFI-6703: Fixed extracted nar directory and marked api as experimental
NIFI-6703: Moving nifi-stateless into nifi-framework
NIFI-6703: Refactored to fix jetty/spring issues
NIFI-6703: checkstyle fix
NIFI-6703: updated to mirror traditional NiFi's bootstrap process and java11 dependency management
NIFI-6703: minor changes
NIFI-6703: Documentation fixes

This closes apache#3795.

Signed-off-by: Bryan Bende <bbende@apache.org>
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.

3 participants