Skip to content
This repository was archived by the owner on Oct 15, 2019. It is now read-only.

Commit b23379d

Browse files
committed
usability and docs improvements
including inferring download url
1 parent 5c69206 commit b23379d

15 files changed

+183
-90
lines changed

README.md

+13-19
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,47 @@ AMP-Basho
66

77
The **AMP-Basho** software will automatically deploy and manage
88
Basho Riak and Riak Enterprise clusters in a wide range of environments.
9-
This uses [Apache Brooklyn](http://brooklyn.io)'s easy-to-use YAML blueprinting approach,
9+
10+
This uses [Apache Brooklyn](http://brooklyn.apache.org)'s easy-to-use YAML blueprinting approach,
1011
combined with [Cloudsoft](http://cloudsoftcorp.com)'s enterprise-supported
1112
Application Management Platform (AMP).
1213

13-
For instance, deploy a Riak EE cluster with a configured elastic appserver
14-
by posting the following YAML to Brooklyn:
14+
For instance, deploy a 5-node Riak EE cluster to CentOS by supplying the following blueprint:
1515

1616
```yaml
17-
name: Riak with Web Cluster
17+
name: Riak Cluster
1818

1919
services:
2020
- type: io.cloudsoft.basho.RiakEnterpriseCluster
21-
id: riak-cluster
2221
initialSize: 5
23-
brooklyn.config:
24-
download.url.rhelcentos: http://YOUR_DOWNLOAD_URL.FOR_EXAMPLE.s3.amazonaws.com/private.downloads.basho.com/riak_ee/YOUR_CODE/2.0/2.0.5/rhel/6/riak-ee-2.0.5-1.el6.x86_64.rpm
25-
26-
- type: brooklyn.entity.webapp.ControlledDynamicWebAppCluster
27-
initialSize: 3
28-
brooklyn.config:
29-
wars.root: https://s3-eu-west-1.amazonaws.com/brooklyn-clocker/brooklyn-example-hello-world-sql-webapp.war
30-
java.sysprops:
31-
brooklyn.example.riak.nodes: $brooklyn:component("riak-cluster").attributeWhenReady("riak.cluster.nodeList")
22+
download.url: <your-riak-ee-centos-download-url-here>
3223

3324
location:
3425
jclouds:aws-ec2:
3526
identity: YOUR_CLOUD_IDENTIFIER
3627
credential: YOUR_CLOUD_CREDENTIAL
28+
osFamily: centos
29+
stopIptables: true
3730
```
3831
39-
More options, and info on configuring locations, is included in the [runtime docs](src/main/docs/README.md).
32+
More blueprints are available in the [runtime docs](src/main/docs/README.md),
33+
including examples for **Riak EE with a demo app** and **multi-cluster replication**.
4034
4135
4236
Interested? What Next?
4337
---
4438
45-
* Download the latest [release](https://github.com/cloudsoft/amp-basho/releases) tarball and get started
39+
* Download the latest [release](https://github.com/cloudsoft/amp-basho/releases) tarball and **get started**
4640
47-
* Browse runtime docs [online](src/main/docs/README.md) (these are also included in the release download)
41+
* Browse runtime docs [online](src/main/docs/README.md): these are also included in the README in the release download
4842
49-
* Read [the source code docs](docs/building-from-source.md) including how to build this project
43+
* Read [the source code docs](docs/) including how to build this project
5044
5145
5246
License
5347
---
5448
5549
AMP-Basho is built on [Cloudsoft AMP](http://www.cloudsoftcorp.com) and [Apache Brooklyn](http://brooklyn.io)
56-
and is copyright &copy; 2015 by Cloudsoft Corporation and Basho.
50+
and is copyright &copy; 2016 by Cloudsoft Corporation and Basho.
5751
5852
This software is released under the terms of [the Cloudsoft EULA](LICENSE.txt).

docs/building-from-source.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ AMP-Basho: Build Instructions
77

88
These instructions cover how to build the project.
99

10-
For instructions on running -- deploying Riak EE blueprints -- see [the distro's README](../src/main/docs/README.md).
10+
For instructions on running -- deploying Riak EE blueprints --
11+
see [the distro's README](../src/main/docs/README.md).
1112

1213

1314
Building this Project
1415
---
1516

1617
To build this project, with Java 7 and Maven 3 installed, simply run:
1718

18-
mvn clean install assembly:single
19+
mvn clean install
1920

2021
This will build and install a `...-dist.tar.gz` in `target/` which can be redistributed,
2122
expanded, and run anywhere where Java is installed to run AMP-Basho.
@@ -27,11 +28,14 @@ Release Build
2728
---
2829

2930
For a release build, we want to include Cloudsoft AMP instead of Apache Brooklyn
30-
and ensure the latest version of the docs are built. To do this
31-
you will require jekyll setup (as described [here](https://github.com/apache/incubator-brooklyn/blob/master/docs/README.md)) and a local maven install of Cloudsoft AMP:
31+
and ensure the latest version of the docs are built.
32+
To do this you will require
33+
jekyll setup (as described [here](https://github.com/apache/brooklyn-docs/blob/master/README.md)) and
34+
Cloudsoft AMP available in your maven environment.
35+
Then:
3236

3337
pushd src/main/docs ; rm -rf _site ; jekyll build ; popd
34-
mvn clean install assembly:single -Pamp
38+
mvn clean install -Pamp
3539

3640

3741
Other Ways of Running
@@ -57,6 +61,6 @@ License
5761
---
5862

5963
AMP-Basho is built on [Cloudsoft AMP](http://www.cloudsoftcorp.com) and [Apache Brooklyn](http://brooklyn.io)
60-
and is copyright &copy; 2015 by Cloudsoft Corporation and Basho.
64+
and is copyright &copy; 2016 by Cloudsoft Corporation and Basho.
6165

6266
This software is released under the terms of [the Cloudsoft EULA](../LICENSE.txt).

docs/roadmap.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
Immediate:
3+
* Document DOWNLOAD_URL and specifying the OS
4+
* Fix cluster join
5+
* Trim landing README
6+
7+
Longer term:
8+
* Ensure concurrent resizes don't clobber each other
9+
* Collect (and render?) migration status

pom.xml

+3-9
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
<properties>
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2323
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24-
<bundle.version>2.3.7</bundle.version>
25-
<jar.version>2.4</jar.version>
26-
<compiler.version>3.1</compiler.version>
27-
<amp.version>2.0.0-SNAPSHOT</amp.version>
24+
<amp.version>3.0.0</amp.version>
2825
</properties>
2926

3027
<repositories>
@@ -66,7 +63,6 @@
6663
<plugin>
6764
<groupId>org.apache.maven.plugins</groupId>
6865
<artifactId>maven-compiler-plugin</artifactId>
69-
<version>${compiler.version}</version>
7066
<configuration>
7167
<source>1.7</source>
7268
<target>1.7</target>
@@ -93,7 +89,6 @@
9389
<plugin>
9490
<groupId>org.apache.felix</groupId>
9591
<artifactId>maven-bundle-plugin</artifactId>
96-
<version>${bundle.version}</version>
9792
<extensions>true</extensions>
9893
<executions>
9994
<execution>
@@ -116,7 +111,6 @@
116111
<plugin>
117112
<groupId>org.apache.maven.plugins</groupId>
118113
<artifactId>maven-jar-plugin</artifactId>
119-
<version>${jar.version}</version>
120114
<configuration>
121115
<archive>
122116
<manifest>
@@ -133,7 +127,8 @@
133127

134128
<profiles>
135129
<profile>
136-
<!-- amp profile builds with Cloudsoft AMP instead of Apache Brooklyn -->
130+
<!-- amp profile builds with Cloudsoft AMP instead of Apache Brooklyn.
131+
requires assumes AMP is available in repo configured locally. -->
137132
<id>amp</id>
138133
<dependencies>
139134
<dependency>
@@ -202,7 +197,6 @@
202197
<dependency>
203198
<groupId>org.apache.brooklyn</groupId>
204199
<artifactId>brooklyn-all</artifactId>
205-
<version>${brooklyn.version}</version>
206200
</dependency>
207201
</dependencies>
208202
</profile>

src/main/java/io/cloudsoft/basho/RiakEnterpriseCluster.java

+18-11
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22

33
import java.util.Set;
44

5-
import com.google.common.reflect.TypeToken;
6-
7-
import org.apache.brooklyn.core.annotation.Effector;
8-
import org.apache.brooklyn.core.annotation.EffectorParam;
9-
import org.apache.brooklyn.entity.nosql.riak.RiakCluster;
10-
import org.apache.brooklyn.entity.nosql.riak.RiakNode;
5+
import org.apache.brooklyn.api.entity.EntitySpec;
116
import org.apache.brooklyn.api.entity.ImplementedBy;
127
import org.apache.brooklyn.api.sensor.AttributeSensor;
8+
import org.apache.brooklyn.config.ConfigKey;
9+
import org.apache.brooklyn.core.annotation.Effector;
10+
import org.apache.brooklyn.core.annotation.EffectorParam;
11+
import org.apache.brooklyn.core.config.ConfigKeys;
1312
import org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey;
1413
import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey;
1514
import org.apache.brooklyn.core.sensor.Sensors;
15+
import org.apache.brooklyn.entity.nosql.riak.RiakCluster;
1616
import org.apache.brooklyn.util.core.flags.SetFromFlag;
1717

18+
import com.google.common.reflect.TypeToken;
19+
1820
@ImplementedBy(RiakEnterpriseClusterImpl.class)
1921
public interface RiakEnterpriseCluster extends RiakCluster {
2022

@@ -29,21 +31,26 @@ public interface RiakEnterpriseCluster extends RiakCluster {
2931
AttributeSensor<Set<RiakEnterpriseCluster>> REPLICATION_SINKS = Sensors.newSensor(new TypeToken<Set<RiakEnterpriseCluster>>(){},
3032
"riak.cluster.replication.sinks", "Set of RiakEnterpriseClusters currently acting as replication sinks to this cluster");
3133

34+
ConfigKey<EntitySpec<?>> MEMBER_SPEC = ConfigKeys.newConfigKeyWithDefault(RiakCluster.MEMBER_SPEC, EntitySpec.create(RiakEnterpriseNode.class));
35+
3236
void updateReplication(Set<RiakEnterpriseCluster> upClusters);
3337

3438
@Effector(description="Manually initiates a fullsync operation with connected sites.")
3539
void triggerFullSync(@EffectorParam(name = "clusterSink", description = "cluster to make sync with") String clusterName);
3640

3741
@SetFromFlag("downloadUrlRhelCentos")
38-
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_RHEL_CENTOS = RiakNode.DOWNLOAD_URL_RHEL_CENTOS;
42+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_RHEL_CENTOS = RiakEnterpriseNode.DOWNLOAD_URL_RHEL_CENTOS;
3943

4044
@SetFromFlag("downloadUrlUbuntu")
41-
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_UBUNTU = RiakNode.DOWNLOAD_URL_UBUNTU;
42-
45+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_UBUNTU = RiakEnterpriseNode.DOWNLOAD_URL_UBUNTU;
46+
4347
@SetFromFlag("downloadUrlDebian")
44-
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_DEBIAN = RiakNode.DOWNLOAD_URL_DEBIAN;
48+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_DEBIAN = RiakEnterpriseNode.DOWNLOAD_URL_DEBIAN;
4549

4650
@SetFromFlag("downloadUrlMac")
47-
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_MAC = RiakNode.DOWNLOAD_URL_MAC;
51+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_MAC = RiakEnterpriseNode.DOWNLOAD_URL_MAC;
52+
53+
@SetFromFlag("downloadUrl")
54+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL = RiakEnterpriseNode.DOWNLOAD_URL;
4855

4956
}

src/main/java/io/cloudsoft/basho/RiakEnterpriseClusterImpl.java

+8-13
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
import java.util.Collection;
44
import java.util.Set;
55

6-
import com.google.common.base.Optional;
7-
import com.google.common.collect.Iterables;
8-
import com.google.common.collect.Sets;
9-
106
import org.apache.brooklyn.api.entity.Entity;
7+
import org.apache.brooklyn.api.location.Location;
118
import org.apache.brooklyn.core.entity.EntityPredicates;
129
import org.apache.brooklyn.entity.nosql.riak.RiakClusterImpl;
13-
import org.apache.brooklyn.api.entity.EntitySpec;
14-
import org.apache.brooklyn.api.location.Location;
10+
11+
import com.google.common.base.Optional;
12+
import com.google.common.collect.Iterables;
13+
import com.google.common.collect.Sets;
1514

1615
public class RiakEnterpriseClusterImpl extends RiakClusterImpl implements RiakEnterpriseCluster {
1716

@@ -44,7 +43,7 @@ public void updateReplication(Set<RiakEnterpriseCluster> upClusters) {
4443
}
4544
}
4645

47-
setAttribute(REPLICATION_SINKS, sinks);
46+
sensors().set(REPLICATION_SINKS, sinks);
4847
}
4948

5049
@Override
@@ -57,10 +56,6 @@ public void triggerFullSync(String clusterName) {
5756
anyNode.get().triggerFullSync(clusterName);
5857
}
5958

60-
protected EntitySpec<?> getMemberSpec() {
61-
return getConfig(MEMBER_SPEC, EntitySpec.create(RiakEnterpriseNode.class));
62-
}
63-
6459
private void initializeReplication() {
6560
String name = getConfig(CLUSTER_NAME);
6661
if(name != null) {
@@ -71,8 +66,8 @@ private void initializeReplication() {
7166
}
7267

7368
anyNode.get().initializeReplication(name);
74-
setAttribute(CLUSTER_NAME, name);
75-
setAttribute(REPLICATION_INITIALIZED, true);
69+
sensors().set(CLUSTER_NAME, name);
70+
sensors().set(REPLICATION_INITIALIZED, true);
7671
}
7772
}
7873

src/main/java/io/cloudsoft/basho/RiakEnterpriseFabric.java

+22
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,36 @@
22

33
import org.apache.brooklyn.config.ConfigKey;
44
import org.apache.brooklyn.core.config.ConfigKeys;
5+
import org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey;
56
import org.apache.brooklyn.entity.group.DynamicFabric;
7+
import org.apache.brooklyn.util.core.flags.SetFromFlag;
68
import org.apache.brooklyn.api.entity.ImplementedBy;
79
import org.apache.brooklyn.api.location.Location;
10+
811
import com.google.common.base.Function;
912
import com.google.common.reflect.TypeToken;
1013

1114
@ImplementedBy(RiakEnterpriseFabricImpl.class)
1215
public interface RiakEnterpriseFabric extends DynamicFabric {
16+
17+
@SuppressWarnings("serial")
1318
ConfigKey<? extends Function<Location,String>> CLUSTER_NAMER = ConfigKeys.newConfigKey(new TypeToken<Function<Location, String>>() {},
1419
"riak.fabric.cluster.namer", "Function used to provide the riak.replication.clusterName for a given location");
20+
21+
22+
@SetFromFlag("downloadUrlRhelCentos")
23+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_RHEL_CENTOS = RiakEnterpriseNode.DOWNLOAD_URL_RHEL_CENTOS;
24+
25+
@SetFromFlag("downloadUrlUbuntu")
26+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_UBUNTU = RiakEnterpriseNode.DOWNLOAD_URL_UBUNTU;
27+
28+
@SetFromFlag("downloadUrlDebian")
29+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_DEBIAN = RiakEnterpriseNode.DOWNLOAD_URL_DEBIAN;
30+
31+
@SetFromFlag("downloadUrlMac")
32+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_MAC = RiakEnterpriseNode.DOWNLOAD_URL_MAC;
33+
34+
@SetFromFlag("downloadUrl")
35+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL = RiakEnterpriseNode.DOWNLOAD_URL;
36+
1537
}

src/main/java/io/cloudsoft/basho/RiakEnterpriseFabricImpl.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ protected EntitySpec<?> getMemberSpec() {
8989
}
9090
}
9191

92+
@SuppressWarnings({"unchecked","rawtypes"})
9293
@Override
9394
protected Entity createCluster(Location location, Map flags) {
9495
Function<Location, String> clusterNamer = getConfig(CLUSTER_NAMER);
@@ -118,7 +119,7 @@ protected void connectEnrichers() {
118119
subscribeToMembers(this, SERVICE_UP, new SensorEventListener<Boolean>() {
119120
@Override
120121
public void onEvent(SensorEvent<Boolean> event) {
121-
setAttribute(SERVICE_UP, calculateServiceUp());
122+
sensors().set(SERVICE_UP, calculateServiceUp());
122123
}
123124
});
124125
}

src/main/java/io/cloudsoft/basho/RiakEnterpriseNode.java

+34-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
package io.cloudsoft.basho;
22

3+
import org.apache.brooklyn.api.entity.ImplementedBy;
34
import org.apache.brooklyn.config.ConfigKey;
45
import org.apache.brooklyn.core.config.ConfigKeys;
5-
import org.apache.brooklyn.entity.nosql.riak.RiakNode;
6-
import org.apache.brooklyn.api.entity.ImplementedBy;
6+
import org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey;
7+
import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey;
78
import org.apache.brooklyn.core.sensor.PortAttributeSensorAndConfigKey;
9+
import org.apache.brooklyn.entity.nosql.riak.RiakNode;
10+
import org.apache.brooklyn.util.core.flags.SetFromFlag;
11+
12+
import com.google.common.annotations.Beta;
813

914
@ImplementedBy(RiakEnterpriseNodeImpl.class)
1015
public interface RiakEnterpriseNode extends RiakNode {
@@ -15,11 +20,38 @@ public interface RiakEnterpriseNode extends RiakNode {
1520
PortAttributeSensorAndConfigKey CLUSTER_MANAGER_PORT = new PortAttributeSensorAndConfigKey("riak.replication.cluster.manager.port",
1621
"Cluster Manager Port", "9080+");
1722

23+
@SetFromFlag("downloadUrlRhelCentos")
24+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_RHEL_CENTOS =
25+
Helper.newSensorConfigKey(RiakNode.DOWNLOAD_URL_RHEL_CENTOS, "");
26+
27+
@SetFromFlag("downloadUrlUbuntu")
28+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_UBUNTU =
29+
Helper.newSensorConfigKey(RiakNode.DOWNLOAD_URL_UBUNTU, "");
30+
31+
@SetFromFlag("downloadUrlDebian")
32+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_DEBIAN =
33+
Helper.newSensorConfigKey(RiakNode.DOWNLOAD_URL_DEBIAN, "");
34+
35+
@SetFromFlag("downloadUrlMac")
36+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL_MAC =
37+
Helper.newSensorConfigKey(RiakNode.DOWNLOAD_URL_MAC, "");
38+
39+
@SetFromFlag("downloadUrl")
40+
AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL =
41+
Helper.newSensorConfigKey(RiakNode.DOWNLOAD_URL, "");
42+
1843
void initializeReplication(String name);
1944

2045
void triggerFullSync(String clusterName);
2146

2247
void addReplicationSink(RiakEnterpriseCluster upCluster);
2348

2449
Integer getRiakClusterManagerPort();
50+
51+
static class Helper {
52+
@Beta
53+
public static <T> AttributeSensorAndConfigKey<T, T> newSensorConfigKey(AttributeSensorAndConfigKey<T, T> orig, T newDefaultValue) {
54+
return new BasicAttributeSensorAndConfigKey<T>(orig, newDefaultValue);
55+
}
56+
}
2557
}

0 commit comments

Comments
 (0)