[jira] [Commented] (NIFI-5027) CLI - Add a command to start controller services

2018-04-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16426198#comment-16426198
 ] 

ASF GitHub Bot commented on NIFI-5027:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/2604


> CLI - Add a command to start controller services
> 
>
> Key: NIFI-5027
> URL: https://issues.apache.org/jira/browse/NIFI-5027
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Tools and Build
>Reporter: Pierre Villard
>Assignee: Bryan Bende
>Priority: Major
> Fix For: 1.7.0
>
> Attachments: TestStartStopCS.xml
>
>
> When importing a versioned process group from the registry, all the 
> components will be stopped (in case of update, only the newly added 
> components will be stopped). We already have a command pg-start to start a 
> process group, but it will fail if the process group relies on controller 
> services that should be enabled first.
> A new command like pg-enable-cs could be added, or just add a parameter/flag 
> to the pg-start command.
> Things to consider:
>  * there can be a dependency chain between the controller services requiring 
> to start the controller services in the right order. Example: the avro schema 
> registry CS and a reader/writer CS depending on the schema registry CS.
>  * there can be a CS defined at pg level that is not referenced by any 
> component inside the pg but that would need to be started nevertheless. 
> Example: the distributed map cache server CS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5027) CLI - Add a command to start controller services

2018-04-04 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16426197#comment-16426197
 ] 

ASF subversion and git services commented on NIFI-5027:
---

Commit 7abb02fff000e70523c8b7afb6d3b9a7df5c929f in nifi's branch 
refs/heads/master from [~bbende]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=7abb02f ]

NIFI-5027 Adding commands pg-get-services, pg-enable-services, and 
pg-disable-services
- Improving response when service is stuck enabling, and improving response 
when some services couldn't be enabled
- Throwing exception when a service is stuck enabling or can't be enabled so 
that standalone mode gets a non-zero status code, also allowing use of -verbose 
so stand-alone can decide if output is desired
- Improving information provided by pg-disable-services

Signed-off-by: Pierre Villard 

This closes #2604.


> CLI - Add a command to start controller services
> 
>
> Key: NIFI-5027
> URL: https://issues.apache.org/jira/browse/NIFI-5027
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Tools and Build
>Reporter: Pierre Villard
>Assignee: Bryan Bende
>Priority: Major
> Attachments: TestStartStopCS.xml
>
>
> When importing a versioned process group from the registry, all the 
> components will be stopped (in case of update, only the newly added 
> components will be stopped). We already have a command pg-start to start a 
> process group, but it will fail if the process group relies on controller 
> services that should be enabled first.
> A new command like pg-enable-cs could be added, or just add a parameter/flag 
> to the pg-start command.
> Things to consider:
>  * there can be a dependency chain between the controller services requiring 
> to start the controller services in the right order. Example: the avro schema 
> registry CS and a reader/writer CS depending on the schema registry CS.
>  * there can be a CS defined at pg level that is not referenced by any 
> component inside the pg but that would need to be started nevertheless. 
> Example: the distributed map cache server CS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5027) CLI - Add a command to start controller services

2018-04-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16426188#comment-16426188
 ] 

ASF GitHub Bot commented on NIFI-5027:
--

Github user pvillard31 commented on the issue:

https://github.com/apache/nifi/pull/2604
  
Just did some more testing and it looks good to me. Thanks for all the 
improvements. Just a note about the response code: it's equal to 255 on my Mac, 
but as long as it's not equal to 0, it's good for me. Thanks @bbende ! Merging 
to master.


> CLI - Add a command to start controller services
> 
>
> Key: NIFI-5027
> URL: https://issues.apache.org/jira/browse/NIFI-5027
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Tools and Build
>Reporter: Pierre Villard
>Assignee: Bryan Bende
>Priority: Major
> Attachments: TestStartStopCS.xml
>
>
> When importing a versioned process group from the registry, all the 
> components will be stopped (in case of update, only the newly added 
> components will be stopped). We already have a command pg-start to start a 
> process group, but it will fail if the process group relies on controller 
> services that should be enabled first.
> A new command like pg-enable-cs could be added, or just add a parameter/flag 
> to the pg-start command.
> Things to consider:
>  * there can be a dependency chain between the controller services requiring 
> to start the controller services in the right order. Example: the avro schema 
> registry CS and a reader/writer CS depending on the schema registry CS.
>  * there can be a CS defined at pg level that is not referenced by any 
> component inside the pg but that would need to be started nevertheless. 
> Example: the distributed map cache server CS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5027) CLI - Add a command to start controller services

2018-04-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16425278#comment-16425278
 ] 

ASF GitHub Bot commented on NIFI-5027:
--

Github user pvillard31 commented on the issue:

https://github.com/apache/nifi/pull/2604
  
Thanks @bbende. With your last changes:


#> nifi pg-enable-services -pgid &2 -u http://localhost:8080

Using a positional back-reference for 'Test 2 - Misconfigured CS'
Currently 0 enabled services and 1 disabled services, attempting to enable 
services...

Finished with 0 enabled services and 1 disabled services

The following services could not be enabled:

Service: 016210d5-759f-1d4a-d095-69323147e9dd - 
StandardRestrictedSSLContextService

Validation Errors:
- 'StandardRestrictedSSLContextService : 
016210d5-759f-1d4a-d095-69323147e9dd' is invalid because Does not have the 
KeyStore or the TrustStore populated

#>
#> nifi pg-enable-services -pgid &5 -u http://localhost:8080

Using a positional back-reference for 'Test 5 - Not referenced CS'
Currently 0 enabled services and 2 disabled services, attempting to enable 
services...
Currently 1 services are enabling, waiting to finish before proceeding (1 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (2 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (3 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (4 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (5 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (6 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (7 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (8 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (9 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (10 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (11 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (12 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (13 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (14 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (15 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (16 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (17 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (18 
of 20)
Currently 1 services are enabling, waiting to finish before proceeding (19 
of 20)

One or more services appear to be stuck enabling:

Service: 016210ec-759f-1d4a-3cf3-c507e978ffc5 - DistributedMapCacheServer

Reasons:
- DistributedMapCacheServer[id=016210ec-759f-1d4a-3cf3-c507e978ffc5] Failed 
to invoke @OnEnabled method due to java.net.BindException: Address already in 
use: Address already in use
- DistributedMapCacheServer[id=016210ec-759f-1d4a-3cf3-c507e978ffc5] Failed 
to invoke @OnEnabled method due to java.net.BindException: Address already in 
use: Address already in use


That's great!

Regarding the fact it's only displayed when using the interactive mode: I 
think it would make sense to also print it when using the "scripted" way (maybe 
just the error message you added with your last commit). I'd imagine users 
writing scripts redirecting the standard output to log files or using tools 
like Jenkins/Travis that already give you access to the standard output. If the 
script fails it would be useful to see what happened. Also, but I think it has 
already been mentioned in the previous PR for the CLI, having an exit code not 
equal to 0 could be useful to fail fast.

Test 2:

$ ./cli.sh nifi pg-enable-services -pgid 
016210c2-759f-1d4a-c230-abfde87350cf -u http://localhost:8080
$ echo $?
0



> CLI - Add a command to start controller services
> 
>
> Key: NIFI-5027
> URL: https://issues.apache.org/jira/browse/NIFI-5027
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Tools and Build
>Reporter: Pierre Villard
>Assignee: Bryan Bende
>Priority: Major
> Attachments: TestStartStopCS.xml
>
>
> When importing a versioned process group from the registry, all the 
> components will be stopped (in case of update, only the newly added 
> components will be stopped). We already have a command pg-start to start a 
> process group, but it will fail if the process group relies on 

[jira] [Commented] (NIFI-5027) CLI - Add a command to start controller services

2018-04-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16424654#comment-16424654
 ] 

ASF GitHub Bot commented on NIFI-5027:
--

Github user bbende commented on the issue:

https://github.com/apache/nifi/pull/2604
  
@pvillard31 thanks for the very thorough review, I'll take a look at some 
of these tomorrow and see what improvements can be made.

Regarding the lack of feedback on some commands... 

The way the enabling is implemented is by using a REST end-point that tells 
a process group to enable all of its controller services. So it checks how many 
are enabled, tells the PG to enable all, then checks how many are enabled, and 
basically when the # of enabled services stops changing then it means no more 
could be enabled, but the enable command isn't providing any response because 
it is an asynchronous command and doesn't know what was/wasn't enabled.

So for #2 we don't really know which CS couldn't be enabled, we just know 
no more were enabled. Maybe when it finishes we can list the validation errors 
for all of the invalid services.

For #5, the looping is something that can happen whenever any controller 
service gets stuck in the "enabling" state which can happen if it gets a stuck 
thread or an error. Right now it loops 120 times sleeping 1 second and then 
would break out and throw an error. This is obviously too long, but it is hard 
to say how long to wait, maybe 30 seconds?

For disabling, it just fires off a call to a REST end point and tells a PG 
to disable all it's services. I can see if we can make additional calls to get 
the count before and after and give some info.

Keeping in mind, all of the above info is only going to print in 
interactive mode. From standalone mode nothing is currently printed because I 
don't know if anything makes sense for someone writing a script.


> CLI - Add a command to start controller services
> 
>
> Key: NIFI-5027
> URL: https://issues.apache.org/jira/browse/NIFI-5027
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Tools and Build
>Reporter: Pierre Villard
>Assignee: Bryan Bende
>Priority: Major
> Attachments: TestStartStopCS.xml
>
>
> When importing a versioned process group from the registry, all the 
> components will be stopped (in case of update, only the newly added 
> components will be stopped). We already have a command pg-start to start a 
> process group, but it will fail if the process group relies on controller 
> services that should be enabled first.
> A new command like pg-enable-cs could be added, or just add a parameter/flag 
> to the pg-start command.
> Things to consider:
>  * there can be a dependency chain between the controller services requiring 
> to start the controller services in the right order. Example: the avro schema 
> registry CS and a reader/writer CS depending on the schema registry CS.
>  * there can be a CS defined at pg level that is not referenced by any 
> component inside the pg but that would need to be started nevertheless. 
> Example: the distributed map cache server CS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5027) CLI - Add a command to start controller services

2018-04-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16424573#comment-16424573
 ] 

ASF GitHub Bot commented on NIFI-5027:
--

Github user pvillard31 commented on the issue:

https://github.com/apache/nifi/pull/2604
  
Did multiple tests with different scenarios (I attached to the JIRA a 
template to test each scenario - cannot attached an XML file here).

**Test 1** - Normal case, processors relying on a single CS correctly 
configured.
=> Working as expected.

#> nifi pg-enable-services -pgid &1 -u http://localhost:8080/
Currently 0 enabled services and 1 disabled services, attempting to enable 
services...
Currently 1 services are enabling, waiting to finish before proceeding...
Currently 1 enabled services and 0 disabled services, attempting to enable 
services...

Finished with 1 enabled services and 0 disabled services

No more services could be enabled, exiting...


**Test 2** - Misconfigured CS that cannot be enabled.
=> One remark: no information regarding why the CS cannot be enabled. 
Ideally, providing the reason why the CS cannot be enabled would be great (like 
in the tooltip), not sure we have the info though. But at least saying that the 
CS "x" cannot be enabled, no?

#> nifi pg-enable-services -pgid &2 -u http://localhost:8080/

Using a positional back-reference for 'Test 2 - Misconfigured CS'
Currently 0 enabled services and 1 disabled services, attempting to enable 
services...

Finished with 0 enabled services and 1 disabled services

No more services could be enabled, exiting...


**Test 3** - CS referencing another CS
=> Working as expected.

#> nifi pg-enable-services -pgid &3 -u http://localhost:8080/

Using a positional back-reference for 'Test 3 - CS referencing CS'
Currently 0 enabled services and 3 disabled services, attempting to enable 
services...
Currently 1 services are enabling, waiting to finish before proceeding...
Currently 2 enabled services and 1 disabled services, attempting to enable 
services...
Currently 1 services are enabling, waiting to finish before proceeding...
Currently 3 enabled services and 0 disabled services, attempting to enable 
services...

Finished with 3 enabled services and 0 disabled services

No more services could be enabled, exiting...


**Test 4** - No CS to start for the process group.
=> Working as expected.

#> nifi pg-enable-services -pgid &4 -u http://localhost:8080/

Using a positional back-reference for 'Test 4 - No CS'
Currently 0 enabled services and 0 disabled services, attempting to enable 
services...

Finished with 0 enabled services and 0 disabled services

No more services could be enabled, exiting...


**Test 5** - CS relying on an unreferenced CS (distributed map cache client 
service / server) with a CS that cannot be properly started (distributed server 
trying to start on a port already used)
=> Would it be possible to say what CS is causing the issue? Also, once the 
command is looping, no way to kill it with ctrl+C, esc, etc. Not really a big 
issue, but just mentioning it.

#> nifi pg-enable-services -pgid &5 -u http://localhost:8080

Using a positional back-reference for 'Test 5 - Not referenced CS'
Currently 0 enabled services and 2 disabled services, attempting to enable 
services...
Currently 1 services are enabling, waiting to finish before proceeding...
Currently 1 services are enabling, waiting to finish before proceeding...
Currently 1 services are enabling, waiting to finish before proceeding...
Currently 1 services are enabling, waiting to finish before proceeding...


**Test 6** - CS relying on an unreferenced CS (distributed map cache client 
service / server)
=> Working as expected.

#> nifi pg-enable-services -pgid &6 -u http://localhost:8080

Using a positional back-reference for 'Test 6 - Not referenced CS'
Currently 0 enabled services and 2 disabled services, attempting to enable 
services...
Currently 2 enabled services and 0 disabled services, attempting to enable 
services...

Finished with 2 enabled services and 0 disabled services

No more services could be enabled, exiting...


Then tried to disabled the CS, everything is working as expected. Could be 
nice to say how many CS have been disabled?

#> nifi pg-disable-services -pgid &1 -u http://localhost:8080

Using a positional back-reference for 'Test 1 - Basic case'
#> nifi pg-disable-services -pgid &2 -u http://localhost:8080

Using a positional back-reference for 'Test 2 - Misconfigured CS'
#> nifi 

[jira] [Commented] (NIFI-5027) CLI - Add a command to start controller services

2018-04-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16424440#comment-16424440
 ] 

ASF GitHub Bot commented on NIFI-5027:
--

Github user pvillard31 commented on the issue:

https://github.com/apache/nifi/pull/2604
  
Giving it a try...


> CLI - Add a command to start controller services
> 
>
> Key: NIFI-5027
> URL: https://issues.apache.org/jira/browse/NIFI-5027
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Tools and Build
>Reporter: Pierre Villard
>Assignee: Bryan Bende
>Priority: Major
>
> When importing a versioned process group from the registry, all the 
> components will be stopped (in case of update, only the newly added 
> components will be stopped). We already have a command pg-start to start a 
> process group, but it will fail if the process group relies on controller 
> services that should be enabled first.
> A new command like pg-enable-cs could be added, or just add a parameter/flag 
> to the pg-start command.
> Things to consider:
>  * there can be a dependency chain between the controller services requiring 
> to start the controller services in the right order. Example: the avro schema 
> registry CS and a reader/writer CS depending on the schema registry CS.
>  * there can be a CS defined at pg level that is not referenced by any 
> component inside the pg but that would need to be started nevertheless. 
> Example: the distributed map cache server CS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5027) CLI - Add a command to start controller services

2018-04-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16424405#comment-16424405
 ] 

ASF GitHub Bot commented on NIFI-5027:
--

GitHub user bbende opened a pull request:

https://github.com/apache/nifi/pull/2604

NIFI-5027 Adding pg-get-services command

NIFI-5027 Adding pg-enable-services command

NIFI-5027 Adding pg-disable-services command

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

- [ ] Does your PR title start with NIFI- where  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)?

- [ ] Is your initial contribution a single, squashed commit?

### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit 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](http://www.apache.org/legal/resolved.html#category-a)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### 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.


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

$ git pull https://github.com/bbende/nifi NIFI-5027

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

https://github.com/apache/nifi/pull/2604.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 #2604


commit dc3f4fa08ce395551db7f93a4377fe83ad3e8ed7
Author: Bryan Bende 
Date:   2018-04-03T13:30:30Z

NIFI-5027 Adding pg-get-services command

NIFI-5027 Adding pg-enable-services command

NIFI-5027 Adding pg-disable-services command




> CLI - Add a command to start controller services
> 
>
> Key: NIFI-5027
> URL: https://issues.apache.org/jira/browse/NIFI-5027
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Tools and Build
>Reporter: Pierre Villard
>Priority: Major
>
> When importing a versioned process group from the registry, all the 
> components will be stopped (in case of update, only the newly added 
> components will be stopped). We already have a command pg-start to start a 
> process group, but it will fail if the process group relies on controller 
> services that should be enabled first.
> A new command like pg-enable-cs could be added, or just add a parameter/flag 
> to the pg-start command.
> Things to consider:
>  * there can be a dependency chain between the controller services requiring 
> to start the controller services in the right order. Example: the avro schema 
> registry CS and a reader/writer CS depending on the schema registry CS.
>  * there can be a CS defined at pg level that is not referenced by any 
> component inside the pg but that would need to be started nevertheless. 
> Example: the distributed map cache server CS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)