Re: Nice-to-have: Built-in Cluster Sensor List Generator

2016-05-05 Thread David Bush
+1 

Using this in a couple of blueprints at the moment and would be really nice to 
have a concise method.

-- 
David Bush • Systems Integrator • Cloudsoft Corporation • 
http://www.cloudsoftcorp.com 
T: 07834 127195 • SKYPE: david.c.bush

> On 6 May 2016, at 01:44, Mike Zaccardo  
> wrote:
> 
> Hi all,
> 
> I've encountered the following task numerous times when authoring
> `DynamicCluster` blueprints: write a sensor that returns a comma separated
> list of values for each member of a cluster (e.g. the host address of each
> member).
> 
> This is currently how to achieve such a task:
> 
>  brooklyn.enrichers:
>  - type: org.apache.brooklyn.enricher.stock.Aggregator
>brooklyn.config:
>  uniqueTag: member-address-aggregator
>  enricher.aggregator.excludeBlank: true
>  enricher.aggregating.fromMembers: true
>  enricher.sourceSensor: $brooklyn:sensor("member.host.address")
>  enricher.targetSensor:
> $brooklyn:sensor("member.host.address.list")
> 
>  - type: org.apache.brooklyn.enricher.stock.Joiner
>brooklyn.config:
>  uniqueTag: member-address-joiner
>  enricher.sourceSensor:
> $brooklyn:sensor("member.host.address.list")
>  enricher.targetSensor:
> $brooklyn:sensor("member.host.address.list.comma_separated")
>  minimum: $brooklyn:config("cluster.size")
>  separator: ","
>  quote: false
> 
> And here[1] is a specific example in a real blueprint.
> 
> That's pretty verbose for a commonly required task.  Instead, it would be
> nice to have something resembling the following:
> 
>  brooklyn.enrichers:
>  - type: org.apache.brooklyn.enricher.stock.ClusterListGenerator
>brooklyn.config:
>  uniqueTag: member-address-list-generator
>  enricher.sourceSensor: $brooklyn:sensor("member.host.address")
>  enricher.targetSensor:
> $brooklyn:sensor("member.host.address.list")
> 
> Short and sweet!  WDYT?
> 
> -Mike
> 
> [1]
> https://github.com/cloudsoft/brooklyn-tendermint/blob/master/tendermint-mintnet.bom#L82



Nice-to-have: Built-in Cluster Sensor List Generator

2016-05-05 Thread Mike Zaccardo
Hi all,

I've encountered the following task numerous times when authoring
`DynamicCluster` blueprints: write a sensor that returns a comma separated
list of values for each member of a cluster (e.g. the host address of each
member).

This is currently how to achieve such a task:

  brooklyn.enrichers:
  - type: org.apache.brooklyn.enricher.stock.Aggregator
brooklyn.config:
  uniqueTag: member-address-aggregator
  enricher.aggregator.excludeBlank: true
  enricher.aggregating.fromMembers: true
  enricher.sourceSensor: $brooklyn:sensor("member.host.address")
  enricher.targetSensor:
$brooklyn:sensor("member.host.address.list")

  - type: org.apache.brooklyn.enricher.stock.Joiner
brooklyn.config:
  uniqueTag: member-address-joiner
  enricher.sourceSensor:
$brooklyn:sensor("member.host.address.list")
  enricher.targetSensor:
$brooklyn:sensor("member.host.address.list.comma_separated")
  minimum: $brooklyn:config("cluster.size")
  separator: ","
  quote: false

And here[1] is a specific example in a real blueprint.

That's pretty verbose for a commonly required task.  Instead, it would be
nice to have something resembling the following:

  brooklyn.enrichers:
  - type: org.apache.brooklyn.enricher.stock.ClusterListGenerator
brooklyn.config:
  uniqueTag: member-address-list-generator
  enricher.sourceSensor: $brooklyn:sensor("member.host.address")
  enricher.targetSensor:
$brooklyn:sensor("member.host.address.list")

Short and sweet!  WDYT?

-Mike

[1]
https://github.com/cloudsoft/brooklyn-tendermint/blob/master/tendermint-mintnet.bom#L82


[GitHub] brooklyn-library pull request: Allow creating roles for PostgreSQL

2016-05-05 Thread geomacy
Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-library/pull/33#discussion_r62264240
  
--- Diff: 
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
 ---
@@ -328,9 +340,39 @@ private void initializeNewDatabase() {
 " --command="+ createUserCommand),
 sudoAsUser("postgres", getInstallDir() + "/bin/psql -p " + 
entity.getAttribute(PostgreSqlNode.POSTGRESQL_PORT) + 
 " --command="+ createDatabaseCommand),
+createRolesAdditionalCommand,
 callPgctl("stop", true))
 .failOnNonZeroResultCode().execute();
 }
+
+private String buildCreateRolesQuery() {
+Map roles = entity.getConfig(PostgreSqlNode.ROLES);
+String createRolesQuery = "\"";
+
+for (Map.Entry role: roles.entrySet()) {
+createRolesQuery = 
createRolesQuery.concat(String.format("CREATE ROLE %s", role.getKey()));
--- End diff --

Here and below, you shouldn't create SQL statements using string 
concatenation, that leaves you wide open to SQL injection attacks.  Instead use 
a prepared statement with appropriate bind variables, if at all possible.


---
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: Configurable removal strategies

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

https://github.com/apache/brooklyn-server/pull/112#discussion_r62239950
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/entity/group/FirstFromRemovalStrategy.java
 ---
@@ -0,0 +1,53 @@
+/*
+ * 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.entity.group;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.annotation.Nullable;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+
+import com.google.common.collect.Iterables;
+import com.google.common.reflect.TypeToken;
+
+public class FirstFromRemovalStrategy extends RemovalStrategy {
+
+public static final ConfigKey> STRATEGIES = 
ConfigKeys.newConfigKey(new TypeToken>() {}, 
"firstfrom.strategies",
+"An ordered list of removal strategies to be used to determine 
which entity to remove");
+
+@Nullable
+@Override
+public Entity apply(@Nullable Collection input) {
+List strategies = config().get(STRATEGIES);
--- End diff --

Following up on @neykov's point - from a yaml perspective, how would one 
use this currently? What is the advantage of having `RemovalStrategy extends 
BasicConfigurableObject`? Are you expecting people to use (in yaml) the 
`$brooklyn:object` syntax to instantiate the removal strategy? (if so, they can 
use `brooklyn.config` within the `$brooklyn:object:`). I still don't see the 
benefit of that over a pojo.


---
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: Configurable removal strategies

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

https://github.com/apache/brooklyn-server/pull/112#discussion_r62237872
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/entity/group/SensorMatchingRemovalStrategy.java
 ---
@@ -0,0 +1,50 @@
+/*
+ * 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.entity.group;
+
+import java.util.Collection;
+import java.util.Objects;
+
+import javax.annotation.Nullable;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.sensor.AttributeSensor;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+
+import com.google.common.reflect.TypeToken;
+
+public class SensorMatchingRemovalStrategy extends RemovalStrategy {
+public static final ConfigKey SENSOR = 
ConfigKeys.newConfigKey(new TypeToken() {}, 
"sensor.matching.sensor");
+// Would be nice to use ConfigKey, but TypeToken cannot be 
instantiated at runtime
+public static final ConfigKey DESIRED_VALUE = 
ConfigKeys.newConfigKey(new TypeToken() {}, "sensor.matching.value");
--- End diff --

Ah, it's a brand new class - in which case yes, change to just 
`AttributeSensor.class` and `Object.class`.


---
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: Configurable removal strategies

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

https://github.com/apache/brooklyn-server/pull/112#discussion_r62227937
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/entity/group/SensorMatchingRemovalStrategy.java
 ---
@@ -0,0 +1,50 @@
+/*
+ * 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.entity.group;
+
+import java.util.Collection;
+import java.util.Objects;
+
+import javax.annotation.Nullable;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.sensor.AttributeSensor;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+
+import com.google.common.reflect.TypeToken;
+
+public class SensorMatchingRemovalStrategy extends RemovalStrategy {
+public static final ConfigKey SENSOR = 
ConfigKeys.newConfigKey(new TypeToken() {}, 
"sensor.matching.sensor");
+// Would be nice to use ConfigKey, but TypeToken cannot be 
instantiated at runtime
+public static final ConfigKey DESIRED_VALUE = 
ConfigKeys.newConfigKey(new TypeToken() {}, "sensor.matching.value");
--- End diff --

@neykov scarily, changing the use of TypeToken will renumber all the 
anonymous inner classes below it! If anyone has persisted those, it will cause 
problems.

We really do need to get to be stricter by default, that we won't accept 
persisting anonymous inner classes!


---
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: Configurable removal strategies

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

https://github.com/apache/brooklyn-server/pull/112#discussion_r62227490
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java ---
@@ -151,12 +151,14 @@ public ZoneFailureDetector apply(final String input) {
  */
 protected final Object mutex = new Object[0];
 
-private static final Function, Entity> 
defaultRemovalStrategy = new Function, Entity>() {
-@Override public Entity apply(Collection contenders) {
--- End diff --

Agreed, let's be paranoid. Mark it as deprecated, with a comment saying why 
we have not deleted it.

There are two ways changing your anonymous inner class can break 
persistence: one is if someone has persisted it; two is if deleted or moving 
the class changes the classnames of other anonymous inner classes (there are 5 
of them in DynamicClusterImpl)!


---
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: Fix JcloudsLocation.resumeMachine wh...

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

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


---
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: Fix JcloudsLocation.resumeMachine wh...

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

https://github.com/apache/brooklyn-server/pull/116#discussion_r62226135
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
 ---
@@ -2133,11 +2133,17 @@ protected NodeMetadata findNodeOrThrow(ConfigBag 
config) {
 }
 NodeMetadata node = Iterables.getOnlyElement(candidateNodes);
 
-String pkd = 
LocationConfigUtils.getOsCredential(config).checkNoErrors().logAnyWarnings().getPrivateKeyData();
+OsCredential osCredentials = 
LocationConfigUtils.getOsCredential(config).checkNoErrors().logAnyWarnings();
+String pkd = osCredentials.getPrivateKeyData();
+String password = osCredentials.getPassword();
 if (Strings.isNonBlank(pkd)) {
 LoginCredentials expectedCredentials = 
LoginCredentials.fromCredentials(new Credentials(user, pkd));
 //override credentials
 node = 
NodeMetadataBuilder.fromNodeMetadata(node).credentials(expectedCredentials).build();
+} else if (Strings.isNonBlank(password)) {
+LoginCredentials expectedCredentials = 
LoginCredentials.fromCredentials(new Credentials(user, password));
+//override credentials
+node = 
NodeMetadataBuilder.fromNodeMetadata(node).credentials(expectedCredentials).build();
 }
 
 return node;
--- End diff --

I'm going to leave as-is because there is an implicit third case (where 
neither if block matches). In that case, we don't override the node's 
credentials (so use whatever the compute-service gave us). I suspect that will 
not have credentials at all.


---
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: Fix JcloudsLocation.resumeMachine wh...

2016-05-05 Thread aledsage
Github user aledsage commented on the pull request:

https://github.com/apache/brooklyn-server/pull/116#issuecomment-217226272
  
Thanks @andreaturli - 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: Add method HttpFeed.Builder#credenti...

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

https://github.com/apache/brooklyn-server/pull/119#discussion_r62225338
  
--- Diff: core/src/main/java/org/apache/brooklyn/feed/http/HttpFeed.java ---
@@ -197,6 +197,10 @@ public Builder credentials(String username, String 
password) {
 this.credentials = new UsernamePasswordCredentials(username, 
password);
 return this;
 }
+public Builder credentials(Credentials credentials) {
--- End diff --

Not sure about this. Nothing in the HttpFeed's public API talks about 
`org.apache.http.auth`. If we add this public method, then 
`org.apache.http.auth.Credentials` is exposed (rather than it being an 
implementation detail).

Mind you, some of our other "public" classes (e.g. `HttpTool`) exposes 
`org.apache.http.*` in its API.

What is the use-case for adding this?

@rdowner what are your thoughts - should we expose this in the API?


---
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 pull request: Allow creating roles for PostgreSQL

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

https://github.com/apache/brooklyn-library/pull/33#discussion_r62216594
  
--- Diff: 
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
 ---
@@ -328,9 +340,39 @@ private void initializeNewDatabase() {
 " --command="+ createUserCommand),
 sudoAsUser("postgres", getInstallDir() + "/bin/psql -p " + 
entity.getAttribute(PostgreSqlNode.POSTGRESQL_PORT) + 
 " --command="+ createDatabaseCommand),
+createRolesAdditionalCommand,
 callPgctl("stop", true))
 .failOnNonZeroResultCode().execute();
 }
+
+private String buildCreateRolesQuery() {
+Map roles = entity.getConfig(PostgreSqlNode.ROLES);
+String createRolesQuery = "\"";
+
+for (Map.Entry role: roles.entrySet()) {
+createRolesQuery = 
createRolesQuery.concat(String.format("CREATE ROLE %s", role.getKey()));
+if (((Map) 
role.getValue()).containsKey(PostgreSqlNode.ROLE_PROPERTIES_KEY)) {
+createRolesQuery = createRolesQuery.concat(String.format(" 
WITH %s; ", ((Map) role.getValue()).get("properties")));
+} else {
+createRolesQuery = createRolesQuery.concat(";");
+}
+
+if (((Map) 
role.getValue()).containsKey(PostgreSqlNode.ROLE_PRIVILEGES_KEY)) {
+if ( ((Map) 
role.getValue()).get(PostgreSqlNode.ROLE_PRIVILEGES_KEY) instanceof List) {
+for (Object privilage: (List) ((Map) 
role.getValue()).get(PostgreSqlNode.ROLE_PRIVILEGES_KEY)) {
+createRolesQuery = 
createRolesQuery.concat(String.format("GRANT %s TO %s; ", privilage, 
role.getKey()));
--- End diff --

s/privilage/privilege


---
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 pull request: Allow creating roles for PostgreSQL

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

https://github.com/apache/brooklyn-library/pull/33#discussion_r62216578
  
--- Diff: 
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
 ---
@@ -328,9 +340,39 @@ private void initializeNewDatabase() {
 " --command="+ createUserCommand),
 sudoAsUser("postgres", getInstallDir() + "/bin/psql -p " + 
entity.getAttribute(PostgreSqlNode.POSTGRESQL_PORT) + 
 " --command="+ createDatabaseCommand),
+createRolesAdditionalCommand,
 callPgctl("stop", true))
 .failOnNonZeroResultCode().execute();
 }
+
+private String buildCreateRolesQuery() {
+Map roles = entity.getConfig(PostgreSqlNode.ROLES);
+String createRolesQuery = "\"";
+
+for (Map.Entry role: roles.entrySet()) {
+createRolesQuery = 
createRolesQuery.concat(String.format("CREATE ROLE %s", role.getKey()));
+if (((Map) 
role.getValue()).containsKey(PostgreSqlNode.ROLE_PROPERTIES_KEY)) {
+createRolesQuery = createRolesQuery.concat(String.format(" 
WITH %s; ", ((Map) role.getValue()).get("properties")));
+} else {
+createRolesQuery = createRolesQuery.concat(";");
+}
+
+if (((Map) 
role.getValue()).containsKey(PostgreSqlNode.ROLE_PRIVILEGES_KEY)) {
+if ( ((Map) 
role.getValue()).get(PostgreSqlNode.ROLE_PRIVILEGES_KEY) instanceof List) {
+for (Object privilage: (List) ((Map) 
role.getValue()).get(PostgreSqlNode.ROLE_PRIVILEGES_KEY)) {
--- End diff --

s/privilage/privilege


---
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 pull request: Allow creating roles for PostgreSQL

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

https://github.com/apache/brooklyn-library/pull/33#discussion_r62215974
  
--- Diff: 
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNode.java
 ---
@@ -90,6 +95,17 @@
 String.class, "postgresql.username", "Username of the database 
user");
 
 String DEFAULT_USERNAME = "postgresqluser";
+
+@SetFromFlag("roles")
+ConfigKey> ROLES = new MapConfigKey(Map.class, 
"postgresql.roles",
+"Set roles with properties and permissions. Shoud be a map 
with keys equal to role names and values a map of the type:" +
+  "key equal to `properties` and value - the role 
properties that should be in the query after `WITH` statement" +
+"key equal to `privileges` and value - the `GRANT` 
query value between the `GRANT` and `TO` statements"
+);
--- End diff --

Maybe worth to add an actual example within the description of what the map 
should look like?


---
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 pull request: Allow creating roles for PostgreSQL

2016-05-05 Thread iyovcheva
Github user iyovcheva commented on the pull request:

https://github.com/apache/brooklyn-library/pull/33#issuecomment-217200840
  
Thanks @geomacy 


---
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 pull request: Allow creating roles for PostgreSQL

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

https://github.com/apache/brooklyn-library/pull/33#discussion_r62208621
  
--- Diff: 
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
 ---
@@ -328,9 +340,39 @@ private void initializeNewDatabase() {
 " --command="+ createUserCommand),
 sudoAsUser("postgres", getInstallDir() + "/bin/psql -p " + 
entity.getAttribute(PostgreSqlNode.POSTGRESQL_PORT) + 
 " --command="+ createDatabaseCommand),
+createRolesAdditionalCommand,
 callPgctl("stop", true))
 .failOnNonZeroResultCode().execute();
 }
+
+private String buildCreateRolesQuery() {
+Map roles = entity.getConfig(PostgreSqlNode.ROLES);
+String createRolesQuery = "\"";
+
+for (Map.Entry role: roles.entrySet()) {
+createRolesQuery = 
createRolesQuery.concat(String.format("CREATE ROLE %s", role.getKey()));
+if (((Map) role.getValue()).containsKey("properties")) {
+createRolesQuery = createRolesQuery.concat(String.format(" 
WITH %s; ", ((Map) role.getValue()).get("properties")));
+} else {
+createRolesQuery = createRolesQuery.concat(";");
+}
+
+if (((Map) role.getValue()).containsKey("privilages")) {
--- End diff --

Thanks @geomacy 
Do you think the roles defaults are fine to be in brooklyn as they look 
pretty standard, not specific?


---
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 pull request: Allow creating roles for PostgreSQL

2016-05-05 Thread geomacy
Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-library/pull/33#discussion_r62207834
  
--- Diff: 
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNode.java
 ---
@@ -90,6 +95,29 @@
 String.class, "postgresql.username", "Username of the database 
user");
 
 String DEFAULT_USERNAME = "postgresqluser";
+
+@SetFromFlag("roles")
+ConfigKey> ROLES = new MapConfigKey(Map.class, 
"postgresql.roles", "Initial roles with permissions",
+ImmutableMap.of(
+"Admin", ImmutableMap.of(
+"properties", "SUPERUSER",
+"privilages", "ALL PRIVILEGES ON ALL TABLES IN 
SCHEMA public"
+),
+"Data_Modeler", ImmutableMap.of(
+"properties", "CREATEDB CREATEROLE",
+"privilages", "ALL PRIVILEGES ON ALL TABLES IN 
SCHEMA public"
+),
+"Developer", ImmutableMap.of(
+"privilages", ImmutableList.of("SELECT, 
INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public",
+"EXECUTE ON ALL FUNCTIONS IN SCHEMA 
public")
+),
+"Analyst", ImmutableMap.of(
+"privilages", "SELECT ON ALL TABLES IN SCHEMA 
public"
+)
+));
+
+@SetFromFlag("createRoles")
+ConfigKey CREATE_ROLES = 
ConfigKeys.newBooleanConfigKey("create.roles", "Should roles be created with 
database initialization", false);
--- End diff --

Do you really need this?   Why not just check if config key ROLES is not 
empty?


---
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 pull request: Allow creating roles for PostgreSQL

2016-05-05 Thread geomacy
Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-library/pull/33#discussion_r62207804
  
--- Diff: 
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNode.java
 ---
@@ -90,6 +95,29 @@
 String.class, "postgresql.username", "Username of the database 
user");
 
 String DEFAULT_USERNAME = "postgresqluser";
+
+@SetFromFlag("roles")
+ConfigKey> ROLES = new MapConfigKey(Map.class, 
"postgresql.roles", "Initial roles with permissions",
+ImmutableMap.of(
--- End diff --

I'd leave the default empty - hard to predict the roles users will want.


---
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 pull request: Allow creating roles for PostgreSQL

2016-05-05 Thread geomacy
Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-library/pull/33#discussion_r62207350
  
--- Diff: 
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
 ---
@@ -328,9 +340,39 @@ private void initializeNewDatabase() {
 " --command="+ createUserCommand),
 sudoAsUser("postgres", getInstallDir() + "/bin/psql -p " + 
entity.getAttribute(PostgreSqlNode.POSTGRESQL_PORT) + 
 " --command="+ createDatabaseCommand),
+createRolesAdditionalCommand,
 callPgctl("stop", true))
 .failOnNonZeroResultCode().execute();
 }
+
+private String buildCreateRolesQuery() {
+Map roles = entity.getConfig(PostgreSqlNode.ROLES);
+String createRolesQuery = "\"";
+
+for (Map.Entry role: roles.entrySet()) {
+createRolesQuery = 
createRolesQuery.concat(String.format("CREATE ROLE %s", role.getKey()));
+if (((Map) role.getValue()).containsKey("properties")) {
+createRolesQuery = createRolesQuery.concat(String.format(" 
WITH %s; ", ((Map) role.getValue()).get("properties")));
+} else {
+createRolesQuery = createRolesQuery.concat(";");
+}
+
+if (((Map) role.getValue()).containsKey("privilages")) {
--- End diff --

typo "privilages" -> "privileges" 


---
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 pull request: Allow creating roles for PostgreSQL

2016-05-05 Thread iyovcheva
GitHub user iyovcheva opened a pull request:

https://github.com/apache/brooklyn-library/pull/33

Allow creating roles for PostgreSQL



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

$ git pull https://github.com/iyovcheva/brooklyn-library postgresql-roles

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

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


commit d266a85cc4fc716d62e67a4231e67850475ac82b
Author: Ivana Yovcheva 
Date:   2016-05-04T16:13:38Z

Allow creating roles for PostgreSQL




---
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: Update server-cli-reference.md

2016-05-05 Thread tbouron
GitHub user tbouron opened a pull request:

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

Update server-cli-reference.md

Fix a small typo within the `nohup` command

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

$ git pull https://github.com/tbouron/brooklyn-docs patch-1

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

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


commit a72f538073baa220f4aae3c2553bc4c662885ad3
Author: Thomas Bouron 
Date:   2016-05-05T14:43:27Z

Update server-cli-reference.md

Fix a small typo within the `nohup` command




---
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-263) Explicit ports are not open for BrooklynNode in cloud

2016-05-05 Thread Jose Carrasco (JIRA)

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

Jose Carrasco commented on BROOKLYN-263:


As [~andreaturli] suggested me, the expected HTTP_PORT for a BrooklynNode can 
be forced to be opened using the provision.properties.
{code:}
name: BrooklynNode
location: aws-ec2:us-west-2

services:
- type: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
  id: deployer
  name: Deployer
  
  brooklyn.config:
onExistingProperties: do_not_use
brooklynnode.webconsole.nosecurity: true
brooklynnode.webconsole.httpPort: 8082
provisioning.properties:
  required.ports:
  - 8082  
{code}

But, probably this does not solve the issue. Because if you modify the 
brooklynnode.webconsole.httpPort, required.ports should be modified too.


> Explicit ports are not open for BrooklynNode in cloud
> -
>
> Key: BROOKLYN-263
> URL: https://issues.apache.org/jira/browse/BROOKLYN-263
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0, 0.10.0
>Reporter: Jose Carrasco
>Priority: Minor
>  Labels: easyfix
>
> I tried to deploy a BrooklynNode entity with an explicit web console port 
> (8082) over a AWS VM machine. Using the following plan:
> {code:title=BluePrint|borderStyle=solid}
> name: BrooklynNode
> location: aws-ec2:us-west-2
> services:
> - type: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
>   id: brooklynNode
>   brooklyn.config:
> onExistingProperties: do_not_use
> brooklynnode.webconsole.nosecurity: true
> brooklynnode.webconsole.httpPort: 8082 
> {code}
> However I found an error because the entity did not look to be up (SERVICE_UP 
> retrieved false). Then, I tried to figure out a bit. The BrooklynNode 
> instance was installed and executed correctly but the VM’s security group did 
> not have any rule to enable the 8082 port.



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


[GitHub] brooklyn-docs pull request: tidy #1 of maven build instructions

2016-05-05 Thread alrick87
Github user alrick87 commented on the pull request:

https://github.com/apache/brooklyn-docs/pull/53#issuecomment-217144618
  
LGTM


---
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: Draft board report

2016-05-05 Thread Alex Heneveld


Thanks.  Great job.

--A


On 05/05/2016 11:52, Richard Downer wrote:

All,

Below is a draft for our next board report, which needs to be submitted by
Wednesday 11th May. If you have any comments please let me know; otherwise
I'll go for passive consensus.

---

## Description:
  - Apache Brooklyn Project is a software framework for modeling,
monitoring and managing cloud applications through autonomic
blueprints.

## Issues:
  - There are no issues requiring board attention at this time

## Activity:
  - We have completed our first release as a top-level project.
  - We have taken on our first GSoC student.
  - Development continues with a regular turnover of pull requests submitted
and merged.

## Health report:
  - The project continues with a similar level of activity that we have seen
recently.
  - An unsolicited volunteer for a GSoC project has been an exciting advance.
  - Unfortunately we do not have any talks at ApacheCon NA, owing to the
majority of our active community being Europe-based. This would have been a
good opportunity to spread awareness of the project which we were
unfortunately unable to take advantage of. However we have had
representation at ApacheCon Europe for the last two years and expect this
to continue this year.

## PMC changes:

  - Currently 11 PMC members.
  - No new PMC members added in the last 3 months
  - Last PMC addition was Jean-Baptiste Onofré and Olivier Lamy, who
converted their mentor status to committer/PMC member on graduation.

## Committer base changes:

  - Currently 11 committers.
  - No new committers added in the last 3 months
  - Last committer addition was Jean-Baptiste Onofré and Olivier Lamy,
who converted their mentor status to committer/PMC member on
graduation.

## Releases:

  - 0.9.0 was released on Mon Apr 18 2016

## JIRA activity:

  - 43 JIRA tickets created in the last 3 months
  - 17 JIRA tickets closed/resolved in the last 3 months





Draft board report

2016-05-05 Thread Richard Downer
All,

Below is a draft for our next board report, which needs to be submitted by
Wednesday 11th May. If you have any comments please let me know; otherwise
I'll go for passive consensus.

---

## Description:
 - Apache Brooklyn Project is a software framework for modeling,
   monitoring and managing cloud applications through autonomic
   blueprints.

## Issues:
 - There are no issues requiring board attention at this time

## Activity:
 - We have completed our first release as a top-level project.
 - We have taken on our first GSoC student.
 - Development continues with a regular turnover of pull requests submitted
and merged.

## Health report:
 - The project continues with a similar level of activity that we have seen
recently.
 - An unsolicited volunteer for a GSoC project has been an exciting advance.
 - Unfortunately we do not have any talks at ApacheCon NA, owing to the
majority of our active community being Europe-based. This would have been a
good opportunity to spread awareness of the project which we were
unfortunately unable to take advantage of. However we have had
representation at ApacheCon Europe for the last two years and expect this
to continue this year.

## PMC changes:

 - Currently 11 PMC members.
 - No new PMC members added in the last 3 months
 - Last PMC addition was Jean-Baptiste Onofré and Olivier Lamy, who
   converted their mentor status to committer/PMC member on graduation.

## Committer base changes:

 - Currently 11 committers.
 - No new committers added in the last 3 months
 - Last committer addition was Jean-Baptiste Onofré and Olivier Lamy,
   who converted their mentor status to committer/PMC member on
   graduation.

## Releases:

 - 0.9.0 was released on Mon Apr 18 2016

## JIRA activity:

 - 43 JIRA tickets created in the last 3 months
 - 17 JIRA tickets closed/resolved in the last 3 months


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

2016-05-05 Thread Apache Jenkins Server
See 

--
[...truncated 43947 lines...]
[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 DEB Package ... SKIPPED
[INFO] Brooklyn Root .. SKIPPED
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time: 23:43 min
[INFO] Finished at: 2016-05-05T10:41:37+01:00
[INFO] Final Memory: 157M/444M
[INFO] 
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on 
project brooklyn-software-webapp: There are test failures.
[ERROR] 
[ERROR] Please refer to 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-library\software\webapp\target\surefire-reports
 for the individual test results.
[ERROR] -> [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
[ERROR]   mvn  -rf :brooklyn-software-webapp
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-server\policy\pom.xml
 to 
org.apache.brooklyn/brooklyn-policy/0.10.0-SNAPSHOT/brooklyn-policy-0.10.0-SNAPSHOT.pom
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-server\policy\target\brooklyn-policy-0.10.0-SNAPSHOT.jar
 to 
org.apache.brooklyn/brooklyn-policy/0.10.0-SNAPSHOT/brooklyn-policy-0.10.0-SNAPSHOT.jar
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-server\policy\target\brooklyn-policy-0.10.0-SNAPSHOT-tests.jar
 to 
org.apache.brooklyn/brooklyn-policy/0.10.0-SNAPSHOT/brooklyn-policy-0.10.0-SNAPSHOT-tests.jar
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-server\policy\target\brooklyn-policy-0.10.0-SNAPSHOT-sources.jar
 to 
org.apache.brooklyn/brooklyn-policy/0.10.0-SNAPSHOT/brooklyn-policy-0.10.0-SNAPSHOT-sources.jar
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-server\policy\target\brooklyn-policy-0.10.0-SNAPSHOT-test-sources.jar
 to 
org.apache.brooklyn/brooklyn-policy/0.10.0-SNAPSHOT/brooklyn-policy-0.10.0-SNAPSHOT-test-sources.jar
Compressed 593.45 KB of artifacts by 16.2% relative to #96
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-library\software\osgi\pom.xml
 to 
org.apache.brooklyn/brooklyn-software-osgi/0.10.0-SNAPSHOT/brooklyn-software-osgi-0.10.0-SNAPSHOT.pom
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-library\software\osgi\target\brooklyn-software-osgi-0.10.0-SNAPSHOT.jar
 to 
org.apache.brooklyn/brooklyn-software-osgi/0.10.0-SNAPSHOT/brooklyn-software-osgi-0.10.0-SNAPSHOT.jar
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-library\software\osgi\target\brooklyn-software-osgi-0.10.0-SNAPSHOT-tests.jar
 to 
org.apache.brooklyn/brooklyn-software-osgi/0.10.0-SNAPSHOT/brooklyn-software-osgi-0.10.0-SNAPSHOT-tests.jar
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-library\software\osgi\target\brooklyn-software-osgi-0.10.0-SNAPSHOT-sources.jar
 to 
org.apache.brooklyn/brooklyn-software-osgi/0.10.0-SNAPSHOT/brooklyn-software-osgi-0.10.0-SNAPSHOT-sources.jar
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-library\software\osgi\target\brooklyn-software-osgi-0.10.0-SNAPSHOT-test-sources.jar
 to 
org.apache.brooklyn/brooklyn-software-osgi/0.10.0-SNAPSHOT/brooklyn-software-osgi-0.10.0-SNAPSHOT-test-sources.jar
[JENKINS] Archiving 
F:\hudson\hudson-slave\workspace\brooklyn-master-windows\brooklyn-library\examples\simple-messaging-pubsub\pom.xml
 to 
org.apache.brooklyn.example/brooklyn-example-simple-messaging-pubsub/0.10.0-SNA

Re: BrooklynNode with a explicit httpPort in cloud

2016-05-05 Thread Andrea Turli
Jose,

On 5 May 2016 at 10:30, Jose Carrasco  wrote:

> Hi all,
>
> Andrea, thanks for your reply. I have opened a jira issue
> https://issues.apache.org/jira/browse/BROOKLYN-263


Thanks!

>
> Just a pair of question, do you think I should add a gsoc label to my
> tasks in order to maintain the gsoc flavor?
> What routing should I follow? I mean, I would like to work in this issue,
> so probably somebody should assigns the task to my jira profile (kiuby88),
> right?
>

I'm not sure about the gsoc label as it seems more a brooklyn induction to
me rather than a gsoc related task, but not strong feelings.
Feel free to start looking at the jira issue you just created and propose a
fix that reference a PR (this would be ideal IMHO) even if you are not
explicitly assigned to the task.


> Let me try your first workaround (required.ports), I assume that I have to
> add the result in the jira task. About second advice, yes I am using the
> default port. Currently, this issue is not a problem for me. I find this
> issue while deploying some examples and I thought it could be starting
> point for the gsoc immersion in the community.
>

Excellent! Let us know if the former suggestion fixes the issue for the
time being.

Looking forward for your PR!

Great job!
Andrea


Re: BrooklynNode with a explicit httpPort in cloud

2016-05-05 Thread Jose Carrasco
Hi all,

Andrea, thanks for your reply. I have opened a jira issue
https://issues.apache.org/jira/browse/BROOKLYN-263

Just a pair of question, do you think I should add a gsoc label to my tasks in 
order to maintain the gsoc flavor?
What routing should I follow? I mean, I would like to work in this issue, so 
probably somebody should assigns the task to my jira profile (kiuby88), right?

Let me try your first workaround (required.ports), I assume that I have to add 
the result in the jira task. About second advice, yes I am using the default 
port. Currently, this issue is not a problem for me. I find this issue while 
deploying some examples and I thought it could be starting point for the gsoc 
immersion in the community.

Thanks a lot.

Jose
GSoC student


El 05/05/2016, a las 08:18, Andrea Turli  
escribió:

> Jose,
> 
> Thanks for that. Can you open a jira task to track this issue properly and
> add the jira issue url in this thread later on?
> 
> There are a couple of workaround to ypur problem:
> 
> 1. Can you try a list of
> 
> required.ports:
> - 22
> - 8082
> 
> in the provisioning.properties of your entity?
> 
> 2. Alternatively, can you just use the default 8081, maybe?
> 
> Thanks,
> Andrea
> 
> Andrea
> Il 05/mag/2016 03:49, "Jose Carrasco"  ha scritto:
> 
>> Hi all,
>> 
>> I tried to deploy a BrooklynNode entity with an explicit web console port
>> (8082) over a AWS VM machine. Using the following plan:
>> 
>> name: BrooklynNode
>> location:
>> jclouds:aws-ec2:
>>   region: us-west-2
>>   identity: 
>>   credential: 
>> services:
>> - type: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
>> id: brooklynNode
>> name: brooklynNode
>> brooklyn.config:
>>   onExistingProperties: do_not_use
>>   brooklynnode.webconsole.nosecurity: true
>>   brooklynnode.webconsole.httpPort: 8082
>> 
>> However I found an error because the entity did not look to be up (
>> SERVICE_UP retrieved false). Then, I tried to figure out a bit. The
>> BrooklynNode instance was installed and executed correctly but the VM’s
>> security group did not have any rule to enable the 8082 port. It looks that
>> the problem is here [1], the following if code condition:
>> 
>> (PortRange.class.isAssignableFrom(k.getType()) ||
>> portsPattern.matcher(k.getName()).matches())
>> 
>> returns false because when the BrooklynNode.HTTPS_PORT is evaluated the
>> entity is not assignable from PortRange because the config key instance
>> is retrieved by [2], which returns a ConfigKey, so the type is
>> not assignable from PortRange.class.
>> Moreover, the config key name is brooklynnode.webconsole.httpPort, which
>> is not matchable by the portPattern “*.port”.
>> Then, the port that is specified from BrooklynNode.HTTPS_PORT config key
>> is  not  evaluated as a PortRange config key, and it is not returned by
>> getRequiredOpenPorts() method. Then you can see that the VM does not
>> contains the necessary flags [3] to open the specified http port, so as
>> result the *Brooklyn node web console* is not accesible.
>> I have seen that there is a test which check the BrooklynNode.HTTPS_PORT
>> in BrooklynNodeIntegrationTest [4], but  (I think) different ports are
>> tested over the local machine where all ports are accessible.
>> 
>> If you consider that this behavior should be solved, I have two different
>> proposal.
>> 
>>   - First,  adapting the BrooklynNode.HTTPS_PORT name to the
>>   portPattern, so “brooklynnode.webconsole.httpPort” should be replaced
>>   by “brooklynnode.webconsole.http.port”. I think it is the best option.
>>   (it should be necessary review the rest of config keys too).
>>   - Modify the InboundPortsUtils#getRequiredOpenPorts method in order to
>>   support config keys whose value is assignable from PortRange. In this
>>   case I have written a little commit [commit].
>> 
>> 
>> I would like to solve this issue.
>> Thought?
>> 
>> Please, note that if you configure the BrooklynNode.HTTPS_PORT pointing to
>> 8081 (default value) the web console will be not accessible because the
>> configuration follows the same process that 8082 scenario.
>> If no port is defined, the 8081 will be accessible because config keys
>> will be retrieved by the entityType [5] that provides the default entities’
>> ConfigKeys whose types will be assignable from PortRange.class.
>> 
>> Jose
>> GSoC student
>> 
>> [1]
>> https://github.com/apache/brooklyn-server/blob/9b0fe8a6d1766728753e0d3ae7bf7c87602a443a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java#L85
>> 
>> [2]
>> https://github.com/apache/brooklyn-server/blob/9b0fe8a6d1766728753e0d3ae7bf7c87602a443a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java#L80
>> 
>> [3]
>> https://github.com/apache/brooklyn-server/blob/9b0fe8a6d1766728753e0d3ae7bf7c87602a443a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java#L374
>> 
>> [4]
>> h

[jira] [Updated] (BROOKLYN-263) Explicit ports are not open for BrooklynNode in cloud

2016-05-05 Thread Jose Carrasco (JIRA)

 [ 
https://issues.apache.org/jira/browse/BROOKLYN-263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jose Carrasco updated BROOKLYN-263:
---
Description: 
I tried to deploy a BrooklynNode entity with an explicit web console port 
(8082) over a AWS VM machine. Using the following plan:

{code:title=BluePrint|borderStyle=solid}
name: BrooklynNode
location: aws-ec2:us-west-2
services:
- type: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
  id: brooklynNode
  brooklyn.config:
onExistingProperties: do_not_use
brooklynnode.webconsole.nosecurity: true
brooklynnode.webconsole.httpPort: 8082 
{code}

However I found an error because the entity did not look to be up (SERVICE_UP 
retrieved false). Then, I tried to figure out a bit. The BrooklynNode instance 
was installed and executed correctly but the VM’s security group did not have 
any rule to enable the 8082 port.

  was:
I tried to deploy a BrooklynNode entity with an explicit web console port 
(8082) over a AWS VM machine. Using the following plan:

{code:title=BluePrit|borderStyle=solid}
name: BrooklynNode
location: aws-ec2:us-west-2
services:
- type: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
  id: brooklynNode
  brooklyn.config:
onExistingProperties: do_not_use
brooklynnode.webconsole.nosecurity: true
brooklynnode.webconsole.httpPort: 8082 
{code}

However I found an error because the entity did not look to be up (SERVICE_UP 
retrieved false). Then, I tried to figure out a bit. The BrooklynNode instance 
was installed and executed correctly but the VM’s security group did not have 
any rule to enable the 8082 port.


> Explicit ports are not open for BrooklynNode in cloud
> -
>
> Key: BROOKLYN-263
> URL: https://issues.apache.org/jira/browse/BROOKLYN-263
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0, 0.10.0
>Reporter: Jose Carrasco
>Priority: Minor
>  Labels: easyfix
>
> I tried to deploy a BrooklynNode entity with an explicit web console port 
> (8082) over a AWS VM machine. Using the following plan:
> {code:title=BluePrint|borderStyle=solid}
> name: BrooklynNode
> location: aws-ec2:us-west-2
> services:
> - type: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
>   id: brooklynNode
>   brooklyn.config:
> onExistingProperties: do_not_use
> brooklynnode.webconsole.nosecurity: true
> brooklynnode.webconsole.httpPort: 8082 
> {code}
> However I found an error because the entity did not look to be up (SERVICE_UP 
> retrieved false). Then, I tried to figure out a bit. The BrooklynNode 
> instance was installed and executed correctly but the VM’s security group did 
> not have any rule to enable the 8082 port.



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


[jira] [Created] (BROOKLYN-263) Explicit ports are not open for BrooklynNode in cloud

2016-05-05 Thread Jose Carrasco (JIRA)
Jose Carrasco created BROOKLYN-263:
--

 Summary: Explicit ports are not open for BrooklynNode in cloud
 Key: BROOKLYN-263
 URL: https://issues.apache.org/jira/browse/BROOKLYN-263
 Project: Brooklyn
  Issue Type: Bug
Affects Versions: 0.9.0, 0.10.0
Reporter: Jose Carrasco
Priority: Minor


I tried to deploy a BrooklynNode entity with an explicit web console port 
(8082) over a AWS VM machine. Using the following plan:

{code:title=BluePrit|borderStyle=solid}
name: BrooklynNode
location: aws-ec2:us-west-2
services:
- type: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
  id: brooklynNode
  brooklyn.config:
onExistingProperties: do_not_use
brooklynnode.webconsole.nosecurity: true
brooklynnode.webconsole.httpPort: 8082 
{code}

However I found an error because the entity did not look to be up (SERVICE_UP 
retrieved false). Then, I tried to figure out a bit. The BrooklynNode instance 
was installed and executed correctly but the VM’s security group did not have 
any rule to enable the 8082 port.



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