[ https://issues.apache.org/jira/browse/METRON-942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16005386#comment-16005386 ]
ASF GitHub Bot commented on METRON-942: --------------------------------------- GitHub user ottobackwards reopened a pull request: https://github.com/apache/incubator-metron/pull/580 METRON-942 [NO MERGE UNTIL METRON-777] Rest api and configuration for Metron parser extensions ## Contributor Comments METRON-777 introduces metron extensions and metron parser extensions. The existing parsers have been moved to be packaged and loaded as extensions. A maven archetype for creating parser extensions has also been created. What is missing however is the ability to install a parser extension created outside the metron tree by the archetype into a metron system. This PR introduces a REST api to accomplish this. Along with that, this PR introduces a parser extension configuration type, for zookeeper that serves as a registry for installed extensions and their default configurations. The idea being that in a follow on effort, the management UI will create a new 'instance' of a parser type through cloning, editing and deploying these configurations. The included configurations are indexing, enrichment, parser, and elasticsearch. There may be multiple of these configurations, as each parser extension library can contain more than one parser. NOTE: the elasticsearch template is NOT deployed to elasticsearch at this time. Any parser created will still need a separate step for this. One outstanding question for feedback -> The configuration tracks the parsers created out of the extension, initially. In the future this list should have new parsers added to it when they are cloned. This would mean we would want new rest endpoints to edit the configuration ( most likely api to add parser to config {name} ) added This PR is built on top of METRON-777, and should not be merged until METRON-777 is in, and this branched is rebased on to master. ### USAGE For usage, I'll cover creating a parser and deploying it... and deleting it using the rest api. ## Preparation In order to build the parser, we need to build and install the maven plugin to build the bundles, as well as the maven archetype itself. At this time, since they are not published to apache maven, this will be a requirement. - Build the bundle plugin ``` cd bundles-maven-plugin && mvn -q install && cd .. ``` - Build the archetype ``` cd metron-maven-archetypes/metron-maven-parser-extension-archetype mvn install cd ../.. ``` ## Create and build a new parser extension - Make a directory and cd into it - Create from archetype ``` mvn archetype:generate -DarchetypeCatalog=local ``` - choose the org.apache.metron:metron-maven-parser-extension-archetype (Apache Maven Parser Extension Archetype for Metron) option - Fill out the information (information on the parameters is in the README for the archetype) - NOTE: at this time, the version must match the metronVersion. Maven is using version in the parent pom chain, and messing up the plugin dependency - cd into the created directory and build the parser extension ``` mvn package ``` This will result in the tar.gz being created inside the {NAME}-parser-assembly project/target directory ## start full_dev - run vagrant up from metron-deployment/vagrant/full_dev_platform ## add a slot to storm - log into ambari on http://node1:8080 - add a new slot to the storm config ## Open swagger - log into ambari on http://node1:8080 - go into the metron service | quicklinks - start swagger with user | password ## Install your parser In swagger, using the parser-extension-controller - drop down the POST method - use the file selector to select the created .tar.gz - execute The extension should now be installed: - you should be able to use the other GET methods to review the generated configuration. - the configuration will have the extensionID to use for the other {name} operations - you should be able to view the installed files in hdfs/apps/metron/patterns/{parsername}, hdfs/apps/metron/extensions_alt_lib/ ## Start the parser using rest Still in swagger - Use the Kafka Controller and the Storm Controller to create a {parserName} topic, and start a storm job for {parserName} - In the storm UI you should see the storm instance for the parser You should be able to verify using the rest api and the various controllers that the configurations are there and the topics exist and the storm jobs as well ## Uninstall your parser In swagger, using the parser-extension-controller - drop down the DELETE method - fill in the name parameter with the extensionID from the config - exectute When complete you should see that the kafka topic, storm job, the various configurations are all gone, along with the patterns and other things from hdfs Because this is on METRON-777 the changed file list remains huge. The main changes here are those in the metron-interface directories As well as those in the metron-common configuration In github, select all changes from 2f9cf0d199c565ae1c7ceb1cfdddfb0ebad96c31 onwards. ## 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 incubating-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/ottobackwards/incubator-metron METRON-942 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-metron/pull/580.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 #580 ---- commit 864d320d91c522dfc2eb63fc12341f316a3f8952 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-03-17T04:56:49Z Metron Extension system Based on Apache Nifi Nars NAR changes * new lib , rebrand to bundles from NAR * port to VFS/FileObject from File based * ability to set property values * Rework FileUtils so that you can derive and override * added initializers to set 'classes' that we care about instead of hard coding them, still needs defaults * added components nec. for integration tests ( do not want dep. on metron-* ) * VFSClassloader for NarClassLoader * Hdfs based integration test version of unpacknars tests * HDFS ( filesystem ) based fileutilities to cover for writes to hdfs, since VFS is currently R/O HDFS * modified plugin to support configuration of outputs * use class index not service loader ( both subclass and annotated supported ) Archetype * Parser Extension archetyp * incudes all configuration * creates tar.gz with bundle and configuration * class index support ( automatic generation ) Extensions * new extensions modules * parser * archetype built module for each parser type * support for configuration only parsers with tests Parsers * moved all but json, csv, grok to extensions * Bolt now loads from bundle properties Deployment * rpms for parsers * create extension directories * ambari initializes zookeeper per parser * amabri creates hdfs directories * ISSUE: Writing to hdfs Rest-API * only test against parsers in metron-parsers * still needs integration commit 850154cb086bd9f825daa6797b575cde95392a87 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-14T12:55:37Z fix package names commit e8caaf51e3f3d640e9ec1c3c548bd722d595687d Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-17T12:19:02Z Merge remote-tracking branch 'apache/master' into METRON-777 commit c18cbe3a8847fbed7b5f6ba9182b58f01d142c2c Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-23T16:14:15Z merge apache/master commit 7760425b02142f01f37d58876aa09fb88b197c82 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-27T10:45:37Z Merge remote-tracking branch 'apache/master' into METRON-777 commit bc7cc2d823d54be58fae13ef94f671457d4c10f0 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-29T04:05:41Z use correct testing bundle commit c25585d10529ca2048d2ed0df4d8dbd904d3db17 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-29T04:07:11Z use the configured extension list, do not hardcode commit 158f463f121cbca2cf2c4d3c1cd9cf7b707e1d23 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-29T12:58:41Z Merge remote-tracking branch 'apache/master' into METRON-777 commit e21efb89a37d034e36cb82dab6c0b862cad3777b Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-30T13:16:41Z make dependency explicit, I think parent version is not what we think it is when running from archetype, causing the extension versio to be used for this dependency commit ac92d7b88404f8b8bc825c71a4aeee5aa015d757 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-30T13:44:58Z instead of hard-coding in metron-parsers-extensions, overload in the archetype to use metronVersion commit fd021e42a2cdb80676426b65ae227ac9f44fcd6a Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-03T14:34:31Z Merge remote-tracking branch 'apache/master' into METRON-777 commit 9cafe970b40d551a846fc442ac121591ab1d0d6d Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-04T02:18:29Z specify the plugin to fix dependency problem commit de48845634ae1cecb258175326592a28f5b3f8fe Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-04T02:40:55Z second attempt to fix plugin errors with jacoco commit 995a4d746fa21400a55e9571957878ef2d5b48d8 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-04T13:46:58Z Merge remote-tracking branch 'apache/master' into METRON-777 commit 5f74fc3a15fe5e56f9e3483fa4c25961ffb284dd Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-04T20:25:18Z be sure to clear out before and after, we cannot assume order of maven build commit a3e63555e4e76486be58ddd6f818006ff42cdd1f Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-05T03:42:54Z Merge remote-tracking branch 'apache/master' into METRON-777 commit 1e0e30562b4b526d9512bb1dc06077674d6b3277 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-05T18:18:32Z update archetype based on changes to loading and configuration commit e3b71aed74271cf255be5fad072a99506f553d2e Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-06T16:08:58Z use simple json and not the JSONUtil Instance, there are issues in storm loading commit 6c0201b853ffd079f02589011c57cb6a960475e8 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-09T13:55:31Z Merge remote-tracking branch 'apache/master' into METRON-777 commit ab0aad849319117dd3d964247861cf09bc3e7822 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-10T12:57:21Z Merge remote-tracking branch 'apache/master' into METRON-777 commit 5565ad661f4143234b67230f7cfd420ea1bce91a Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-05-10T19:47:58Z Merge remote-tracking branch 'apache/master' into METRON-777 commit 7df1345715598c576648b5763b65ac2b96bf0c61 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-27T21:02:49Z create controller class shell commit 5fbe86ca1cdae82170f2602fcd2d940adae27f1b Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-28T03:00:38Z start of implementation of service, validation of extensions commit 06a7a583c9d8fec090b3ebc03e665a837f41f59f Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-28T03:08:47Z wire up the services we will use commit 8647de04937841ffc32da296364f0a292d1c3bff Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-28T03:49:24Z use context to track paths that are created, delete tmp files on exit commit dc264f20d2bfdbc49e8076de55068d6618223965 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-28T14:39:31Z first pass implementation, no tests commit 483807d4f8b656e83c97764b0f2cd508a64e4948 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-28T14:50:15Z correct path to write bundle to commit 090ee6daba21c1506b674012349e669c0c4a11e6 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-29T03:41:27Z start of controller test commit 5254b6e613aa74c3be86523826a31dc49ecf36b3 Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-29T04:11:26Z do not need to add this, with the right intellij project ref to metron-common this works fine commit 1146b36e7fd3fabfbab51a98c602d138746534ec Author: Otto Fowler <ottobackwa...@gmail.com> Date: 2017-04-29T17:09:38Z do not assume empty content, unless you are going to clear out everything ---- > REST Support for Parser Extensions > ---------------------------------- > > Key: METRON-942 > URL: https://issues.apache.org/jira/browse/METRON-942 > Project: Metron > Issue Type: New Feature > Reporter: Otto Fowler > Assignee: Otto Fowler > > If and after METRON-777 lands, support will be required for installing parser > extensions into the system, as well as uninstalling them. > The first step in this is to have support in metron-rest for this. > The rest interface should support installing a parser extension from the > assembly tar.gz produced by the archetype. > The result of the installation should be: > * the bundle is installed in the alternate extension library location in hdfs > * the patterns for all parsers in the extension should be deployed to hdfs > * the configurations for each pattern should be installed into ZK ( parser, > indexing, enrichment ) > * an extension configuration, that includes the parsers it produces, and the > default configurations ( the above and elasticsearch etc ) should be entered > into ZK > The reading of these configurations should also be supported. -- This message was sent by Atlassian JIRA (v6.3.15#6346)