This repository was archived by the owner on Aug 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 505
METRON-942 [NO MERGE UNTIL METRON-777] Rest api and configuration for Metron parser extensions #580
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
… it is when running from archetype, causing the extension versio to be used for this dependency
…archetype to use metronVersion
…n-common this works fine
…n, including bundle information The goal is to have enough information to fill out a configuration object that is in zk, that will allow for some kind of removal/uninstall of a parser
Needs more tests, but this should allow implmementation of delete()
At this time, the location of the hdfs grok directory is hard coded to the default If it is changed in ambari, this will not work.
…the patterns dir in hdfs while testing
fixed bug where we were calling wrong function in ConfigurationUtils
change ConfigurationType to allow changing zookeeper root generate a new extension name, must not have 0.0.0 version at end... will be the archive.tar.gz file name, with . -> _ and dropping the archive.tar.gz this foo-0.4.0-archive.tar.gz -> foo-0_5_0 as the extension name
the call works, but I cannot get the jsonpath verification right a single statement works in a verification tool, but not here
… dispatch in mock tests to get right result
…pattern dir for hdfs Be sure to rollback on install exception, and delete grok dir for installed parsers
…en out in master. Instead - do not delete kafka topic or storm topology, since this service doesn't create them.
…om METRON-947, no reason to maintain two prs
95e6450 to
198eca1
Compare
Contributor
Author
|
I am closing this in preparation for feature branch |
10 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This PR also addresses METRON-947, adding Management Stellar function support for the extension configurations
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.
Create and build a new parser extension
at this time, the version must match the metronVersion. Maven is using version in the parent pom chain, and messing up the plugin dependency[ THIS HAS BEEN RESOLVED]This will result in the tar.gz being created inside the {NAME}-parser-assembly project/target directory
start full_dev
add a slot to storm
Open swagger
Install your parser
In swagger, using the parser-extension-controller
The extension should now be installed:
Start the parser using rest
Still in swagger
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
When complete you should see that 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 2f9cf0d onwards.
Testing Stellar
Run Stellar
[vagrant@node1 ~]$ /usr/metron/0.4.1/bin/stellar -z node1:2181Run the command:
verify that the configuration return matches what you would see in the rest client
if you executed Parser Extension Controller : get /api/v1/ext/parsers/{name} -> name = metron-parser-nice-assembly-0_4_1
Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines 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:
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:
[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?
[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: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 is set up for your personal repository such that your branches are built there before submitting a pull request.