You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2014/11/03 16:51:53 UTC

[09/29] git commit: clean up process of setting up the new-version cluster

clean up process of setting up the new-version cluster


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/4aa2cc4e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/4aa2cc4e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/4aa2cc4e

Branch: refs/heads/master
Commit: 4aa2cc4e5a486207981e59db40c47f4cf9c49a6f
Parents: e1cf3b8
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sat Oct 25 01:46:19 2014 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Oct 31 09:38:19 2014 -0500

----------------------------------------------------------------------
 .../brooklynnode/BrooklynClusterImpl.java       |  7 +++-
 .../entity/brooklynnode/brooklyn-cluster.yaml   | 32 ++++++++++++++++++
 .../brooklyn-node-persisting-to-tmp.yaml        | 26 +++++++++++++++
 .../entity/brooklynnode/brooklyn-node.yaml      | 35 ++++++++++++++++++++
 .../entity/brooklynnode/brooklyn-node.yaml      | 34 -------------------
 .../BrooklynAssemblyTemplateInstantiator.java   |  3 +-
 6 files changed, 100 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4aa2cc4e/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
index dc3ee17..0d1afb6 100644
--- a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
+++ b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
@@ -24,6 +24,7 @@ import java.util.concurrent.Callable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import brooklyn.config.render.RendererHints;
 import brooklyn.entity.Entity;
 import brooklyn.entity.basic.EntityPredicates;
 import brooklyn.entity.basic.ServiceStateLogic;
@@ -46,7 +47,11 @@ public class BrooklynClusterImpl extends DynamicClusterImpl implements BrooklynC
 
     private static final Logger LOG = LoggerFactory.getLogger(BrooklynClusterImpl.class);
 
-    //TODO set MEMBER_SPEC
+    static {
+        RendererHints.register(MASTER_NODE, RendererHints.namedActionWithUrl());
+    }
+
+    // TODO should we set a default MEMBER_SPEC ?  difficult though because we'd need to set a password
 
     @SuppressWarnings("unused")
     private FunctionFeed scanMaster;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4aa2cc4e/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-cluster.yaml
----------------------------------------------------------------------
diff --git a/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-cluster.yaml b/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-cluster.yaml
new file mode 100644
index 0000000..f25a879
--- /dev/null
+++ b/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-cluster.yaml
@@ -0,0 +1,32 @@
+#
+# 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.
+#
+
+name: Example Brooklyn Cluster
+
+services:
+- type: brooklyn.entity.brooklynnode.BrooklynCluster
+  initialSize: 2
+  memberSpec:
+    $brooklyn:entitySpec: 
+#      type: classpath://brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml
+      type: brooklyn.entity.brooklynnode.BrooklynNode
+      brooklyn.config:
+        brooklynnode.launch.parameters.extra: --persist auto --persistenceDir /tmp/brooklyn-persistence-example/
+
+# location: localhost

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4aa2cc4e/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml
----------------------------------------------------------------------
diff --git a/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml b/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml
new file mode 100644
index 0000000..a932e4e
--- /dev/null
+++ b/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+name: Example Persisting Brooklyn Node
+
+services:
+- type: classpath://brooklyn/entity/brooklynnode/brooklyn-node.yaml
+  launchParameters: --persist auto --persistenceDir /tmp/brooklyn-persistence-example/
+
+# location: localhost

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4aa2cc4e/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node.yaml
----------------------------------------------------------------------
diff --git a/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node.yaml b/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node.yaml
new file mode 100644
index 0000000..55d09f6
--- /dev/null
+++ b/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node.yaml
@@ -0,0 +1,35 @@
+#
+# 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.
+#
+
+name: Example Brooklyn Node
+
+services:
+- type: brooklyn.entity.brooklynnode.BrooklynNode
+
+  ## to use a local file, specify something such as the following:   [BROOKLYN_VERSION_BELOW] 
+  # downloadUrl: file:///tmp/brooklyn-dist-0.7.0-SNAPSHOT-dist.tar.gz
+
+  ## if deploying to anything other than localhost you must also configure login details, e.g.:
+  # managementUsername: admin
+  # managementPassword: p4ssw0rd
+  # brooklynLocalPropertiesContents: |
+  #   brooklyn.webconsole.security.users=admin
+  #   brooklyn.webconsole.security.user.admin.password=p4ssw0rd
+
+# location: localhost

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4aa2cc4e/software/base/src/test/resources/brooklyn/entity/brooklynnode/brooklyn-node.yaml
----------------------------------------------------------------------
diff --git a/software/base/src/test/resources/brooklyn/entity/brooklynnode/brooklyn-node.yaml b/software/base/src/test/resources/brooklyn/entity/brooklynnode/brooklyn-node.yaml
deleted file mode 100644
index bd91f77..0000000
--- a/software/base/src/test/resources/brooklyn/entity/brooklynnode/brooklyn-node.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# 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.
-#
-
-name: Example Brooklyn Node
-
-services:
-- type: brooklyn.entity.brooklynnode.BrooklynNode
-
-  ## to use a local file, specify something such as the following:
-  downloadUrl: file:///Users/alex/.m2/repository/org/apache/brooklyn/brooklyn-dist/0.7.0-SNAPSHOT/brooklyn-dist-0.7.0-SNAPSHOT-dist.tar.gz
-  # downloadUrl: file:///tmp/brooklyn-dist-0.7.0-SNAPSHOT-dist.tar.gz
-  
-  ## to persist
-#  launchParameters: --persist auto --persistenceDir /tmp/brooklyn-persistence-example/
-
-
-## NB if deploying to a remote machine you must also supply management{Username,Password} and a brooklyn properties with those values set 
-location: localhost

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4aa2cc4e/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java b/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
index 5f594c4..77d55f5 100644
--- a/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
+++ b/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
@@ -32,7 +32,6 @@ import java.io.InputStreamReader;
 import java.io.Reader;
 import java.io.StringReader;
 import java.util.List;
-import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
@@ -42,8 +41,8 @@ import org.slf4j.LoggerFactory;
 import brooklyn.camp.brooklyn.api.AssemblyTemplateSpecInstantiator;
 import brooklyn.camp.brooklyn.api.HasBrooklynManagementContext;
 import brooklyn.catalog.CatalogItem;
-import brooklyn.catalog.internal.CatalogUtils;
 import brooklyn.catalog.internal.BasicBrooklynCatalog.BrooklynLoaderTracker;
+import brooklyn.catalog.internal.CatalogUtils;
 import brooklyn.config.BrooklynServerConfig;
 import brooklyn.entity.Application;
 import brooklyn.entity.Entity;