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

2016-06-23 Thread Apache Jenkins Server
See 

--
Started by upstream project "brooklyn-master-build" build number 276
originally caused by:
 Started by timer
[EnvInject] - Loading node environment variables.
ERROR: SEVERE ERROR occurs
org.jenkinsci.lib.envinject.EnvInjectException: 
hudson.remoting.ChannelClosedException: channel is already closed
at 
org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvironmentVariablesNode(EnvironmentVariablesNodeLoader.java:75)
at 
org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:81)
at 
org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:39)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:572)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:492)
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)
Caused by: hudson.remoting.ChannelClosedException: channel is already closed
at hudson.remoting.Channel.send(Channel.java:578)
at hudson.remoting.Request.call(Request.java:130)
at hudson.remoting.Channel.call(Channel.java:780)
at hudson.FilePath.act(FilePath.java:1074)
at 
org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvironmentVariablesNode(EnvironmentVariablesNodeLoader.java:44)
... 8 more
Caused by: java.io.IOException
at hudson.remoting.Channel.close(Channel.java:1163)
at hudson.slaves.ChannelPinger$1.onDead(ChannelPinger.java:118)
at hudson.remoting.PingThread.ping(PingThread.java:126)
at hudson.remoting.PingThread.run(PingThread.java:85)
Caused by: java.util.concurrent.TimeoutException: Ping started at 1466734210161 
hasn't completed by 1466734450162
... 2 more
[EnvInject] - [ERROR] - SEVERE ERROR occurs: remote file operation failed: 
f:\jenkins\jenkins-slave\tools\hudson.tasks.Maven_MavenInstallation\maven-3.2.5\.installedFrom
 at hudson.remoting.Channel@7b1ed426:windows-2012-1: 
hudson.remoting.ChannelClosedException: channel is already closed


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

2016-06-23 Thread Apache Jenkins Server
See 

--
Started by upstream project "brooklyn-master-build" build number 275
originally caused by:
 Started by upstream project "brooklyn-server-master" build number 150
 originally caused by:
  Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on windows-2012-1 (Windows) 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.git # timeout=10
Fetching upstream changes from 
https://git-wip-us.apache.org/repos/asf/brooklyn.git
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress 
 > https://git-wip-us.apache.org/repos/asf/brooklyn.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse "origin/master^{commit}" # timeout=10
Checking out Revision e9ea4570b82ae6d41a9197d45ba576a173c1d275 (origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f e9ea4570b82ae6d41a9197d45ba576a173c1d275
 > git rev-list e9ea4570b82ae6d41a9197d45ba576a173c1d275 # timeout=10
 > git remote # timeout=10
 > git submodule init # timeout=10
 > git submodule sync # timeout=10
 > git config --get remote.origin.url # timeout=10
 > git submodule update --init --recursive --remote
[brooklyn-master-windows] $ cmd /c call 
C:\Windows\TEMP\hudson5648849686139830319.bat

git> submodule 
foreach "git checkout master & git pull origin master" 
Entering 'brooklyn-client'
Your branch is up-to-date with 'origin/master'.
Already on 'master'
>From https://github.com/apache/brooklyn-client
 * branchmaster -> FETCH_HEAD
Already up-to-date.
Entering 'brooklyn-dist'
Your branch is up-to-date with 'origin/master'.
Already on 'master'
>From https://github.com/apache/brooklyn-dist
 * branchmaster -> FETCH_HEAD
Already up-to-date.
Entering 'brooklyn-docs'
Your branch is behind 'origin/master' by 5 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Previous HEAD position was 9f2f0cf... This closes #77
Switched to branch 'master'
>From https://github.com/apache/brooklyn-docs
 * branchmaster -> FETCH_HEAD
warning: fetch updated the current branch head.
fast-forwarding your working tree from
commit 9f2f0cf3517eb8154561b710050853d853fff7a1.
error: Your local changes to the following files would be overwritten by merge:
guide/ops/index.md
guide/ops/locations/_clouds.md
Please commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
guide/ops/high-availability.md
Please move or remove them before you can merge.
Aborting
fatal: Cannot fast-forward your working tree.
After making sure that you saved anything precious from
$ git diff 9f2f0cf3517eb8154561b710050853d853fff7a1
output, run
$ git reset --hard
to recover.
Stopping at 'brooklyn-docs'; script returned non-zero status.

exit> 1 
Build step 'Execute Windows batch command' marked build as failure


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

2016-06-23 Thread Apache Jenkins Server
See 



[jira] [Commented] (BROOKLYN-264) Stop app while VM still being provisioned: vm is left running when app is expunged

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-264:
-

Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/211
  
My comments so far are bike-shedding.

Looking at the big picture, I need to think more about:

* How should we trigger the delete, so that it safely handles success and 
failure of provisioning? Options include:
  * As you've done here, have `stop()` wait for the machine to be set; but 
abort if start() fails.
  * Mark the entity's internal state as "requiring machine-release", and 
have the start() code immediately release the machine. But we'd still need 
`stop()` to wait for that to be done, otherwise we might go on to unmanage the 
entity and thus cancel the tasks.

* For speed:
  * Can we use the jclouds event bus to be told of the VM's id long before 
jclouds has returned from the provisioning call? @andreaturli what do you think?
  * Can we tell the `JcloudsLocation` instance that the provisioning has 
been aborted (this would allow us to avoid waiting-for-sshable, etc). Not quite 
sure how best to do that.

We can ignore the speed issue for now, unless there is a quick win that 
greatly speeds things up. The main thing is to get it functionally correct, and 
with clean code.


> Stop app while VM still being provisioned: vm is left running when app is 
> expunged
> --
>
> Key: BROOKLYN-264
> URL: https://issues.apache.org/jira/browse/BROOKLYN-264
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> A customer deployed an app to AWS, but while the VM was still starting up 
> they stopped (and thus expunged) the app. The app disappeared from the 
> Brooklyn web-console, but the starting VM was left behind in AWS.
> This is simple to reproduce:
> 1. deploy a simple blueprint, such as:
> {noformat}
> location: aws-ec2:us-east-1
> services:
> - type: org.apache.brooklyn.entity.machine.MachineEntity
> {noformat}
> 2. wait for the VM to appear in the AWS web-console (with state 
> "initialising")
> 3. call the {{stop}} effector on the top-level app.
> ---
> Looking at the {{start}} task that was executing at the time when {{stop}} 
> was called, below is the thread's stack trace:
> {noformat}
> Provisioning machine in JcloudsLocation[AWS 
> Virginia:/aws-ec2:us-east-1@eyNrLIo5]
> Task[provisioning (AWS Virginia)]@MJITkjw0
> Submitted by SoftlyPresent[value=Task[start]@tKw0qJET]
> In progress, thread waiting (notify) on 
> java.util.concurrent.CountDownLatch$Sync@2ed5be36
> At: 
> org.jclouds.concurrent.FutureIterables.awaitCompletion(FutureIterables.java:149)
> 
> org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:214)
> 
> org.jclouds.ec2.compute.EC2ComputeService.createNodesInGroup(EC2ComputeService.java:149)
> 
> org.apache.brooklyn.location.jclouds.JcloudsLocation.obtainOnce(JcloudsLocation.java:726)
> 
> org.apache.brooklyn.location.jclouds.JcloudsLocation.obtain(JcloudsLocation.java:616)
> 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:406)
> 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:396)
> 
> org.apache.brooklyn.util.core.task.Tasks.withBlockingDetails(Tasks.java:98)
> 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:380)
> 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:364)
> 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
> 
> org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:519)
> {noformat}
> From this, we can see that we are still calling jclouds. This means that 
> jclouds has not yet returned to Brooklyn the VM's id. It also means that the 
> {{MachineEntity}} will not have been given a {{JcloudsSshMachineLocation}} 
> instance. 
> When {{stop}} is called on the {{MachineEntity}}, it doesn't have a machine 
> location instance so it doesn't have anything to ask to stop. This is why the 
> VM is left running.



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


[GitHub] brooklyn-server issue #211: BROOKLYN-264 Stop app while VM still being provi...

2016-06-23 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/211
  
My comments so far are bike-shedding.

Looking at the big picture, I need to think more about:

* How should we trigger the delete, so that it safely handles success and 
failure of provisioning? Options include:
  * As you've done here, have `stop()` wait for the machine to be set; but 
abort if start() fails.
  * Mark the entity's internal state as "requiring machine-release", and 
have the start() code immediately release the machine. But we'd still need 
`stop()` to wait for that to be done, otherwise we might go on to unmanage the 
entity and thus cancel the tasks.

* For speed:
  * Can we use the jclouds event bus to be told of the VM's id long before 
jclouds has returned from the provisioning call? @andreaturli what do you think?
  * Can we tell the `JcloudsLocation` instance that the provisioning has 
been aborted (this would allow us to avoid waiting-for-sshable, etc). Not quite 
sure how best to do that.

We can ignore the speed issue for now, unless there is a quick win that 
greatly speeds things up. The main thing is to get it functionally correct, and 
with clean code.


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


[jira] [Commented] (BROOKLYN-264) Stop app while VM still being provisioned: vm is left running when app is expunged

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-264:
-

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68328999
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
+Map flags = ImmutableMap.of("imageId", 
"us-west-2/ami-cd715dfd", 
LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS.getName(), "");
+Map allFlags = MutableMap.builder()
+.put("tags", 

[GitHub] brooklyn-server pull request #211: BROOKLYN-264 Stop app while VM still bein...

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68328999
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
+Map flags = ImmutableMap.of("imageId", 
"us-west-2/ami-cd715dfd", 
LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS.getName(), "");
+Map allFlags = MutableMap.builder()
+.put("tags", ImmutableList.of(getClass().getName()))
+.putAll(flags)
+.build();
+JcloudsLocation jcloudsLocation = 
(JcloudsLocation)mgmt.getLocationRegistry().getLocationManaged(LOCATION_SPEC, 
allFlags);
+
+
+

[jira] [Commented] (BROOKLYN-264) Stop app while VM still being provisioned: vm is left running when app is expunged

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-264:
-

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68328923
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
+Map flags = ImmutableMap.of("imageId", 
"us-west-2/ami-cd715dfd", 
LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS.getName(), "");
+Map allFlags = MutableMap.builder()
+.put("tags", 

[GitHub] brooklyn-server pull request #211: BROOKLYN-264 Stop app while VM still bein...

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68328923
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
+Map flags = ImmutableMap.of("imageId", 
"us-west-2/ami-cd715dfd", 
LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS.getName(), "");
+Map allFlags = MutableMap.builder()
+.put("tags", ImmutableList.of(getClass().getName()))
+.putAll(flags)
+.build();
+JcloudsLocation jcloudsLocation = 
(JcloudsLocation)mgmt.getLocationRegistry().getLocationManaged(LOCATION_SPEC, 
allFlags);
+
+
+

[jira] [Commented] (BROOKLYN-264) Stop app while VM still being provisioned: vm is left running when app is expunged

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-264:
-

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68328852
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
+Map flags = ImmutableMap.of("imageId", 
"us-west-2/ami-cd715dfd", 
LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS.getName(), "");
+Map allFlags = MutableMap.builder()
+.put("tags", 

[GitHub] brooklyn-server pull request #211: BROOKLYN-264 Stop app while VM still bein...

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68328852
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
+Map flags = ImmutableMap.of("imageId", 
"us-west-2/ami-cd715dfd", 
LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS.getName(), "");
+Map allFlags = MutableMap.builder()
+.put("tags", ImmutableList.of(getClass().getName()))
+.putAll(flags)
+.build();
+JcloudsLocation jcloudsLocation = 
(JcloudsLocation)mgmt.getLocationRegistry().getLocationManaged(LOCATION_SPEC, 
allFlags);
+
+
+

[jira] [Commented] (BROOKLYN-264) Stop app while VM still being provisioned: vm is left running when app is expunged

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-264:
-

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68328600
  
--- Diff: 
software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java
 ---
@@ -708,7 +710,21 @@ protected void doStop(ConfigBag parameters, 
Callable Stop app while VM still being provisioned: vm is left running when app is 
> expunged
> --
>
> Key: BROOKLYN-264
> URL: https://issues.apache.org/jira/browse/BROOKLYN-264
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> A customer deployed an app to AWS, but while the VM was still starting up 
> they stopped (and thus expunged) the app. The app disappeared from the 
> Brooklyn web-console, but the starting VM was left behind in AWS.
> This is simple to reproduce:
> 1. deploy a simple blueprint, such as:
> {noformat}
> location: aws-ec2:us-east-1
> services:
> - type: org.apache.brooklyn.entity.machine.MachineEntity
> {noformat}
> 2. wait for the VM to appear in the AWS web-console (with state 
> "initialising")
> 3. call the {{stop}} effector on the top-level app.
> ---
> Looking at the {{start}} task that was executing at the time when {{stop}} 
> was called, below is the thread's stack trace:
> {noformat}
> Provisioning machine in JcloudsLocation[AWS 
> Virginia:/aws-ec2:us-east-1@eyNrLIo5]
> Task[provisioning (AWS Virginia)]@MJITkjw0
> Submitted by SoftlyPresent[value=Task[start]@tKw0qJET]
> In progress, thread waiting (notify) on 
> java.util.concurrent.CountDownLatch$Sync@2ed5be36
> At: 
> org.jclouds.concurrent.FutureIterables.awaitCompletion(FutureIterables.java:149)
> 
> org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:214)
> 
> org.jclouds.ec2.compute.EC2ComputeService.createNodesInGroup(EC2ComputeService.java:149)
> 
> org.apache.brooklyn.location.jclouds.JcloudsLocation.obtainOnce(JcloudsLocation.java:726)
> 
> org.apache.brooklyn.location.jclouds.JcloudsLocation.obtain(JcloudsLocation.java:616)
> 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:406)
> 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:396)
> 
> org.apache.brooklyn.util.core.task.Tasks.withBlockingDetails(Tasks.java:98)
> 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:380)
> 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:364)
> 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
> 
> org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:519)
> {noformat}
> From this, we can see that we are still calling jclouds. This means that 
> jclouds has not yet returned to Brooklyn the VM's id. It also means that the 
> {{MachineEntity}} will not have been given a {{JcloudsSshMachineLocation}} 
> instance. 
> When {{stop}} is called on the {{MachineEntity}}, it doesn't have a machine 
> location instance so it doesn't have anything to ask to stop. This is why the 
> VM is left running.



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


[GitHub] brooklyn-server pull request #211: BROOKLYN-264 Stop app while VM still bein...

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68328600
  
--- Diff: 
software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java
 ---
@@ -708,7 +710,21 @@ protected void doStop(ConfigBag parameters, 
Callable

[GitHub] brooklyn-server issue #217: Propagator defaults to producer=self, if not spe...

2016-06-23 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/217
  
Thanks @robertgmoss - 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 #217: Propagator defaults to producer=self, if ...

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

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


---
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 #219: Added identity method to DSL

2016-06-23 Thread grkvlt
GitHub user grkvlt opened a pull request:

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

Added identity method to DSL

Adds a new function to the DSL that returns an entities ID. Useful for 
unique identifiers and references in blueprints. The new function can be used 
as follows:

```YAML
shell.env:
  ENTITY_ID: $brooklyn:identity()
  OTHER_ID: $brooklyn:entity("other-entity").identity()
```

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

$ git pull https://github.com/grkvlt/brooklyn-server dsl-identity

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

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


commit a205c5d206e5f0c89919329ab85d0e5b797d26f1
Author: Andrew Donald Kennedy 
Date:   2016-06-08T17:18:47Z

Added identity method to DSL




---
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 #217: Propagator defaults to producer=self, if not spe...

2016-06-23 Thread robertgmoss
Github user robertgmoss commented on the issue:

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


[jira] [Commented] (BROOKLYN-264) Stop app while VM still being provisioned: vm is left running when app is expunged

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-264:
-

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68260925
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
--- End diff --

BTW the whole test passes for 3:45 seconds.
If we exclude the `listNodes` call, users will wait approximately 3 and a 
half minutes for expunge if they immediately click deploy and expunge.


> Stop app while VM still being provisioned: vm is left running 

[GitHub] brooklyn-server pull request #211: BROOKLYN-264 Stop app while VM still bein...

2016-06-23 Thread bostko
Github user bostko commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/211#discussion_r68260925
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
--- End diff --

BTW the whole test passes for 3:45 seconds.
If we exclude the `listNodes` call, users will wait approximately 3 and a 
half minutes for expunge if they immediately click deploy and expunge.


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

[GitHub] brooklyn-server pull request #218: Yaml entity refs: support $brooklyn:self(...

2016-06-23 Thread aledsage
GitHub user aledsage opened a pull request:

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

Yaml entity refs: support $brooklyn:self()

- Adds proper test coverage
- Fixes sibling/descendant/ancestor so will never return self

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

$ git pull https://github.com/aledsage/brooklyn-server yaml-dsl-entity-refs

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

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


commit b21c5fcfc3ebc000b321419f4bb2934a0f85d5d6
Author: Aled Sage 
Date:   2016-06-23T14:49:12Z

Yaml entity refs: support $brooklyn:self()

- Adds proper test coverage
- Fixes sibling/descendant/ancestor so will never return self




---
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-server-master #149

2016-06-23 Thread Apache Jenkins Server
See 

Changes:

[aled.sage] Improve/test performance of XmlUtil.xpath

[aled.sage] Adds XmlSerializerTest

[aled.sage] BROOKLYN-305: Handle invalid xml chars in attribute vals

--
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on ubuntu-6 (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 746a81906e64577b493fa35590a9fbbbdafe4201 (origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 746a81906e64577b493fa35590a9fbbbdafe4201
 > git rev-list 4b11f509d09792145539db0cc4a7cf63b425ea40 # timeout=10
Parsing POMs
Modules changed, recalculating dependency graph
Established TCP socket on 59563
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/jenkins-slave/tools/hudson.model.JDK/JDK_1.7_latest_/bin/java 
-Xmx1024m -Xms512m -XX:MaxPermSize=512m -cp 
/home/jenkins/jenkins-slave/maven32-agent.jar:/home/jenkins/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3/boot/plexus-classworlds-2.5.2.jar:/home/jenkins/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3/conf/logging
 jenkins.maven3.agent.Maven32Main 
/home/jenkins/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3
 /home/jenkins/jenkins-slave/slave.jar 
/home/jenkins/jenkins-slave/maven32-interceptor.jar 
/home/jenkins/jenkins-slave/maven3-interceptor-commons.jar 59563
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create GC thread. Out of system resources.
# An error report file with more information is saved as:
# 
ERROR: Failed to launch Maven. Exit code = 1



[GitHub] brooklyn-server pull request #214: BROOKLYN-305: handle invalid xml chars in...

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

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


---
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-305) Rebind fails when entity attribute contains special unicode character ""

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-305:
-

Github user asfgit closed the pull request at:

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


> Rebind fails when entity attribute contains special unicode character ""
> --
>
> Key: BROOKLYN-305
> URL: https://issues.apache.org/jira/browse/BROOKLYN-305
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> I had an entity with a sensor value that contained unicode character 27 (in 
> the persisted state, this was converted to by xstream to {{}} and 
> written to the xml file).
> On restarting Brooklyn, it failed to restart. This is because {{}} is 
> an illegal character in xml. The xstream deserialization works fine, but our 
> code first uses xpath to extract the entity id from the raw xml. That fails 
> with the exception below:
> {noformat}
> 2016-06-22 09:17:09,555 ERROR o.a.b.l.common.BasicLauncher [main]: Subsystem 
> for persistence had startup error (continuing with startup): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Failure 
> rebinding; 3 errors including: problem loading memento: memento X2C3QT87 
> loading raw error: SAXParseException: Character reference "

[jira] [Commented] (BROOKLYN-305) Rebind fails when entity attribute contains special unicode character ""

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-305:
-

Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/214
  
Thanks @duncangrant - merging now.

We can later look at including in our persisted state:



But a very quick test gave the error below, which I still need to look into:

com.thoughtworks.xstream.io.StreamException:  : only 1.0 is supported 
as  Rebind fails when entity attribute contains special unicode character ""
> --
>
> Key: BROOKLYN-305
> URL: https://issues.apache.org/jira/browse/BROOKLYN-305
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> I had an entity with a sensor value that contained unicode character 27 (in 
> the persisted state, this was converted to by xstream to {{}} and 
> written to the xml file).
> On restarting Brooklyn, it failed to restart. This is because {{}} is 
> an illegal character in xml. The xstream deserialization works fine, but our 
> code first uses xpath to extract the entity id from the raw xml. That fails 
> with the exception below:
> {noformat}
> 2016-06-22 09:17:09,555 ERROR o.a.b.l.common.BasicLauncher [main]: Subsystem 
> for persistence had startup error (continuing with startup): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Failure 
> rebinding; 3 errors including: problem loading memento: memento X2C3QT87 
> loading raw error: SAXParseException: Character reference "

[GitHub] brooklyn-server issue #214: BROOKLYN-305: handle invalid xml chars in attrib...

2016-06-23 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/214
  
Thanks @duncangrant - merging now.

We can later look at including in our persisted state:



But a very quick test gave the error below, which I still need to look into:

com.thoughtworks.xstream.io.StreamException:  : only 1.0 is supported 
as 

[GitHub] brooklyn-server issue #214: BROOKLYN-305: handle invalid xml chars in attrib...

2016-06-23 Thread duncangrant
Github user duncangrant commented on the issue:

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


[GitHub] brooklyn-docs issue #80: Document shell.env json serialization behaviour.

2016-06-23 Thread geomacy
Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-docs/pull/80
  
Looks good; short but sweet.  A couple of minor comments.


---
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 #80: Document shell.env json serialization behavi...

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

https://github.com/apache/brooklyn-docs/pull/80#discussion_r68231455
  
--- Diff: guide/yaml/example_yaml/vanilla-bash-netcat-env.yaml ---
@@ -0,0 +1,12 @@
+name: Netcat Example with Environment Vars
+location: localhost
+services:
+- type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
+  name: Simple Netcat Server
+  launch.command: |
+echo $MESSAGE | nc -l $NETCAT_PORT &
+echo $! > $PID_FILE
+
+  env:
+MESSAGE: hello
--- End diff --

maybe worth adding a $brooklyn.config() in as the value, to emphasise 
the reusability mentioned in the .md, here and in the port.


---
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 #80: Document shell.env json serialization behavi...

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

https://github.com/apache/brooklyn-docs/pull/80#discussion_r68231465
  
--- Diff: guide/yaml/custom-entities.md ---
@@ -82,6 +82,18 @@ to be specified up one level, alongside the type.
 However config keys which are *not* declared on the type *must* be 
declared in the `brooklyn.config` block. 
 
 
+### Passing custom variables
+
+Blueprint scripts can be parametrized through environment variables, 
making them reusable in different use-cases.
--- End diff --

typo "parametrised"


---
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 #157: Windows helper script for using Invoke-Command -...

2016-06-23 Thread nakomis
Github user nakomis commented on the issue:

https://github.com/apache/brooklyn-server/pull/157
  
The install scripts are run in the INSTALLDIR, and not the RUNDIR (the 
launch script is run in RUNDIR), which would be a good pattern to keep. As it 
will require a change to `templates.install` can you add a Jira issue so that 
this PR can be merged? (once the other issue you mentioned above has been 
resolved)


---
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 #216: Serialize environment values - implement ...

2016-06-23 Thread neykov
GitHub user neykov opened a pull request:

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

Serialize environment values - implement for all entities



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

$ git pull https://github.com/neykov/brooklyn-server json-env

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

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


commit 7f730a1f0013051c37cf671606ee063ba3e41602
Author: Svetoslav Neykov 
Date:   2016-06-23T12:23:06Z

Serialize environment values - implement for all entities




---
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 #80: Document shell.env json serialization behavi...

2016-06-23 Thread neykov
GitHub user neykov opened a pull request:

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

Document shell.env json serialization behaviour.



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

$ git pull https://github.com/neykov/brooklyn-docs json-env

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

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


commit b903ab595facf8599c82dc8711acda5f7fe020d9
Author: Svetoslav Neykov 
Date:   2016-06-23T12:39:20Z

Document shell.env json serialization behaviour.




---
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 #157: Windows helper script for using Invoke-Command -...

2016-06-23 Thread bostko
Github user bostko commented on the issue:

https://github.com/apache/brooklyn-server/pull/157
  
Regarding moving scripts in `C:\brooklyn-managed-processes\install`:
I am hesitant whether `C:\brooklyn-managed-processes` is the right path in 
first place.
It would be better to be in `%USERPROFILE%` or in `%APPDATA%`.
Because of this it is best if we have to advice users to upload scripts 
independently from where invoke-command-credssp.ps1 helper scripts is.
It is best if the script is uploaded to RUNDIR and it is used with relative 
path like it is in linux.

So to move the helper scripts in a folder I would first:

1. find a way to use `templates.install` with a pseudonym `$env:RUNDIR` 
rather than the explicit `C:\` or `C:\brooklyn-managed-processes\install` or 
`C:\brooklyn-managed-processes\apps\\` 
1. Change the VanillaWindowsProcess to execute commands in `$env:RUNDIR` 
1. as @nakomis suggested add a `ENABLE_CRED_SSP` config key which uploads 
the scripts automatically and launch it
1. Add a config key which is uploading automatically 
`invoke-command-credssp.ps1`  so it is convenient for users to run it later. 



---
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-264) Stop app while VM still being provisioned: vm is left running when app is expunged

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-264:
-

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

https://github.com/apache/brooklyn-server/pull/211#discussion_r68225850
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
+Map flags = ImmutableMap.of("imageId", 
"us-west-2/ami-cd715dfd", 
LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS.getName(), "");
+Map allFlags = MutableMap.builder()
+.put("tags", 

[GitHub] brooklyn-server pull request #211: BROOKLYN-264 Stop app while VM still bein...

2016-06-23 Thread andreaturli
Github user andreaturli commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/211#discussion_r68225850
  
--- Diff: 
software/base/src/test/java/org/apache/brooklyn/entity/EC2ExpungeLiveTest.java 
---
@@ -0,0 +1,128 @@
+/*
+ * 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;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.location.LocationConfigKeys;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
+import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
+import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
+import org.apache.brooklyn.location.jclouds.JcloudsLocation;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.jclouds.aws.ec2.compute.AWSEC2ComputeService;
+import org.jclouds.compute.domain.ComputeMetadata;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class EC2ExpungeLiveTest extends BrooklynAppLiveTestSupport {
+private static final Logger LOG = 
LoggerFactory.getLogger(EC2ExpungeLiveTest.class);
+
+public static final String PROVIDER = "aws-ec2";
+public static final String SMALL_HARDWARE_ID = "m1.small";
+
+public static final String REGION_NAME = "us-west-2";
+public static final String LOCATION_SPEC = PROVIDER + (REGION_NAME == 
null ? "" : ":" + REGION_NAME);
+
+protected BrooklynProperties brooklynProperties;
+
+protected Location jcloudsLocation;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+// Don't let any defaults from brooklyn.properties (except 
credentials) interfere with test
+brooklynProperties = BrooklynProperties.Factory.newDefault();
+
+// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. 
~/.profile`, then that can cause "stdin: is not a tty")
+brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
+
+mgmt = new LocalManagementContextForTests(brooklynProperties);
+super.setUp();
+}
+
+/**
+ * Verifies the behavior described in
+ * https://issues.apache.org/jira/browse/BROOKLYN-264;>BROOKLYN-264 Stop app 
while VM still being provisioned: vm is left running when app is expunged
+ * 
+ * ApplicationResource.launch
+ * wait a few seconds and EntityResponse.expunge
+ * assert the image is on the cloud
+ * 
+ */
+@Test(groups = {"Live"})
+public void testExpunge() {
+Map flags = ImmutableMap.of("imageId", 
"us-west-2/ami-cd715dfd", 
LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS.getName(), "");
+Map allFlags = MutableMap.builder()
+.put("tags", ImmutableList.of(getClass().getName()))
+.putAll(flags)
+.build();
+JcloudsLocation jcloudsLocation = 
(JcloudsLocation)mgmt.getLocationRegistry().getLocationManaged(LOCATION_SPEC, 
allFlags);
+
+
+ 

Re: Need help in deploying Brooklyn on OpenStack liberty

2016-06-23 Thread Andrea Turli
I think it is

loginUser.privateKeyFile: /path/to/private/key/for/loginUser

not

loginUser.privateKeyData: "/home/ubuntu/openstack-in-key-g-priv.ppk"

On 23 June 2016 at 14:15, Gowri LN  wrote:

> Hi Andrea,
>
> Apologies. I missed out the difference of including
> loginUser,loginUser.privateKeyyFile outside template options.
>
> I tried the new yaml as suggested but I get the following error :
>
>
> RunNodesException: error running 1 node
> > group(brooklyn-o982m4-ubuntu-vm-ne-pdy7-empty-software-p-hkpn)
> > location(RegionOne) image(...imageid..) size(2)
> options({loginUser=ubuntu,
> > loginPrivateKeyPresent=true, scriptPresent=true,
> > securityGroups=[..my-security-group-name],
> >
> userMetadata={Name=brooklyn-o982m4-ubuntu-vm-ne-pdy7-empty-software-p-hkpn-artw,
> > brooklyn-user=ubuntu, brooklyn-app-id=PDy7dD1P,
> brooklyn-app-name=VM-new13,
> > brooklyn-entity-id=hKpNlTVx, brooklyn-entity-name=Empty software process,
> > brooklyn-server-creation-date=2016-06-23-1130}, networks=[..],
> > floatingIpPoolNames=[.], generateKeyPair=true, configDrive=false})
> > Execution failures:
> > 0 error[s]
> > Node failures:
> > 1) IllegalArgumentException on node
> > RegionOne/e9ded49e-8ae0-404b-9a0f-7705f6a55622:
> > java.lang.IllegalArgumentException: no credential or ssh agent found for
> > ubuntu on node RegionOne/e9ded49e-8ae0-404b-9a0f-7705f6a55622
> > at
> >
> com.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
> >
>  yaml I tried:
> name: VM-new13
> services:
> - type: brooklyn.entity.basic.EmptySoftwareProcess
>   name: Empty software process
> location:
>   jclouds:openstack-devtest-compute:
> endpoint: https://x.x.x.x:5000/v2.0/
> identity: "my-tenant:my-username"
> credential: password
> imageId: RegionOne/image-id
> hardwareId: RegionOne/2
> loginUser: "ubuntu"
> loginUser.privateKeyData: "/home/ubuntu/openstack-in-key-g-priv.ppk"
> templateOptions:
>   networks: [ "network-id" ]
>   floatingIpPoolNames: [ "name-of-my-floatingIp-pool" ]
>   securityGroups: ['my-security-group-name']
>
>
> Thanks,
> Gowri
>
>
> On Thu, Jun 23, 2016 at 1:32 PM, Andrea Turli <
> andrea.tu...@cloudsoftcorp.com> wrote:
>
> > Hi Gowri,
> >
> > > 2016-06-23 06:05:12,297 WARN  o.a.b.l.j.JcloudsLocation
> > > [brooklyn-execmanager-XlwkWB3k-312]: Ignoring request to set template
> > > option loginUser because this is not supported by
> > > org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions
> > > 2016-06-23 06:05:12,298 WARN  o.a.b.l.j.JcloudsLocation
> > > [brooklyn-execmanager-XlwkWB3k-312]: Ignoring request to set template
> > > option loginUser.privateKeyData because this is not supported by
> > > org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions
> >
> >
> > I guess this means that you are passing `loginUser` and
> > `loginUser.privateKeyData` as templateOptions. Try again exactly with
> > this one, and let us know:
> >
> > services:
> > - type: brooklyn.entity.basic.EmptySoftwareProcess
> >
> > location:
> >   jclouds:openstack-devtest-compute:
> > endpoint: https://x.x.x.x:5000/v2.0/
> > identity: "my-tenant:my-username"
> > credential: password
> > loginUser: ubuntu
> > loginUser.privateKeyFile: /path/to/private/key/for/loginUser
> > imageId: RegionOne/image-id
> > hardwareId: RegionOne/2
> > templateOptions:
> >   networks: [ "network-id" ]
> >   floatingIpPoolNames: [ "name-of-my-floatingIp-pool" ]
> >
> > Best,
> > Andrea
> >
>


[GitHub] brooklyn-server pull request #215: Address PR 208 review comments

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

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


---
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 #71: Openstack network documentation

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

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


---
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 #77: Machine naming in locations

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

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


---
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 issue #77: Machine naming in locations

2016-06-23 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-docs/pull/77
  
LGTM; 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-docs pull request #78: Adds details of setting up a HA master-slave...

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

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


---
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 issue #78: Adds details of setting up a HA master-slave pair

2016-06-23 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-docs/pull/78
  
LGTM; 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 #215: Address PR 208 review comments

2016-06-23 Thread neykov
GitHub user neykov opened a pull request:

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

Address PR 208 review comments



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

$ git pull https://github.com/neykov/brooklyn-server json-env

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

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


commit 1d929bc6c3d37bfc226cd11c20bd39e13d7bdddc
Author: Svetoslav Neykov 
Date:   2016-06-23T11:18:11Z

Address commit e4dfd87a74e58d373d45fa67f66656c9e6ac863c  review comments




---
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 #208: Serialize complex objects as JSON in shel...

2016-06-23 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/208#discussion_r68217234
  
--- Diff: 
utils/common/src/main/java/org/apache/brooklyn/util/javalang/Reflections.java 
---
@@ -242,7 +242,13 @@ public Object loadInstance(String classname) throws 
ReflectionNotFoundException,
 
 /** Invokes a suitable constructor, supporting varargs and primitives 
*/
 public static  Optional invokeConstructorWithArgs(Class 
clazz, Object[] argsArray, boolean setAccessible) {
-Reflections reflections = new Reflections(clazz.getClassLoader());
+ClassLoader cl = clazz.getClassLoader();
--- End diff --

It's very specific to this method call as we don't really care what the 
fallback classloader 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.
---


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

2016-06-23 Thread Apache Jenkins Server
See 

Changes:

[m4rkmckenna] Adds /activities/{id}/children/recurse endpoint for fetching all 
child

--
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on ubuntu-6 (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 d9cbe117d757d1c493abe2527a9ab4bcb188afce (origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f d9cbe117d757d1c493abe2527a9ab4bcb188afce
 > git rev-list 4388cbe580a57d092b5e99ac3209c2fa9076757f # timeout=10
Parsing POMs
Modules changed, recalculating dependency graph
Established TCP socket on 52559
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/jenkins-slave/tools/hudson.model.JDK/JDK_1.7_latest_/bin/java 
-Xmx1024m -Xms512m -XX:MaxPermSize=512m -cp 
/home/jenkins/jenkins-slave/maven32-agent.jar:/home/jenkins/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3/boot/plexus-classworlds-2.5.2.jar:/home/jenkins/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3/conf/logging
 jenkins.maven3.agent.Maven32Main 
/home/jenkins/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3
 /home/jenkins/jenkins-slave/slave.jar 
/home/jenkins/jenkins-slave/maven32-interceptor.jar 
/home/jenkins/jenkins-slave/maven3-interceptor-commons.jar 52559
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create GC thread. Out of system resources.
# An error report file with more information is saved as:
# 
ERROR: Failed to launch Maven. Exit code = 1



[GitHub] brooklyn-server pull request #210: Adds the ability for you to fetch all chi...

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

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


---
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 #210: Adds the ability for you to fetch all children o...

2016-06-23 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/210
  
Thanks for the update, merging.


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


[GitHub] brooklyn-server issue #209: Test relative entities

2016-06-23 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/209
  
Great idea. Good to merge.
Some thoughts I had while reading the code:
* Do we really need to have a spec of the child test? Could set 
TARGET_ENTITY on self and let that propagate to children through the 
inheritance chain. This will allow nesting children using `brooklyn.children`.
* `target` and `targetId` are reserved in the framework for the actual 
target. Could rename the config in the test to `ROOT_ENTITY` or 
`ANCHOR_ENTITY`. This is kind of related to the above, allowing target 
inheritance.
* Could pull the functionality up in `TargetableTestComponentImpl`, letting 
any entity use the scoping.

---

Spending some more time on it I now see that it's all designed to work 
together with the looping test case, so the above points are mute.

---

One final thing. Instead of configuring `DslComponent.Scope` could directly 
pass `DslComponent` as the configuration and evaluate that against the target. 
This would allow for more complex queries like 
`$brooklyn:ancestor("anchor-id").descendant("scoped-id")`.


---
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 #210: Adds the ability for you to fetch all children o...

2016-06-23 Thread m4rkmckenna
Github user m4rkmckenna commented on the issue:

https://github.com/apache/brooklyn-server/pull/210
  
@neykov 
> What's the use case for this API? 

When debugging you are usually only interested in one task being able to 
fetch the full tree makes debugging much easier as you do not have walk the 
full tree of data fetching children at each level 

> What about returning all the tasks of an entity instead?

Returning the full task tree of an entity could be a massive amount of data.

Re Documentation quirks ... My bad i thought swagger supported 
responseContainer Map since 2.0. I will amend shortly


---
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 #210: Adds the ability for you to fetch all chi...

2016-06-23 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/210#discussion_r68208002
  
--- Diff: 
rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/ActivityApi.java ---
@@ -57,6 +57,18 @@ public TaskSummary get(
 @ApiParam(value = "Task ID", required = true) 
@PathParam("task") String taskId);
 
 @GET
+@Path("/{task}/children/recurse")
+@ApiOperation(
+value = "Fetch all child tasks details",
+response = org.apache.brooklyn.rest.domain.TaskSummary.class,
--- End diff --

Oh there's a `responseContainer`, never mind.


---
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 #210: Adds the ability for you to fetch all children o...

2016-06-23 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/210
  
Looks good, apart from the documentation quirks (not sure how it should 
look like though).

What's the use case for this API? Shouldn't we include the top-level task 
in the response as well? I expected that before reading the code.
What about returning all the tasks of an entity instead?


---
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 #210: Adds the ability for you to fetch all chi...

2016-06-23 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/210#discussion_r68208077
  
--- Diff: 
rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/ActivityApi.java ---
@@ -57,6 +57,18 @@ public TaskSummary get(
 @ApiParam(value = "Task ID", required = true) 
@PathParam("task") String taskId);
 
 @GET
+@Path("/{task}/children/recurse")
+@ApiOperation(
+value = "Fetch all child tasks details",
+response = org.apache.brooklyn.rest.domain.TaskSummary.class,
+responseContainer = "map")
--- End diff --

Looks like that's not a valid value - 
http://docs.swagger.io/swagger-core/apidocs/com/wordnik/swagger/annotations/ApiOperation.html#responseContainer()


---
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 #210: Adds the ability for you to fetch all chi...

2016-06-23 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/210#discussion_r68207907
  
--- Diff: 
rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/ActivityApi.java ---
@@ -57,6 +57,18 @@ public TaskSummary get(
 @ApiParam(value = "Task ID", required = true) 
@PathParam("task") String taskId);
 
 @GET
+@Path("/{task}/children/recurse")
+@ApiOperation(
+value = "Fetch all child tasks details",
+response = org.apache.brooklyn.rest.domain.TaskSummary.class,
--- End diff --

The response is a `Map`, not an instance of the 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-docs issue #78: Adds details of setting up a HA master-slave pair

2016-06-23 Thread nakomis
Github user nakomis commented on the issue:

https://github.com/apache/brooklyn-docs/pull/78
  
PR comments addressed


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


[jira] [Commented] (BROOKLYN-305) Rebind fails when entity attribute contains special unicode character ""

2016-06-23 Thread Aled Sage (JIRA)

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

Aled Sage commented on BROOKLYN-305:


[~svet] your suggestion of using XML version 1.1 works! It can parse these 
characters (but not {{}}).

Given we have not included the xml version in our existing persisted state, I 
think we still want the fix I've done. But if we change our persister to write 
out that xml header, then we'll avoid the need for going down that code path in 
the future.

> Rebind fails when entity attribute contains special unicode character ""
> --
>
> Key: BROOKLYN-305
> URL: https://issues.apache.org/jira/browse/BROOKLYN-305
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> I had an entity with a sensor value that contained unicode character 27 (in 
> the persisted state, this was converted to by xstream to {{}} and 
> written to the xml file).
> On restarting Brooklyn, it failed to restart. This is because {{}} is 
> an illegal character in xml. The xstream deserialization works fine, but our 
> code first uses xpath to extract the entity id from the raw xml. That fails 
> with the exception below:
> {noformat}
> 2016-06-22 09:17:09,555 ERROR o.a.b.l.common.BasicLauncher [main]: Subsystem 
> for persistence had startup error (continuing with startup): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Failure 
> rebinding; 3 errors including: problem loading memento: memento X2C3QT87 
> loading raw error: SAXParseException: Character reference "

[jira] [Commented] (BROOKLYN-305) Rebind fails when entity attribute contains special unicode character ""

2016-06-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on BROOKLYN-305:
-

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

https://github.com/apache/brooklyn-server/pull/214#discussion_r68202480
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
 ---
@@ -294,7 +294,7 @@ public void visit(BrooklynObjectType type, String id, 
String contentsSubpath) th
 exceptionHandler.onLoadMementoFailed(type, "memento 
"+id+" read error", e);
 }
 
-String xmlId = (String) XmlUtil.xpath(contents, 
"/"+type.toCamelCase()+"/id");
+String xmlId = (String) 
XmlUtil.xpathHandlingIllegalChars(contents, "/"+type.toCamelCase()+"/id");
--- End diff --

We're making the assumption that the `id` field etc won't have crazy 
characters in it (because the Brooklyn framework generates those ids). The 
place we can get crazy characters is in attributes and config values that are 
set by the user.


> Rebind fails when entity attribute contains special unicode character ""
> --
>
> Key: BROOKLYN-305
> URL: https://issues.apache.org/jira/browse/BROOKLYN-305
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.9.0
>Reporter: Aled Sage
>
> I had an entity with a sensor value that contained unicode character 27 (in 
> the persisted state, this was converted to by xstream to {{}} and 
> written to the xml file).
> On restarting Brooklyn, it failed to restart. This is because {{}} is 
> an illegal character in xml. The xstream deserialization works fine, but our 
> code first uses xpath to extract the entity id from the raw xml. That fails 
> with the exception below:
> {noformat}
> 2016-06-22 09:17:09,555 ERROR o.a.b.l.common.BasicLauncher [main]: Subsystem 
> for persistence had startup error (continuing with startup): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Failure 
> rebinding; 3 errors including: problem loading memento: memento X2C3QT87 
> loading raw error: SAXParseException: Character reference "

[GitHub] brooklyn-server pull request #214: BROOKLYN-305: handle invalid xml chars in...

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

https://github.com/apache/brooklyn-server/pull/214#discussion_r68202480
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
 ---
@@ -294,7 +294,7 @@ public void visit(BrooklynObjectType type, String id, 
String contentsSubpath) th
 exceptionHandler.onLoadMementoFailed(type, "memento 
"+id+" read error", e);
 }
 
-String xmlId = (String) XmlUtil.xpath(contents, 
"/"+type.toCamelCase()+"/id");
+String xmlId = (String) 
XmlUtil.xpathHandlingIllegalChars(contents, "/"+type.toCamelCase()+"/id");
--- End diff --

We're making the assumption that the `id` field etc won't have crazy 
characters in it (because the Brooklyn framework generates those ids). The 
place we can get crazy characters is in attributes and config values that are 
set by the user.


---
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: Need help in deploying Brooklyn on OpenStack liberty

2016-06-23 Thread Gowri LN
Hi ,

Yes . Is there something that I am missing here ?

Log :

2016-06-23 06:05:12,297 WARN  o.a.b.l.j.JcloudsLocation
[brooklyn-execmanager-XlwkWB3k-312]: Ignoring request to set template
option loginUser because this is not supported by
org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions
2016-06-23 06:05:12,298 WARN  o.a.b.l.j.JcloudsLocation
[brooklyn-execmanager-XlwkWB3k-312]: Ignoring request to set template
option loginUser.privateKeyData because this is not supported by
org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions
2016-06-23 06:05:12,299 INFO  o.a.b.l.j.JcloudsLocation
[brooklyn-execmanager-XlwkWB3k-312]: Default SSH keys not found or not
usable; will create new keys for each machine. Create ~/.ssh/id_rsa or set
privateKeyFile / privateKeyPassphrase / password as appropriate for this
location if you wish to be able to log in without Brooklyn.

And it is still trying to login as root even after providing loginUser:
ubuntu

Thanks,

On Wed, Jun 22, 2016 at 6:34 PM, Andrea Turli <
andrea.tu...@cloudsoftcorp.com> wrote:

> Are you testing something like the following?
>
> location:
>   jclouds:openstack-devtest-compute:
> endpoint: https://x.x.x.x:5000/v2.0/
> identity: "my-tenant:my-username"
> credential: password
> # optional as it should try `ubuntu` anyway - loginUser: ubuntu
> loginUser.privateKeyData: /path/to/private/key/for/loginUser
> # optional
> imageId: RegionOne/image-id
> hardwareId: RegionOne/2
> templateOptions:
>   networks: [ "network-id" ]
>   floatingIpPoolNames: [ "name-of-my-floatingIp-pool" ]
>   securityGroups: [ "security-group-name" ]
>
> services:
> - type: brooklyn.entity.basic.EmptySoftwareProcess
>