Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-623: Management UI #484

Closed
wants to merge 199 commits into from
Closed

Conversation

merrimanr
Copy link
Contributor

Contributor Comments

This PR includes the latest version of the Management UI. Instructions for building and installing are located in metron-interface/metron-config/README.md.

Here are the commands I used to deploy to Quick Dev:

  1. Install REST application:
scp ./metron-interface/metron-rest/target/metron-rest-0.3.1-archive.tar.gz root@node1:/usr/metron/0.3.1/
ssh root@node1
cd /usr/metron/0.3.1/
tar -xf metron-rest-0.3.1-archive.tar.gz
java -jar ./lib/metron-rest-0.3.1.jar --spring.profiles.active=vagrant,dev --server.port=8082
  1. Install the Management UI:
scp ./metron-interface/metron-config/target/metron-config-0.3.1-archive.tar.gz root@node1:/usr/metron/0.3.1/
ssh root@node1
cd /usr/metron/0.3.1/
tar -xf metron-config-0.3.1-archive.tar.gz
yum install -y npm
npm install npm@3.8.9 -g
export METRON_REST_URL=http://node1:8082
./bin/start_management_ui.sh

The UI should be available at http://node1:4200 (login with user/password).

So far this UI has only been dev tested and there will likely be some bugs found. If reviewers feel they have found a critical bug that should be fixed before this can be accepted, please state that and we will address it ASAP. Otherwise I will create Jiras for bugs/issues that can be done as follow on work.

This is a very large pull request that contains mostly client-side code. The application was built on the Angular 2 framework using Angular CLI.

Changes that are outside of metron-interface/metron-config (Management UI module) include:

  • Addition of "/api/v1/grok/get/statement" REST endpoint that gets a grok statement from the classpath instead of HDFS
  • A couple fields added to the Storm topology status response (emitted and acked tuples)
  • Updated REST documentation
  • Apache Rat exclusions added to the top level pom.xml

There are a couple tasks still outstanding so don't merge until those are complete. These tasks should not affect functional testing or code review. They include:

  • add angular unit tests to the Maven build cycle (tests pass and can be run with npm test in the metron-config directory, they just don't get executed on a top level build yet)
  • optimize build process and dependencies (our build process is already painful, need to ensure this doesn't make it worse)
  • add architectural documentation to the README
  • resolve error when building the site-book

I will keep the thread updated as these are completed. Thanks for reviewing!

Pull Request Checklist

Thank you for submitting a contribution to Apache Metron (Incubating).
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:

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • 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.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?

For code changes:

  • Have you included steps to reproduce the behavior or problem that is being changed or addressed?

  • Have you included steps or a guide to how the change may be verified and tested manually?

  • 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 
    
  • Have you written or updated unit tests and or integration tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

  • 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:

  • 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
    bin/generate-md.sh
    mvn site: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 recommened that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.

rmerriman added 30 commits October 19, 2016 10:24
…me only if it doesn't exist and patternLabel is not appended to grokStatement (that now happens in middleware). Changed Stellar panel to Raw JSON.
… local filesystem. Also fixed some corner cases for sensorParserConfigHistoryService (history doesn't exist, deleting a history that doesn't exist, etc). Added context path to integration tests.
# Conflicts:
#	metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/SensorParserConfigHistoryService.java
# Conflicts:
#	pom.xml
@merrimanr merrimanr closed this Mar 24, 2017
@merrimanr merrimanr reopened this Mar 24, 2017
@merrimanr merrimanr closed this Mar 24, 2017
Copy link
Contributor

@simonellistonball simonellistonball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review (incomplete)

<metron-config-ace-editor [(ngModel)]="newGrokStatement" [ngModelOptions]="{standalone: true}" [type]="'GROK'" [options]="grokFunctionList" [placeHolder]="'Enter Grok statement'"> </metron-config-ace-editor>

<div class="buttons-bar">
<button type="submit" class="btn form-enable-disable-button" [disabled]="parseMessageRequest.sampleData.length===0 || newGrokStatement.length===0" (click)="onTestGrokStatement()">TEST</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this logic be in controller?

<button class="btn btn-primary" type="button" (click)="onEditSensor()" [disabled]="startStopInProgress">EDIT</button>

<button class="btn btn-primary" type="button" (click)="onStartSensor()" [disabled]="startStopInProgress" [hidden]="(topologyStatus.status != 'Stopped')">START</button>
<button class="btn form-enable-disable-button" type="button" (click)="onStopSensor()" [disabled]="startStopInProgress" [hidden]="((topologyStatus.status != 'Running' && topologyStatus.status != 'Disabled'))">STOP</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

controller logic?

</div>
</div>
<div class="col-xs-12 form-label threatIntel">{{ getRuleDisplayName() }}</div>
<a *ngIf="rules.length>0" class="collapsed blue-label font-weight-bold col-xs-8 col-xs-push-4" data-toggle="collapse" href="#collapseThreatTriage" aria-expanded="false" aria-controls="collapseThreatTriage" #threatTriageLink (click)="threatTriageLink.text=(threatTriageLink.text==='show more')?'show less':'show more'">show more</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be encapsulated in a controller function?

@@ -0,0 +1,51 @@
{
"project": {
"version": "1.0.0-beta.15",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we version this to match Metron versions? It's likely to run lock step with Metron from a release perspective.

disableParser() {
return waitForElementVisibility(this.disableButton).then(() => {
return this.disableButton.click().then(() => {
return waitForElementVisibility(this.enableButton).then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

promises should be really chained rather than nested... see other instances in this class too.


</div>

<br> <br> <br> <br>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better handled with styling css padding rather than linebreaks.

expect(component.globalConfig).toEqual(globalConfigService._config);
}));

it('should load save config', async(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should report save config?


}));

it('should load save config', async(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate test name

})
export class GeneralSettingsComponent implements OnInit {

@ViewChild('globalSettingsForm') globalSettingsForm: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type should be limited to the child component type


private fieldValidations: string;

constructor(private globalConfigService: GlobalConfigService, private metronAlerts: MetronAlerts,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this class is serialising to JSON for fieldValidations. Feels like unnecessary overhead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants