brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Heneveld <>
Subject catalog CLI commands
Date Mon, 27 Apr 2015 13:32:44 GMT

hi folks-

a few people have asked how the catalog can be set up better when you 
launch brooklyn.

i am thinking we could handle this with four new CLI options to launch:

     --catalog-initial -- adds catalog entries *if* the catalog is empty 
(after catalog item rebind)

     --catalog-reset -- ignores (deletes) any catalog items in the 
persistent store;
         it will then process "initial" and then process "add"

     --catalog-add -- adds items, after catalog rebind, before entity 
         error if same version but different plan; no-op if same version 
and same plan.

     --catalog-force -- when used with catalog-add, this forcibly 
installs even if same version but different plan.

this would mean a downstream project could simply include 
--catalog-initial classpath:// in its start script to 
specify the initial items to put in the catalog.

i'd also like to suggest we:
* deprecate the XML catalog (.brooklyn/catalog.xml)
* introduce some's with a handful of selected 
templates (for now)

one controversial item is that this would *not* have support for 
classpath scanning so the catalog will be empty apart from the 
templates.  the java catalog types are listed on the brooklyn web site 
so these can be found and used.  we could add scanning instructions to 
the yaml ... should we?  an alternative is to have bom's 
discovered and downloaded from a community catalog -- and when that's 
working we'll set up the brooklyn gui to allow you to connect to a 
catalog to easily install things (and the boms you install might 
themselves be populated by a classpath scan and/or a directory scan...) 
and/or select which files you want to load.

does this sound sensible?

to recap and elaborate -- the startup process will be:

A1) if not persisting, go to B1
A2) if --catalog-reset, delete persisted catalog items
A3) read persisted catalog items (possibly deleted in A2)
A4) go to B1

B1) look for --catalog-initial, if so read it, then go to C1
B2) look for BrooklynServerConfig.BROOKLYN_CATALOG_URL, if so, read it, 
supporting YAML or XML (warning if XML), then go to C1
B3) look for ~/.brooklyn/, if exists, read it then go to C1
B4) look for ~/.brooklyn/brooklyn.xml, if exists, warn, read it then go 
to C1
B5) read all classpath://brooklyn/ items, if they 
exist (and for now they will)
B6) go to C1

C1) if --catalog-add, read and add those items

D1) if persisting, read the rest of the persisted items (entities etc)

sound good?


View raw message