You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metron.apache.org by merrimanr <gi...@git.apache.org> on 2017/09/08 13:42:56 UTC

[GitHub] metron pull request #737: METRON-1161: Add ability to edit parser command li...

GitHub user merrimanr opened a pull request:

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

    METRON-1161: Add ability to edit parser command line options in the management UI

    ## Contributor Comments
    This PR is a follow up to https://github.com/apache/metron/pull/717 and exposes the new Storm parser topology options in the Management UI.  This can be verified in full dev by navigating to the Management UI and editing any parser.  There should be a new "Storm Settings" pane in the primary panel that can be expanded and exposes input controls for all the new parser topology properties.  Editing these should successfully change the parser configs in zookeeper.
    
    I also performed a slight refactor of the Raw JSON editor to make it easier to maintain as we add more parser config properties.
    
    ## 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/merrimanr/incubator-metron METRON-1161

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

    https://github.com/apache/metron/pull/737.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 #737
    
----
commit 3b2a7a36443ab8c5599223951dc9d25f587d3ca0
Author: merrimanr <me...@gmail.com>
Date:   2017-09-06T21:20:49Z

    initial commit

commit dd3d44cdece6d553444f838891b33010491f99fa
Author: merrimanr <me...@gmail.com>
Date:   2017-09-07T19:24:29Z

    added new properties to readme panel and updated tests

----


---

[GitHub] metron pull request #737: METRON-1161: Add ability to edit parser command li...

Posted by merrimanr <gi...@git.apache.org>.
Github user merrimanr commented on a diff in the pull request:

    https://github.com/apache/metron/pull/737#discussion_r139815513
  
    --- Diff: metron-interface/metron-config/src/app/sensors/sensor-parser-config-readonly/sensor-parser-config-readonly.component.spec.ts ---
    @@ -301,7 +301,7 @@ describe('Component: SensorParserConfigReadonly', () => {
       }));
     
       it('should have metadata defined ', async(() => {
    --- End diff --
    
    Sure I will add a comment here.


---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by cestella <gi...@git.apache.org>.
Github user cestella commented on the issue:

    https://github.com/apache/metron/pull/737
  
    +1 by inspection.  This looks good to me.  Great job!


---

[GitHub] metron pull request #737: METRON-1161: Add ability to edit parser command li...

Posted by ottobackwards <gi...@git.apache.org>.
Github user ottobackwards commented on a diff in the pull request:

    https://github.com/apache/metron/pull/737#discussion_r138506828
  
    --- Diff: metron-interface/metron-config/src/app/sensors/sensor-parser-config-readonly/sensor-parser-config-readonly.component.spec.ts ---
    @@ -301,7 +301,7 @@ describe('Component: SensorParserConfigReadonly', () => {
       }));
     
       it('should have metadata defined ', async(() => {
    --- End diff --
    
    Why is this '32'?  Maybe a comment for a maintainer down the road?


---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by merrimanr <gi...@git.apache.org>.
Github user merrimanr commented on the issue:

    https://github.com/apache/metron/pull/737
  
    Ok I reverted the SensorParserConfig class so that defaults are not provided for numWorkers and numAckers.  I also added help text to make it clear to the user what happens when these are not set.  Let me know how this looks.


---

[GitHub] metron pull request #737: METRON-1161: Add ability to edit parser command li...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by merrimanr <gi...@git.apache.org>.
Github user merrimanr commented on the issue:

    https://github.com/apache/metron/pull/737
  
    Thank you for the feedback @nickwallen.  
    
    On points 1-3 and 5, these could be applied to any panel in the management UI.  They all work the same.  My opinion is that correct design in this case is somewhat subjective:  what may be intuitive to you may not be intuitive to someone else and vice-versa.  That being said, I think a discussion thread is needed to sort out the right way to do it.
    
    On point 4, zookeeper data is persisted across zookeeper restarts so this is not an issue.  If the write to zookeeper fails you will get an error in the UI.  Did you mean parser restart in Ambari?
    
    On point 6, this is a problem with the backend but I don't mind fixing it here since it's a small change.


---

[GitHub] metron pull request #737: METRON-1161: Add ability to edit parser command li...

Posted by merrimanr <gi...@git.apache.org>.
Github user merrimanr commented on a diff in the pull request:

    https://github.com/apache/metron/pull/737#discussion_r139815871
  
    --- Diff: metron-interface/metron-config/src/app/sensors/sensor-parser-config/sensor-parser-config.component.ts ---
    @@ -409,12 +403,17 @@ export class SensorParserConfigComponent implements OnInit {
         this.showFieldSchema = (pane === Pane.FIELDSCHEMA) ? visibilty : false;
         this.showRawJson = (pane ===  Pane.RAWJSON) ? visibilty : false;
         this.showThreatTriage = (pane ===  Pane.THREATTRIAGE) ? visibilty : false;
    +    this.showStormSettings = (pane === Pane.STORMSETTINGS) ? visibilty : false;
       }
     
       onRawJsonChanged(): void {
         this.sensorFieldSchema.createFieldSchemaRows();
       }
     
    +  onStormSettingsChanged(): void {
    --- End diff --
    
    Yes this was a mistake.  I think we should leave this function in the event we need it in the future but I will definitely remove this logging.


---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by cestella <gi...@git.apache.org>.
Github user cestella commented on the issue:

    https://github.com/apache/metron/pull/737
  
    Wait, I'm confused, the current behavior is to default to the storm config.  Why did you pull that into the SensorParserConfig?
    
    The issue with what you've done here is that when you save out the configs into zookeeper, you are serializing the object with the values set (including those defaults).  Now, if someone restarts the topology, those are the values set regardless of what is set in the storm config.
    
    Can we please just solve this by some hover-over text indicating if the field is not set, then the storm defaults are used?  Maybe even indicating what the default currently is.  I'd have honestly made those values Optional if I could've (serialization issues caused that not to be the case).
    
    I guess what I'm saying is that, no, I don't like this approach. :)


---

[GitHub] metron pull request #737: METRON-1161: Add ability to edit parser command li...

Posted by ottobackwards <gi...@git.apache.org>.
Github user ottobackwards commented on a diff in the pull request:

    https://github.com/apache/metron/pull/737#discussion_r138506984
  
    --- Diff: metron-interface/metron-config/src/app/sensors/sensor-parser-config/sensor-parser-config.component.ts ---
    @@ -409,12 +403,17 @@ export class SensorParserConfigComponent implements OnInit {
         this.showFieldSchema = (pane === Pane.FIELDSCHEMA) ? visibilty : false;
         this.showRawJson = (pane ===  Pane.RAWJSON) ? visibilty : false;
         this.showThreatTriage = (pane ===  Pane.THREATTRIAGE) ? visibilty : false;
    +    this.showStormSettings = (pane === Pane.STORMSETTINGS) ? visibilty : false;
       }
     
       onRawJsonChanged(): void {
         this.sensorFieldSchema.createFieldSchemaRows();
       }
     
    +  onStormSettingsChanged(): void {
    --- End diff --
    
    Is this a debug artifact?


---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by merrimanr <gi...@git.apache.org>.
Github user merrimanr commented on the issue:

    https://github.com/apache/metron/pull/737
  
    Just pushed out a commit that addresses @ottobackwards comments and fixes the NUM_WORKERS and NUM_ACKERS issue.  I also added a warning that appears when a storm setting changes, telling the user that the topology needs to be restarted.  It may seem redundant that the same message appears for each field but we might want a different message in the future once we expose a way to rebalance using zookeeper values.  At that point this pattern would make sense and I don't think it necessarily looks too bad now.
    
    @nickwallen I also started a discussion on the other points you brought up.  Hopefully whatever conclusion we come to there can be a follow-on JIRA.


---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by cestella <gi...@git.apache.org>.
Github user cestella commented on the issue:

    https://github.com/apache/metron/pull/737
  
    So, I do believe the default values for num workers and ackers should be taken from the storm config if unspecified by us.  Providing defaults when storm already has defaults for these properties seems wrong IMO.  I think that's what you are asking.


---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen commented on the issue:

    https://github.com/apache/metron/pull/737
  
    @merrimanr This will be uber useful.  Here are my initial reactions focusing on usability.  I am totally open to knocking some of these out as separate PRs, should that be a better approach.
    
    ### (1) Double Save Required
    
    A user is required to do a "double save" for the changes to hit Zookeeper.  When I click "Save" on the "Storm Settings" panel, it doesn't actually save anything yet.  I then have to click "Save" again on the parser edit panel.  Once I do this "double save", I can then see the settings take effect in Zookeeper.  
    
    This is counter-intuitive to me.  A button that saves "Save" should save things.
    
    ### (2) Unsaved Changes Indicator
    
    When the user changes a field in the "Storm Settings" panel, it would be nice to have an indication that there are unsaved changes.  This "unsaved change indicator" should stick around until we actually push the changes to Zookeeper.  I should not be able to exit the panel without a warning, if I have unsaved changes.  Right now, I can close the panel and lose all of my changes.  
    
    In this case, I think this is important because the "Save" and "Cancel" buttons show up "below the fold" and are not visible unless the user scrolls down.  On my first pass, I found myself making changes on the panel, clicking the X in the top-right corner because this is the only transition that is visible.  I then found that my changes were not saved.
    
    ### (3) What Now?
    
    Once the user saves changes on this panel, I think we need to provide some guidance to the user as to what to do next.  As a user I am left wondering; 
    * What just happened?  
    * How do I know that his action was successful?  
    * What do I need to do now?
    
    ### (4) Warning about Persistence
    
    We should have a warning that indicates under what conditions these settings will not persist.   Right now all we do is dump them in Zk.  So if Zk is restarted, we lose them, right?  Whatever does actually happen should be made clear to the user.
    
    ### (5) Reset to Defaults
    
    It would be nice to have a "Reset to Defaults" button of some sort.  I wanted to go back to what I had initially.  I tried to do this by erasing the value in each field and then saving.  All this did was set each value to 0, which is not the "reset to defaults" that I expected.
    
    ### (6) Blank Fields
    
    The `NUM_WORKERS` and `NUM_ACKERS` are blank, unlike all of the other configuration fields.



---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by merrimanr <gi...@git.apache.org>.
Github user merrimanr commented on the issue:

    https://github.com/apache/metron/pull/737
  
    I moved the default values to the storm config and changed getNumWorkers and getNumAckers to return the values in the storm config if numWorkers/numAckers is null.  Is this what you were thinking?
    
    I had to set the defaults in SensorParserConfig because I could not find a way to get these defaults from the Storm Java API.  Is there a way and I just missed it?


---

[GitHub] metron issue #737: METRON-1161: Add ability to edit parser command line opti...

Posted by merrimanr <gi...@git.apache.org>.
Github user merrimanr commented on the issue:

    https://github.com/apache/metron/pull/737
  
    Changing numWorkers and numAckers default values from null to 1 had the unintended consequences of breaking the ParserTopologyCliTest.  This is because they can no longer be overriden by setting the topology.workers and topology.acker.executors properties in stormConfig.  I believe this is the correct behaviour because numWorkers and numAckers are top-level properties and should take precedence.  If this is not correct then I would argue that we shouldn't even have them.  Can you verify this @cestella?


---