You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whirr.apache.org by as...@apache.org on 2011/03/17 23:11:03 UTC
svn commit: r1082725 - in /incubator/whirr/branches/branch-0.4: ./
core/src/main/java/org/apache/whirr/service/
core/src/main/java/org/apache/whirr/service/jclouds/
services/cassandra/src/test/resources/
services/hadoop/src/main/java/org/apache/whirr/s...
Author: asavu
Date: Thu Mar 17 22:11:02 2011
New Revision: 1082725
URL: http://svn.apache.org/viewvc?rev=1082725&view=rev
Log:
WHIRR-233. Change test properties to be less provider bound and improve TemplateBuilder defaults
Removed:
incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopTemplateBuilderStrategy.java
incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseTemplateBuilderStrategy.java
Modified:
incubator/whirr/branches/branch-0.4/CHANGES.txt
incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/ClusterSpec.java
incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/jclouds/TemplateBuilderStrategy.java
incubator/whirr/branches/branch-0.4/services/cassandra/src/test/resources/whirr-cassandra-test.properties
incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java
incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java
incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/BasicServerClusterActionHandler.java
incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseMasterClusterActionHandler.java
incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseRegionServerClusterActionHandler.java
incubator/whirr/branches/branch-0.4/services/hbase/src/test/resources/whirr-hbase-test.properties
incubator/whirr/branches/branch-0.4/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties
Modified: incubator/whirr/branches/branch-0.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/CHANGES.txt?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/CHANGES.txt (original)
+++ incubator/whirr/branches/branch-0.4/CHANGES.txt Thu Mar 17 22:11:02 2011
@@ -57,6 +57,9 @@ Release 0.4.0 - 2011-03-15
WHIRR-259. Disable configuration list handling for Hadoop
properties (asavu)
+ WHIRR-233. Change test properties to be less provider bound and
+ improve TemplateBuilder defaults (asavu)
+
BUG FIXES
WHIRR-170. Instances should be started in the order specified in
Modified: incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/ClusterSpec.java
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/ClusterSpec.java?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/ClusterSpec.java (original)
+++ incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/ClusterSpec.java Thu Mar 17 22:11:02 2011
@@ -121,6 +121,9 @@ public class ClusterSpec {
HARDWARE_ID(String.class, false, "The type of hardware to use for" +
" the instance. This must be compatible with the image ID."),
+
+ HARDWARE_MIN_RAM(Integer.class, false, "The minimum amount of " +
+ "instance memory. E.g. 1024"),
LOCATION_ID(String.class, false, "The location to launch " +
"instances in. If not specified then an arbitrary location " +
@@ -370,6 +373,7 @@ public class ClusterSpec {
private String publicKey;
private String imageId;
private String hardwareId;
+ private int hardwareMinRam;
private String locationId;
private List<String> clientCidrs;
private String version;
@@ -439,6 +443,7 @@ public class ClusterSpec {
setImageId(config.getString(Property.IMAGE_ID.getConfigName()));
setHardwareId(config.getString(Property.HARDWARE_ID.getConfigName()));
+ setHardwareMinRam(c.getInteger(Property.HARDWARE_MIN_RAM.getConfigName(), 1024));
setLocationId(config.getString(Property.LOCATION_ID.getConfigName()));
setClientCidrs(c.getList(Property.CLIENT_CIDRS.getConfigName()));
setVersion(c.getString(Property.VERSION.getConfigName()));
@@ -513,6 +518,9 @@ public class ClusterSpec {
public String getHardwareId() {
return hardwareId;
}
+ public int getHardwareMinRam() {
+ return hardwareMinRam;
+ }
public String getLocationId() {
return locationId;
}
@@ -628,6 +636,10 @@ public class ClusterSpec {
public void setHardwareId(String hardwareId) {
this.hardwareId = hardwareId;
}
+
+ public void setHardwareMinRam(int minRam) {
+ this.hardwareMinRam = minRam;
+ }
public void setLocationId(String locationId) {
this.locationId = locationId;
@@ -687,6 +699,7 @@ public class ClusterSpec {
&& Objects.equal(clusterName, that.clusterName)
&& Objects.equal(imageId, that.imageId)
&& Objects.equal(hardwareId, that.hardwareId)
+ && Objects.equal(hardwareMinRam, that.hardwareMinRam)
&& Objects.equal(locationId, that.locationId)
&& Objects.equal(clientCidrs, that.clientCidrs)
&& Objects.equal(version, that.version)
@@ -715,6 +728,7 @@ public class ClusterSpec {
.add("privateKey", privateKey)
.add("imageId", imageId)
.add("instanceSizeId", hardwareId)
+ .add("instanceMinRam", hardwareMinRam)
.add("locationId", locationId)
.add("clientCidrs", clientCidrs)
.add("version", version)
Modified: incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/jclouds/TemplateBuilderStrategy.java
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/jclouds/TemplateBuilderStrategy.java?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/jclouds/TemplateBuilderStrategy.java (original)
+++ incubator/whirr/branches/branch-0.4/core/src/main/java/org/apache/whirr/service/jclouds/TemplateBuilderStrategy.java Thu Mar 17 22:11:02 2011
@@ -19,6 +19,7 @@
package org.apache.whirr.service.jclouds;
import org.apache.whirr.service.ClusterSpec;
+import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.domain.TemplateBuilder;
/**
@@ -28,13 +29,21 @@ public class TemplateBuilderStrategy {
public void configureTemplateBuilder(ClusterSpec clusterSpec,
TemplateBuilder templateBuilder) {
-
+
if (clusterSpec.getImageId() != null) {
templateBuilder.imageId(clusterSpec.getImageId());
+ } else {
+ templateBuilder.os64Bit(true);
+ templateBuilder.osFamily(OsFamily.UBUNTU);
+ templateBuilder.osVersionMatches("10.04");
}
if (clusterSpec.getHardwareId() != null) {
templateBuilder.hardwareId(clusterSpec.getHardwareId());
+ } else if(clusterSpec.getHardwareMinRam() != 0) {
+ templateBuilder.minRam(clusterSpec.getHardwareMinRam());
+ } else {
+ templateBuilder.minRam(1024);
}
if (clusterSpec.getLocationId() != null) {
Modified: incubator/whirr/branches/branch-0.4/services/cassandra/src/test/resources/whirr-cassandra-test.properties
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/services/cassandra/src/test/resources/whirr-cassandra-test.properties?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/services/cassandra/src/test/resources/whirr-cassandra-test.properties (original)
+++ incubator/whirr/branches/branch-0.4/services/cassandra/src/test/resources/whirr-cassandra-test.properties Thu Mar 17 22:11:02 2011
@@ -20,3 +20,4 @@ whirr.instance-templates=2 cassandra
whirr.provider=${sys:whirr.test.provider}
whirr.identity=${sys:whirr.test.identity}
whirr.credential=${sys:whirr.test.credential}
+whirr.hardware-min-ram=512
Modified: incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java (original)
+++ incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java Thu Mar 17 22:11:02 2011
@@ -52,7 +52,6 @@ public class HadoopDataNodeClusterAction
addStatement(event, call("install_java"));
addStatement(event, call("install_tarball"));
addStatement(event, call(hadoopInstallFunction, "-c", clusterSpec.getProvider()));
- event.setTemplateBuilderStrategy(new HadoopTemplateBuilderStrategy());
}
@Override
Modified: incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java (original)
+++ incubator/whirr/branches/branch-0.4/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java Thu Mar 17 22:11:02 2011
@@ -73,7 +73,6 @@ public class HadoopNameNodeClusterAction
addStatement(event, call("install_java"));
addStatement(event, call("install_tarball"));
addStatement(event, call(hadoopInstallFunction, "-c", clusterSpec.getProvider()));
- event.setTemplateBuilderStrategy(new HadoopTemplateBuilderStrategy());
}
@Override
Modified: incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/BasicServerClusterActionHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/BasicServerClusterActionHandler.java?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/BasicServerClusterActionHandler.java (original)
+++ incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/BasicServerClusterActionHandler.java Thu Mar 17 22:11:02 2011
@@ -67,7 +67,6 @@ public class BasicServerClusterActionHan
addStatement(event, call(hbaseInstallFunction,
HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider(),
HBaseConstants.PARAM_TARBALL_URL, tarurl));
- event.setTemplateBuilderStrategy(new HBaseTemplateBuilderStrategy());
}
@Override
Modified: incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseMasterClusterActionHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseMasterClusterActionHandler.java?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseMasterClusterActionHandler.java (original)
+++ incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseMasterClusterActionHandler.java Thu Mar 17 22:11:02 2011
@@ -73,7 +73,6 @@ public class HBaseMasterClusterActionHan
addStatement(event, call(hbaseInstallFunction,
HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider(),
HBaseConstants.PARAM_TARBALL_URL, tarurl));
- event.setTemplateBuilderStrategy(new HBaseTemplateBuilderStrategy());
}
@Override
Modified: incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseRegionServerClusterActionHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseRegionServerClusterActionHandler.java?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseRegionServerClusterActionHandler.java (original)
+++ incubator/whirr/branches/branch-0.4/services/hbase/src/main/java/org/apache/whirr/service/hbase/HBaseRegionServerClusterActionHandler.java Thu Mar 17 22:11:02 2011
@@ -60,7 +60,6 @@ public class HBaseRegionServerClusterAct
addStatement(event, call(hbaseInstallFunction,
HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider(),
HBaseConstants.PARAM_TARBALL_URL, tarurl));
- event.setTemplateBuilderStrategy(new HBaseTemplateBuilderStrategy());
}
@Override
Modified: incubator/whirr/branches/branch-0.4/services/hbase/src/test/resources/whirr-hbase-test.properties
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/services/hbase/src/test/resources/whirr-hbase-test.properties?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/services/hbase/src/test/resources/whirr-hbase-test.properties (original)
+++ incubator/whirr/branches/branch-0.4/services/hbase/src/test/resources/whirr-hbase-test.properties Thu Mar 17 22:11:02 2011
@@ -20,10 +20,4 @@ whirr.instance-templates=1 zookeeper,1 h
whirr.provider=${sys:whirr.test.provider}
whirr.identity=${sys:whirr.test.identity}
whirr.credential=${sys:whirr.test.credential}
-whirr.private-key-file=${sys:user.home}/.ssh/id_rsa
-# enforce large instance during the test
-whirr.hardware-id=m1.large
-# Ubuntu 10.04 LTS Lucid instance-store - see http://alestic.com/
-whirr.image-id=us-east-1/ami-da0cf8b3
-whirr.location-id=us-east-1
whirr.hbase.tarball.url=http://archive.apache.org/dist/hbase/hbase-0.89.20100924/hbase-0.89.20100924-bin.tar.gz
Modified: incubator/whirr/branches/branch-0.4/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties
URL: http://svn.apache.org/viewvc/incubator/whirr/branches/branch-0.4/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties?rev=1082725&r1=1082724&r2=1082725&view=diff
==============================================================================
--- incubator/whirr/branches/branch-0.4/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties (original)
+++ incubator/whirr/branches/branch-0.4/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties Thu Mar 17 22:11:02 2011
@@ -20,3 +20,4 @@ whirr.instance-templates=2 zookeeper
whirr.provider=${sys:whirr.test.provider}
whirr.identity=${sys:whirr.test.identity}
whirr.credential=${sys:whirr.test.credential}
+whirr.hardware-min-ram=512