Uploaded image for project: 'Metron'
  1. Metron
  2. METRON-1185

Stellar REPL does not work on a kerberized cluster when calling functions interacting with HBase

    Details

    • Type: Improvement
    • Status: To Do
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Because we put all the jars on the classpath from $METRON_HOME/lib via a glob, if we get the wrong order, we get classpath issues around Stopwatch (i.e. more recent guava may sneak onto the classpath first). This is non-deterministic and can cause issues randomly. Instead of a glob, we should choose one of the uber jars with all the metron Stellar functions baked in and allow users to provide any extra directories we should include via an env variable. Also, we are not pulling the full hbase classpath, so in a kerberized cluster we do not get all of the configs on the classpath, so we can't find always find tgts.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user cestella opened a pull request:

          https://github.com/apache/metron/pull/755

          METRON-1185: Stellar REPL does not work on a kerberized cluster when calling functions interacting with HBase

            1. Contributor Comments

          Because we put all the jars on the classpath from `$METRON_HOME/lib` via a glob, if we get the wrong order, we get classpath issues around Stopwatch (i.e. more recent guava may sneak onto the classpath first). This is non-deterministic and can cause issues randomly. Instead of a glob, we should choose one of the uber jars with all the metron Stellar functions baked in and allow users to provide any extra directories we should include via an env variable. Also, we are not pulling the full hbase classpath, so in a kerberized cluster we do not get all of the configs on the classpath, so we can't find always find tgts.

            1. Pull Request Checklist

          Thank you for submitting a contribution to Apache Metron.
          Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions.
          Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) for complete smoke testing guides.

          In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:

              1. For all changes:
              1. For code changes:
          • [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed?
          • [x] Have you included steps or a guide to how the change may be verified and tested manually?
          • [x] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
            ```
            mvn -q clean integration-test install && build_utils/verify_licenses.sh
            ```
          • [x] Have you written or updated unit tests and or integration tests to verify your changes?
          • [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
          • [x] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
              1. For documentation related changes:
          • [x] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`:

          ```
          cd site-book
          mvn site
          ```

                1. 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.
                  It is also recommended that [travis-ci](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/cestella/incubator-metron stellar_shell_classpath

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/metron/pull/755.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #755


          commit ea11899dd89eb92f7e8d8d46b68b9e46503bef14
          Author: cstella <cestella@gmail.com>
          Date: 2017-09-13T23:26:48Z

          Updating scripts


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user cestella opened a pull request: https://github.com/apache/metron/pull/755 METRON-1185 : Stellar REPL does not work on a kerberized cluster when calling functions interacting with HBase Contributor Comments Because we put all the jars on the classpath from `$METRON_HOME/lib` via a glob, if we get the wrong order, we get classpath issues around Stopwatch (i.e. more recent guava may sneak onto the classpath first). This is non-deterministic and can cause issues randomly. Instead of a glob, we should choose one of the uber jars with all the metron Stellar functions baked in and allow users to provide any extra directories we should include via an env variable. Also, we are not pulling the full hbase classpath, so in a kerberized cluster we do not get all of the configs on the classpath, so we can't find always find tgts. Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines] ( https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235 ) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines] ( https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview ) for complete smoke testing guides. In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following: For all changes: [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira] ( https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel ). [x] Does your PR title start with METRON-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)? For code changes: [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? [x] Have you included steps or a guide to how the change may be verified and tested manually? [x] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` [x] Have you written or updated unit tests and or integration tests to verify your changes? [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0] ( http://www.apache.org/legal/resolved.html#category-a)? [x] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent? For documentation related changes: [x] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`: ``` cd site-book mvn site ``` 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. It is also recommended that [travis-ci] ( https://travis-ci.org ) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron stellar_shell_classpath Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/755.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #755 commit ea11899dd89eb92f7e8d8d46b68b9e46503bef14 Author: cstella <cestella@gmail.com> Date: 2017-09-13T23:26:48Z Updating scripts
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user nickwallen commented on a diff in the pull request:

          https://github.com/apache/metron/pull/755#discussion_r138773096

          — Diff: metron-stellar/stellar-common/src/main/scripts/stellar —
          @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
          . /usr/lib/bigtop-utils/bigtop-detect-javahome
          fi

          -export HBASE_CONFIGS=/etc/hbase/conf
          +export HBASE_CONFIGS=$(hbase classpath)
          export METRON_VERSION=$

          {project.version}

          export METRON_HOME=/usr/metron/$METRON_VERSION
          -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@"
          +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar)
          — End diff –

          This will not pick-up any of the Profiler or Management functions, right?

          Show
          githubbot ASF GitHub Bot added a comment - Github user nickwallen commented on a diff in the pull request: https://github.com/apache/metron/pull/755#discussion_r138773096 — Diff: metron-stellar/stellar-common/src/main/scripts/stellar — @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then . /usr/lib/bigtop-utils/bigtop-detect-javahome fi -export HBASE_CONFIGS=/etc/hbase/conf +export HBASE_CONFIGS=$(hbase classpath) export METRON_VERSION=$ {project.version} export METRON_HOME=/usr/metron/$METRON_VERSION -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@" +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar) — End diff – This will not pick-up any of the Profiler or Management functions, right?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user nickwallen commented on a diff in the pull request:

          https://github.com/apache/metron/pull/755#discussion_r138773199

          — Diff: metron-stellar/stellar-common/src/main/scripts/stellar —
          @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
          . /usr/lib/bigtop-utils/bigtop-detect-javahome
          fi

          -export HBASE_CONFIGS=/etc/hbase/conf
          +export HBASE_CONFIGS=$(hbase classpath)
          export METRON_VERSION=$

          {project.version}

          export METRON_HOME=/usr/metron/$METRON_VERSION
          -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@"
          +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar)
          — End diff –

          We might need to create a JAR specifically tailored for the REPL.

          Show
          githubbot ASF GitHub Bot added a comment - Github user nickwallen commented on a diff in the pull request: https://github.com/apache/metron/pull/755#discussion_r138773199 — Diff: metron-stellar/stellar-common/src/main/scripts/stellar — @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then . /usr/lib/bigtop-utils/bigtop-detect-javahome fi -export HBASE_CONFIGS=/etc/hbase/conf +export HBASE_CONFIGS=$(hbase classpath) export METRON_VERSION=$ {project.version} export METRON_HOME=/usr/metron/$METRON_VERSION -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@" +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar) — End diff – We might need to create a JAR specifically tailored for the REPL.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ottobackwards commented on a diff in the pull request:

          https://github.com/apache/metron/pull/755#discussion_r138776105

          — Diff: metron-stellar/stellar-common/src/main/scripts/stellar —
          @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
          . /usr/lib/bigtop-utils/bigtop-detect-javahome
          fi

          -export HBASE_CONFIGS=/etc/hbase/conf
          +export HBASE_CONFIGS=$(hbase classpath)
          export METRON_VERSION=$

          {project.version}

          export METRON_HOME=/usr/metron/$METRON_VERSION
          -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@"
          +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar)
          — End diff –

          So we are just picking the enrichment jar?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ottobackwards commented on a diff in the pull request: https://github.com/apache/metron/pull/755#discussion_r138776105 — Diff: metron-stellar/stellar-common/src/main/scripts/stellar — @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then . /usr/lib/bigtop-utils/bigtop-detect-javahome fi -export HBASE_CONFIGS=/etc/hbase/conf +export HBASE_CONFIGS=$(hbase classpath) export METRON_VERSION=$ {project.version} export METRON_HOME=/usr/metron/$METRON_VERSION -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@" +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar) — End diff – So we are just picking the enrichment jar?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ottobackwards commented on the issue:

          https://github.com/apache/metron/pull/755

          Is this just a temporary thing?

          I think the longer term thing is to split the stellar out into their own modules, an possibly have modules split further by special dependencies.

          I would like to do this with stellar extensions based on bundles.

          Show
          githubbot ASF GitHub Bot added a comment - Github user ottobackwards commented on the issue: https://github.com/apache/metron/pull/755 Is this just a temporary thing? I think the longer term thing is to split the stellar out into their own modules, an possibly have modules split further by special dependencies. I would like to do this with stellar extensions based on bundles.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cestella commented on a diff in the pull request:

          https://github.com/apache/metron/pull/755#discussion_r138776403

          — Diff: metron-stellar/stellar-common/src/main/scripts/stellar —
          @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
          . /usr/lib/bigtop-utils/bigtop-detect-javahome
          fi

          -export HBASE_CONFIGS=/etc/hbase/conf
          +export HBASE_CONFIGS=$(hbase classpath)
          export METRON_VERSION=$

          {project.version}

          export METRON_HOME=/usr/metron/$METRON_VERSION
          -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@"
          +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar)
          — End diff –

          It will pick up the profiler functions, they're included in the enrichment jar (that's actually what motivated this, `PROFILE_GET` didn't work randomly based on the order of the classpath).

          We probably should include the management functions directly, though. I'll adjust.

          Show
          githubbot ASF GitHub Bot added a comment - Github user cestella commented on a diff in the pull request: https://github.com/apache/metron/pull/755#discussion_r138776403 — Diff: metron-stellar/stellar-common/src/main/scripts/stellar — @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then . /usr/lib/bigtop-utils/bigtop-detect-javahome fi -export HBASE_CONFIGS=/etc/hbase/conf +export HBASE_CONFIGS=$(hbase classpath) export METRON_VERSION=$ {project.version} export METRON_HOME=/usr/metron/$METRON_VERSION -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@" +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar) — End diff – It will pick up the profiler functions, they're included in the enrichment jar (that's actually what motivated this, `PROFILE_GET` didn't work randomly based on the order of the classpath). We probably should include the management functions directly, though. I'll adjust.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cestella commented on the issue:

          https://github.com/apache/metron/pull/755

          @ottobackwards I'd argue that it SHOULD be a temporary thing. At the moment things are broken as they are.

          Show
          githubbot ASF GitHub Bot added a comment - Github user cestella commented on the issue: https://github.com/apache/metron/pull/755 @ottobackwards I'd argue that it SHOULD be a temporary thing. At the moment things are broken as they are.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ottobackwards commented on the issue:

          https://github.com/apache/metron/pull/755

          ok, if and when we look at stellar archetypes and extensions we'll have to keep this in mind

          Show
          githubbot ASF GitHub Bot added a comment - Github user ottobackwards commented on the issue: https://github.com/apache/metron/pull/755 ok, if and when we look at stellar archetypes and extensions we'll have to keep this in mind
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cestella commented on the issue:

          https://github.com/apache/metron/pull/755

          Ok, I just want to be completely clear, we're actually choosing one of our jars, the parsers jar, because it's an uber jar that has ALL of our stellar functions in Metron in it. I'm also providing explicit support for the management functions. This should make our classpath more deterministic, I think, and provide a mechanism that is more flexible for passing in custom jars (the env variable, rather than presuming users would drop things in `$METRON_HOME/lib`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user cestella commented on the issue: https://github.com/apache/metron/pull/755 Ok, I just want to be completely clear, we're actually choosing one of our jars, the parsers jar, because it's an uber jar that has ALL of our stellar functions in Metron in it. I'm also providing explicit support for the management functions. This should make our classpath more deterministic, I think, and provide a mechanism that is more flexible for passing in custom jars (the env variable, rather than presuming users would drop things in `$METRON_HOME/lib`.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cestella commented on a diff in the pull request:

          https://github.com/apache/metron/pull/755#discussion_r138777894

          — Diff: metron-stellar/stellar-common/src/main/scripts/stellar —
          @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
          . /usr/lib/bigtop-utils/bigtop-detect-javahome
          fi

          -export HBASE_CONFIGS=/etc/hbase/conf
          +export HBASE_CONFIGS=$(hbase classpath)
          export METRON_VERSION=$

          {project.version}

          export METRON_HOME=/usr/metron/$METRON_VERSION
          -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@"
          +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar)
          — End diff –

          The current commit should support both profiler and the management function at this point.

          Show
          githubbot ASF GitHub Bot added a comment - Github user cestella commented on a diff in the pull request: https://github.com/apache/metron/pull/755#discussion_r138777894 — Diff: metron-stellar/stellar-common/src/main/scripts/stellar — @@ -28,7 +28,8 @@ elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then . /usr/lib/bigtop-utils/bigtop-detect-javahome fi -export HBASE_CONFIGS=/etc/hbase/conf +export HBASE_CONFIGS=$(hbase classpath) export METRON_VERSION=$ {project.version} export METRON_HOME=/usr/metron/$METRON_VERSION -java $JVMFLAGS -cp "$HBASE_CONFIGS:$METRON_HOME/lib/*" org.apache.metron.stellar.stellar.shell.StellarShell "$@" +export STELLAR_LIB=$(find $METRON_HOME/lib/ -name metron-enrichment*.jar) — End diff – The current commit should support both profiler and the management function at this point.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ottobackwards commented on the issue:

          https://github.com/apache/metron/pull/755

          Whatever it takes in the meantime. When this is plugin based, this all goes away.

          Show
          githubbot ASF GitHub Bot added a comment - Github user ottobackwards commented on the issue: https://github.com/apache/metron/pull/755 Whatever it takes in the meantime. When this is plugin based, this all goes away.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cestella commented on the issue:

          https://github.com/apache/metron/pull/755

          So, I tested this on a kerberized multi-node cluster and full-dev. I ensured that I tried with and without the management functions jar and with/without kerberos as well.

          Show
          githubbot ASF GitHub Bot added a comment - Github user cestella commented on the issue: https://github.com/apache/metron/pull/755 So, I tested this on a kerberized multi-node cluster and full-dev. I ensured that I tried with and without the management functions jar and with/without kerberos as well.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user justinleet commented on the issue:

          https://github.com/apache/metron/pull/755

          I'm +1 with this (as a temporary measure to make things work), assuming @ottobackwards and @nickwallen are as well.

          Show
          githubbot ASF GitHub Bot added a comment - Github user justinleet commented on the issue: https://github.com/apache/metron/pull/755 I'm +1 with this (as a temporary measure to make things work), assuming @ottobackwards and @nickwallen are as well.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cestella commented on the issue:

          https://github.com/apache/metron/pull/755

          @ottobackwards and @nickwallen any issues?

          Show
          githubbot ASF GitHub Bot added a comment - Github user cestella commented on the issue: https://github.com/apache/metron/pull/755 @ottobackwards and @nickwallen any issues?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user nickwallen commented on the issue:

          https://github.com/apache/metron/pull/755

          +1 by inspection. I agree with @justinleet; its good for a temporary work around. Thanks for the fix.

          Show
          githubbot ASF GitHub Bot added a comment - Github user nickwallen commented on the issue: https://github.com/apache/metron/pull/755 +1 by inspection. I agree with @justinleet; its good for a temporary work around. Thanks for the fix.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/metron/pull/755

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/metron/pull/755
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ottobackwards commented on the issue:

          https://github.com/apache/metron/pull/755

          +1, just for the record

          Show
          githubbot ASF GitHub Bot added a comment - Github user ottobackwards commented on the issue: https://github.com/apache/metron/pull/755 +1, just for the record

            People

            • Assignee:
              Unassigned
              Reporter:
              cestella Casey Stella
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development