Yaml file install version specification

28 views
Skip to first unread message

Dave Finnegan

unread,
Apr 21, 2014, 11:34:04 AM4/21/14
to brookl...@googlegroups.com
Is the 'version: M.m.p' specifier supposed to be supported at the top level of the yaml file?  Is so, it is not working.

For example, in the following yaml file the first instance of the 'version:' specification is ignored.  The version specs at the serviceType levels are honored.

I had thought that the top level version spec would be honored on down through the hierarchy and remove the need for duplicate specifications.

name: Mongo Index Testing Single Server
description: MongoDB single server deployment with MongoDB (javascript) client
#location: ec2_west
location: localhost
version: "2.6.0"
services:
- serviceType: brooklyn.entity.nosql.mongodb.MongoDBServer
  id: MongoDBSingleServer
  name: MongoDB Single Server Deployment
  version: "2.6.0"
- serviceType: brooklyn.entity.nosql.mongodb.MongoDBClient
  name: MongoDB Javascript Client
  version: "2.6.0"
  brooklyn.config:
    server: $brooklyn:component("MongoDBSingleServer")
    scripts:
      mongo-index-load-wrapper: classpath://mongo-index-load-wrapper.js
      mongo-index-query-wrapper: classpath://mongo-index-query-wrapper.js
      mongo-index-load: classpath://mongo-index-load.js
      mongo-index-query: classpath://mongo-index-query.js
    startupJsScripts:
      - mongo-index-load-wrapper
      - mongo-index-query-wrapper

Martin Harris

unread,
Apr 21, 2014, 11:48:53 AM4/21/14
to brookl...@googlegroups.com
Hi Dave,

I'm not familiar with the version specifier. What behavior were you expecting, and where are you seeing it at the serviceType level?

Cheers


--
You received this message because you are subscribed to the Google Groups "brooklyn-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brooklyn-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Martin Harris
Lead Software Engineer
Cloudsoft Corporation Ltd

Alex Heneveld

unread,
Apr 21, 2014, 11:50:37 AM4/21/14
to brookl...@googlegroups.com

the top-level version is the version of the blueprint itself, not any of the software components being used.

it would be nice to have global parameters such as mongo.version which get substituted within the components themselves!

--a

Martin Harris

unread,
Apr 21, 2014, 11:51:05 AM4/21/14
to brookl...@googlegroups.com

Dave Finnegan

unread,
Apr 21, 2014, 12:18:22 PM4/21/14
to brookl...@googlegroups.com
I was referring to the version of the software components being used.  I had mistakenly thought the property would work at the top level and had a sample yaml fiel with that in config place.  When that didn't work I pushed the property down to the component level and it started working as expected.

In retrospect a mongo.version is really the only thing that could effectively work from the top level (and would be nice to have), but I can see now that the 'version' spec that I'm using is only going to work from the component level and only for config keys that are supported by the component.  In this case the AbstractMongoDBServer.java file specifies the 'version' ConfigKey and the yaml correctly overrides it with my value; in each of the server and client component definitions.

Thinking a bit more clearly about this now it seems that a 'MongoDBServer.version' and a 'MongoDBClient.version' spec could work.  Or, perhaps we'd need a fully qualified 'brooklyn.entity.nosql.mongodb.MongoDBServer.version' type specification.

In any event, the issue is the result of a misunderstanding on my part, rather than a short coming of the code.  I'm fine with the current state of affairs.

Though, I'm sorely tempted to tread a yaml more like a scripted environment!  It would be nice to have variables defined at the top which could be substituted below in order to allow for more generic yaml files that I could reuse with simple tweaks.  Still, great stuff!  Thanks, guys.

Martin Harris

unread,
Apr 21, 2014, 12:30:49 PM4/21/14
to brookl...@googlegroups.com
Hi Dave,

You should be able to accomplish what you need using YAML anchors defining the version at the top, then referencing them later in the YAML (you should also do this with the variables you mentioned), so your YAML would be modified as follows:

name: Mongo Index Testing Single Server
description: MongoDB single server deployment with MongoDB (javascript) client
#location: ec2_west
location: localhost
mongoVersion: &VERSION 

  version: "2.6.0"
services:
- serviceType: brooklyn.entity.nosql.mongodb.MongoDBServer
  id: MongoDBSingleServer
  name: MongoDB Single Server Deployment
  <<: *VERSION

- serviceType: brooklyn.entity.nosql.mongodb.MongoDBClient
  name: MongoDB Javascript Client
  <<: *VERSION
  brooklyn.config:
    server: $brooklyn:component("MongoDBSingleServer")
    scripts:
      mongo-index-load-wrapper: classpath://mongo-index-load-wrapper.js
      mongo-index-query-wrapper: classpath://mongo-index-query-wrapper.js
      mongo-index-load: classpath://mongo-index-load.js
      mongo-index-query: classpath://mongo-index-query.js
    startupJsScripts:
      - mongo-index-load-wrapper
      - mongo-index-query-wrapper

Hope this helps

Martin


--
You received this message because you are subscribed to the Google Groups "brooklyn-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brooklyn-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave Finnegan

unread,
Apr 21, 2014, 12:52:21 PM4/21/14
to brookl...@googlegroups.com
Martin,

Thanks!  That's just the ticket.


On Monday, April 21, 2014 11:34:04 AM UTC-4, Dave Finnegan wrote:

Alex Heneveld

unread,
Apr 21, 2014, 5:22:10 PM4/21/14
to brooklyn-dev

Do yaml anchor/references work? It's not something I've tried though it would make sense.

TOSCA and Heat YAML have parameters so this is something we should be able to weave in first class support for, in time.

Best
Alex

Martin Harris

unread,
Apr 21, 2014, 5:24:53 PM4/21/14
to brookl...@googlegroups.com

I've not tested it extensively, but the happy path seems to work for me

Dave Finnegan

unread,
Apr 21, 2014, 6:11:41 PM4/21/14
to brookl...@googlegroups.com
The following anchors/aliase setups works.  Note the use of anchor and alias for mongoVersion.  Though, it's not clear to me what the string 'mongoVersion' is doing.  The 'mongoVer' is what gets aliased later on.

Very cool.


name: Mongo Index Testing Single Server
description: MongoDB single server deployment with MongoDB (javascript) client

location: localhost
#location: ec2_west

mongoVersion: &mongoVer

  version: "2.6.0"

services:

- serviceType: brooklyn.entity.nosql.mongodb.MongoDBServer
  id: MongoDBSingleServer
  name: MongoDB Single Server Deployment
  <<: *mongoVer


- serviceType: brooklyn.entity.nosql.mongodb.MongoDBClient
  name: MongoDB Javascript Client
  <<: *mongoVer

  brooklyn.config:
    server: $brooklyn:component("MongoDBSingleServer")
    scripts:
      mongo-index-load-wrapper: classpath://mongo-index-load-wrapper.js
      mongo-index-query-wrapper: classpath://mongo-index-query-wrapper.js
      mongo-index-load: classpath://mongo-index-load.js
      mongo-index-query: classpath://mongo-index-query.js
    startupJsScripts:
      - mongo-index-load-wrapper
      - mongo-index-query-wrapper

--
You received this message because you are subscribed to a topic in the Google Groups "brooklyn-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/brooklyn-dev/fxH04Y4j9UY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to brooklyn-dev...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages