You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by rdowner <gi...@git.apache.org> on 2015/01/21 13:48:56 UTC
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
GitHub user rdowner opened a pull request:
https://github.com/apache/incubator-brooklyn/pull/460
JcloudsLocation set arbitrary template options
Adds new config key for JcloudsLocation, templateOptions, that takes a Map<String,String> for setting arbitrary template options. For each entry, searches for a method with the same name as the key, with a single parameter that TypeCoercions supports. The method is then invoked with the value. If such a method cannot be found, then a warning is printed to the log.
The config key's value can be expressed as a YAML fragment in blueprints or in brooklyn.properties:
```properties
brooklyn.location.named.softlayer-ams01.templateOptions={ domainName: 'example.com' }
```
```yaml
location:
jclouds:softlayer:ams01:
templateOptions:
domainName: 'example.com'
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rdowner/incubator-brooklyn general-purpose-template-options-setting
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-brooklyn/pull/460.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 #460
----
commit 1056b86baf4bc095b1a4bae6b843f31f9d9c8be9
Author: Richard Downer <ri...@apache.org>
Date: 2015-01-21T12:41:22Z
JcloudsLocation set arbitrary template options
Adds new config key for JcloudsLocation, templateOptions, that takes a
Map<String,String> for setting arbitrary template options. For each
entry, searches for a method with the same name as the key, with a
single parameter that TypeCoercions supports. The method is then invoked
with the value. If such a method cannot be found, then a warning is
printed to the log.
The config key's value can be expressed as a YAML fragment in blueprints
or in brooklyn.properties:
```properties
brooklyn.location.named.softlayer-ams01.templateOptions={ domainName: 'example.com' }
```
```yaml
location:
jclouds:softlayer:ams01:
templateOptions:
domainName: 'example.com'
```
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by richardcloudsoft <gi...@git.apache.org>.
Github user richardcloudsoft commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71833560
Pushed a fix for the failing test. If the next test run passes, am I good to merge this @sjcorbett @andreaturli ?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by andreaturli <gi...@git.apache.org>.
Github user andreaturli commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71715193
@rdowner that is great! nice and simple
A couple of questions:
1. with this feature, do the other SUPPORTED_TEMPLATE_OPTIONS_PROPERTIES still need to be there?
2. how the yaml infers the custom templateOptions?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by rdowner <gi...@git.apache.org>.
Github user rdowner closed the pull request at:
https://github.com/apache/incubator-brooklyn/pull/460
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71845693
Fire away.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71847030
great addition
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by rdowner <gi...@git.apache.org>.
GitHub user rdowner reopened a pull request:
https://github.com/apache/incubator-brooklyn/pull/460
JcloudsLocation set arbitrary template options
Adds new config key for JcloudsLocation, templateOptions, that takes a Map<String,String> for setting arbitrary template options. For each entry, searches for a method with the same name as the key, with a single parameter that TypeCoercions supports. The method is then invoked with the value. If such a method cannot be found, then a warning is printed to the log.
The config key's value can be expressed as a YAML fragment in blueprints or in brooklyn.properties:
```properties
brooklyn.location.named.softlayer-ams01.templateOptions={ domainName: 'example.com' }
```
```yaml
location:
jclouds:softlayer:ams01:
templateOptions:
domainName: 'example.com'
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rdowner/incubator-brooklyn general-purpose-template-options-setting
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-brooklyn/pull/460.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 #460
----
commit 90c673377aaefca412cedd0bdfea7f1e8ba9fc75
Author: Richard Downer <ri...@apache.org>
Date: 2015-01-21T12:41:22Z
JcloudsLocation set arbitrary template options
Adds new config key for JcloudsLocation, templateOptions, that takes a
Map<String,String> for setting arbitrary template options. For each
entry, searches for a method with the same name as the key, with a
single parameter that TypeCoercions supports. The method is then invoked
with the value. If such a method cannot be found, then a warning is
printed to the log.
The config key's value can be expressed as a YAML fragment in blueprints
or in brooklyn.properties:
```properties
brooklyn.location.named.softlayer-ams01.templateOptions={ domainName: 'example.com' }
```
```yaml
location:
jclouds:softlayer:ams01:
templateOptions:
domainName: 'example.com'
```
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by rdowner <gi...@git.apache.org>.
Github user rdowner commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71817326
Hi @andreaturli,
1 - I don't think there's a need to do that since it's still tidier in blueprints to refer to the Brooklyn-supported properties as before. The purpose of this option is to allow the selection of highly cloud-specific template options, without requiring changes to Brooklyn, and especially having to get Brooklyn to introduce a dependency on the relevant jclouds driver to set options.
2 - Something like:
```yaml
location:
jclouds:aws:us-east-1:
templateOptions:
iamInstanceProfileName: myprofile
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-70832090
This looks great. Is it testable?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by rdowner <gi...@git.apache.org>.
Github user rdowner commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71699108
Test failure is unrelated. Retrying...
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-83580044
could this take `Map<String,Object>` instead of `<String,String>` ?
i think it might actually work as is (ignoring the generics) but it could be handy to support lists and maps where template options expect those, where the input is yaml. /cc @alasdairhodge
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by rdowner <gi...@git.apache.org>.
Github user rdowner commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71821985
This time the test failure is genuine. The test is supposed to be a live test so should not be run here. I'll investigate.
@andreaturli, the reflections API takes care of the `AWSEC2TemplateOptions`/`TemplateOptions` problem. The code is not interested in what type the class is - it searches all the methods available on the class for one with a name that matches and a signature that is appropriate.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by andreaturli <gi...@git.apache.org>.
Github user andreaturli commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71819914
@rdowner thanks!
1. makes sense to me
2. I think my question is more "how brooklyn infers that `instanceProfileName` is part of `AWSEC2TemplateOptions` and not `TemplateOptions`?"
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by andreaturli <gi...@git.apache.org>.
Github user andreaturli commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71835966
lgtm, if @sjcorbett is happy as well, please merge it
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by rdowner <gi...@git.apache.org>.
Github user rdowner commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-83652296
@ahgittin @alasdairhodge I don't see why not. Presumably it could be done in a way that keeps the helpful TypeCoercions working?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-brooklyn/pull/460
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: JcloudsLocation set arbitrary tem...
Posted by rdowner <gi...@git.apache.org>.
Github user rdowner commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/460#issuecomment-71697828
Added a test as suggested. Rebased against latest master.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---