You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ha...@apache.org on 2015/09/01 04:11:45 UTC

[1/2] incubator-brooklyn git commit: tidy for GCE, in response to issues encountered

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 5d8ae8f44 -> 27036aa18


tidy for GCE, in response to issues encountered


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

Branch: refs/heads/master
Commit: 0e1ef67963311592b8118c5ca9741d8743806c24
Parents: 6212d19
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sat Aug 29 02:50:23 2015 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Sat Aug 29 03:52:21 2015 +0100

----------------------------------------------------------------------
 docs/guide/start/brooklyn.properties                      | 10 +++++-----
 .../brooklyn/location/jclouds/BrooklynImageChooser.java   |  2 ++
 .../apache/brooklyn/location/jclouds/JcloudsLocation.java |  6 ++++++
 .../brooklyn/location/jclouds/JcloudsLocationConfig.java  |  2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0e1ef679/docs/guide/start/brooklyn.properties
----------------------------------------------------------------------
diff --git a/docs/guide/start/brooklyn.properties b/docs/guide/start/brooklyn.properties
index 2d6682f..0858f94 100644
--- a/docs/guide/start/brooklyn.properties
+++ b/docs/guide/start/brooklyn.properties
@@ -152,10 +152,10 @@ brooklyn.location.named.aws-ireland = jclouds:aws-ec2:eu-west-1
 brooklyn.location.named.aws-tokyo = jclouds:aws-ec2:ap-northeast-1
 
 ## Google Compute
-## Note at present you have to create and download the P12 key from the Google "APIs & auth -> Registered Apps" interface,
-## then convert to PEM private key format using  `openssl pkcs12 -in Certificates.p12 -out Certificates.pem -nodes`
-## then embed that on one line as the 'credential, replacing new lines with \n as below
-## (hopefully this will be improved in jclouds in the future)
+## The credentials for GCE come from the "APIs & auth -> Credentials" page,
+## creating a "Service Account" of type JSON, then extracting 
+## the client_email as the identity and private_key as the identity,
+## keeping new lines as \n (exactly as in the JSON supplied)
 # brooklyn.location.jclouds.google-compute-engine.identity=1234567890-somet1mesArand0mU1Dhere@developer.gserviceaccount.com
 # brooklyn.location.jclouds.google-compute-engine.credential=-----BEGIN PRIVATE KEY----- \nMIIblahablahblah \nblahblahblah \n-----END PRIVATE KEY-----
 # brooklyn.location.named.Google\ US = jclouds:google-compute-engine
@@ -169,7 +169,7 @@ brooklyn.location.named.aws-tokyo = jclouds:aws-ec2:ap-northeast-1
 # brooklyn.location.jclouds.google-compute-engine.networkName=brooklyn-default-network
 ## gce images have bad entropy, this ensures they have noisy /dev/random (even if the "randomness" is not quite as random)
 # brooklyn.location.jclouds.google-compute-engine.installDevUrandom=true
-## gce images often start with iptables turned on; turn it off 
+## gce images often start with iptables turned on; turn it off unless your blueprints are iptables-aware 
 # brooklyn.location.jclouds.google-compute-engine.stopIptables=true
 
 ## HP Cloud - also Ubuntu 12.04 LTS

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0e1ef679/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java
index 963fc2f..608a949 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java
@@ -175,6 +175,8 @@ public class BrooklynImageChooser implements Cloneable {
         if (deprecated!=null) {
             if ("deprecated".equalsIgnoreCase(deprecated))
                 return -30;
+            if ("obsolete".equalsIgnoreCase(deprecated))
+                return -40;
             log.warn("Unrecognised 'deprecatedState' value '"+deprecated+"' when scoring "+img+"; ignoring that metadata");
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0e1ef679/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index 6b960d3..9a812b2 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -1250,6 +1250,12 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
                     }})
             .put(EXTRA_PUBLIC_KEY_DATA_TO_AUTH, new CustomizeTemplateOptions() {
                     public void apply(TemplateOptions t, ConfigBag props, Object v) {
+                        if (t instanceof GoogleComputeEngineTemplateOptions) {
+                            // see email to jclouds list, 29 Aug 2015; 
+                            // GCE takes this to be the only login public key, 
+                            // and setting this only works if you also overrideLoginPrivateKey
+                            LOG.warn("Ignoring "+EXTRA_PUBLIC_KEY_DATA_TO_AUTH+"; not supported in jclouds-gce implementation.");
+                        }
                         t.authorizePublicKey(((CharSequence)v).toString());
                     }})
             .put(RUN_AS_ROOT, new CustomizeTemplateOptions() {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0e1ef679/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocationConfig.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocationConfig.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocationConfig.java
index 3bcc02f..0591714 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocationConfig.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocationConfig.java
@@ -72,7 +72,7 @@ public interface JcloudsLocationConfig extends CloudLocationConfig {
     public static final ConfigKey<String> LOGIN_USER_PRIVATE_KEY_FILE = ConfigKeys.newStringConfigKey("loginUser.privateKeyFile",
             "Custom private key for the user who logs in initially", null); 
     public static final ConfigKey<String> EXTRA_PUBLIC_KEY_DATA_TO_AUTH = ConfigKeys.newStringConfigKey("extraSshPublicKeyData",
-        "Additional public key data to add to authorized_keys", null);
+        "Additional public key data to add to authorized_keys, on supported clouds (not GCE)", null);
     @SuppressWarnings("serial")
     public static final ConfigKey<List<String>> EXTRA_PUBLIC_KEY_URLS_TO_AUTH = ConfigKeys.newConfigKey(new TypeToken<List<String>>() {}, 
         "extraSshPublicKeyUrls", "Additional public keys (files or URLs, in SSH2/RFC4716/id_rsa.pub format) to add to authorized_keys", null);


[2/2] incubator-brooklyn git commit: This closes #871

Posted by ha...@apache.org.
This closes #871


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

Branch: refs/heads/master
Commit: 27036aa186b4a1e2eeed3d08cb1a0ee5b232530a
Parents: 5d8ae8f 0e1ef67
Author: Hadrian Zbarcea <ha...@apache.org>
Authored: Mon Aug 31 22:00:12 2015 -0400
Committer: Hadrian Zbarcea <ha...@apache.org>
Committed: Mon Aug 31 22:00:12 2015 -0400

----------------------------------------------------------------------
 docs/guide/start/brooklyn.properties                      | 10 +++++-----
 .../brooklyn/location/jclouds/BrooklynImageChooser.java   |  2 ++
 .../apache/brooklyn/location/jclouds/JcloudsLocation.java |  6 ++++++
 .../brooklyn/location/jclouds/JcloudsLocationConfig.java  |  2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------