Jenkins build is back to normal : brooklyn-dist-master-docker #20

2018-04-16 Thread Apache Jenkins Server
See 




[GitHub] brooklyn-server pull request #956: SSH Sensor value-on-error

2018-04-16 Thread nakomis
GitHub user nakomis opened a pull request:

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

SSH Sensor value-on-error

Adds `value.on.error` config key to SshCommandSensor to allow a value
to be specified for use when an exception occurs when executing the
ssh command

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

$ git pull https://github.com/nakomis/brooklyn-server 
ssh-sensor-value-on-error

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

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


commit fde2f24f733ce8604a033a775453fbff27e40608
Author: Martin Harris 
Date:   2018-04-16T11:34:11Z

SSH Sensor value-on-error

Adds `value.on.error` config key to SshCommandSensor to allow a value
to be specified for use when an exception occurs when executing the
ssh command




---


[jira] [Commented] (BROOKLYN-568) Rebind failed: NPE deserializing SshFeed

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

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

ASF GitHub Bot commented on BROOKLYN-568:
-

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

https://github.com/apache/brooklyn-server/pull/953#discussion_r181701628
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/sensor/ssh/SshCommandSensor.java ---
@@ -126,7 +118,7 @@ public String get() {
 // Note that entity may be null during rebind (e.g. if 
this SshFeed is orphaned, with no associated entity):
 // See https://issues.apache.org/jira/browse/BROOKLYN-568.
 // We therefore guard against null in 
makeCommandExecutingInDirectory.
-return makeCommandExecutingInDirectory(command, 
executionDir, entity);
+return 
makeCommandExecutingInDirectory(params.get(SENSOR_COMMAND), 
params.get(SENSOR_EXECUTION_DIR), entity);
--- End diff --

I think we should do the `checkNotNull(params.get(SENSOR_COMMAND), ...)` in 
this `Supplier` method, and then pass it into the 
`makeCommandExecutingInDirectory`.

If this were null, then things can go very strange. For example, we might 
try to execute `null` when we construct the command via:
`finalCommand = "mkdir -p '"+execDir+"' && cd '"+execDir+"' && 
"+finalCommand`



> Rebind failed: NPE deserializing SshFeed
> 
>
> Key: BROOKLYN-568
> URL: https://issues.apache.org/jira/browse/BROOKLYN-568
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.12.0
>Reporter: Aled Sage
>Assignee: Aled Sage
>Priority: Major
> Fix For: 1.0.0
>
>
> With Brooklyn 1.0.0-SNAPSHOT, I tried rebinding to some persisted state from 
> 0.12.0. However, rebind failed to deserialize an {{SsshFeed}} with the 
> exception below:
> {noformat}
> 2017-11-25T22:03:31,781 WARN  123 o.a.b.c.m.r.RebindExceptionHandlerImpl 
> [ooklyn-persister] problem loading memento: memento kscyylt8h9 (FEED) 
> deserialization error; continuing: 
> com.thoughtworks.xstream.converters.ConversionException: C
> ould not call com.google.common.collect.HashMultimap.readObject() : null
>  Debugging information 
> message : Could not call 
> com.google.common.collect.HashMultimap.readObject()
> cause-exception : java.lang.NullPointerException
> cause-message   : null
> class   : com.google.common.collect.HashMultimap
> required-type   : com.google.common.collect.HashMultimap
> converter-type  : 
> com.thoughtworks.xstream.converters.reflection.SerializableConverter
> path: 
> /feed/config/polls/com.google.guava:com.google.common.collect.HashMultimap/com.google.guava:com.google.common.collect.HashMultimap
> line number : 135
> class[1]: java.util.LinkedHashMap
> converter-type[1]   : 
> org.apache.brooklyn.util.core.xstream.StringKeyMapConverter
> class[2]: 
> org.apache.brooklyn.core.mgmt.rebind.dto.BasicFeedMemento
> converter-type[2]   : 
> com.thoughtworks.xstream.converters.reflection.ReflectionConverter
> version : 1.0.0-20171113.0927
> ---
> com.thoughtworks.xstream.converters.ConversionException: Could not call 
> com.google.common.collect.HashMultimap.readObject() : null
>  Debugging information 
> message : Could not call 
> com.google.common.collect.HashMultimap.readObject()
> cause-exception : java.lang.NullPointerException
> cause-message   : null
> class   : com.google.common.collect.HashMultimap
> required-type   : com.google.common.collect.HashMultimap
> converter-type  : 
> com.thoughtworks.xstream.converters.reflection.SerializableConverter
> path: 
> /feed/config/polls/com.google.guava:com.google.common.collect.HashMultimap/com.google.guava:com.google.common.collect.HashMultimap
> line number : 135
> class[1]: java.util.LinkedHashMap
> converter-type[1]   : 
> org.apache.brooklyn.util.core.xstream.StringKeyMapConverter
> class[2]: 
> org.apache.brooklyn.core.mgmt.rebind.dto.BasicFeedMemento
> converter-type[2]   : 
> com.thoughtworks.xstream.converters.reflection.ReflectionConverter
> version : 1.0.0-20171113.0927
> ---
> at 
> com.thoughtworks.xstream.core.util.SerializationMembers.callReadObject(SerializationMembers.java:133)
>  [269:xstream:1.4.8]
> at 
> com.thoughtworks.xstream.converters.reflection.SerializableConverter.doUnmarshal(SerializableConverter.java:455)
>  [269:xstream:1.4.8]
> at 
> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
>  

[GitHub] brooklyn-server pull request #953: Defers reading of config in SshCommandSen...

2018-04-16 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/953#discussion_r181700868
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/sensor/ssh/SshCommandSensor.java ---
@@ -136,7 +128,7 @@ public String get() {
 .command(commandSupplier)
 
.suppressDuplicates(Boolean.TRUE.equals(suppressDuplicates))
 .checkSuccess(SshValueFunctions.exitStatusEquals(0))
-.onFailureOrException(Functions.constant((T) null))
+.onFailureOrException(Functions.constant((T) "failed"))
--- End diff --

Why set this to "failed" rather than null?

The risk of "failed" is that it will trigger subsequent enrichers to try to 
do something with this value (e.g. if someone wrote an SshCommandSensor to get 
part of the url, then we might subsequently use "failed" in that url - the 
downstream enricher can't tell the difference between this being a valid value 
and being the value on failed.

If feels like the default of null is better.

Longer term, we could make this configurable so that the default value on 
failed can be explicitly set.


---


Build failed in Jenkins: brooklyn-dist-master-docker #19

2018-04-16 Thread Apache Jenkins Server
See 


--
Started by user tbouron
[EnvInject] - Loading node environment variables.
Building remotely on H33 (ubuntu xenial) in workspace 

Cloning the remote Git repository
Cloning repository https://git-wip-us.apache.org/repos/asf/brooklyn-dist.git
 > git init  # 
 > timeout=10
Fetching upstream changes from 
https://git-wip-us.apache.org/repos/asf/brooklyn-dist.git
 > git --version # timeout=10
 > git fetch --tags --progress 
 > https://git-wip-us.apache.org/repos/asf/brooklyn-dist.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/brooklyn-dist.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # 
 > timeout=10
 > git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/brooklyn-dist.git # timeout=10
Fetching upstream changes from 
https://git-wip-us.apache.org/repos/asf/brooklyn-dist.git
 > git fetch --tags --progress 
 > https://git-wip-us.apache.org/repos/asf/brooklyn-dist.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/master^{commit} # timeout=10
Checking out Revision 67e899490e70c8321921bc355783fed68c840928 (origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 67e899490e70c8321921bc355783fed68c840928
Commit message: "Revert "This closes #119""
 > git rev-list --no-walk 67e899490e70c8321921bc355783fed68c840928 # timeout=10
Run condition [Current build status] enabling prebuild for step [Execute shell]
[brooklyn-dist-master-docker] $ /bin/bash -xe /tmp/jenkins4319960531387161518.sh
+ docker run -i --rm --name brooklyn-dist -v /home/jenkins/.m2:/root/.m2 -v 
:/usr/build -w 
/usr/build tbouron/brooklyn-build:dist mvn clean install
Unable to find image 'tbouron/brooklyn-build:dist' locally
dist: Pulling from tbouron/brooklyn-build
b2388ca7fa65: Already exists
551fb2fe7af1: Already exists
31172a96e9a9: Already exists
399bf9752347: Already exists
9e41e7b89fb8: Already exists
1017f315d511: Already exists
22bc7fb81913: Already exists
2bb03009d8e3: Pulling fs layer
2bb03009d8e3: Verifying Checksum
2bb03009d8e3: Download complete
2bb03009d8e3: Pull complete
Digest: sha256:90aac8df68859c41a1495271562b46e194e4068ddc55b897976d2ffe48ab7441
Status: Downloaded newer image for tbouron/brooklyn-build:dist
[INFO] Scanning for projects...
[INFO] 
[INFO] Reactor Build Order:
[INFO] 
[INFO] Brooklyn Downstream Project Parent
[INFO] Brooklyn Dist Root
[INFO] Brooklyn All Things
[INFO] Brooklyn Distribution
[INFO] Brooklyn Karaf Distribution Parent
[INFO] Brooklyn Karaf Server Configuration
[INFO] Brooklyn Dist Karaf Features
[INFO] Brooklyn Karaf Distribution
[INFO] Brooklyn Karaf pax-exam itest
[INFO] Brooklyn Vagrant Getting Started Environment
[INFO] Brooklyn Quick-Start Project Archetype
[INFO] Brooklyn Shared Package Files
[INFO] Brooklyn RPM Package
[INFO] Brooklyn DEB Package
[INFO] 
[INFO] 
[INFO] Building Brooklyn Downstream Project Parent 1.0.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ 
brooklyn-downstream-parent ---
[INFO] Deleting /usr/build/downstream-parent (includes = [brooklyn*.log, 
brooklyn*.log.*, stacktrace.log, test-output, prodDb.*], excludes = [])
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ 
brooklyn-downstream-parent ---
[INFO] 
[INFO] --- maven-site-plugin:3.4:attach-descriptor (attach-descriptor) @ 
brooklyn-downstream-parent ---
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
brooklyn-downstream-parent ---
[INFO] Installing /usr/build/downstream-parent/pom.xml to 
/root/.m2/repository/org/apache/brooklyn/brooklyn-downstream-parent/1.0.0-SNAPSHOT/brooklyn-downstream-parent-1.0.0-SNAPSHOT.pom
[INFO] 
[INFO] 
[INFO] Building Brooklyn Dist Root 1.0.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ brooklyn-dist-root 
---
[INFO] Deleting /usr/build (includes = [brooklyn*.log, brooklyn*.log.*, 
stacktrace.log, test-output, prodDb.*], excludes = [])
[INFO] 
[INFO] --- maven-replacer-plugin:1.4.1:replace 
(fix-eclipse-dot-classpath-mangling) @ brooklyn-dist-root ---
[INFO] Ignoring missing file
[INFO] Replacement run on 0 file.
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.3:create (default) @ brooklyn-dist-root 
---
[INFO] Executing: 

Build failed in Jenkins: brooklyn-server-master-docker #66

2018-04-16 Thread Apache Jenkins Server
See 


--
[...truncated 8.51 KB...]
ERROR: Failed to clean the workspace
java.io.IOException: Unable to delete 
' Tried 3 
times (of a maximum of 3) waiting 0.1 sec between attempts.
at hudson.Util.deleteContentsRecursive(Util.java:230)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:555)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.file.AccessDeniedException: 

at 
sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at 
sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
at 
sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at hudson.Util.tryOnceDeleteFile(Util.java:290)
at hudson.Util.tryOnceDeleteRecursive(Util.java:370)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.deleteContentsRecursive(Util.java:225)
... 11 more
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Failed to delete workspace
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:558)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to 
ubuntu-4
at 
hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
at hudson.remoting.Channel.call(Channel.java:908)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor829.invoke(Unknown Source)
at 

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

2018-04-16 Thread Apache Jenkins Server
See 




Jenkins build is back to normal : brooklyn-library-master-docker #160

2018-04-16 Thread Apache Jenkins Server
See 




Jenkins build is back to normal : brooklyn-dist-master-docker #17

2018-04-16 Thread Apache Jenkins Server
See 




[DISCUSSION] Kubernetes Helm

2018-04-16 Thread Thomas Bouron
Hi Brooklyners.

You might have noticed that the Brooklyn builds started to fail more than
usual recently. I spent some time last week to fix those issues but I just
realised that there is a deeper one with the recent change I merged (about
Kubernetes Helm)

This change requires a dependency, which depends on some native code. Now,
this dependency exists for 3 platforms: macOS, Linux and Window. The issue
is that the "right" dependency is included at build time via the maven
classifier, and the way it is picked is by looking at the current build OS
and selecting the corresponding one[1]. Obviously, this leads to nasty
problem: as all our builds are done on Linux, Brooklyn artifacts only work
on Linux. Not only that, the classifier is dynamically picked and set as
envvar by a plugin. This is also an issue for any downstream projects.

While we want this feature in Brooklyn, I don't think this is acceptable
for our users therefore I reverted the changes and started this
conversation. What do you think would be the best approach to fix this?
Having 1 build per platform doesn't sound good as it won't be portable
anymore. Maybe we can find another dependency without a link to native code?

Best.

[1]
https://github.com/apache/brooklyn-dist/pull/119/files#diff-01b5eceed5fb6499e99a42e711695648R139
-- 

Thomas Bouron • Senior Software Engineer @ Cloudsoft Corporation •
https://cloudsoft.io/
Github: https://github.com/tbouron
Twitter: https://twitter.com/eltibouron


[GitHub] brooklyn-server pull request #954: Changes access of `StringPredicates` clas...

2018-04-16 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/954#discussion_r18174
  
--- Diff: 
utils/common/src/main/java/org/apache/brooklyn/util/text/StringPredicates.java 
---
@@ -40,7 +40,7 @@
 return new IsBlank();
 }
 
-private static final class IsBlank implements 
Predicate {
+public static final class IsBlank implements 
Predicate {
--- End diff --

Can you instead use the static methods, rather than instantiating the 
classes directly?

For example:
```
$brooklyn:object:
  type: org.apache.brooklyn.util.text.StringPredicates
  factoryMethod.name: containsLiteralIgnoreCase
  factoryMethod.args:
- myarg1
```

For the same reasons as we want the classes private in Java code, I think 
it's good to not access them directly in Brooklyn YAML either.


---


[GitHub] brooklyn-server issue #955: Fix build issue due the the addition of k8s helm

2018-04-16 Thread tbouron
Github user tbouron commented on the issue:

https://github.com/apache/brooklyn-server/pull/955
  
This has been merged (and reverted) so closing manually


---


[GitHub] brooklyn-server pull request #955: Fix build issue due the the addition of k...

2018-04-16 Thread tbouron
Github user tbouron closed the pull request at:

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


---


[GitHub] brooklyn-server pull request #956: SSH Sensor value-on-error

2018-04-16 Thread asfgit
Github user asfgit closed the pull request at:

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


---