Build failed in Jenkins: brooklyn-master-build #446

2016-09-30 Thread Apache Jenkins Server
See 

--
[...truncated 57948 lines...]
[INFO] Installing 

 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/brooklyn/shared-packaging/0.10.0-SNAPSHOT/shared-packaging-0.10.0-SNAPSHOT-test-sources.jar
[INFO] 
[INFO] 
[INFO] Building Brooklyn DEB Package 0.10.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ deb-packaging ---
[INFO] Deleting 

[INFO] Deleting 

 (includes = [brooklyn*.log, brooklyn*.log.*, stacktrace.log, test-output, 
prodDb.*], excludes = [])
[INFO] 
[INFO] --- maven-replacer-plugin:1.4.1:replace 
(fix-eclipse-dot-classpath-mangling) @ deb-packaging ---
[INFO] Ignoring missing file
[INFO] Replacement run on 0 file.
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.3:create (default) @ deb-packaging ---
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (brooklyn-build-req) @ 
deb-packaging ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ deb-packaging 
---
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.13:check (verify-style) @ deb-packaging ---
[INFO] 
[INFO] 
[INFO] --- maven-site-plugin:3.4:attach-descriptor (attach-descriptor) @ 
deb-packaging ---
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:unpack (unpack) @ deb-packaging ---
[INFO] Configured Artifact: 
org.apache.brooklyn:brooklyn-dist:dist:0.10.0-SNAPSHOT:tar.gz
[INFO] Configured Artifact: 
org.apache.brooklyn:shared-packaging:0.10.0-SNAPSHOT:jar
[INFO] Unpacking 

 to 

 with includes "" and excludes ""
[INFO] Expanding: 

 into 

[INFO] Unpacking 

 to 

 with includes "" and excludes ""
[INFO] 
[INFO] --- jdeb:1.5:jdeb (default) @ deb-packaging ---
[INFO] Creating debian package: 

[INFO] Building conffiles
[INFO] Adding conffile: etc/brooklyn/brooklyn.conf
[INFO] Adding conffile: etc/brooklyn/logback.xml
[INFO] Creating changes file: 

[INFO] Attaching created debian package 

[INFO] 
[INFO] --- apache-rat-plugin:0.11:check (default) @ deb-packaging ---
[INFO] 51 implicit excludes (use -debug for more details).
[INFO] Exclude: sandbox/**
[INFO] Exclude: release/**
[INFO] Exclude: README.md
[INFO] Exclude: **/nbactions.xml
[INFO] Exclude: **/nb-configuration.xml
[INFO] Exclude: **/.git/**
[INFO] Exclude: **/.gitignore
[INFO] Exclude: **/.repository/**
[INFO] Exclude: **/.idea/**
[INFO] Exclude: **/*.iml
[INFO] Exclude: **/.classpath/**
[INFO] Exclude: **/.project
[INFO] Exclude: **/.settings/**
[INFO] Exclude: **/*.log
[INFO] Exclude: **/brooklyn*.log.*
[INFO] Exclude: **/target/**
[INFO] Exclude: ignored/**
[INFO] Exclude: LICENSE.md
[INFO] Exclude: **/src/main/license/**
[INFO] Exclude: **/src/test/license/**
[INFO] Exclude: **/MANIFEST.MF
[INFO] Exclude: **/test-output/**
[INFO] Exclude: **/*.pem.pub
[INFO] Exclude: **/*.pem
[INFO] Exclude: **/*_rsa.pub
[INFO] Exclude: **/*_rsa
[INFO] Exclude: **/*.svg
[INFO] Exclude: **/*.crt
[INFO] Exclude: **/*.csr
[INFO] Exclude: **/*.key
[INFO] Exclude: **/*.key.org
[INFO] Exclude: **/*.psd
[INFO] Exclude: **/*.json
[INFO] Exclude: **/*.plxarc
[INFO] Exclude: 
**/src/test/resources/org/apache/brooklyn/entity/software/base/template_with_extra_substitutions.txt
[INFO] Exclude: **/src/main/resources/banner.txt
[INFO] Exclude: **/src/test/resources/ssl/certs/localhost/info.txt
[INFO] Exclude: **/src/main/history/dependencies.xml

[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-ui/pull/34


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui issue #34: Use new pinned and constraints flag returned by the R...

2016-09-30 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-ui/pull/34
  
Thanks for the updates @tbouron, merging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread tbouron
Github user tbouron commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81372043
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,10 +680,12 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return !isNaN(cfg.priority) ? cfg.priority : 9;
+}).each(function (cfg) {
+if (cfg.pinned === true || 
(cfg.contraints.indexOf('required') > -1 && typeof cfg.defaultValue === 
'string' && cfg.defaultValue === '')) {
--- End diff --

Sorry but it's not possible. In case of `defaultValue == null` in java, [it 
is not 
serialised](https://github.com/apache/brooklyn-server/blob/master/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ConfigSummary.java#L45-L46)
 therefore, the only possibilities are either `undefined` or a non empty string.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81371242
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,10 +680,12 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return !isNaN(cfg.priority) ? cfg.priority : 9;
+}).each(function (cfg) {
+if (cfg.pinned === true || 
(cfg.contraints.indexOf('required') > -1 && typeof cfg.defaultValue === 
'string' && cfg.defaultValue === '')) {
--- End diff --

Correct.
`defaultValue` on the other hand can be `null` and is serialized as 
`undefined`. The check above doesn't handle the `defaultValue is null` case.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81370118
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,10 +680,12 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return !isNaN(cfg.priority) ? cfg.priority : 9;
+}).each(function (cfg) {
+if (cfg.pinned === true || 
(cfg.contraints.indexOf('required') > -1 && typeof cfg.defaultValue === 
'string' && cfg.defaultValue === '')) {
--- End diff --

That's the `defaultValue`, not `constraints`. It can (and will frequently) 
be null.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread tbouron
Github user tbouron commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81368420
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,10 +680,12 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return !isNaN(cfg.priority) ? cfg.priority : 9;
--- End diff --

Do you really want me to change it again?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread tbouron
Github user tbouron commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81367589
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,10 +680,12 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return !isNaN(cfg.priority) ? cfg.priority : 9;
+}).each(function (cfg) {
+if (cfg.pinned === true || 
(cfg.contraints.indexOf('required') > -1 && typeof cfg.defaultValue === 
'string' && cfg.defaultValue === '')) {
--- End diff --

> Would be weird to have a defaultValue the empty string and required at 
the same time, but you never know :)

That's the point of this check, what if as a blueprint author I want to 
ensure that one of my parameter has be filled without giving it a default? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81365746
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,10 +680,12 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return !isNaN(cfg.priority) ? cfg.priority : 9;
--- End diff --

Nitpick, The REST API is configured with `@JsonSerialize(include = 
JsonSerialize.Inclusion.NON_NULL)` so `null` values server-side won't be 
included in the response (will be `undefined`). Given that the original check 
`cfg.priority !== undefined` is more explicit - for example `isNaN(null) == 
false` so not really clear what's the purpose of the check when reading the 
code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread tbouron
Github user tbouron commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81367055
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,10 +680,12 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return !isNaN(cfg.priority) ? cfg.priority : 9;
+}).each(function (cfg) {
+if (cfg.pinned === true || 
(cfg.contraints.indexOf('required') > -1 && typeof cfg.defaultValue === 
'string' && cfg.defaultValue === '')) {
--- End diff --

> This doesn't handle defaultValue == null (or is null converted to '' 
somethere?).
Could do

This would never happens as the REST API returns the `Predicate.toString()`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Children of VanillaSoftwareProcess and service.isUp

2016-09-30 Thread Mike Zaccardo
Hi,

I have a blueprint that consists of a `VanillaSoftwareProcess` (VSP) with a
number of children entities. If any of these children go on fire, the
parent VSP still reports as healthy, but I'd really like it to go on fire
as well. In other words, I want the parent VSP to report as healthy if and
only if all of its children are also healthy. Is this achievable in YAML /
how do I go about doing that?

Here is an example blueprint which showcases this issue:
https://gist.github.com/mikezaccardo/227d00f0a90ed46ad7350b067e416bf4. Once
deployed, you can cause a child entity to go on fire simply by removing the
file that is checked. At this point even though the child entity is on fire
the, parent will remain green.

Thanks,
Mike


[GitHub] brooklyn-ui issue #34: Use new pinned and constraints flag returned by the R...

2016-09-30 Thread tbouron
Github user tbouron commented on the issue:

https://github.com/apache/brooklyn-ui/pull/34
  
@neykov Comments addressed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #361: Add disable flag to shared sg customizer

2016-09-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/361


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81357381
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,8 +680,13 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return cfg.priority ? cfg.priority : 9;
+}).each(function (cfg) {
+if (cfg.pinned === true) {
+var html = _.template(RequiredConfigEntryHtml, 
{data:cfg});
+that.$('.config-table').append(html);
+} else if (cfg.constraints.indexOf('required') > - 
1 && (!cfg.defaultValue || cfg.defaultValue === '')) {
--- End diff --

More importantly having a default value of 0 will mess the check - handle 
it explicitly (should not show if required & defaultVAlue = 0).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui issue #34: Use new pinned and constraints flag returned by the R...

2016-09-30 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-ui/pull/34
  
Needs fixing the `priority=0` case, the rest is nitpicks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81356873
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,8 +680,13 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return cfg.priority ? cfg.priority : 9;
+}).each(function (cfg) {
+if (cfg.pinned === true) {
+var html = _.template(RequiredConfigEntryHtml, 
{data:cfg});
+that.$('.config-table').append(html);
+} else if (cfg.constraints.indexOf('required') > - 
1 && (!cfg.defaultValue || cfg.defaultValue === '')) {
--- End diff --

Both cases have the same body so can merge the check by `||`-ing the two 
alternatives (two make it clear that teartment is the same)
`''` is treated as false so could change `(!cfg.defaultValue || 
cfg.defaultValue === '')` to `!cfg.defaultValue`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-ui/pull/34#discussion_r81355465
  
--- Diff: src/main/webapp/assets/js/view/application-add-wizard.js ---
@@ -680,8 +680,13 @@ define([
 this.$('.required-config-loading').hide()
 if (catalogEntryItem!=null && 
catalogEntryItem.config!=null) {
 var that = this
-_.each(catalogEntryItem.config, function (cfg) {
-if (cfg.priority !== undefined) {
+_.chain(catalogEntryItem.config).sortBy(function (cfg){
+return cfg.priority ? cfg.priority : 9;
--- End diff --

`priority = 0` is a valid value


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-docs pull request #112: Add documentation about pinned field for Br...

2016-09-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-docs/pull/112


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #364: Rebind when entity starting: report notUp...

2016-09-30 Thread aledsage
GitHub user aledsage opened a pull request:

https://github.com/apache/brooklyn-server/pull/364

Rebind when entity starting: report notUpIndicator for reason

Entity is reported as on-fire if the starting/stopping task was
aborted due to a Brooklyn rebind. This will set the
SERVICE_NOT_IP_INDICATORS to say what the problem is.

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

$ git pull https://github.com/aledsage/brooklyn-server 
rebind-when-entity-startingOrStopping

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

https://github.com/apache/brooklyn-server/pull/364.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 #364


commit 9e88ff72e576955eae700bc953d26fbfffcf615a
Author: Aled Sage 
Date:   2016-09-30T11:32:54Z

Rebind when entity starting: report notUpIndicator for reason

Entity is reported as on-fire if the starting/stopping task was
aborted due to a Brooklyn rebind. This will set the
SERVICE_NOT_IP_INDICATORS to say what the problem is.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #361: Add disable flag to shared sg customizer

2016-09-30 Thread duncangrant
Github user duncangrant commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/361#discussion_r81350227
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/SharedLocationSecurityGroupCustomizer.java
 ---
@@ -106,8 +115,17 @@ public void setCidr(String cidr) {
 this.cidr = cidr;
 }
 
+/**
+ * @param enableSharedSG set to false to disable this customizer
+ */
+public void setEnableSharedSG(boolean enableSharedSG) {
--- End diff --

Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #358: Allow REST API to return the pinned confi...

2016-09-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/358


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #358: Allow REST API to return the pinned config key a...

2016-09-30 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/358
  
Thanks, merging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #358: Allow REST API to return the pinned config key a...

2016-09-30 Thread tbouron
Github user tbouron commented on the issue:

https://github.com/apache/brooklyn-server/pull/358
  
@neykov Ah ok, I didn't know. Squashed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #358: Allow REST API to return the pinned config key a...

2016-09-30 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/358
  
Unfortunately it doesn't work for Apache projects. The github repo is a 
read-only copy of the Apache repo where this will get merged. Also can't use 
the "share branch with committers" feature.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


simplifying yaml input with a yaml object mapping language

2016-09-30 Thread Alex Heneveld


Hi devs,

I've been spiking a new approach to our YAML modelling for java objects.

The root problem I want to solve is to that it's tedious, inconsistent, 
and poorly documented how YAML should map on to the Java items.  Every 
new place we want to do this we use ad hoc code. This is an obstacle to 
writing new java items which can easily be configured in YAML by any 
Brooklyn user.


The idea of the solution is to have a schema for mapping Java <-> YAML 
so you can simply annotate the Java classes and the job's done.  You get 
a working schema for reading from YAML without having to think about 
it.  The thinking is that this lets us make many more things expressible 
in YAML, including:


* effectors defined as sequences of tasks
* common predicates (as has been discussed in #282 [1] and the mailing list)
* more sensor feeds, policies, etc

I've built a prototype called "YOML" (YAML Object Mapping Language) and 
opened a PR for it [2].


As it stands it supports reading and writing (so we could improve our 
persistence model and be able to output reusable plans from the current 
state of the world -- though I've not worked on those), and it's 
designed to be very flexible, optimizing for the experience of the human 
reading and writing it.


It also has hooks for reflecting about itself -- meaning we could 
generate documentation and code completion proposals with explanations 
for everything that is YOML'd (though again not implemented).


It's integrated with the new BrooklynTypeRegistry (code which replaces 
the old fixed-type-category catalog, allowing arbitrary types and 
aliases; it's used currently, but not persisted, and we're not taking 
advantage of it yet; we could also use this to restrict who can use 
which types) and has a TypePlanTransformer so we can use it in specific 
places.  You can use anywhere the YAML DSL is supported by saying 
`$brooklyn:object-yoml: ...`, and it's hooked in specially in one place, 
under brooklyn.initializers if you supply a map (previously only a list 
was allowed), with some sensor/effector tests at [3], in short allowing:


- type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
  brooklyn.initializers:
echo-hi-name-from-config:
  type: ssh-effector
  command: echo hi ${NAME}
  env:
NAME: $brooklyn:config("name")
date:
  type: ssh-sensor
  command: date
  period: 100ms
  brooklyn.config:
name: bob

A detailed write-up is at [4].

I could do an online brown-bag session next week if folks are interested.

Best
Alex


[1] https://github.com/apache/brooklyn-server/pull/282
[2] https://github.com/apache/brooklyn-server/pull/363
[3] 
https://github.com/ahgittin/brooklyn-server/blob/yoml/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/yoml/YomlTypeRegistryEntityInitializersTest.java
[4] 
https://github.com/ahgittin/brooklyn-server/blob/yoml/utils/common/src/main/java/org/apache/brooklyn/util/yoml/sketch.md




[GitHub] brooklyn-server pull request #363: YOML = YAML object mapping language [BIG!...

2016-09-30 Thread ahgittin
GitHub user ahgittin opened a pull request:

https://github.com/apache/brooklyn-server/pull/363

YOML = YAML object mapping language [BIG!]

*As discussed on mailing list...*

I've been spiking a new approach to our YAML modelling for java objects.

The root problem I want to solve is to that it's tedious, inconsistent, and 
poorly documented how YAML should map on to the Java items.  Every new place we 
want to do this we use ad hoc code.  This is an obstacle to writing new java 
items which can easily be configured in YAML by any Brooklyn user.

The idea of the solution is to have a schema for mapping Java <-> YAML so 
you can simply annotate the Java classes and the job's done.  You get a working 
schema for reading from YAML without having to think about it.  The thinking is 
that this lets us make many more things expressible in YAML, including:

* effectors defined as sequences of tasks
* common predicates (as has been discussed in #282 [1] and the mailing list)
* more sensor feeds, policies, etc

I've built a prototype called "YOML" (YAML Object Mapping Language) and 
opened a PR for it [2].

As it stands it supports reading and writing (so we could improve our 
persistence model and be able to output reusable plans from the current state 
of the world -- though I've not worked on those), and it's designed to be very 
flexible, optimizing for the experience of the human reading and writing it.

It also has hooks for reflecting about itself -- meaning we could generate 
documentation and code completion proposals with explanations for everything 
that is YOML'd (though again not implemented).

It's integrated with the new BrooklynTypeRegistry (code which replaces the 
old fixed-type-category catalog, allowing arbitrary types and aliases; it's 
used currently, but not persisted, and we're not taking advantage of it yet; we 
could also use this to restrict who can use which types) and has a 
TypePlanTransformer so we can use it in specific places.  You can use anywhere 
the YAML DSL is supported by saying `$brooklyn:object-yoml: ...`, and it's 
hooked in specially in one place, under brooklyn.initializers if you supply a 
map (previously only a list was allowed), with some sensor/effector tests at 
[3], in short allowing:

- type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
  brooklyn.initializers:
echo-hi-name-from-config:
  type: ssh-effector
  command: echo hi ${NAME}
  env:
NAME: $brooklyn:config("name")
date:
  type: ssh-sensor
  command: date
  period: 100ms
  brooklyn.config:
name: bob

A detailed write-up is at [4].

I could do an online brown-bag session next week if folks are interested.

[1]  https://github.com/apache/brooklyn-server/pull/282
[2] (this)
[3] 
https://github.com/ahgittin/brooklyn-server/blob/yoml/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/yoml/YomlTypeRegistryEntityInitializersTest.java
[4] 
https://github.com/ahgittin/brooklyn-server/blob/yoml/utils/common/src/main/java/org/apache/brooklyn/util/yoml/sketch.md

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

$ git pull https://github.com/ahgittin/brooklyn-server yoml

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

https://github.com/apache/brooklyn-server/pull/363.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 #363


commit 2a05370de0da5af73cb80276620cd923af0659a6
Author: Alex Heneveld 
Date:   2016-09-30T13:19:10Z

bump httpcomponents versions

note core and client are no longer kept in sync; latest version of each has 
been taken

commit 1d4a289ef55834e494ce493046fa1a6ab4b4026e
Author: Alex Heneveld 
Date:   2016-06-09T16:01:00Z

Start work on YAML Object Relational Mapping Language

commit 7d350e1b88e0c933eeb97eeabf91a885368d1248
Author: Alex Heneveld 
Date:   2016-09-28T14:28:02Z

minor tidies to utils

commit 29e1277254e40a5a21e7ff50042e2844e295cbf6
Author: Alex Heneveld 
Date:   2016-09-28T14:34:34Z

add static Maybe.getException(maybe) to avoid messy casts to Absent, and 
Asserts methods

commit 76aec8b48aa9ce7b801a8264c0e86cd909b4ec4c
Author: Alex Heneveld 
Date:   2016-06-24T10:03:40Z

more YORML improvements, now dealing with fields in fields, primtives, and 
coercion

commit 0ebe35430a76e8aeb8b6725b751eadabcebb7994
Author: Alex Heneveld 
Date:   2016-06-24T10:13:27Z

flesh out much more of YORML

commit b28016bb5b9fce34ddb2c420e371c4686b355e47
Author: Alex Heneveld 

[GitHub] brooklyn-server issue #358: Allow REST API to return the pinned config key a...

2016-09-30 Thread tbouron
Github user tbouron commented on the issue:

https://github.com/apache/brooklyn-server/pull/358
  
@neykov You can do it from the [Github UI 
directly](https://help.github.com/articles/merging-a-pull-request/#merging-a-pull-request-using-the-github-web-interface)
 ;)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #358: Allow REST API to return the pinned config key a...

2016-09-30 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/358
  
Looks great @tbouron. Can you squash then good to merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #362: bump httpcomponents versions

2016-09-30 Thread ahgittin
GitHub user ahgittin opened a pull request:

https://github.com/apache/brooklyn-server/pull/362

bump httpcomponents versions

note core and client are no longer kept in sync; latest version of each has 
been taken

this seems to fix strange problems with `HttpRequestSensorYamlTest` failing 
in maven but working in eclipse, presumably due to use of `TestHttpServer` 
using these components.  it does not however fix the JVM crash in that test 
under java 7 sadly.

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

$ git pull https://github.com/ahgittin/brooklyn-server 
bump-httpcomponents-versions

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

https://github.com/apache/brooklyn-server/pull/362.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 #362


commit da2453de7a50ba05f7443d32ecbd01e522425fa6
Author: Alex Heneveld 
Date:   2016-09-30T13:19:10Z

bump httpcomponents versions

note core and client are no longer kept in sync; latest version of each has 
been taken




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15535975#comment-15535975
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
+1 for  merging.


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
>   at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error 

[GitHub] brooklyn-server issue #341: BROOKLYN-349: fix DSL resolution in location

2016-09-30 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
+1 for  merging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #358: Allow REST API to return the pinned config key a...

2016-09-30 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/358
  
LGTM - very minor comments only.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #358: Allow REST API to return the pinned confi...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/358#discussion_r81334424
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java ---
@@ -375,12 +376,14 @@ public static WeightedParameter 
getFieldConfig(ConfigKey config, Field config
 CatalogConfig catalogConfig = 
configKeyField.getAnnotation(CatalogConfig.class);
 String label = config.getName();
 Double priority = null;
+Boolean pinned = Boolean.FALSE;
--- End diff --

I take it back - non-anotated items should be unpinned.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #279: Allow provisioning.properties to reference resol...

2016-09-30 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/279
  
@grkvlt https://github.com/apache/brooklyn-server/pull/341 is now merged, 
so this PR is no longer needed. Can you close it please (assuming you agree)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #358: Allow REST API to return the pinned confi...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/358#discussion_r81334163
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java ---
@@ -375,12 +376,14 @@ public static WeightedParameter 
getFieldConfig(ConfigKey config, Field config
 CatalogConfig catalogConfig = 
configKeyField.getAnnotation(CatalogConfig.class);
 String label = config.getName();
 Double priority = null;
+Boolean pinned = Boolean.FALSE;
--- End diff --

Shouldn't the default be `true`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #358: Allow REST API to return the pinned confi...

2016-09-30 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/358#discussion_r81333940
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/config/BasicConfigKey.java ---
@@ -422,15 +422,15 @@ public BasicConfigKeyOverwriting(Builder 
builder, ConfigKey parent) {
 parentKey = parent;
 Preconditions.checkArgument(Objects.equal(builder.name, 
parent.getName()), "Builder must use key of the same name.");
 }
-
+
 public BasicConfigKeyOverwriting(ConfigKey key, T defaultValue) 
{
 this(builder(key).defaultValue(defaultValue), key);
 }
-
+
 public BasicConfigKeyOverwriting(ConfigKey key, String 
newDescription, T defaultValue) {
 
this(builder(key).description(newDescription).defaultValue(defaultValue), key);
 }
-
+
--- End diff --

No non-white space changes in the file, can you remove from the change set.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #341: BROOKLYN-349: fix DSL resolution in locat...

2016-09-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/341


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15535932#comment-15535932
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/341


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
>   at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> 

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15535929#comment-15535929
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
Tested by @duncangrant (for his use-case with kubernetes in clocker, which 
also motivated his https://github.com/apache/brooklyn-server/pull/361). Merging 
now.


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
>   at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:

[GitHub] brooklyn-server issue #341: BROOKLYN-349: fix DSL resolution in location

2016-09-30 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
Tested by @duncangrant (for his use-case with kubernetes in clocker, which 
also motivated his https://github.com/apache/brooklyn-server/pull/361). Merging 
now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #361: Add disable flag to shared sg customizer

2016-09-30 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/361#discussion_r81332824
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/SharedLocationSecurityGroupCustomizer.java
 ---
@@ -106,8 +115,17 @@ public void setCidr(String cidr) {
 this.cidr = cidr;
 }
 
+/**
+ * @param enableSharedSG set to false to disable this customizer
+ */
+public void setEnableSharedSG(boolean enableSharedSG) {
--- End diff --

Maybe just call this `setEnabled()`? Possibly mark it as `@Beta`? No strong 
feelings from me though.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #358: Allow REST API to return the pinned config key a...

2016-09-30 Thread tbouron
Github user tbouron commented on the issue:

https://github.com/apache/brooklyn-server/pull/358
  
@neykov Comments addressed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #361: Add disable flag to shared sg customizer

2016-09-30 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/361
  
LGTM; feel free to ignore my comment - no strong feelings. Will merge once 
jenkins finishes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #361: Add disable flag to shared sg customizer

2016-09-30 Thread duncangrant
GitHub user duncangrant opened a pull request:

https://github.com/apache/brooklyn-server/pull/361

Add disable flag to shared sg customizer

This flag allows the shared sg to be disabled in yaml

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

$ git pull https://github.com/duncangrant/brooklyn-server 
add-disable-flag-shared-sg

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

https://github.com/apache/brooklyn-server/pull/361.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 #361


commit 09bed4940ffad6c9c4bbab3adafa28eabbb78f87
Author: Duncan Grant 
Date:   2016-09-30T12:45:39Z

Add disable flag to shared sg customizer

This flag allows the shared sg to be disabled in yaml




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #355: Reduce decisions for HostAndPort which will be u...

2016-09-30 Thread bostko
Github user bostko commented on the issue:

https://github.com/apache/brooklyn-server/pull/355
  
I am fixing

```
machineLocation = 
registerWinRmMachineLocation(computeService, node, managementHostAndPort, 
sshHostAndPortOverride, setup);
machineLocation = 
registerJcloudsSshMachineLocation(computeService, node, 
Optional.fromNullable(template), userCredentials, managementHostAndPort, 
sshHostAndPortOverride, vmHostname, setup);
```
 to use the initial address.

I also trying to make choosing `managementHostAndPort` code simpler and 
easier to maintain.

@grkvlt @neykov could you also take a look at the docker part related to 
this PR?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (BROOKLYN-325) Restarting Brooklyn while entity deploying: entity shown as deploying indefinitely

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15535478#comment-15535478
 ] 

ASF GitHub Bot commented on BROOKLYN-325:
-

Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/356


> Restarting Brooklyn while entity deploying: entity shown as deploying 
> indefinitely
> --
>
> Key: BROOKLYN-325
> URL: https://issues.apache.org/jira/browse/BROOKLYN-325
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> When the Brooklyn server restarts while an entity is halfway through starting 
> or stopping, on rebind that entity continues to report its sensor as 
> starting/stopping. However, the task does not resume so it stays in this 
> state indefinitely.
> To reproduce, run Brooklyn with persistence enabled, and try deploying a 
> blueprint like that below:
> {noformat}
> location: localhost
> services:
> - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
>   brooklyn.config:
> launch.command: sleep 20
> stop.command: sleep 20
> checkRunning.command: true
> {noformat}
> While the app is starting, terminate the Brooklyn server and then restart it. 
> In the UI, the spinning icon shows that the app is still deploying. The 
> entity has the following sensor values:
> {noformat}
> service.isUp: false
> service.notUp.indicators: {"service.process.isRunning":"No information on 
> whether this service is running"}
> service.state: STARTING
> service.state.expected: starting @ 1470658910966 / Mon Aug 08 13:21:50 BST 
> 2016
> {noformat}
> Alternatively, deploy the app normally and then invoke stop. While the app is 
> stopping, terminate the Brooklyn server and then restart it. The entity has 
> the following sensor values:
> {noformat}
> service.process.isRunning: false
> service.state: STOPPING
> service.state.expected: stopping @ 1470658816662 / Mon Aug 08 13:20:16 BST 
> 2016
> {noformat}
> Given that the task won't resume, I'd expect the entity to be marked as 
> having some kind of error. For example, the service.state as on-fire (but 
> ideally without losing the fact that it was previously stopping).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] brooklyn-server pull request #356: BROOKLYN-325 Rebind entity starting

2016-09-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/356


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (BROOKLYN-325) Restarting Brooklyn while entity deploying: entity shown as deploying indefinitely

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15535473#comment-15535473
 ] 

ASF GitHub Bot commented on BROOKLYN-325:
-

Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/356
  
Thanks @iyovcheva - LGTM; merging. We can look at the other TODOs in 
SoftwareProcessRebindNotRunningEntityTest.java (which were removed in the final 
commit?!).


> Restarting Brooklyn while entity deploying: entity shown as deploying 
> indefinitely
> --
>
> Key: BROOKLYN-325
> URL: https://issues.apache.org/jira/browse/BROOKLYN-325
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> When the Brooklyn server restarts while an entity is halfway through starting 
> or stopping, on rebind that entity continues to report its sensor as 
> starting/stopping. However, the task does not resume so it stays in this 
> state indefinitely.
> To reproduce, run Brooklyn with persistence enabled, and try deploying a 
> blueprint like that below:
> {noformat}
> location: localhost
> services:
> - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
>   brooklyn.config:
> launch.command: sleep 20
> stop.command: sleep 20
> checkRunning.command: true
> {noformat}
> While the app is starting, terminate the Brooklyn server and then restart it. 
> In the UI, the spinning icon shows that the app is still deploying. The 
> entity has the following sensor values:
> {noformat}
> service.isUp: false
> service.notUp.indicators: {"service.process.isRunning":"No information on 
> whether this service is running"}
> service.state: STARTING
> service.state.expected: starting @ 1470658910966 / Mon Aug 08 13:21:50 BST 
> 2016
> {noformat}
> Alternatively, deploy the app normally and then invoke stop. While the app is 
> stopping, terminate the Brooklyn server and then restart it. The entity has 
> the following sensor values:
> {noformat}
> service.process.isRunning: false
> service.state: STOPPING
> service.state.expected: stopping @ 1470658816662 / Mon Aug 08 13:20:16 BST 
> 2016
> {noformat}
> Given that the task won't resume, I'd expect the entity to be marked as 
> having some kind of error. For example, the service.state as on-fire (but 
> ideally without losing the fact that it was previously stopping).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] brooklyn-server issue #356: BROOKLYN-325 Rebind entity starting

2016-09-30 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/356
  
Thanks @iyovcheva - LGTM; merging. We can look at the other TODOs in 
SoftwareProcessRebindNotRunningEntityTest.java (which were removed in the final 
commit?!).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #355: Reduce decisions for HostAndPort which will be u...

2016-09-30 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/355
  
@bostko can you say specifically what you're trying to fix here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #355: Reduce decisions for HostAndPort which wi...

2016-09-30 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/355#discussion_r81297696
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
 ---
@@ -770,17 +771,20 @@ protected MachineLocation obtainOnce(ConfigBag setup) 
throws NoMachinesAvailable
 sshHostAndPortOverride = Optional.absent();
 }
 
-LoginCredentials initialCredentials = node.getCredentials();
+String managementAddress = sshHostAndPortOverride.isPresent() 
? sshHostAndPortOverride.get().getHostText() : getFirstReachableAddress(node, 
setup);
--- End diff --

Unfortunately this code is very subtle and delicate. There are so many 
permutations of different behaviour in different clouds, different OS distros, 
and different networking configurations.

Therefore be very cautious about changing it! There are a bunch of live 
tests that are useful (but very slow). But those are not sufficient, as 
downstream projects like clocker and other advanced-networking test cases (e.g. 
with DNAT etc) will require specific behaviour.

Long term, I'd love to rewrite the entire class so that it is properly 
unit-testable. But that is a huge undertaking, so we haven't scheduled the time 
for that.

For example, you can't call `getFirstReachableAddress()` here. There is a 
config key (see `waitForWInRmable` and `waitForSsable` below) that we also use 
to turn off all attempts to reach the VM's IPs. This is used, for example, in 
clocker when provisioning a container that is not ssh'able and whose IP is 
entirely private - I believe that no IP reported by docker for that container 
would be reachable by Brooklyn.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (BROOKLYN-325) Restarting Brooklyn while entity deploying: entity shown as deploying indefinitely

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15535341#comment-15535341
 ] 

ASF GitHub Bot commented on BROOKLYN-325:
-

Github user iyovcheva commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/356#discussion_r81292615
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
 ---
@@ -237,13 +239,21 @@ protected void addLocations(RebindContext 
rebindContext, EntityMemento memento)
 }
 }
 }
-
+
+@Override
 protected void instanceRebind(AbstractBrooklynObject instance) {
 Preconditions.checkState(instance == entity, "Expected %s and %s 
to match, but different objects", instance, entity);
 Lifecycle expectedState = 
ServiceStateLogic.getExpectedState(entity);
 if (expectedState == Lifecycle.STARTING || expectedState == 
Lifecycle.STOPPING) {
-LOG.warn("Entity "+entity);
+LOG.warn("Entity {} goes on-fire because it was in state {} on 
rebind",
+entity, ServiceStateLogic.getExpectedState(entity));
--- End diff --

For some reason this is not showing outdated.


> Restarting Brooklyn while entity deploying: entity shown as deploying 
> indefinitely
> --
>
> Key: BROOKLYN-325
> URL: https://issues.apache.org/jira/browse/BROOKLYN-325
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> When the Brooklyn server restarts while an entity is halfway through starting 
> or stopping, on rebind that entity continues to report its sensor as 
> starting/stopping. However, the task does not resume so it stays in this 
> state indefinitely.
> To reproduce, run Brooklyn with persistence enabled, and try deploying a 
> blueprint like that below:
> {noformat}
> location: localhost
> services:
> - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
>   brooklyn.config:
> launch.command: sleep 20
> stop.command: sleep 20
> checkRunning.command: true
> {noformat}
> While the app is starting, terminate the Brooklyn server and then restart it. 
> In the UI, the spinning icon shows that the app is still deploying. The 
> entity has the following sensor values:
> {noformat}
> service.isUp: false
> service.notUp.indicators: {"service.process.isRunning":"No information on 
> whether this service is running"}
> service.state: STARTING
> service.state.expected: starting @ 1470658910966 / Mon Aug 08 13:21:50 BST 
> 2016
> {noformat}
> Alternatively, deploy the app normally and then invoke stop. While the app is 
> stopping, terminate the Brooklyn server and then restart it. The entity has 
> the following sensor values:
> {noformat}
> service.process.isRunning: false
> service.state: STOPPING
> service.state.expected: stopping @ 1470658816662 / Mon Aug 08 13:20:16 BST 
> 2016
> {noformat}
> Given that the task won't resume, I'd expect the entity to be marked as 
> having some kind of error. For example, the service.state as on-fire (but 
> ideally without losing the fact that it was previously stopping).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] brooklyn-server pull request #356: BROOKLYN-325 Rebind entity starting

2016-09-30 Thread iyovcheva
Github user iyovcheva commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/356#discussion_r81292615
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
 ---
@@ -237,13 +239,21 @@ protected void addLocations(RebindContext 
rebindContext, EntityMemento memento)
 }
 }
 }
-
+
+@Override
 protected void instanceRebind(AbstractBrooklynObject instance) {
 Preconditions.checkState(instance == entity, "Expected %s and %s 
to match, but different objects", instance, entity);
 Lifecycle expectedState = 
ServiceStateLogic.getExpectedState(entity);
 if (expectedState == Lifecycle.STARTING || expectedState == 
Lifecycle.STOPPING) {
-LOG.warn("Entity "+entity);
+LOG.warn("Entity {} goes on-fire because it was in state {} on 
rebind",
+entity, ServiceStateLogic.getExpectedState(entity));
--- End diff --

For some reason this is not showing outdated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---