[rose]: metadata file organisation

Last metadata question (for today anyway!)

Can someone clarify what the recommendation on metadata organisation in the metadata location appendix means please?
Apologies, I’m probably being rather dim, but I’m not understanding this!

First off, does “system” mean “suite” here? I’m currently assuming it does - maybe I’m wrong, and this whole recommendation is irrelevant for a suite?
Wondering as I can’t see recommendations on metadata organisation the suite design guide which would fit my interpretation below.

Assuming recommendation is for suites…
I’ve currently got my suite organised something like this, with a top-level meta dir for the suite metadata, and per-app meta subdirs for the metadata for individual apps:

/path/to/mi-su173
me@pc:> tree
.
|-- app
|   |-- my-model_config-compile-test_cold
|   |   |-- bin
|   |   |   `-- config-compile-test_mod.sh
|   |   |-- meta
|   |   |   `-- rose-meta.conf
|   |   `-- rose-app.conf
|   |-- my-model_install_cold
|   |   |-- bin
|   |   |   `-- install_mod.sh
|   |   |-- meta
|   |   |   `-- rose-meta.conf
|   |   `-- rose-app.conf
|   <snip more apps>
<snip other dirs & files>
|-- meta
|   `-- rose-meta.conf
|-- rose-suite.conf
|-- rose-suite.info
`-- suite.rc

I’m not entirely clear what advice above means for my suite, both for the suite-level metadata, and for the app-level metadata.

I think it means I should rejig my suite, to move the individual apps’ meta subdirs up, to live under a rose-meta dir (and I assume my suite metadata too).
And I should be effectively duplicating my apps’ directory structure - would have same subdirs under /rose-meta as well as under /app. So I’d end up with something like:

|-- app
|   |-- my-model_config-compile-test_cold
|   |   |-- bin
|   |   |   `-- config-compile-test_mod.sh
|   |   `-- rose-app.conf
|   |-- my-model_install_cold
|   |   |-- bin
|   |   |   `-- install_mod.sh
|   |   `-- rose-app.conf
|   <snip more apps>
<snip other stuff>
|-- rose-meta
|   |-- my-model_config-compile-test_cold
|   |   `-- rose-meta.conf
|   |-- my-model_install_cold
|   |   `-- rose-meta.conf
|   <snip dirs/rose-meta.confs for more apps>
|   `-- rose-meta.conf  # suite-level metadata
|-- rose-suite.conf
|-- rose-suite.info
`-- suite.rc

And I’d let each app/the suite know where to find its metadata by using the meta setting.
So rose-suite.conf would specify: meta=rose-meta/rose-meta.conf
While app/my-model_copy_cold/rose-app.conf would specify: meta=rose-meta/my-model_copy_cold/rose-meta.conf
and so on.

Is this right? Wanting to check my understanding on this before I charge off and do this, as this would require updating quite a few extra places if I ever changed the name of a given app! And I’m increasing “separation” in dir structure between my metadata for a given app, and the app itself.

I’m also wondering whether I’ve got wrong end of stick with my “duplicate dir structure” interpretation as I’ve seen other places (e.g. UM) where there’s just a single monolithic large rose-meta.conf file.

If recommendation would apply to me, is there a good reason for the recommendation? I.e. what is the benefit of me overhauling current structure to a “duplicated dir structure”? (or a monolithic rose-meta.conf if I’ve got wrong end of stick)?

Hello,

Took me a couple of reads of that passage. This appendix is talking about “centralised” metadata and might not be relevant to your usage of Rose.

tldr; It’s not recommending that you collect all of the metadata written within a suite into a top-level rose-meta directory but suggesting that when metadata is written in a system code (e.g. the UM) rather than in the suite it should live in a top-level rose-meta dir in the code repository.

Rose apps (and suites) consist of two parts:

  1. The metadata which is the bit that really defines the application itself.
  2. The configuration which is the bit that is specific to the particular usage of the application.

For a lot of purposes, particularly single-use applications, it can be convenient to develop these two parts in the same place, writing the metadata inside the configurations e.g:

suite/
  rose-suite.conf
  meta/
    rose-meta.conf
  app/
    foo/
      rose-app.conf
      meta/
        rose-meta.conf

This works great, however, poses a barrier to sharing and collaboration. If you update the metadata in an app locally, you need to update all of the other copies of that app that may have been made.

For apps that are widely used and re-used by multiple people it makes sense to collect the metadata all in one place and develop it separately under it’s own version control. That factors out the first part of the application leaving just the configuration that relates to the specific usage of the application in your suite.

That would look something like this:

~/roses/my-suite/
  rose-suite.conf
  app/
    foo/
      rose-suite.conf  # no metadata here, it's picked up through the site meta-path

~/foo-code/
  rose-meta/
    foo/
      v1.0.0/
        rose-meta.conf

This pattern is used by some of the larger, more regularly shared apps such as the UM.

1 Like

Lovely, thanks Oliver, enlightenment achieved!
Really helpful - I/others in my team so often work in ~solo code contexts that I don’t encounter/think about pain points relevant to more common shared contexts.
In particular, I don’t believe we’ve yet started sharing apps within our team.
This explanation makes perfect sense, and also means I better understand the upgrading use-case, and likely implementation.
Very useful - means I’ll be better-placed to think about options on how to arrange things if/when we start reusing apps more between suites.

1 Like