Build failed in Jenkins: brooklyn-master-windows #221

2016-07-28 Thread Apache Jenkins Server
See 

--
[...truncated 42975 lines...]
[INFO] Brooklyn Policies .. SUCCESS [01:42 min]
[INFO] Brooklyn WinRM Software Entities ... SUCCESS [ 19.230 s]
[INFO] Brooklyn Secure JMXMP Agent  SUCCESS [ 17.565 s]
[INFO] Brooklyn JMX RMI Agent . SUCCESS [  5.726 s]
[INFO] Brooklyn Jclouds Location Targets .. SUCCESS [ 35.599 s]
[INFO] Brooklyn Software Base . SUCCESS [02:33 min]
[INFO] Brooklyn CAMP REST API . SUCCESS [07:09 min]
[INFO] Brooklyn Hazelcast Storage . SUCCESS [  9.714 s]
[INFO] Brooklyn Launcher Common ... SUCCESS [ 16.165 s]
[INFO] Brooklyn REST API .. SUCCESS [ 16.015 s]
[INFO] Brooklyn REST Resources  SUCCESS [01:13 min]
[INFO] Brooklyn REST Server ... SUCCESS [ 33.180 s]
[INFO] Brooklyn Launcher .. FAILURE [01:29 min]
[INFO] Brooklyn Command Line Interface  SKIPPED
[INFO] Brooklyn REST Client ... SKIPPED
[INFO] Brooklyn Test Framework  SKIPPED
[INFO] Brooklyn OSGi init . SKIPPED
[INFO] Brooklyn Karaf . SKIPPED
[INFO] Jetty config fragment .. SKIPPED
[INFO] Brooklyn Karaf Features  SKIPPED
[INFO] Brooklyn Karaf Shell Commands .. SKIPPED
[INFO] Brooklyn Karaf Distro .. SKIPPED
[INFO] Brooklyn Karaf pax-exam itest .. SKIPPED
[INFO] Brooklyn Library Root .. SKIPPED
[INFO] Brooklyn CM SaltStack .. SKIPPED
[INFO] Brooklyn CM Ansible  SKIPPED
[INFO] Brooklyn CM Integration Root ... SKIPPED
[INFO] Brooklyn Network Software Entities . SKIPPED
[INFO] Brooklyn OSGi Software Entities  SKIPPED
[INFO] Brooklyn Database Software Entities  SKIPPED
[INFO] Brooklyn Web App Software Entities . SKIPPED
[INFO] Brooklyn Messaging Software Entities ... SKIPPED
[INFO] Brooklyn NoSQL Data Store Software Entities  SKIPPED
[INFO] Brooklyn Monitoring Software Entities .. SKIPPED
[INFO] Brooklyn QA  SKIPPED
[INFO] Brooklyn Examples Aggregator Project ... SKIPPED
[INFO] Brooklyn Examples Aggregator Project - Webapps . SKIPPED
[INFO] hello-world-webapp Maven Webapp  SKIPPED
[INFO] hello-world-sql-webapp Maven Webapp  SKIPPED
[INFO] Brooklyn Simple Web Cluster Example  SKIPPED
[INFO] Brooklyn Global Web Fabric Example . SKIPPED
[INFO] Brooklyn Simple Messaging Publish-Subscribe Example  SKIPPED
[INFO] Brooklyn NoSQL Cluster Examples  SKIPPED
[INFO] Brooklyn Downstream Project Parent . SKIPPED
[INFO] Brooklyn Dist Root . SKIPPED
[INFO] Brooklyn All Things  SKIPPED
[INFO] Brooklyn Distribution .. SKIPPED
[INFO] Brooklyn Vagrant Getting Started Environment ... SKIPPED
[INFO] Brooklyn Quick-Start Project Archetype . SKIPPED
[INFO] Brooklyn Shared Package Files .. SKIPPED
[INFO] Brooklyn DEB Package ... SKIPPED
[INFO] Brooklyn Root .. SKIPPED
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time: 29:08 min
[INFO] Finished at: 2016-07-28T19:16:25-07:00
[INFO] Final Memory: 121M/479M
[INFO] 
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.11:check 
(default) on project brooklyn-launcher: Too many files with unapproved license: 
45 See RAT report in: 
F:\jenkins\jenkins-slave\workspace\brooklyn-master-windows\brooklyn-server\launcher\target\rat.txt
 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command

[GitHub] brooklyn-server issue #274: Load default exception mapper in web.xml

2016-07-28 Thread grkvlt
Github user grkvlt commented on the issue:

https://github.com/apache/brooklyn-server/pull/274
  
@neykov actually it doesn't work, it turns out. i think the idea is sound, 
but need to work out how Karaf is loading CXF and JAX:RS


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


Re: [PROPOSAL] Brooklyn DSL in YAML using custom YAML types

2016-07-28 Thread Andrew Kennedy
Hi.

The 'formatString' example you quote would normally be written like this,
though:

  brooklyn.config:
brooklyn.example.db.url:
  $brooklyn:formatString:
- "jdbc:%s%s?user=%s\\=%s"
- $brooklyn:component("db").attributeWhenReady("datastore.url")
- "visitors"
- "brooklyn"
- "br00k11n"

So, I'm not sure what we gain here? I'll have a proper look at the YAML
spec, though, and see if I can understand it better.

Cheers,
Andrew.

On Wed, 13 Jul 2016 at 13:35 Thomas Bouron 
wrote:

> Hi All
>
> The YAML spec[1] has a very nice and standard way of defining custom types
> by prefixing any value or object by a `!!`. This seems like a
> perfect feature for the Brooklyn DSL instead of the `$brooklyn:`.
> Let's me explain why.
>
> Right now, a Brooklyn DSL command needs to be written as a string such as:
> $brooklyn:formatString("jdbc:%s%s?user=%s\\=%s",
> component("db").attributeWhenReady("datastore.url"),
> "visitors", "brooklyn", "br00k11n")
> However, any good YAML library (such as js-yaml[2]) to parse and dump YAML
> <--> JSON would wrap this string in quotes because it contains quotes or
> reserved characters. That is the expected behaviour based on the
> specification[3]. But this is an issue for the Brooklyn parser as the value
> will be treated as a `String` and not as a `DslCommand` object.
>
> So my proposal is as follow: support the Brooklyn DSL as a standard custom
> YAML type. We obviously need to avoid any quote or reserved characters.
> That is relatively simple for commands that takes only one parameter, for
> instance:
>
>- $brooklyn:component('my-id') could become
>   - !brooklyn:component my-id
>- $brooklyn:entitySpec would become
>   - !brooklyn:spec
>
> For the more complex ones, I created a gist[4] that illustrates how this
> could work. It is more verbose than the current version but we get a rid of
> the hacky `$brooklyn` and comply fully to the YAML specification.
>
> Best.
>
> [1] http://yaml.org/spec/1.2/spec.html
> [2] https://github.com/nodeca/js-yaml
> [3] http://yaml.org/spec/1.2/spec.html#id2788859
> [4] https://gist.github.com/tbouron/67527796726e10689d8d3c34784cd7ec
>
> --
>
> Thomas Bouron • Software Engineer @ Cloudsoft Corporation •
> http://www.cloudsoftcorp.com/
> Github: https://github.com/tbouron
> Twitter: https://twitter.com/eltibouron
>
-- 

Andrew Kennedy ; Founder clocker.io project ; @grkvlt ; Cloudsoft


[GitHub] brooklyn-docs pull request #98: Improve location docs

2016-07-28 Thread aledsage
GitHub user aledsage opened a pull request:

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

Improve location docs



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

$ git pull https://github.com/aledsage/brooklyn-docs improve-location-docs

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

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


commit 148e35cb5881b7a1727fb6767bdb755f2f83d1e5
Author: Aled Sage 
Date:   2016-07-28T22:16:42Z

Fix some broken links

commit e762710f4bf26db138aaa11d2ef1c94e239516ba
Author: Aled Sage 
Date:   2016-07-28T22:17:13Z

Improve location docs




---
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 #277: Fix TestCases, and add TestSensor.abortCo...

2016-07-28 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/277#discussion_r72673817
  
--- Diff: 
test-framework/src/main/java/org/apache/brooklyn/test/framework/TargetableTestComponentImpl.java
 ---
@@ -116,4 +125,14 @@ private static Entity getTargetById(final 
ExecutionContext executionContext, fin
 protected  T getRequiredConfig(ConfigKey key) {
 return checkNotNull(config().get(key), "config %s must not be 
null", key);
 }
+
+protected void setUpAndRunState(boolean up, Lifecycle status) {
+if (up) {
+sensors().set(SERVICE_UP, up);
+setExpectedState(this, status);
+} else {
+setExpectedState(this, status);
+sensors().set(SERVICE_UP, up);
+}
--- End diff --

We are waiting for `service.isUp` in `SoftwareProcess` so makes sense to do 
the same here for consistency.


---
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 #274: Load default exception mapper in web.xml

2016-07-28 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/274
  
LGTM. Can you remove changes on DefaultExceptionMapper.java file 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.
---


Build failed in Jenkins: brooklyn-master-windows #220

2016-07-28 Thread Apache Jenkins Server
See 

--
[...truncated 40946 lines...]
[INFO] Brooklyn Core .. SUCCESS [05:18 min]
[INFO] Brooklyn Policies .. SUCCESS [01:41 min]
[INFO] Brooklyn WinRM Software Entities ... SUCCESS [ 19.514 s]
[INFO] Brooklyn Secure JMXMP Agent  SUCCESS [ 18.269 s]
[INFO] Brooklyn JMX RMI Agent . SUCCESS [  6.004 s]
[INFO] Brooklyn Jclouds Location Targets .. SUCCESS [ 34.085 s]
[INFO] Brooklyn Software Base . SUCCESS [02:30 min]
[INFO] Brooklyn CAMP REST API . SUCCESS [06:56 min]
[INFO] Brooklyn Hazelcast Storage . SUCCESS [  9.944 s]
[INFO] Brooklyn Launcher Common ... SUCCESS [ 16.272 s]
[INFO] Brooklyn REST API .. SUCCESS [ 16.631 s]
[INFO] Brooklyn REST Resources  SUCCESS [01:13 min]
[INFO] Brooklyn REST Server ... SUCCESS [ 33.640 s]
[INFO] Brooklyn Launcher .. FAILURE [01:20 min]
[INFO] Brooklyn Command Line Interface  SKIPPED
[INFO] Brooklyn REST Client ... SKIPPED
[INFO] Brooklyn Test Framework  SKIPPED
[INFO] Brooklyn OSGi init . SKIPPED
[INFO] Brooklyn Karaf . SKIPPED
[INFO] Jetty config fragment .. SKIPPED
[INFO] Brooklyn Karaf Features  SKIPPED
[INFO] Brooklyn Karaf Shell Commands .. SKIPPED
[INFO] Brooklyn Karaf Distro .. SKIPPED
[INFO] Brooklyn Karaf pax-exam itest .. SKIPPED
[INFO] Brooklyn Library Root .. SKIPPED
[INFO] Brooklyn CM SaltStack .. SKIPPED
[INFO] Brooklyn CM Ansible  SKIPPED
[INFO] Brooklyn CM Integration Root ... SKIPPED
[INFO] Brooklyn Network Software Entities . SKIPPED
[INFO] Brooklyn OSGi Software Entities  SKIPPED
[INFO] Brooklyn Database Software Entities  SKIPPED
[INFO] Brooklyn Web App Software Entities . SKIPPED
[INFO] Brooklyn Messaging Software Entities ... SKIPPED
[INFO] Brooklyn NoSQL Data Store Software Entities  SKIPPED
[INFO] Brooklyn Monitoring Software Entities .. SKIPPED
[INFO] Brooklyn QA  SKIPPED
[INFO] Brooklyn Examples Aggregator Project ... SKIPPED
[INFO] Brooklyn Examples Aggregator Project - Webapps . SKIPPED
[INFO] hello-world-webapp Maven Webapp  SKIPPED
[INFO] hello-world-sql-webapp Maven Webapp  SKIPPED
[INFO] Brooklyn Simple Web Cluster Example  SKIPPED
[INFO] Brooklyn Global Web Fabric Example . SKIPPED
[INFO] Brooklyn Simple Messaging Publish-Subscribe Example  SKIPPED
[INFO] Brooklyn NoSQL Cluster Examples  SKIPPED
[INFO] Brooklyn Downstream Project Parent . SKIPPED
[INFO] Brooklyn Dist Root . SKIPPED
[INFO] Brooklyn All Things  SKIPPED
[INFO] Brooklyn Distribution .. SKIPPED
[INFO] Brooklyn Vagrant Getting Started Environment ... SKIPPED
[INFO] Brooklyn Quick-Start Project Archetype . SKIPPED
[INFO] Brooklyn Shared Package Files .. SKIPPED
[INFO] Brooklyn DEB Package ... SKIPPED
[INFO] Brooklyn Root .. SKIPPED
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time: 28:12 min
[INFO] Finished at: 2016-07-28T10:37:30-07:00
[INFO] Final Memory: 121M/478M
[INFO] 
[ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.11:check 
(default) on project brooklyn-launcher: Too many files with unapproved license: 
40 See RAT report in: 
F:\jenkins\jenkins-slave\workspace\brooklyn-master-windows\brooklyn-server\launcher\target\rat.txt
 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can 

Build failed in Jenkins: brooklyn-server-master #207

2016-07-28 Thread Apache Jenkins Server
See 

Changes:

[andrew.kennedy] Merge brooklyn.parameters in YAML files

[andrew.kennedy] Always add new parameters at start

--
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H11 (docker Ubuntu ubuntu yahoo-not-h2) in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/brooklyn-server.git # timeout=10
Fetching upstream changes from 
https://git-wip-us.apache.org/repos/asf/brooklyn-server.git
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress 
 > https://git-wip-us.apache.org/repos/asf/brooklyn-server.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/master^{commit} # timeout=10
Checking out Revision a2148becf8252d0934ee5a697a57ac03088806c5 (origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f a2148becf8252d0934ee5a697a57ac03088806c5
 > git rev-list e9d84bfcb11ca2a1b586f4f1ef84e0d78fb2cbcb # timeout=10
Parsing POMs
Modules changed, recalculating dependency graph
Established TCP socket on 39067
maven32-agent.jar already up to date
maven32-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
[brooklyn-server-master] $ /home/jenkins/tools/java/latest1.7/bin/java 
-Xmx1024m -Xms512m -XX:MaxPermSize=512m -cp 
/home/jenkins/jenkins-slave/maven32-agent.jar:/home/jenkins/tools/maven/apache-maven-3.3.9/boot/plexus-classworlds-2.5.2.jar:/home/jenkins/tools/maven/apache-maven-3.3.9/conf/logging
 jenkins.maven3.agent.Maven32Main /home/jenkins/tools/maven/apache-maven-3.3.9 
/home/jenkins/jenkins-slave/slave.jar 
/home/jenkins/jenkins-slave/maven32-interceptor.jar 
/home/jenkins/jenkins-slave/maven3-interceptor-commons.jar 39067
Exception in thread "main" java.lang.ClassNotFoundException: 
hudson.remoting.Launcher
at 
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at 
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
at jenkins.maven3.agent.Maven32Main.main(Maven32Main.java:143)
at jenkins.maven3.agent.Maven32Main.main(Maven32Main.java:74)
ERROR: Failed to parse POMs
java.io.EOFException: unexpected stream termination
at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:365)
at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:310)
at hudson.slaves.Channels.forProcess(Channels.java:115)
at 
hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:297)
at hudson.maven.ProcessCache.get(ProcessCache.java:236)
at 
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:778)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)


[GitHub] brooklyn-server pull request #229: Merge brooklyn.parameters in YAML files

2016-07-28 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 #229: Merge brooklyn.parameters in YAML files

2016-07-28 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/229
  
Thanks @grkvlt. 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 pull request #229: Merge brooklyn.parameters in YAML files

2016-07-28 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/229#discussion_r72664225
  
--- Diff: 
api/src/main/java/org/apache/brooklyn/api/internal/AbstractBrooklynObjectSpec.java
 ---
@@ -153,17 +155,20 @@ public SpecT parameters(List> parameters) {
 @Beta
 public SpecT parametersAdd(List> 
parameters) {
 // parameters follows immutable pattern, unlike the other fields
-Builder result = 
ImmutableList.builder();
-if (this.parameters!=null)
-result.addAll(this.parameters);
-result.addAll( checkNotNull(parameters, "parameters") );
-this.parameters = result.build();
+Set params = 
MutableSet.copyOf(parameters);
+Set current = 
MutableSet.copyOf(this.parameters);
+current.removeAll(params);
+
+this.parameters = ImmutableList.builder()
+.addAll(params)
+.addAll(current)
--- End diff --

I really like how this turned out. We can use it to reorder/pull up 
parameters we are interested in.


---
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 #97: Improves examples copy-ability

2016-07-28 Thread sjcorbett
Github user sjcorbett commented on a diff in the pull request:

https://github.com/apache/brooklyn-docs/pull/97#discussion_r72660313
  
--- Diff: guide/start/policies.md ---
@@ -355,8 +355,8 @@ Tomcat on the vagrant VMs named "byon1" to "byon4":
 
 {% highlight bash %}
 $ for i in byon{1..4}; do
-$   vagrant ssh ${i} --command 'ps aux | grep -i tomcat |  grep -v grep | 
awk '\''{print $2}'\'' | xargs kill -9'
--- End diff --

I don't.


---
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 #97: Improves examples copy-ability

2016-07-28 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-docs/pull/97#discussion_r72659467
  
--- Diff: guide/start/policies.md ---
@@ -355,8 +355,8 @@ Tomcat on the vagrant VMs named "byon1" to "byon4":
 
 {% highlight bash %}
 $ for i in byon{1..4}; do
-$   vagrant ssh ${i} --command 'ps aux | grep -i tomcat |  grep -v grep | 
awk '\''{print $2}'\'' | xargs kill -9'
--- End diff --

Where is our magic that used to treat "$" prefix in a special way (putting 
it into a separate div, so it wouldn't be included if someone highlighted the 
text to copy-paste it)? I can't find it.

@drigodwin said that he thinks it may have broken at around the same time 
as someone did a bootstrap upgrade.

@ahgittin @sjcorbett do you know where that code 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-docs pull request #97: Improves examples copy-ability

2016-07-28 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-docs/pull/97#discussion_r72659089
  
--- Diff: guide/start/policies.md ---
@@ -435,14 +435,14 @@ you could use a load generator like jmeter, or use a 
script such as the one show
 (changing URL for the URL of your load-balancer):
 
 {% highlight bash %}
-$ URL=http://10.10.10.101:8000/
+$ URL=http://10.10.10.101:8080/
--- End diff --

Good point, will revert.


---
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 #97: Improves examples copy-ability

2016-07-28 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-docs/pull/97#discussion_r72654950
  
--- Diff: guide/start/policies.md ---
@@ -435,14 +435,14 @@ you could use a load generator like jmeter, or use a 
script such as the one show
 (changing URL for the URL of your load-balancer):
 
 {% highlight bash %}
-$ URL=http://10.10.10.101:8000/
+$ URL=http://10.10.10.101:8080/
--- End diff --

I thought nginx would come up on 8000, rather than 8080 (which is the port 
that the first tomcat would use).


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


Re: Merge brooklyn.parameters in YAML files

2016-07-28 Thread Svetoslav Neykov
Hi Andrew,
I think that's a very useful change. Let me give a summary of what my 
understanding of the change is:
  * Using a java class declaring ConfigKeys with @CatalogConfig annotation will 
display those keys in the UI (if priority > 0)

brooklyn.catalog:
  version: 0.0.1
  id: bash
  item:
type: VanillaWindowsProcess

will display in UI configuration for Install PowerShell command, Install 
Command, Customize PowerShell command, etc.

  * Parameters defined in brooklyn.parameters override keys coming from the 
java class for the UI - only the brooklyn.parameters will be visible in the UI

brooklyn.catalog:
  version: 0.0.1
  id: bash-custom-parameters
  item:
type: bash
  brooklyn.parameters:
  - username
  - password

will display in UI configuration for username, password


  * Specializing a catalog item in a new catalog item with brooklyn.parameters 
will concatenate the parameters, adding the current catalog item's parameters 
to the beginning of the list

brooklyn.catalog:
  version: 0.0.1
  id: downloader
  item:
type: bash-custom-parameters
  brooklyn.parameters:
  - download_url


will display in UI configuration for download_url, username, password

---

I think that's a nice compromise between having too many configuration items in 
the UI and having to repeat brooklyn.parameters on each catalog item 
re-definition/specialization.

At runtime we will get all brooklyn.parameters including all config keys 
defined on the java class so in yaml we can use the DSL to access them.

--

+1 from me. 

Svet.



> On 26.07.2016 г., at 22:45, Andrew Kennedy  
> wrote:
> 
> One thing to note in the latest commit on the PR is that I made some
> changes suggested by @neykov to always add the configuration from the
> entity as parameters, and also to *prepend* new parameters. That means that
> in the UI, the list of parameters will be sorted in the reverse order of
> entity hierarchy, with the parameters defined on the current entity first,
> then the entity it inherited from, and so on. This is the _inheritance_
> hierarchy, of entity definitions in BOm files or via Java class and
> interface inheritance, not the structural parent-child relationships. I am
> not 100% convinced this is the best way, as it does fill up the UI with
> more parameters, but at least they are all visible and in a sensible order.
> 
> Perhaps we could add some further properties to SpecParameter that can be
> used as display hints?
> 
> Andrew.
> 
> On Tue, 26 Jul 2016 at 20:42 Andrew Kennedy <
> andrew.kenn...@cloudsoftcorp.com> wrote:
> 
>> - https://github.com/apache/brooklyn-server/pull/229
>> 
>> I have created this PR to fix an issue with the handling of
>> brooklyn.parameters in BOM files. We now merge config keys and maps, so it
>> is expected that an entity will have its configuration be the union of the
>> config of its ancestors, with the lowest level config taking priority. This
>> PR does the same for parameters - instead of replacing the entire set of
>> parameters when an entity is declared, we add the new parameters,
>> overwriting any that already exist and have the same config key. This means
>> an entity can alter defaults or descriptions for a key when it is defined,
>> and these will be used when retrieving config.
>> 
>> One issue is that this now results in long lists of parameters in the UI,
>> and one must also be quite careful referencing config to make sure the
>> correct entity is in scope. Also, if an entity has some parameters defined,
>> they are only available to its descendants. If you wish to make them
>> visible in the application UI details, they must be re-declared there, and
>> again, care must be taken with coping when retrieving the config values.
>> 
>> I think this PR is probably good enough to use as-is, but I'm interested
>> in any feedback and ideas for further changes and improvements that can be
>> implemented in a future PR. If nobody objects, i would like to merge this
>> in a few days?
>> 
>> Thanks,
>> Andrew.
>> --
>> 
>> Andrew Kennedy ; Founder clocker.io project ; @grkvlt ; Cloudsoft
>> 
> -- 
> 
> Andrew Kennedy ; Founder clocker.io project ; @grkvlt ; Cloudsoft



[GitHub] brooklyn-server issue #277: Fix TestCases, and add TestSensor.abortCondition...

2016-07-28 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/277
  
@neykov interesting discussion. The "validConditions" makes a lot of sense. 
I was imagining we'd list abortConditions as {on-fire, stopping, stopped, 
destroyed} (which is quite verbose compared to your `validConditions`).

I also like the idea of being able to assert about a different sensor. We 
can do that in the Java code's `DependentConfiguration` (unrelated, but I used 
that as inspiration). It's a bit more fiddly to wire in here.

I'm going to leave in the `abortConditions`, and think about adding 
`validConditions` as well (in a different PR). My one concern about 
`validConditions` is that it sounds like it could be a valid termination 
condition, rather than us keeping going until the assert succeeds.


---
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] [Created] (BROOKLYN-319) RabbitMQ restart failure

2016-07-28 Thread Duncan Godwin (JIRA)
Duncan Godwin created BROOKLYN-319:
--

 Summary: RabbitMQ restart failure
 Key: BROOKLYN-319
 URL: https://issues.apache.org/jira/browse/BROOKLYN-319
 Project: Brooklyn
  Issue Type: Bug
 Environment: Centos 6 on BlueBox and Google Compute
Reporter: Duncan Godwin


RabbitMQ intermittently fails to come back up after restart of the entity on 
some clouds (BlueBox and Google Compute known to fail).

The brooklyn.debug.log shows the following:

{code}
2016-07-28 14:05:12,642 DEBUG brooklyn.SSH 
[brooklyn-execmanager-E26Om0Sg-12886]: check-running 
RabbitBrokerImpl{id=d5kw04uk46, amqpPort=5672}, initiating ssh on machine 
SshMachineLocation[10.104.2.181:amp@10.104.2.181/10.104.2.181:22(id=t0tvrv6o0h)]
 (env 
{RABBITMQ_HOME=/home/users/amp/brooklyn-managed-processes/apps/b6kxbm5fei/entities/RabbitBroker_d5kw04uk46,
 
RABBITMQ_LOG_BASE=/home/users/amp/brooklyn-managed-processes/apps/b6kxbm5fei/entities/RabbitBroker_d5kw04uk46,
 RABBITMQ_NODENAME=d5kw04uk46, RABBITMQ_NODE_PORT=5672, 
RABBITMQ_PID_FILE=/home/users/amp/brooklyn-managed-processes/apps/b6kxbm5fei/entities/RabbitBroker_d5kw04uk46/rabbitmq.pid,
 
RABBITMQ_CONFIG_FILE=/home/users/amp/brooklyn-managed-processes/apps/b6kxbm5fei/entities/RabbitBroker_d5kw04uk46/rabbitmq}):
 #!/bin/bash -e
 ; export 
INSTALL_DIR="/home/users/amp/brooklyn-managed-processes/installs/RabbitBroker_3.6.0"
 ; export 
RUN_DIR="/home/users/amp/brooklyn-managed-processes/apps/b6kxbm5fei/entities/RabbitBroker_d5kw04uk46"
 ; mkdir -p $RUN_DIR ; cd $RUN_DIR ; ./sbin/rabbitmqctl -q status
2016-07-28 14:05:12,982 DEBUG o.a.b.u.c.i.w.w.Winrm4jTool 
[brooklyn-execmanager-E26Om0Sg-12879]: Finished WinRM exec on 
Administrator@217.115.71.201:11049  done after 2.01s (connected in 0ms)
2016-07-28 14:05:13,012 DEBUG brooklyn.SSH [Thread-350446]: 
[d5kw04uk46@10.104.2.181:stdout] Executed 
/tmp/brooklyn-20160728-140512642-NDCx-check-running_RabbitBrokerImpl.sh, result 
69
2016-07-28 14:05:13,012 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] Error: unable to connect to node 
'd5kw04uk46@qa-scheduler-rabbitmq-server-be5': nodedown
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] DIAGNOSTICS
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] ===
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] attempted to contact: 
['d5kw04uk46@qa-scheduler-rabbitmq-server-be5']
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] d5kw04uk46@qa-scheduler-rabbitmq-server-be5:
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr]   * connected to epmd (port 4369) on 
qa-scheduler-rabbitmq-server-be5
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr]   * epmd reports: node 'd5kw04uk46' not 
running at all
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr]   no other nodes on 
qa-scheduler-rabbitmq-server-be5
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr]   * suggestion: start the node
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] current node details:
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] - node name: 
'rabbitmq-cli-23557@qa-scheduler-rabbitmq-server-be5'
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] - home dir: /home/users/amp
2016-07-28 14:05:13,013 DEBUG brooklyn.SSH [Thread-350447]: 
[d5kw04uk46@10.104.2.181:stderr] - cookie hash: hGw+myYNiff8VA9lwwfh0g==
{code}

the console-out.log contains:

{code}
ERROR: node with name "d5kw04uk46" already running on 
"qa-scheduler-rabbitmq-server-be5"
{code}

The RabbitMQ service is not runing on the machine.



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


[GitHub] brooklyn-server pull request #278: rest api: entity/spec returns unquoted te...

2016-07-28 Thread aledsage
GitHub user aledsage opened a pull request:

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

rest api: entity/spec returns unquoted text/x-yaml

Previously it returned json:
* it wrapped it in quotes.
* it did strange things with \n: the result rendered as “\n” rather 
than actual new-line characters (though it was more complicated than that - an 
angular UI did recognise the “\n” as a single character).

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

$ git pull https://github.com/aledsage/brooklyn-server 
entity-rest-api/get-spec-returns-plain-text

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

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


commit 15d1014789f9a4945330ff8f6acc6f5dae27f95c
Author: Aled Sage 
Date:   2016-07-28T13:59:39Z

rest api: entity/spec returns unquoted text_plain

Previously it returned json:
* it wrapped it in quotes.
* it did strange things with \n: the result rendered as “\n” rather than
  actual new-line characters (though it was more complicated than that
  in that an angular UI did recognise the “\n” as a single character).




---
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-dist issue #41: Move karaf distribution to brooklyn-dist.

2016-07-28 Thread duncangrant
Github user duncangrant commented on the issue:

https://github.com/apache/brooklyn-dist/pull/41
  
I've tested this - all seems to work
Tested compiling, running in amp and karaf
Checked entities available as expected in catalog
Ran some entities (mariadb crate)



---
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-library issue #53: Move karaf distribution to brooklyn-dist.

2016-07-28 Thread duncangrant
Github user duncangrant commented on the issue:

https://github.com/apache/brooklyn-library/pull/53
  
I've tested this - all seems to work


---
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 #271: Move karaf distribution to brooklyn-dist.

2016-07-28 Thread duncangrant
Github user duncangrant commented on the issue:

https://github.com/apache/brooklyn-server/pull/271
  
I've tested this - all seems to work


---
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] [Created] (BROOKLYN-318) MariaDbNode fails to start on centos7 on aws

2016-07-28 Thread Duncan Grant (JIRA)
Duncan Grant created BROOKLYN-318:
-

 Summary: MariaDbNode fails to start on centos7 on aws
 Key: BROOKLYN-318
 URL: https://issues.apache.org/jira/browse/BROOKLYN-318
 Project: Brooklyn
  Issue Type: Bug
Reporter: Duncan Grant
Priority: Minor


When deploying MariaDbNode on aws on centos 7 with default config it fails to 
start.  Error shows in post-launch when it fails to pass isRunning check after 
2 minutes.  I have tried the same entity on centos 7 on Softlayer and it ran OK.

Using eu-central-1/ami-9bf712f4

>From console.log:
160728 11:14:23 [ERROR] mysqld: Can't lock aria control file 
'/home/users/amp/brooklyn-managed-processes/apps/dx8im7ym7x/entities/MariaDbNode_g4hh2cwvws/aria_log_control'
 for exclusive use, error: 11. Will retry for 30 seconds
160728 11:14:29 InnoDB: The InnoDB memory heap is disabled
160728 11:14:29 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160728 11:14:29 InnoDB: Compressed tables use zlib 1.2.3
160728 11:14:29 InnoDB: Using Linux native AIO
160728 11:14:29 InnoDB: Initializing buffer pool, size = 128.0M
160728 11:14:29 InnoDB: Completed initialization of buffer pool
InnoDB: Error: space header page consists of zero bytes in data file ./ibdata1
160728 11:14:29 InnoDB: Could not open or create data files.
160728 11:14:29 InnoDB: If you tried to add new data files, and it failed here,
160728 11:14:29 InnoDB: you should now edit innodb_data_file_path in my.cnf back
160728 11:14:29 InnoDB: to what it was, and remove the new ibdata files InnoDB 
created
160728 11:14:29 InnoDB: in this failed attempt. InnoDB only wrote those files 
full of
160728 11:14:29 InnoDB: zeros, but did not yet use them in any way. But be 
careful: do not
160728 11:14:29 InnoDB: remove old data files which contain your precious data!
160728 11:14:29 [ERROR] Plugin 'InnoDB' init function returned error.
160728 11:14:29 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160728 11:14:29 [Note] Plugin 'FEEDBACK' is disabled.
160728 11:14:29 [ERROR] Unknown/unsupported storage engine: InnoDB
160728 11:14:29 [ERROR] Aborting



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


[GitHub] brooklyn-server issue #277: Fix TestCases, and add TestSensor.abortCondition...

2016-07-28 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/277
  
After a very quick look I think that's very useful and something I felt the 
need for. When previously thinking about the problem the approach I came up 
with is having `validConditions` instead of `abortConditions`. This way you 
only define the expected states the blueprint will go through instead of any 
combination of invalid state. For `service.state` that would usually be 
`STARTING`, `RUNNING`, but where it becomes even more useful is asserting on 
any random sensor. For example resizing a cluster and asserting the new size - 
the expected sizes are the initial one and the end one. Using the 
`abortConditions` here would not be too practical.
Or may be both are useful - would be easier to use one or the other for 
different use cases.


---
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 #277: Fix TestCases, and add TestSensor.abortCo...

2016-07-28 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/277#discussion_r72601245
  
--- Diff: 
test-framework/src/main/java/org/apache/brooklyn/test/framework/TargetableTestComponentImpl.java
 ---
@@ -116,4 +125,14 @@ private static Entity getTargetById(final 
ExecutionContext executionContext, fin
 protected  T getRequiredConfig(ConfigKey key) {
 return checkNotNull(config().get(key), "config %s must not be 
null", key);
 }
+
+protected void setUpAndRunState(boolean up, Lifecycle status) {
+if (up) {
+sensors().set(SERVICE_UP, up);
+setExpectedState(this, status);
+} else {
+setExpectedState(this, status);
+sensors().set(SERVICE_UP, up);
+}
--- End diff --

As you are updating this anyway would be nice to make the `service.isUp` + 
`service.state` managed through the notUp + problems maps, instead of directly. 
Current approach is valid as well so happy to go this way if you think it's 
out of scope.


---
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 #276: (For Review) Effector for opening inbound ports ...

2016-07-28 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/276
  
It would be good to have test(s). Have you thought about how to write those?


---
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 #276: (For Review) Effector for opening inbound...

2016-07-28 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/276#discussion_r72586637
  
--- Diff: 
software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcess.java
 ---
@@ -147,6 +147,8 @@
 @SetFromFlag("runDir")
 AttributeSensorAndConfigKey RUN_DIR = 
BrooklynConfigKeys.RUN_DIR;
 
+ConfigKey ADD_OPEN_PORTS_EFFECTOR = 
ConfigKeys.newBooleanConfigKey("effector.add.openPorts", "Flag which adds 
effector for opening ports through Cloud security groups");
--- End diff --

I prefer giving an explicit default, rather than null.

(But I do see you handle null in SoftwareProcessImpl.init, so the code does 
work).


---
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 #276: (For Review) Effector for opening inbound...

2016-07-28 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/276#discussion_r72586500
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/NetworkingEffectors.java
 ---
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.location.jclouds.networking;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicates;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Range;
+import com.google.common.reflect.TypeToken;
+import org.apache.brooklyn.api.effector.Effector;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.effector.EffectorBody;
+import org.apache.brooklyn.core.effector.Effectors;
+import org.apache.brooklyn.location.jclouds.JcloudsMachineLocation;
+import org.apache.brooklyn.util.collections.MutableList;
+import org.apache.brooklyn.util.core.BrooklynNetworkUtils;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+import org.apache.brooklyn.util.net.Cidr;
+import org.jclouds.net.domain.IpPermission;
+import org.jclouds.net.domain.IpProtocol;
+
+import java.util.List;
+
+public class NetworkingEffectors {
+public static final ConfigKey INBOUND_PORTS_EFFECTOR = 
ConfigKeys.newConfigKey(new TypeToken() {}, 
"inbound.ports.effector",
--- End diff --

"inbound.ports.effector" seems like a strange name. This isn't an effector, 
I believe: it's a parameter for the effector, yes?


---
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 #276: (For Review) Effector for opening inbound...

2016-07-28 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/276#discussion_r72586282
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/NetworkingEffectors.java
 ---
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.location.jclouds.networking;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicates;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Range;
+import com.google.common.reflect.TypeToken;
+import org.apache.brooklyn.api.effector.Effector;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.effector.EffectorBody;
+import org.apache.brooklyn.core.effector.Effectors;
+import org.apache.brooklyn.location.jclouds.JcloudsMachineLocation;
+import org.apache.brooklyn.util.collections.MutableList;
+import org.apache.brooklyn.util.core.BrooklynNetworkUtils;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+import org.apache.brooklyn.util.net.Cidr;
+import org.jclouds.net.domain.IpPermission;
+import org.jclouds.net.domain.IpProtocol;
+
+import java.util.List;
+
+public class NetworkingEffectors {
+public static final ConfigKey INBOUND_PORTS_EFFECTOR = 
ConfigKeys.newConfigKey(new TypeToken() {}, 
"inbound.ports.effector",
+"Ports to open from the effector", ImmutableList.of());
+
+public static Effector openPortsInSecurityGroupEffector() {
+return Effectors.effector(Void.class, "openPortsInSecurityGroup")
+.parameter(INBOUND_PORTS_EFFECTOR)
+.description("Open ports in Cloud Security Group")
+.impl(new OpenPortsInSecurityGroupBody())
+.build();
+}
+
+private static class OpenPortsInSecurityGroupBody extends 
EffectorBody {
--- End diff --

We'd also like this to work in other clouds, such as downsteram projects 
that use vCloudDirector via the brooklyn-networking `SubnetTier`. I need to 
think about that more, for how we structure that.



---
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 #276: (For Review) Effector for opening inbound...

2016-07-28 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/276#discussion_r72585871
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/NetworkingEffectors.java
 ---
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.location.jclouds.networking;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicates;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Range;
+import com.google.common.reflect.TypeToken;
+import org.apache.brooklyn.api.effector.Effector;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.effector.EffectorBody;
+import org.apache.brooklyn.core.effector.Effectors;
+import org.apache.brooklyn.location.jclouds.JcloudsMachineLocation;
+import org.apache.brooklyn.util.collections.MutableList;
+import org.apache.brooklyn.util.core.BrooklynNetworkUtils;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+import org.apache.brooklyn.util.net.Cidr;
+import org.jclouds.net.domain.IpPermission;
+import org.jclouds.net.domain.IpProtocol;
+
+import java.util.List;
+
+public class NetworkingEffectors {
+public static final ConfigKey INBOUND_PORTS_EFFECTOR = 
ConfigKeys.newConfigKey(new TypeToken() {}, 
"inbound.ports.effector",
+"Ports to open from the effector", ImmutableList.of());
+
+public static Effector openPortsInSecurityGroupEffector() {
+return Effectors.effector(Void.class, "openPortsInSecurityGroup")
+.parameter(INBOUND_PORTS_EFFECTOR)
+.description("Open ports in Cloud Security Group")
+.impl(new OpenPortsInSecurityGroupBody())
+.build();
+}
+
+private static class OpenPortsInSecurityGroupBody extends 
EffectorBody {
+@Override
+public Void call(ConfigBag parameters) {
+List rawPortRules = 
parameters.get(INBOUND_PORTS_EFFECTOR);
+Preconditions.checkNotNull(rawPortRules, "ports cannot be 
null");
+MutableList.Builder ipPermissionsBuilder = 
MutableList.builder();
+for (Range portRule : 
BrooklynNetworkUtils.portRulesToRanges(rawPortRules).asRanges()) {
+ipPermissionsBuilder.add(
+IpPermission.builder()
+.ipProtocol(IpProtocol.TCP)
--- End diff --

We want this to support both UPD and TCP, so the effector to indicate which 
is required.


---
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 #276: (For Review) Effector for opening inbound...

2016-07-28 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/276#discussion_r72585710
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/util/core/BrooklynNetworkUtils.java ---
@@ -39,4 +43,22 @@ public static InetAddress getLocalhostInetAddress() {
 Networking.getLocalHost()), InetAddress.class);
 }
 
+// TODO it does not add adjacent intervals: {[22, 22], [23, 23]} is 
not merged to {[22, 23]}
+public static RangeSet portRulesToRanges(Collection 
portRules) {
+RangeSet result = TreeRangeSet.create();
+for (String portRule : portRules) {
+if (portRule.contains("-")) {
+String[] fromTo = portRule.split("-");
+assert fromTo.length == 2;
--- End diff --

Don't use `assert` for validating user input. Instead we'd want to throw a 
nicer `IllegalArgumentException` to tell the caller that they passed in the 
wrong input.

Only use `assert` when it's about the internal invariants of a class (e.g. 
validating args in private methods, etc).


---
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 #276: (For Review) Effector for opening inbound...

2016-07-28 Thread nakomis
Github user nakomis commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/276#discussion_r72585644
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/util/core/BrooklynNetworkUtils.java ---
@@ -39,4 +43,22 @@ public static InetAddress getLocalhostInetAddress() {
 Networking.getLocalHost()), InetAddress.class);
 }
 
+// TODO it does not add adjacent intervals: {[22, 22], [23, 23]} is 
not merged to {[22, 23]}
+public static RangeSet portRulesToRanges(Collection 
portRules) {
+RangeSet result = TreeRangeSet.create();
+for (String portRule : portRules) {
+if (portRule.contains("-")) {
+String[] fromTo = portRule.split("-");
+assert fromTo.length == 2;
--- End diff --

Assertions are disabled by default, use `Preconditions.checkState`


---
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 #277: Fix TestCases, and add TestSensor.abortCo...

2016-07-28 Thread aledsage
GitHub user aledsage opened a pull request:

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

Fix TestCases, and add TestSensor.abortConditions



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

$ git pull https://github.com/aledsage/brooklyn-server 
fix/test-cases-strike2

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

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


commit 3a2a7e0b16e8a3deef74e5ecdcbeb34cab8f4906
Author: Aled Sage 
Date:   2016-07-26T12:40:14Z

Improve TestEffector etc tests

- Make code more concise and clearer
- Make it a lot faster by tweaking timeouts

commit d2d55c379f70050bf7dac0a135de97d7d5d3
Author: Aled Sage 
Date:   2016-07-26T12:54:34Z

TestEffector: handle non-string return types

commit b93e82c7d623bdca853e66b62d4b3c134c31959d
Author: Aled Sage 
Date:   2016-07-26T13:41:00Z

Test case improvements: config error-handling

commit 96e6269c40d84a314f0ccd60d9ff94f3a31b7ec8
Author: Aled Sage 
Date:   2016-07-26T13:46:33Z

TestEffector: fix timeout for effector call

commit 88891c838a735502aa1e1fc29833f5cd4f9afb7c
Author: Aled Sage 
Date:   2016-07-26T15:34:45Z

Refactor TestFrameworkAssertions

commit dc156bed7f5d1fc79d95ad90e6adee41b3797c87
Author: Aled Sage 
Date:   2016-07-26T21:16:30Z

TestSensor: support abortConditions




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


Jenkins build is back to normal : brooklyn-server-master #206

2016-07-28 Thread Apache Jenkins Server
See